/* Header Components */
.retro-logo {
    width: clamp(112px, 15vw, 180px);
    height: auto;
    display: block;
    filter:
        drop-shadow(0 2px 0 rgba(255,255,255,0.75))
        drop-shadow(0 0 10px rgba(0, 217, 255, 0.62))
        drop-shadow(0 0 16px rgba(255, 47, 178, 0.38));
}

.header-title {
    font-size: 1.55rem;
    color: #1c2350;
    text-shadow: 0 1px 0 #fff, 0 0 12px rgba(0, 217, 255, 0.62);
    letter-spacing: 0;
}

.lang-selector {
    display: flex;
    align-items: center;
    gap: 5px;
}

#lang-toggle-btn {
    color: #172256;
    font-size: 1rem;
    border: 1px solid rgba(0,217,255,0.45);
    border-radius: 4px;
    padding: 4px 8px;
    background: linear-gradient(180deg, #ffffff, #ccd5e8);
}

/* Winamp-style Radio Player */
.player-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 22px;
    padding: 0 8px;
    margin-bottom: 6px;
    border: 1px solid #05070d;
    border-top-color: #cbd3e3;
    border-left-color: #cbd3e3;
    border-radius: 3px;
    background: linear-gradient(90deg, #18284e, #6b748c 55%, #161b2b);
    color: #eef4ff;
    font-family: var(--font-mono);
    font-size: 0.72rem;
}

.player-window-buttons {
    color: #07101f;
    background: #b9c1d1;
    padding: 0 4px;
    line-height: 14px;
    border: 1px solid #303748;
}

.player-display {
    display: grid;
    grid-template-columns: 84px 1fr;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    padding: 8px;
    border: 1px solid #05070d;
    border-top-color: #3d4d72;
    border-left-color: #3d4d72;
    border-radius: 4px;
    background: linear-gradient(180deg, #101a38, #071026);
    box-shadow: inset 0 0 18px rgba(0, 217, 255, 0.12);
}

.player-time {
    font-family: var(--font-mono);
    font-size: 1.35rem;
    color: #9de8ff;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.75);
}

.player-screen {
    min-width: 0;
}

#player-track-title {
    margin-bottom: 4px;
    color: #9de8ff;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-shadow: 0 0 8px rgba(0, 217, 255, 0.6);
}

.player-spectrum {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    align-items: end;
    gap: 3px;
    height: 34px;
    padding: 3px;
    background: rgba(0,0,0,0.24);
    border: 1px solid rgba(157, 232, 255, 0.16);
}

.player-spectrum span {
    display: block;
    height: 35%;
    background: linear-gradient(180deg, #ff2fb2, #00d9ff);
    opacity: 0.85;
}

.player-spectrum span:nth-child(2n) { height: 70%; }
.player-spectrum span:nth-child(3n) { height: 48%; }
.player-spectrum span:nth-child(4n) { height: 86%; }

.station-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 305px;
    overflow-y: auto;
}

.station-btn {
    display: grid;
    grid-template-columns: 28px 1fr 8px;
    align-items: center;
    text-align: left;
    color: #172256;
    font-size: 0.88rem;
    padding: 6px 6px;
    border: 1px solid transparent;
    border-bottom-color: rgba(0, 217, 255, 0.12);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.68);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.72);
}

.station-btn:hover,
.station-btn.active {
    border-color: rgba(0, 217, 255, 0.48);
    background: linear-gradient(90deg, rgba(255,47,178,0.2), rgba(0,217,255,0.34), rgba(255,255,255,0.72));
}

.station-icon {
    font-size: 1.2rem;
}

.status-indicator {
    width: 6px;
    height: 15px;
    background: #333;
    border-radius: 2px;
}

.station-btn.online .status-indicator {
    background: var(--color-cyan);
    box-shadow: 0 0 5px var(--color-cyan);
}

.station-btn.active .status-indicator {
    background: var(--color-text-green);
    box-shadow: 0 0 5px var(--color-text-green);
}

.now-playing {
    margin-top: 10px;
    background: #0d1c40;
    padding: 8px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--color-cyan);
    border: 1px solid rgba(0, 217, 255, 0.32);
    box-shadow: inset 0 0 16px rgba(0, 217, 255, 0.08);
}

