/* ==========================================================================
   SIMÓN DICE — ARCADE CONSOLE UI
   A physical tabletop arcade cabinet: chrome bezel, recessed LED screens,
   glossy pressable domes, center status hub. Built from these tokens:

   Color:
     --void        #05070f  page background (dark room)
     --steel       #161b2c  cabinet panel
     --steel-hi    #232a42  bezel highlight edge
     --steel-lo    #0a0d18  bezel shadow edge
     --chrome      #9aa5c0  metallic text / hairlines
     --led-amber   #ffb020  LED digit glow
     --chrome-glow #8b5cf6  accessory violet glow (focus/hub)

   Type:
     Display -> 'Orbitron'        (title)
     UI      -> 'Rajdhani'        (labels, buttons, message ticker)
     Digits  -> 'Share Tech Mono' (score / timer readouts)

   Signature: the bolted bezel ring + glowing center hub on the pad grid.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@500;700;800;900&family=Rajdhani:wght@500;600;700&family=Share+Tech+Mono&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --void: #05070f;
    --steel: #161b2c;
    --steel-hi: #232a42;
    --steel-lo: #0a0d18;
    --chrome: #9aa5c0;
    --led-amber: #ffb020;
    --chrome-glow: #8b5cf6;

    --red: #ff2d55;
    --red-dim: #4a0f1e;
    --green: #26ff8a;
    --green-dim: #0a3d24;
    --blue: #2d8cff;
    --blue-dim: #0d2c56;
    --yellow: #ffd60a;
    --yellow-dim: #4a3c00;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
}

body {
    font-family: 'Rajdhani', sans-serif;
    background:
        radial-gradient(ellipse at 50% -10%, rgba(139, 92, 246, 0.10), transparent 55%),
        radial-gradient(ellipse at 50% 110%, rgba(45, 140, 255, 0.08), transparent 55%),
        var(--void);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* faint scanline atmosphere across the whole room */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    background: repeating-linear-gradient(
        to bottom,
        rgba(255,255,255,0.015) 0px,
        rgba(255,255,255,0.015) 1px,
        transparent 1px,
        transparent 3px
    );
    z-index: 1;
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 560px;
    padding: 32px 28px 28px;
    position: relative;
    z-index: 2;
    background:
        linear-gradient(155deg, var(--steel-hi) 0%, var(--steel) 12%, var(--steel) 88%, var(--steel-lo) 100%);
    border-radius: 28px;
    border: 1px solid rgba(154, 165, 192, 0.15);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.55),
        0 2px 0 rgba(255, 255, 255, 0.05) inset,
        0 -6px 20px rgba(0, 0, 0, 0.4) inset;
}

h1 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    font-size: 2.1em;
    letter-spacing: 0.06em;
    margin-bottom: 22px;
    margin-top: 6px;
    color: #eef1fb;
    text-transform: uppercase;
    text-align: center;
    background: linear-gradient(180deg, #ffffff 10%, var(--chrome) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 24px rgba(139, 92, 246, 0.35);
}

.info-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 18px;
    width: 100%;
    justify-content: center;
}

.score, .timer {
    font-family: 'Share Tech Mono', monospace;
    font-size: 1.25em;
    letter-spacing: 0.05em;
    padding: 10px 22px;
    background: linear-gradient(180deg, #05070c, #0d1220);
    color: var(--led-amber);
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.6);
    box-shadow:
        0 0 12px rgba(255, 176, 32, 0.25) inset,
        0 2px 0 rgba(255,255,255,0.04),
        0 4px 10px rgba(0,0,0,0.5);
    text-shadow: 0 0 8px rgba(255, 176, 32, 0.75);
    flex: 1;
    text-align: center;
    min-width: 0;
}

.message {
    font-family: 'Rajdhani', sans-serif;
    font-weight: 600;
    font-size: 1.15em;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 22px;
    min-height: 1.8em;
    color: var(--chrome);
    text-align: center;
}

