/* ============================================
   SOCCER SURVIVOR - GAME CONSOLE STYLE
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --console-body: #2d2d3a;
    --console-dark: #1a1a24;
    --console-highlight: #3d3d4d;
    --screen-frame: #1a1a24;
    --accent: #ff69b4;
    --accent-glow: #ff1493;
    --led-green: #00ff88;
    --text: #ffffff;
}

body {
    font-family: 'Outfit', sans-serif;
    background: linear-gradient(135deg, #0a0a12 0%, #1a1a2e 50%, #0a0a12 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* ============================================
   SPLASH SCREEN WITH EYES
   ============================================ */

.splash-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.7s ease-out;
    border-radius: 8px;
}

.splash-screen.fade-out {
    opacity: 0;
}

.eyes {
    display: flex;
    gap: clamp(30px, 8vw, 80px);
    opacity: 0;
    transition: opacity 0.5s ease-in;
}

.eyes.show {
    opacity: 1;
}

.eyes.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.eyes.blink .eye {
    transform: scaleY(0.1);
}

.eye {
    width: clamp(40px, 10vw, 80px);
    height: clamp(60px, 15vw, 120px);
    background: radial-gradient(ellipse at 30% 30%, #fff 0%, #e0e0e0 100%);
    border-radius: 50%;
    position: relative;
    box-shadow:
        0 0 30px rgba(255, 255, 255, 0.3),
        0 0 60px rgba(255, 255, 255, 0.1),
        inset 0 -10px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.1s ease-in-out;
}

.pupil {
    position: absolute;
    width: 45%;
    height: 35%;
    background: radial-gradient(ellipse at 30% 30%, #333 0%, #000 70%);
    border-radius: 50%;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: inset 2px 2px 4px rgba(255, 255, 255, 0.2);
}

.pupil::after {
    content: '';
    position: absolute;
    width: 30%;
    height: 30%;
    background: #fff;
    border-radius: 50%;
    top: 20%;
    left: 20%;
}

/* ============================================
   GAME CONSOLE
   ============================================ */

.console {
    background: linear-gradient(145deg, var(--console-highlight) 0%, var(--console-body) 50%, var(--console-dark) 100%);
    border-radius: 40px;
    padding: clamp(20px, 4vw, 35px);
    box-shadow:
        0 30px 60px rgba(0, 0, 0, 0.5),
        0 0 100px rgba(255, 105, 180, 0.1),
        inset 0 2px 0 rgba(255, 255, 255, 0.1),
        inset 0 -2px 0 rgba(0, 0, 0, 0.3);
    max-width: 720px;
    width: 95vw;
}

/* ============================================
   TOP SECTION
   ============================================ */

.console-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px 20px;
}

.speaker-grille {
    display: flex;
    gap: 4px;
}

.speaker-line {
    width: 3px;
    height: 20px;
    background: var(--console-dark);
    border-radius: 2px;
}

.console-title {
    font-size: 0.9rem;
    font-weight: 800;
    letter-spacing: 4px;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.power-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.power-led {
    width: 8px;
    height: 8px;
    background: var(--led-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--led-green), 0 0 20px var(--led-green);
    animation: pulse-led 2s ease-in-out infinite;
}

.power-led.off {
    background: #333;
    box-shadow: none;
    animation: none;
}

@keyframes pulse-led {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* ============================================
   SCREEN / DISPLAY
   ============================================ */

.screen-bezel {
    background: var(--screen-frame);
    border-radius: 15px;
    padding: 15px;
    position: relative;
    box-shadow:
        inset 0 5px 15px rgba(0, 0, 0, 0.5),
        0 -2px 0 rgba(255, 255, 255, 0.05);
}

.screen {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 16 / 9;
}

/* Screen off state */
.screen.off {
    background: #0a0a0a;
}

/* Screen turning on effect */
.screen.turning-on {
    animation: screen-on 0.5s ease-out forwards;
}

@keyframes screen-on {
    0% {
        background: #0a0a0a;
        filter: brightness(0);
    }

    30% {
        background: #fff;
        filter: brightness(2);
    }

    50% {
        background: #111;
        filter: brightness(0.5);
    }

    100% {
        background: #000;
        filter: brightness(1);
    }
}

.screen-reflection {
    position: absolute;
    top: 15px;
    left: 15px;
    right: 15px;
    height: 50%;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    border-radius: 8px 8px 0 0;
    pointer-events: none;
}

#unity-container {
    width: 100%;
    height: 100%;
    display: none;
}

#unity-canvas {
    width: 100%;
    height: 100%;
}

#unity-loading-bar {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    text-align: center;
}

