body {
    margin: 0;
    width: 100%;
    height: 100vh;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 2vh 0;
    box-sizing: border-box;

    gap: 4vh;

    background: radial-gradient(circle at top, #2b2b2b, #0d0d0d);
    font-family: Arial, sans-serif;

    font-size: 3vh;
}

/* =========================
   HEADER (1-3-1 BLOCK)
========================= */

.title-block {
    color: #ffffff;

    width: 80vw;
    max-width: 1000px;

    margin: 0 auto;

    display: flex;
    flex-direction: column;
    align-items: center;

    text-align: center;

    overflow-x: visible;
}

.title-block h1 {
    font-size: clamp(64px, 10vh, 120px);
    margin: 0 0 2vh 0;

    color: #00ffcc;
    text-shadow: 0 0 22px rgba(0,255,204,0.5);

    white-space: nowrap;
}

.title-block p {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.neon {
    color: #00ffcc;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(0,255,204,0.6);
}

/* =========================
   MACHINE LAYOUT
========================= */

.machine {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 3vw;
}

/* slot frame */
.slot-container {
    background: linear-gradient(145deg, #3a3a3a, #1f1f1f);

    padding: 2vw;
    border-radius: 2vw;

    border: 2px solid #555;

    box-shadow:
        0 2vh 5vh rgba(0,0,0,0.6),
        inset 0 2px 6px rgba(255,255,255,0.1);
}

/* =========================
   CANVAS (75% WIDTH RULE)
========================= */

canvas {
    width: 75vw;
    height: 30vh;

    background: #000;
    border-radius: 16px;
}

/* =========================
   SPIN BUTTON
========================= */

button {
    height: 35vh;
    width: 6vw;

    font-size: 2.2vh;
    font-weight: bold;

    border: none;
    border-radius: 1.2vw;

    cursor: pointer;

    background: linear-gradient(145deg, #ffcc00, #ff8800);
    color: #111;

    box-shadow:
        0 1vh 0 #b35c00,
        0 2vh 4vh rgba(0,0,0,0.4);

    display: flex;
    align-items: center;
    justify-content: center;

    writing-mode: vertical-rl;
    text-orientation: upright;

    letter-spacing: 2px;
    text-transform: uppercase;
}

button:hover {
    transform: translateY(-2px);
}

button:active {
    transform: translateY(4px);
    box-shadow: 0 3px 0 #b35c00;
}

/* =========================
   TIMER ROW
========================= */

.timer-row {
    display: flex;
    align-items: center;
    justify-content: center;

    gap: 5vw;
}

/* BIG TIMER */
#timer {
    font-size: 9vh;

    min-width: 15vw;
    text-align: center;

    color: #666;
    opacity: 0.4;
}

#timer.active {
    color: #00ffcc;
    opacity: 1;

    text-shadow: 0 0 22px rgba(0,255,204,0.5);
}

/* =========================
   START BUTTON
========================= */

#startBtn {
    width: 18vw;
    height: 6vh;

    font-size: 2.2vh;

    border: none;
    border-radius: 1.2vw;

    cursor: pointer;

    background: linear-gradient(145deg, #00ffcc, #00aa88);
    color: #111;

    box-shadow:
        0 1vh 0 #007a66,
        0 2vh 4vh rgba(0,0,0,0.4);

    display: flex;
    align-items: center;
    justify-content: center;

    writing-mode: horizontal-tb;
}

#startBtn:active {
    transform: translateY(4px);
    box-shadow: 0 3px 0 #007a66;
}

#startBtn.pressed {
    transform: translateY(4px);

    box-shadow:
        0 3px 0 #007a66,
        0 6px 12px rgba(0,0,0,0.3);

    filter: brightness(0.95);
}

#startBtn:disabled {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    color: #666;

    border: 1px solid #444;

    box-shadow: none;

    opacity: 0.4;

    cursor: not-allowed;
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1000px) {

    body {
        gap: 2vh;
        font-size: 2.2vh;
    }

    .title-block h1 {
        font-size: 8vw;
        white-space: normal;
    }

    .title-block p {
        white-space: normal;
        font-size: 2vh;
    }

    .machine {
        flex-direction: column;
        gap: 2vh;
    }

    canvas {
        width: 92vw;
        height: 28vh;
    }

    /* spin button becomes horizontal (critical fix) */
    button {
        width: 60vw;
        height: 7vh;
        writing-mode: horizontal-tb;
        font-size: 2.5vh;
    }

    #startBtn {
        width: 70vw;
        height: 6.5vh;
    }

    .timer-row {
        flex-direction: column;
        gap: 2vh;
    }

    #timer {
        font-size: 10vw;
        min-width: auto;
    }

    .slot-container {
        padding: 3vw;
        border-radius: 3vw;
    }
}