.game-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 30px;
    padding: 42px;
    position: relative;
    border-radius: 50%;
    aspect-ratio: 1;
    place-items: center;
    background:
        radial-gradient(circle at 50% 50%, var(--steel-hi) 0%, var(--steel) 55%, var(--steel-lo) 100%);
    border: 10px solid transparent;
    background-clip: padding-box;
    box-shadow:
        0 0 0 2px rgba(0,0,0,0.5),
        0 0 0 3px rgba(154, 165, 192, 0.18),
        0 20px 40px rgba(0,0,0,0.5) inset,
        0 10px 24px rgba(0,0,0,0.5);
}

.button {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    transition: transform 0.12s ease, filter 0.15s ease, box-shadow 0.15s ease;
    position: relative;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

.button:focus-visible {
    outline: 3px solid var(--chrome-glow);
    outline-offset: 4px;
}

.button::after {
    content: '';
    position: absolute;
    top: 18%;
    left: 18%;
    width: 32%;
    height: 22%;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    filter: blur(2px);
    transform: rotate(-25deg);
}

.button:not(.disabled):hover {
    transform: scale(1.04) translateY(-2px);
}

.button.active {
    filter: brightness(1.6) saturate(1.3);
    transform: scale(0.94);
}

.button.disabled {
    cursor: not-allowed;
    filter: grayscale(0.65) brightness(0.55);
}

.red {
    background: radial-gradient(circle at 35% 30%, #ff6b85, var(--red) 45%, #8a0f2b 100%);
    box-shadow: 0 8px 0 var(--red-dim), 0 12px 20px rgba(255, 45, 85, 0.25);
}
.red.active {
    box-shadow: 0 4px 0 var(--red-dim), 0 0 45px 8px rgba(255, 45, 85, 0.9);
}

.green {
    background: radial-gradient(circle at 35% 30%, #7dffb8, var(--green) 45%, #0d6b3c 100%);
    box-shadow: 0 8px 0 var(--green-dim), 0 12px 20px rgba(38, 255, 138, 0.22);
}
.green.active {
    box-shadow: 0 4px 0 var(--green-dim), 0 0 45px 8px rgba(38, 255, 138, 0.85);
}

.blue {
    background: radial-gradient(circle at 35% 30%, #7fb8ff, var(--blue) 45%, #0f4a8f 100%);
    box-shadow: 0 8px 0 var(--blue-dim), 0 12px 20px rgba(45, 140, 255, 0.25);
}
.blue.active {
    box-shadow: 0 4px 0 var(--blue-dim), 0 0 45px 8px rgba(45, 140, 255, 0.9);
}

.yellow {
    background: radial-gradient(circle at 35% 30%, #fff08a, var(--yellow) 45%, #8a6f00 100%);
    box-shadow: 0 8px 0 var(--yellow-dim), 0 12px 20px rgba(255, 214, 10, 0.22);
}
.yellow.active {
    box-shadow: 0 4px 0 var(--yellow-dim), 0 0 45px 8px rgba(255, 214, 10, 0.85);
}

.button:not(.disabled):active {
    transform: scale(0.96) translateY(3px);
}

.controls {
    margin-top: 6px;
}

#start {
    font-family: 'Orbitron', sans-serif;
    font-size: 1em;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 16px 40px;
    color: #f4f1ff;
    background: linear-gradient(180deg, #9d6bff, var(--chrome-glow) 60%, #5b2fc4);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease, background 0.2s ease;
    outline: none;
    box-shadow:
        0 6px 0 #4a2299,
        0 10px 18px rgba(139, 92, 246, 0.35);
}

#start:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

#start:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 0 #4a2299,
        0 14px 24px rgba(139, 92, 246, 0.45);
}

#start:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #4a2299, 0 6px 12px rgba(139, 92, 246, 0.3);
}

#start:disabled {
    background: linear-gradient(180deg, #4a5066, #363c52);
    color: rgba(255,255,255,0.5);
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 6px 0 #23263a;
}

#start.end-game {
    background: linear-gradient(180deg, #ff6b85, var(--red) 60%, #8a0f2b);
    box-shadow: 0 6px 0 #5c0e22, 0 10px 18px rgba(255, 45, 85, 0.35);
}

#start.end-game:hover {
    box-shadow: 0 8px 0 #5c0e22, 0 14px 24px rgba(255, 45, 85, 0.45);
}

#start.end-game:active {
    box-shadow: 0 3px 0 #5c0e22, 0 6px 12px rgba(255, 45, 85, 0.3);
}

/* Tablet styles */
@media (max-width: 1024px) and (min-width: 601px) {
    h1 { font-size: 1.9em; }

    .button {
        width: 160px;
        height: 160px;
    }

    .score, .timer {
        font-size: 1.1em;
        padding: 9px 18px;
    }

    .message {
        font-size: 1.05em;
    }

    #start {
        font-size: 0.95em;
        padding: 14px 34px;
    }
}