#unity-progress-bar-empty {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid var(--accent);
}

#unity-progress-bar-full {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-glow));
    border-radius: 4px;
    transition: width 0.2s;
    box-shadow: 0 0 20px var(--accent);
}

.loading-text {
    margin-top: 15px;
    font-size: 0.8rem;
    letter-spacing: 3px;
    color: var(--accent);
    animation: blink 1s step-end infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* ============================================
   INTRO SCREEN
   ============================================ */

.intro-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
}

.intro-content {
    text-align: center;
    opacity: 0;
    transform: scale(0.9);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.intro-content.show {
    opacity: 1;
    transform: scale(1);
}

.intro-presents {
    font-size: clamp(2rem, 8vw, 4rem);
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.intro-xr {
    color: var(--accent);
    text-shadow:
        0 0 20px var(--accent),
        0 0 40px var(--accent-glow),
        0 0 60px var(--accent-glow);
}

.intro-chris {
    color: white;
}

.intro-presents-text {
    font-size: clamp(0.8rem, 3vw, 1.2rem);
    letter-spacing: 8px;
    color: rgba(255, 255, 255, 0.6);
    opacity: 0;
    animation: fade-up 0.5s ease-out 0.3s forwards;
}

.intro-content.show .intro-presents-text {
    opacity: 1;
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Glitch on intro text */
.intro-screen.glitch-text {
    animation: glitch-screen 0.5s steps(1) forwards;
}

.intro-screen.glitch-text .intro-content {
    animation: glitch-text 0.5s steps(2) forwards;
}

@keyframes glitch-text {
    0% {
        transform: translate(0);
        filter: none;
    }

    20% {
        transform: translate(-5px, 3px);
        filter: hue-rotate(90deg);
    }

    40% {
        transform: translate(5px, -3px);
        filter: hue-rotate(180deg);
    }

    60% {
        transform: translate(-3px, -5px);
        filter: hue-rotate(270deg);
    }

    80% {
        transform: translate(3px, 5px);
        filter: hue-rotate(360deg);
        opacity: 0.5;
    }

    100% {
        transform: translate(0);
        opacity: 0;
    }
}

@keyframes glitch-screen {

    0%,
    100% {
        background: #000;
    }

    10% {
        background: #ff0080;
    }

    20% {
        background: #00ff80;
    }

    30% {
        background: #000;
    }

    40% {
        background: #8000ff;
    }

    50% {
        background: #000;
    }

    60% {
        background: #ff8000;
    }

    70% {
        background: #000;
    }
}

/* ============================================
   GLITCH OVERLAY
   ============================================ */

.glitch-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 60;
    opacity: 0;
}

.glitch-overlay.active {
    opacity: 1;
    animation: glitch-lines 0.5s steps(1) forwards;
}

@keyframes glitch-lines {
    0% {
        background: repeating-linear-gradient(0deg,
                transparent 0px,
                transparent 2px,
                rgba(255, 0, 128, 0.3) 2px,
                rgba(255, 0, 128, 0.3) 4px);
    }

    25% {
        background: repeating-linear-gradient(0deg,
                transparent 0px,
                transparent 4px,
                rgba(0, 255, 128, 0.3) 4px,
                rgba(0, 255, 128, 0.3) 6px);
        transform: translateX(-2px);
    }

    50% {
        background: repeating-linear-gradient(0deg,
                transparent 0px,
                transparent 1px,
                rgba(128, 0, 255, 0.4) 1px,
                rgba(128, 0, 255, 0.4) 3px);
        transform: translateX(3px);
    }

    75% {
        background: repeating-linear-gradient(0deg,
                transparent 0px,
                transparent 3px,
                rgba(255, 255, 0, 0.3) 3px,
                rgba(255, 255, 0, 0.3) 5px);
        transform: translateX(-1px);
    }

    100% {
        opacity: 0;
    }
}

/* ============================================
   PLACEHOLDER
   ============================================ */

.placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(ellipse at center, #111 0%, #000 100%);
}

.placeholder-content {
    text-align: center;
}

.placeholder-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 1rem;
    animation: bounce 1.5s ease-in-out infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-15px);
    }
}

.placeholder h2 {
    font-size: 1.2rem;
    letter-spacing: 4px;
    color: var(--text);
    animation: blink 1s step-end infinite;
}

/* ============================================
   CONTROLS
   ============================================ */

.console-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 20px 15px;
}

/* D-Pad */
.dpad {
    width: clamp(70px, 14vw, 100px);
    height: clamp(70px, 14vw, 100px);
    position: relative;
}