.now-playing-label {
    color: var(--color-hot-pink);
    margin-bottom: 4px;
}

/* Game Menu */
.game-menu-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.game-menu-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border: 1px solid rgba(20, 39, 92, 0.28);
    border-radius: 4px;
    color: #101a44;
    text-align: left;
    background: rgba(255,255,255,0.76);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.8);
}

.game-menu-btn:hover {
    background: linear-gradient(90deg, rgba(255,47,178,0.2), rgba(0,217,255,0.32), rgba(255,255,255,0.8));
    border-color: rgba(20, 39, 92, 0.48);
}

.game-icon {
    font-size: 1.35rem;
    width: 28px;
    text-align: center;
}

.game-title {
    font-size: 0.86rem;
    font-weight: 800;
    color: #101a44;
}

.game-subtitle {
    font-size: 0.66rem;
    opacity: 1;
    color: #273769;
    font-family: var(--font-mono);
}

/* XR Button */
.xr-btn {
    display: none; /* Hidden by default, shown via JS if supported */
    width: 100%;
    padding: 12px 14px;
    font-size: 1.15rem;
    font-weight: bold;
    color: #fff;
    text-shadow: 0 0 10px var(--color-cyan);
    border: 1px solid var(--color-cyan);
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,47,178,0.22), rgba(0,217,255,0.2));
    box-shadow: 
        inset 0 0 15px rgba(0, 217, 255, 0.18),
        0 0 18px rgba(255, 47, 178, 0.22);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: inset 0 0 14px rgba(0, 217, 255, 0.16), 0 0 8px rgba(255, 47, 178, 0.18); }
    50% { box-shadow: inset 0 0 24px rgba(0, 217, 255, 0.28), 0 0 22px rgba(255, 47, 178, 0.32); }
    100% { box-shadow: inset 0 0 14px rgba(0, 217, 255, 0.16), 0 0 8px rgba(255, 47, 178, 0.18); }
}