/* Mobile styles */
@media (max-width: 600px) {
    .container {
        padding: 26px 18px 22px;
        border-radius: 22px;
    }

    h1 {
        font-size: 1.6em;
        margin-bottom: 16px;
    }

    .info-bar {
        gap: 10px;
        margin-bottom: 14px;
    }

    .score, .timer {
        font-size: 1em;
        padding: 8px 14px;
    }

    .message {
        font-size: 0.95em;
        margin-bottom: 16px;
        min-height: 1.6em;
    }

    .game-board {
        gap: 10px;
        margin-bottom: 22px;
        padding: 30px;
    }

    .button {
        width: 130px;
        height: 130px;
    }

    #start {
        font-size: 0.9em;
        padding: 13px 30px;
    }
}

/* Extra small mobile */
@media (max-width: 400px) {
    h1 { font-size: 1.4em; }

    .score, .timer {
        font-size: 0.9em;
        padding: 7px 10px;
    }

    .message { font-size: 0.85em; }

    .button {
        width: 108px;
        height: 108px;
    }

    #start {
        font-size: 0.85em;
        padding: 11px 24px;
    }
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 3, 8, 0.75);
    backdrop-filter: blur(3px);
    justify-content: center;
    align-items: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: linear-gradient(155deg, var(--steel-hi) 0%, var(--steel) 60%, var(--steel-lo) 100%);
    padding: 44px 40px;
    border-radius: 20px;
    border: 1px solid rgba(139, 92, 246, 0.3);
    box-shadow:
        0 0 60px rgba(139, 92, 246, 0.25),
        0 20px 50px rgba(0,0,0,0.6);
    text-align: center;
    max-width: 90%;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-40px) scale(0.96);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.modal-content h2 {
    font-family: 'Orbitron', sans-serif;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--red);
    font-size: 1.8em;
    margin-bottom: 22px;
    text-shadow: 0 0 20px rgba(255, 45, 85, 0.5);
}

.modal-content p {
    font-family: 'Share Tech Mono', monospace;
    color: var(--led-amber);
    font-size: 1.15em;
    margin: 12px 0;
    text-shadow: 0 0 8px rgba(255, 176, 32, 0.6);
}

.modal-content button {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.95em;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 14px 32px;
    color: #f4f1ff;
    background: linear-gradient(180deg, #9d6bff, var(--chrome-glow) 60%, #5b2fc4);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.15s ease;
    margin-top: 22px;
    outline: none;
    box-shadow: 0 6px 0 #4a2299, 0 10px 18px rgba(139, 92, 246, 0.35);
}

.modal-content button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.modal-content button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 #4a2299, 0 14px 24px rgba(139, 92, 246, 0.45);
}

.modal-content button:active {
    transform: translateY(3px);
    box-shadow: 0 3px 0 #4a2299, 0 6px 12px rgba(139, 92, 246, 0.3);
}

@media (max-width: 600px) {
    .modal-content {
        padding: 32px 22px;
        border-radius: 16px;
    }

    .modal-content h2 { font-size: 1.4em; }
    .modal-content p { font-size: 1em; }

    .modal-content button {
        font-size: 0.85em;
        padding: 12px 24px;
    }
}