.dpad-up,
.dpad-down,
.dpad-left,
.dpad-right {
    position: absolute;
    width: clamp(22px, 5vw, 32px);
    height: clamp(22px, 5vw, 32px);
    background: var(--console-dark);
    border-radius: 4px;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.5);
}

.dpad-up {
    top: 0;
    left: 50%;
    transform: translateX(-50%);
}

.dpad-down {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.dpad-left {
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

.dpad-right {
    right: 0;
    top: 50%;
    transform: translateY(-50%);
}

.dpad-center {
    position: absolute;
    width: clamp(22px, 5vw, 32px);
    height: clamp(22px, 5vw, 32px);
    background: var(--console-dark);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 4px;
}

/* D-Pad Pressed State */
.dpad-up.pressed,
.dpad-down.pressed,
.dpad-left.pressed,
.dpad-right.pressed {
    background: var(--accent);
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, 0.3),
        0 0 15px var(--accent-glow);
    transform: translateX(-50%) scale(0.95);
}

.dpad-left.pressed,
.dpad-right.pressed {
    transform: translateY(-50%) scale(0.95);
}

/* Brand */
.console-brand {
    font-size: 1.2rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
}

.console-brand span {
    color: var(--accent);
    font-weight: 800;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 15px;
    transform: rotate(-20deg);
}

.btn-a,
.btn-b {
    width: clamp(40px, 8vw, 55px);
    height: clamp(40px, 8vw, 55px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: clamp(1rem, 2vw, 1.4rem);
    box-shadow:
        0 4px 0 rgba(0, 0, 0, 0.3),
        inset 0 2px 0 rgba(255, 255, 255, 0.2);
    cursor: pointer;
    transition: transform 0.1s, box-shadow 0.1s;
    user-select: none;
}

.btn-a {
    background: linear-gradient(145deg, #ff69b4, #ff1493);
    color: white;
    font-size: clamp(1.2rem, 2.5vw, 1.8rem);
}

.btn-b {
    background: linear-gradient(145deg, #4a4a5a, #3a3a4a);
    color: rgba(255, 255, 255, 0.7);
}

.btn-a:hover,
.btn-b:hover {
    transform: translateY(2px);
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.3);
}

.btn-a:active,
.btn-b:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 rgba(0, 0, 0, 0.3);
}

/* ============================================
   BOTTOM SECTION
   ============================================ */

.console-bottom {
    padding: 10px 20px;
}

.start-select {
    display: flex;
    justify-content: center;
    gap: 30px;
}

.small-btn {
    background: var(--console-dark);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.6rem;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.4);
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.3);
}

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

@media (max-width: 500px) {
    body {
        padding: 1rem;
    }

    .console {
        border-radius: 30px;
        padding: 15px;
    }

    .console-title {
        font-size: 0.7rem;
        letter-spacing: 2px;
    }

    .screen-bezel {
        padding: 10px;
    }

    .dpad {
        width: 60px;
        height: 60px;
    }

    .dpad-up,
    .dpad-down,
    .dpad-left,
    .dpad-right,
    .dpad-center {
        width: 20px;
        height: 20px;
    }

    .btn-a,
    .btn-b {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
    }

    .console-brand {
        font-size: 0.9rem;
    }
}

/* ============================================
   NOTICE
   ============================================ */

.notice {
    text-align: center;
    color: rgba(255, 255, 255, 0.4);
    font-size: 0.8rem;
    margin-top: 1.5rem;
    letter-spacing: 0.5px;
}

/* ============================================
   VISITOR COUNTER
   ============================================ */

.visitor-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 2rem;
    padding: 12px 24px;
    background: linear-gradient(145deg, rgba(45, 45, 58, 0.8), rgba(26, 26, 36, 0.9));
    border-radius: 50px;
    box-shadow:
        0 4px 15px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1),
        0 0 30px rgba(255, 105, 180, 0.1);
    border: 1px solid rgba(255, 105, 180, 0.2);
}

.counter-icon {
    font-size: 1.3rem;
    filter: grayscale(0.3);
}

.counter-label {
    font-size: 0.7rem;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
}

.counter-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--accent);
    text-shadow: 0 0 15px var(--accent-glow);
    font-family: 'Outfit', monospace;
    min-width: 80px;
    text-align: center;
    animation: counter-glow 3s ease-in-out infinite;
}

@keyframes counter-glow {

    0%,
    100% {
        text-shadow: 0 0 10px var(--accent-glow);
    }

    50% {
        text-shadow: 0 0 25px var(--accent-glow), 0 0 40px var(--accent);
    }
}