:root {
    --bg: #0b0f12;
    --panel: #121820;
    --accent: #39ffb0;
    --accent-dim: #1d6b50;
    --text: #e8f2ee;
    --text-dim: #7c8a86;
    --danger: #ff6b6b;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.chip-bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(90deg, rgba(57,255,176,0.05) 1px, transparent 1px),
        linear-gradient(0deg, rgba(57,255,176,0.05) 1px, transparent 1px);
    background-size: 28px 28px;
    background-color: var(--bg);
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-bar {
    text-align: center;
    padding: 20px 16px 8px;
}

.top-text {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    letter-spacing: 0.12em;
    font-size: 15px;
    color: var(--accent);
    text-shadow: 0 0 12px rgba(57,255,176,0.5);
}

.player-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.idle-state {
    text-align: center;
    color: var(--text-dim);
    max-width: 320px;
}

.idle-state .chip-icon {
    font-size: 48px;
    color: var(--accent-dim);
    margin-bottom: 8px;
}

.idle-state .hint {
    font-size: 13px;
}

.idle-state code {
    color: var(--accent);
}

.player {
    width: 100%;
    max-width: 420px;
    background: var(--panel);
    border: 1px solid rgba(57,255,176,0.15);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 0 40px rgba(57,255,176,0.06), 0 10px 30px rgba(0,0,0,0.4);
}

.media-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    background: #060a0d;
    margin-bottom: 20px;
}

.video-frame { aspect-ratio: 16 / 9; }

.media-frame img, .media-frame video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.overlay-play {
    position: absolute;
    inset: 0;
    margin: auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: none;
    background: rgba(18,24,32,0.85);
    color: var(--accent);
    font-size: 26px;
    cursor: pointer;
}

.media-title {
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    margin: 0 0 18px;
    word-break: break-word;
}

.progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.time {
    font-family: Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--text-dim);
    min-width: 38px;
    text-align: center;
}

.progress {
    flex: 1;
    -webkit-appearance: none;
    height: 4px;
    border-radius: 2px;
    background: rgba(255,255,255,0.12);
    outline: none;
    accent-color: var(--accent);
}

.progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px rgba(57,255,176,0.7);
    cursor: pointer;
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
}

.ctrl-btn {
    border: none;
    background: rgba(255,255,255,0.06);
    color: var(--text);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ctrl-btn.loop {
    width: 44px;
    height: 44px;
    font-size: 18px;
    color: var(--text-dim);
}

.ctrl-btn.loop[aria-pressed="true"] {
    color: var(--accent);
    background: rgba(57,255,176,0.12);
    box-shadow: 0 0 10px rgba(57,255,176,0.35);
}

.ctrl-btn.play {
    width: 60px;
    height: 60px;
    font-size: 22px;
    background: var(--accent);
    color: #04150e;
}

.ctrl-spacer { width: 44px; }

.footer {
    text-align: center;
    padding: 18px;
}

.footer a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.04em;
}

.footer a:hover { color: var(--accent); }

@media (max-width: 420px) {
    .player { padding: 18px; border-radius: 18px; }
}