/* Game Board Wrapper */
.game-header {
    text-align: center;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.game-header h2 {
    color: #101a44;
    text-shadow: 0 1px 0 rgba(255,255,255,0.8);
    font-size: 1.15rem;
}

#btn-back-menu {
    color: #101a44;
    background: linear-gradient(180deg, #f8fbff, #aeb8cf);
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #273769;
    border-top-color: #fff;
    border-left-color: #fff;
    font-weight: 800;
}

.game-stats {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    margin-bottom: 10px;
    color: #172256;
}

.game-shell {
    width: 100%;
    color: #101a44;
    font-family: var(--font-main);
}

.game-status {
    margin-top: 10px;
    text-align: center;
    color: #101a44;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    min-height: 22px;
}

.game-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.game-action {
    padding: 6px 10px;
    border: 1px solid #273769;
    border-top-color: #fff;
    border-left-color: #fff;
    border-radius: 3px;
    color: #101a44;
    background: linear-gradient(180deg, #f8fbff, #aeb8cf);
    font-weight: 800;
}

.game-action:active {
    border-top-color: #273769;
    border-left-color: #273769;
    border-bottom-color: #fff;
    border-right-color: #fff;
}

.board-placeholder {
    color: #101a44;
}

.checkers-board {
    display: grid;
    grid-template-columns: repeat(8, minmax(28px, 46px));
    grid-template-rows: repeat(8, minmax(28px, 46px));
    justify-content: center;
    border: 2px solid #1b2441;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.checker-square {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(16,26,68,0.14);
}

.checker-square.light { background: #e9f0fc; }
.checker-square.dark { background: #334579; }
.checker-square.selected { outline: 3px solid #ff2fb2; outline-offset: -3px; }
.checker-square.legal { box-shadow: inset 0 0 0 4px rgba(0,217,255,0.65); cursor: pointer; }

.checker-piece {
    width: 72%;
    height: 72%;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.75);
    box-shadow: inset -4px -5px 8px rgba(0,0,0,0.35), 0 2px 4px rgba(0,0,0,0.4);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    cursor: pointer;
}

.checker-piece.red { background: radial-gradient(circle at 32% 28%, #ff8fba, #d41462 72%); }
.checker-piece.black { background: radial-gradient(circle at 32% 28%, #9de8ff, #17366e 72%); }

.peg-board {
    display: grid;
    grid-template-columns: repeat(7, minmax(28px, 44px));
    grid-template-rows: repeat(7, minmax(28px, 44px));
    gap: 4px;
    justify-content: center;
}

.peg-cell {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.peg-hole {
    width: 82%;
    height: 82%;
    border-radius: 50%;
    border: 2px solid #273769;
    background: radial-gradient(circle at 50% 58%, #1d2747 0 18%, #60719b 19% 100%);
    cursor: pointer;
}

.peg-hole.selected { outline: 3px solid #ff2fb2; }
.peg-hole.legal { box-shadow: 0 0 0 3px rgba(0,217,255,0.68); }
.peg-hole.has-peg::after {
    content: "";
    display: block;
    width: 70%;
    height: 70%;
    margin: 15%;
    border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #fff36d, #ff2fb2 70%);
    box-shadow: inset -4px -5px 8px rgba(0,0,0,0.3), 0 2px 5px rgba(0,0,0,0.4);
}

.solitaire-game {
    display: grid;
    gap: 10px;
}

.solitaire-top,
.solitaire-tableau {
    display: grid;
    grid-template-columns: repeat(7, minmax(36px, 58px));
    gap: 6px;
    justify-content: center;
}

.card-pile {
    min-height: 72px;
    border: 1px dashed rgba(39,55,105,0.58);
    border-radius: 5px;
    background: rgba(255,255,255,0.48);
    padding: 3px;
}

.tableau-pile {
    min-height: 170px;
}

.playing-card {
    height: 68px;
    border: 1px solid #273769;
    border-radius: 5px;
    background: #f8fbff;
    color: #101a44;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    font-weight: 800;
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 5px;
    margin-bottom: -42px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.28);
}

.playing-card.red-card {
    color: #c41456;
}

.playing-card.face-down {
    color: transparent;
    background:
        linear-gradient(45deg, rgba(255,255,255,0.18) 25%, transparent 25% 50%, rgba(255,255,255,0.18) 50% 75%, transparent 75%),
        linear-gradient(180deg, #1c2c60, #ff2fb2);
    background-size: 12px 12px, auto;
}

.playing-card.selected {
    outline: 3px solid #00d9ff;
    outline-offset: -3px;
}

.stock-label {
    color: #273769;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-align: center;
    margin-top: 22px;
}

.c4-drop-row {
    display: grid;
    grid-template-columns: repeat(7, 40px);
    gap: 3px;
    justify-content: center;
    margin-bottom: 5px;
    padding: 0 10px;
}

.c4-drop-btn {
    height: 26px;
    border: 1px solid #273769;
    border-top-color: #fff;
    border-left-color: #fff;
    border-radius: 3px;
    color: #101a44;
    background: linear-gradient(180deg, #f8fbff, #aeb8cf);
    font-size: 0.9rem;
    font-weight: 800;
    line-height: 1;
}

.c4-drop-btn:disabled {
    opacity: 0.38;
    cursor: default;
}

.c4-board {
    display: grid;
    grid-template-columns: repeat(7, 40px);
    grid-template-rows: repeat(6, 40px);
    gap: 3px;
    justify-content: center;
    padding: 10px;
    border: 2px solid #101a44;
    border-radius: 5px;
    background: #20366f;
    box-shadow: 0 10px 20px rgba(0,0,0,0.24);
    overflow: hidden;
}

.c4-cell {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 50%;
    background: #121c3d;
    cursor: pointer;
    overflow: visible;
}

.c4-piece {
    width: 34px;
    height: 34px;
    border-radius: 50%;
}

.c4-red {
    background: radial-gradient(circle at 30% 30%, #ff8da4, #cc0000);
    box-shadow: inset -2px -2px 5px rgba(0,0,0,0.5), 1px 1px 3px rgba(0,0,0,0.5);
}

.c4-yellow {
    background: radial-gradient(circle at 30% 30%, #ffffa6, #cca300);
    box-shadow: inset -2px -2px 5px rgba(0,0,0,0.5), 1px 1px 3px rgba(0,0,0,0.5);
}

.c4-falling {
    animation: c4-drop 260ms cubic-bezier(0.18, 0.76, 0.28, 1.08);
}

@keyframes c4-drop {
    from {
        transform: translateY(var(--drop-distance));
    }
    to {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .c4-falling {
        animation: none;
    }
}

/* Station Meta */
.station-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
.station-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #101a44;
    font-weight: 800;
}
.station-meta {
    font-family: var(--font-mono);
    font-size: 0.74rem;
    color: #21305f;
    opacity: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 14px;
    text-transform: none;
    text-shadow: 0 1px 0 rgba(255,255,255,0.78);
}

.station-btn.active .station-meta,
.station-btn:hover .station-meta {
    color: #09235d;
}

/* Radio Controls Player */
.radio-controls-player {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    padding: 10px;
    border: 1px solid rgba(0, 217, 255, 0.22);
    border-radius: 6px;
    background: linear-gradient(180deg, #cfd7e8, #8f9ab6);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.volume-control button {
    width: 25px;
    height: 25px;
    border: 1px solid rgba(0, 217, 255, 0.4);
    background: #080b12;
    color: var(--color-cyan);
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vol-indicator {
    flex: 1;
    height: 10px;
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(0, 217, 255, 0.28);
    border-radius: 2px;
}

.playback-control {
    display: flex;
    gap: 10px;
}

.playback-control button {
    flex: 1;
    padding: 8px;
    border: 1px solid rgba(255,255,255,0.18);
    border-bottom-color: var(--color-panel-border-dark);
    border-right-color: var(--color-panel-border-dark);
    border-radius: 3px;
    background: linear-gradient(180deg, #4b536a, #171c29);
    color: #fff;
    font-weight: bold;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.5);
}

/* XR Preview */
.xr-scene {
    position: relative;
    min-height: 410px;
    height: 100%;
    border: 1px solid rgba(34, 49, 102, 0.34);
    border-radius: 4px;
    overflow: hidden;
    background: linear-gradient(180deg, #8edfff 0%, #ffc4ed 43%, #31286e 44%, #140d36 100%);
}

.xr-sky,
.xr-horizon,
.xr-grid-floor {
    position: absolute;
    inset: 0;
}

.xr-sun {
    position: absolute;
    left: 50%;
    top: 36px;
    width: 132px;
    height: 132px;
    transform: translateX(-50%);
    border-radius: 50%;
    background: repeating-linear-gradient(180deg, #fff36d 0 11px, #ff7bbd 12px 18px);
    box-shadow: 0 0 34px rgba(255, 47, 178, 0.45);
}

.xr-cloud {
    position: absolute;
    width: 148px;
    height: 36px;
    border-radius: 999px;
    background: rgba(255,255,255,0.78);
    box-shadow: 28px -10px 0 rgba(255,255,255,0.64), 56px 4px 0 rgba(255,255,255,0.56);
}

.cloud-one { left: 44px; top: 42px; }
.cloud-two { right: 76px; top: 94px; transform: scale(0.8); }

.xr-horizon {
    top: 42%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #00d9ff, #ff2fb2, transparent);
    box-shadow: 0 0 18px rgba(0,217,255,0.7);
}

.xr-grid-floor {
    top: 42%;
    transform-origin: top center;
    background:
        linear-gradient(rgba(0,217,255,0.3) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,47,178,0.24) 1px, transparent 1px);
    background-size: 100% 28px, 42px 100%;
    transform: perspective(420px) rotateX(62deg) scaleY(1.8);
}

.xr-radio-object {
    position: absolute;
    left: 8%;
    top: 32%;
    width: min(390px, 54%);
    padding: 14px;
    border: 2px solid #f8fbff;
    border-right-color: #30384d;
    border-bottom-color: #30384d;
    border-radius: 7px;
    background:
        linear-gradient(90deg, rgba(255,255,255,0.3), transparent 12% 88%, rgba(0,0,0,0.16)),
        linear-gradient(180deg, #f1f4fb, #a5afc6 48%, #5f687f);
    box-shadow:
        0 24px 36px rgba(0,0,0,0.4),
        0 0 26px rgba(0,217,255,0.34),
        inset 0 0 0 1px rgba(255,255,255,0.55);
}

.xr-radio-topline {
    height: 8px;
    margin-bottom: 10px;
    border: 1px solid #30384d;
    border-radius: 999px;
    background: linear-gradient(90deg, #151b2c, #dce6f7 46%, #151b2c);
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.5);
}

.xr-radio-face {
    display: grid;
    grid-template-columns: minmax(84px, 130px) 1fr;
    gap: 12px;
    align-items: center;
}

.xr-radio-object img {
    width: 100%;
    display: block;
    filter:
        drop-shadow(0 2px 0 rgba(255,255,255,0.65))
        drop-shadow(0 0 9px rgba(255,47,178,0.45));
}

.xr-radio-screen {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    height: 82px;
    align-items: end;
    padding: 20px 7px 7px;
    position: relative;
    border: 2px solid #0b1122;
    border-top-color: #253a71;
    border-left-color: #253a71;
    background:
        linear-gradient(rgba(157,232,255,0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(157,232,255,0.1) 1px, transparent 1px),
        #10285b;
    background-size: 100% 9px, 14px 100%, auto;
    box-shadow: inset 0 0 16px rgba(0,217,255,0.25);
}

.xr-screen-title {
    position: absolute;
    top: 5px;
    left: 8px;
    color: #9de8ff;
    font-family: var(--font-mono);
    font-size: 0.78rem;
    text-shadow: 0 0 7px rgba(0,217,255,0.85);
}

.xr-radio-screen span {
    height: 45%;
    background: linear-gradient(180deg, #fff36d, #00d9ff);
}

.xr-radio-screen span:nth-child(even) { height: 78%; }

.xr-radio-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.xr-radio-controls i,
.xr-cassette i {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background:
        radial-gradient(circle at 35% 32%, #f8fbff 0 10%, #8c97ad 11% 33%, #222b40 34% 100%);
    border: 2px solid #d8dfec;
    box-shadow: inset -4px -4px 8px rgba(0,0,0,0.4), 0 1px 0 rgba(255,255,255,0.6);
}

.xr-button-bank {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.xr-button-bank b {
    display: block;
    height: 18px;
    border: 1px solid #1b2437;
    border-top-color: #f4f7ff;
    border-left-color: #f4f7ff;
    border-radius: 3px;
    background: linear-gradient(180deg, #f5f7fc, #8d98af);
}

.xr-radio-vents {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 7px;
    margin-top: 11px;
}

.xr-radio-vents span {
    height: 5px;
    border-radius: 999px;
    background: #252e45;
    box-shadow: inset 0 1px 1px rgba(0,0,0,0.7);
}

.xr-game-object {
    position: absolute;
    right: 13%;
    top: 46%;
    display: grid;
    grid-template-columns: repeat(4, 26px);
    gap: 4px;
    padding: 10px;
    transform: rotate(-7deg);
    background: rgba(255,255,255,0.76);
    border: 1px solid #29324d;
    box-shadow: 0 16px 28px rgba(0,0,0,0.32);
}

.xr-game-object span {
    width: 26px;
    height: 26px;
    background: #172256;
}

.xr-game-object span:nth-child(3n) { background: #ff2fb2; }
.xr-game-object span:nth-child(4n) { background: #00d9ff; }

.xr-cassette {
    position: absolute;
    right: 28%;
    bottom: 34px;
    width: 142px;
    height: 78px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-radius: 8px;
    background: linear-gradient(180deg, #fff7d6, #f0a7dc);
    border: 2px solid #29324d;
    box-shadow: 0 14px 22px rgba(0,0,0,0.28);
}

.playback-control button:active {
    border-top-color: var(--color-panel-border-dark);
    border-left-color: var(--color-panel-border-dark);
    border-bottom-color: var(--color-panel-border);
    border-right-color: var(--color-panel-border);
}

/* Help Panel */
.help-panel {
    background: #18284e;
    border: 1px solid #303748;
    border-radius: 4px;
    margin-bottom: 10px;
    color: #eef4ff;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.help-panel.collapsed .help-content {
    display: none;
}

.help-panel.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.help-header {
    border-bottom: 1px solid #303748;
}
