/* RESET */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        sans-serif;
    background: #020308;
    color: #f5f5f5;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Scanlines for CRT look */
.scanlines {
    pointer-events: none;
    position: fixed;
    inset: 0;
    background-image: linear-gradient(to bottom,
            rgba(255, 255, 255, 0.12) 1px,
            transparent 1px);
    background-size: 100% 2px;
    mix-blend-mode: soft-light;
    opacity: 0.4;
    z-index: 5;
}

/* CONSOLE SHELL – centered, responsive, no scroll on large screens */
.console-shell {
    position: relative;
    width: min(100vw, 960px);
    height: min(calc(var(--vh, 1vh) * 100), 600px);
    padding: clamp(10px, 2vw, 18px);
    border-radius: 24px;
    background: radial-gradient(circle at 50% 0, #2a314d, #04040d 70%);
    box-shadow:
        0 0 0 1px rgba(17, 20, 40, 0.9),
        0 24px 40px rgba(0, 0, 0, 0.95);
    display: flex;
    flex-direction: column;
    gap: clamp(8px, 1.5vh, 14px);
    z-index: 1;
}

/* TOP BAR */
.console-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    border-radius: 14px;
    background: linear-gradient(180deg, #161a2b, #050713);
    box-shadow:
        inset 0 0 0 1px rgba(39, 45, 82, 0.85),
        0 10px 18px rgba(0, 0, 0, 0.8);
    font-size: 0.75rem;
}

.console-top-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.power-led {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #3fff93;
    box-shadow: 0 0 8px rgba(63, 255, 147, 0.9);
}

.console-label {
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: #dde6ff;
}

.console-top-right {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #9aa4cf;
}

.battery-text {
    letter-spacing: 0.15em;
    font-size: 0.7rem;
}

.battery-icon {
    position: relative;
    width: 22px;
    height: 10px;
    border-radius: 3px;
    border: 1px solid #9aa4cf;
    overflow: hidden;
}

.battery-fill {
    position: absolute;
    inset: 2px 3px 2px 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #4cff9a, #cfffd5);
}

/* MAIN SCREEN */
.console-screen {
    position: relative;
    flex: 1 1 auto;
    border-radius: 18px;
    padding: clamp(8px, 1.5vw, 12px);
    background: #03050e;
    box-shadow:
        inset 0 0 0 1px rgba(33, 42, 77, 0.9),
        0 16px 22px rgba(0, 0, 0, 0.85);
    overflow: hidden;
}

/* Background layers: sky, mountains, grass */
.screen-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.layer {
    position: absolute;
    left: 0;
    right: 0;
}

/* Sky */
.layer.sky {
    top: 0;
    bottom: 40%;
    background: linear-gradient(#87b0ff, #5575d9, #1b2144);
}

/* Mountains */
.layer.mountains {
    bottom: 30%;
    height: 40%;
    background: linear-gradient(to top,
            #1b2144 0,
            #27356c 25%,
            #3b4c8c 50%,
            #4e66a8 75%,
            #627fbe 100%);
    clip-path: polygon(0% 100%,
            5% 70%,
            14% 78%,
            22% 55%,
            30% 63%,
            38% 42%,
            50% 60%,
            60% 37%,
            70% 55%,
            82% 40%,
            91% 58%,
            100% 35%,
            100% 100%);
}

/* Grass */
.layer.grass {
    bottom: 0;
    height: 34%;
    background: linear-gradient(#1c5025 0, #0f3518 40%, #071909 100%);
}

/* Foreground content */
.screen-content {
    position: relative;
    z-index: 1;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(20px, 4vh, 28px);
    padding: clamp(12px, 3vw, 24px);
    text-align: center;
}

/* Logo */
.logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    user-select: none;
}

.logo-main {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: clamp(2rem, 6vw, 3rem);
    color: #ffcc03;
    text-shadow:
        0 3px 0 #27406f,
        0 0 18px rgba(255, 255, 255, 0.7);
}

.logo-sub {
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: clamp(0.9rem, 3vw, 1.1rem);
    color: #f5f5f5;
    text-shadow: 0 2px 0 #27406f;
}

/* START BUTTON – center, single action */
.start-btn {
    position: relative;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    transform-origin: center;
    transition:
        transform 0.18s ease-out,
        box-shadow 0.18s ease-out;
}

/* Outer glow ring */
.start-btn-border {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffe782, #ff7a15);
    filter: blur(0.45px);
    opacity: 0.9;
}

/* Inner button base */
.start-btn-inner {
    position: relative;
    min-width: min(260px, 80vw);
    height: clamp(60px, 9vh, 76px);
    padding-inline: 32px;
    border-radius: 999px;
    background:
        radial-gradient(circle at 10% 0, rgba(255, 255, 255, 0.2), transparent 50%),
        linear-gradient(135deg, #ffcc03, #ff7e11);
    box-shadow:
        0 12px 24px rgba(0, 0, 0, 0.8),
        0 0 22px rgba(255, 203, 76, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Inner dark band for retro feel */
.start-btn-inner::before {
    content: "";
    position: absolute;
    inset: 3px;
    border-radius: inherit;
    background: linear-gradient(180deg, #2b324a, #151929);
    opacity: 0.55;
}

/* Moving shine */
.start-btn-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
            transparent 0,
            rgba(255, 255, 255, 0.85) 40%,
            rgba(255, 255, 255, 0) 60%,
            transparent 100%);
    mix-blend-mode: screen;
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
}

/* Button text */
.start-btn-text {
    position: relative;
    z-index: 1;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    font-size: clamp(1rem, 3.4vw, 1.25rem);
    color: #fffef4;
    text-shadow:
        0 2px 0 rgba(0, 0, 0, 0.8),
        0 0 10px rgba(0, 0, 0, 0.9);
}

/* Hover / focus / active */
.start-btn:hover,
.start-btn:focus-visible {
    transform: translateY(-3px) scale(1.03);
}

.start-btn:hover .start-btn-inner,
.start-btn:focus-visible .start-btn-inner {
    box-shadow:
        0 14px 28px rgba(0, 0, 0, 0.9),
        0 0 28px rgba(255, 224, 135, 0.9);
    background:
        radial-gradient(circle at 10% 0, rgba(255, 255, 255, 0.25), transparent 50%),
        linear-gradient(135deg, #ffd44f, #ff9731);
}

.start-btn:hover .start-btn-shine,
.start-btn:focus-visible .start-btn-shine {
    animation: shine-sweep 0.9s cubic-bezier(0.19, 1, 0.22, 1) forwards;
}

.start-btn:active {
    transform: translateY(1px) scale(0.98);
}

.start-btn:active .start-btn-inner {
    box-shadow:
        0 8px 16px rgba(0, 0, 0, 0.9),
        0 0 18px rgba(255, 203, 76, 0.75);
}

/* Keyboard focus outline */
.start-btn:focus-visible {
    outline: 2px solid #ffe678;
    outline-offset: 6px;
}

/* Shine animation */
@keyframes shine-sweep {
    0% {
        transform: translateX(-120%);
        opacity: 0;
    }

    10% {
        opacity: 0.9;
    }

    60% {
        opacity: 0.7;
    }

    100% {
        transform: translateX(120%);
        opacity: 0;
    }
}

/* BOTTOM BAR – console buttons */
.console-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 4px;
    font-size: 0.72rem;
    color: #8b92b8;
}

.bottom-left {
    display: flex;
    gap: 8px;
    align-items: center;
}

.bottom-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

.btn-circle {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    color: #fff6f0;
    font-weight: 700;
    box-shadow:
        0 2px 0 rgba(0, 0, 0, 0.85),
        0 0 0 2px rgba(46, 16, 16, 0.9);
    font-size: 0.78rem;
}

.btn-a {
    background: radial-gradient(circle at 30% 25%, #ff5d5d, #a42121);
}

.btn-b {
    background: radial-gradient(circle at 30% 25%, #ffc659, #b57c1b);
    box-shadow:
        0 2px 0 rgba(0, 0, 0, 0.85),
        0 0 0 2px rgba(75, 42, 5, 0.9);
}

.btn-oval {
    padding: 3px 12px;
    border-radius: 999px;
    background: linear-gradient(#2c314f, #161a31);
    box-shadow:
        0 2px 0 rgba(0, 0, 0, 0.9),
        0 0 0 1px rgba(70, 78, 130, 0.9);
    letter-spacing: 0.18em;
}

/* RESPONSIVE – keep everything visible without scroll when possible */
@media (max-width: 768px) {
    .console-shell {
        width: 100vw;
        height: calc(var(--vh, 1vh) * 100);
        border-radius: 0;
        padding: 10px;
    }

    .console-top {
        border-radius: 10px;
        padding-inline: 8px;
    }

    .console-screen {
        border-radius: 10px;
    }

    .console-bottom {
        padding-top: 6px;
    }

    .btn-circle {
        width: 26px;
        height: 26px;
        font-size: 0.7rem;
    }

    .btn-oval {
        padding: 3px 10px;
    }
}

/* In very short viewports, allow vertical scroll but keep layout clean */
@media (max-height: 500px) {
    body {
        overflow-y: auto;
    }

    .console-shell {
        height: auto;
        min-height: 100vh;
    }
}