/* ==========================================================================
   FLAPPY WYZUK - CORE DESIGN SYSTEM & STYLESHEET
   Author: Wyzuk (https://github.com/wyzuk)
   Repository: https://github.com/wyzuk/flappy
   ========================================================================== */

:root {
    /* Color Palette - Neon Cyber & Glassmorphism */
    --bg-dark: #080a14;
    --bg-deep: #0e1222;
    --bg-card: rgba(18, 24, 43, 0.65);
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --bg-glass-active: rgba(255, 255, 255, 0.12);

    /* Neon Accent Colors */
    --neon-cyan: #00f2fe;
    --neon-cyan-glow: rgba(0, 242, 254, 0.45);
    --neon-violet: #892cdc;
    --neon-violet-glow: rgba(137, 44, 220, 0.45);
    --neon-pink: #ff2a7a;
    --neon-pink-glow: rgba(255, 42, 122, 0.45);
    --neon-gold: #ffbe0b;
    --neon-gold-glow: rgba(255, 190, 11, 0.45);
    --neon-green: #00f090;
    --neon-green-glow: rgba(0, 240, 144, 0.45);

    /* Gradients */
    --grad-primary: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #892cdc 100%);
    --grad-accent: linear-gradient(135deg, #ff2a7a 0%, #ff70a6 100%);
    --grad-gold: linear-gradient(135deg, #ffbe0b 0%, #fb5607 100%);
    --grad-dark-glass: linear-gradient(145deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.02) 100%);

    /* Typography */
    --font-main: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-display: 'Space Grotesk', 'Outfit', sans-serif;

    /* Borders & Glass */
    --border-glass: rgba(255, 255, 255, 0.12);
    --border-glass-bright: rgba(255, 255, 255, 0.28);
    --border-neon-cyan: rgba(0, 242, 254, 0.5);
    --border-radius-sm: 8px;
    --border-radius-md: 16px;
    --border-radius-lg: 24px;
    --border-radius-xl: 32px;
    --border-radius-full: 9999px;

    /* Shadows */
    --shadow-glass: 0 16px 40px -8px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    --shadow-glow-cyan: 0 0 28px rgba(0, 242, 254, 0.35);
    --shadow-glow-pink: 0 0 28px rgba(255, 42, 122, 0.35);
    --shadow-inner-glow: inset 0 0 20px rgba(0, 242, 254, 0.1);

    /* Animation Timing */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Reset & Box Sizing */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: var(--bg-dark);
    font-family: var(--font-main);
    color: #ffffff;
    line-height: 1.5;
    position: fixed;
}

/* Base Body Ambient Glow Orbs */
.ambient-glow-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

.ambient-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.22;
    will-change: transform;
}

.orb-1 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #00f2fe 0%, #4facfe 80%);
    top: -120px;
    left: -100px;
    animation: orbFloat1 22s infinite alternate ease-in-out;
}

.orb-2 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, #892cdc 0%, #ff2a7a 80%);
    bottom: -150px;
    right: -100px;
    animation: orbFloat2 26s infinite alternate ease-in-out;
}

.orb-3 {
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, #ffbe0b 0%, #fb5607 70%);
    top: 40%;
    right: 25%;
    opacity: 0.12;
    animation: orbFloat3 18s infinite alternate ease-in-out;
}

.light-ray {
    position: absolute;
    width: 200%;
    height: 120px;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
    transform: rotate(-35deg);
    top: -20%;
    left: -50%;
    pointer-events: none;
}

.ray-2 {
    top: 30%;
    opacity: 0.4;
    transform: rotate(-45deg);
}

/* Main Viewport Container */
.app-container {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1;
}

/* Canvas Stage */
.game-stage {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #000;
}

#game-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.screen-shake-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* HUD System */
.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: clamp(14px, 3vw, 28px);
    transition: opacity var(--transition-normal);
}

.game-hud.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

.hud-top-bar {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto;
}

.hud-left, .hud-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hud-badge {
    background: rgba(14, 18, 34, 0.7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-md);
    padding: 8px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    box-shadow: var(--shadow-glass);
    transition: transform var(--transition-fast);
}

.hud-score-badge {
    border-color: var(--border-neon-cyan);
    box-shadow: 0 0 16px rgba(0, 242, 254, 0.2);
}

.hud-label {
    font-size: 0.65rem;
    letter-spacing: 1.5px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.6);
    font-family: var(--font-display);
}

.hud-value {
    font-size: 1.65rem;
    font-weight: 900;
    font-family: var(--font-display);
    line-height: 1.1;
    color: #ffffff;
}

.hud-difficulty-indicator {
    width: 140px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: var(--border-radius-full);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hud-diff-progress {
    width: 5%;
    height: 100%;
    background: var(--grad-primary);
    border-radius: var(--border-radius-full);
    transition: width 0.5s ease;
    box-shadow: 0 0 8px var(--neon-cyan);
}

.hud-icon-btn {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(14, 18, 34, 0.7);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-glass);
    color: #fff;
    transition: all var(--transition-fast);
}

.hud-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--neon-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 242, 254, 0.3);
}

.hud-ready-hint {
    margin: auto auto 40px auto;
    background: rgba(14, 18, 34, 0.75);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass-bright);
    padding: 14px 28px;
    border-radius: var(--border-radius-full);
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 242, 254, 0.2);
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.hud-ready-hint.hidden {
    opacity: 0;
    transform: scale(0.9);
}

.hint-tap-icon {
    width: 22px;
    height: 22px;
    color: var(--neon-cyan);
}

.hint-text {
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    font-family: var(--font-display);
    color: #ffffff;
}

/* Mobile Jump Controls */
.mobile-jump-controls {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 20;
    pointer-events: auto;
}

.mobile-jump-controls.hidden {
    display: none !important;
}

.mobile-jump-btn {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(0, 242, 254, 0.25) 0%, rgba(137, 44, 220, 0.35) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 2px solid rgba(0, 242, 254, 0.6);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 24px rgba(0, 242, 254, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    touch-action: manipulation;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.mobile-jump-btn:active {
    transform: scale(0.92);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4), 0 0 35px var(--neon-cyan);
    border-color: #fff;
}

.jump-btn-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #fff;
}

.jump-wing-icon {
    width: 26px;
    height: 26px;
}

.jump-btn-text {
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 1px;
    font-family: var(--font-display);
}

/* Screens Common Layout */
.ui-screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
    padding: 16px;
}

.ui-screen.active {
    opacity: 1;
    pointer-events: auto;
    visibility: visible;
}

/* Main Menu UI */
.menu-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(14px, 2.5vh, 24px);
    width: 100%;
    max-width: 440px;
    text-align: center;
    z-index: 5;
}

.menu-branding {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.creator-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--border-radius-full);
    padding: 6px 16px;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-display);
    letter-spacing: 0.5px;
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--neon-cyan);
    box-shadow: 0 0 10px var(--neon-cyan);
}

.glow-author {
    color: #ffffff;
    font-weight: 800;
    text-shadow: 0 0 12px var(--neon-cyan);
}

.game-logo {
    display: flex;
    flex-direction: column;
    line-height: 0.9;
    font-family: var(--font-display);
    font-weight: 900;
    letter-spacing: -1.5px;
}

.logo-text-top {
    font-size: clamp(2.4rem, 7vw, 3.4rem);
    color: #ffffff;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.8);
}

.logo-text-bottom {
    font-size: clamp(2.8rem, 8.5vw, 4.2rem);
    letter-spacing: -1px;
}

.game-tagline {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* Character Showcase Card */
.menu-hero-card {
    width: 100%;
    padding: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    border-radius: var(--border-radius-lg);
    background: var(--grad-dark-glass);
}

.hero-preview-stage {
    width: 160px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#menu-bird-preview-canvas {
    width: 160px;
    height: 120px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.5));
}

.hero-character-info {
    display: flex;
    gap: 8px;
}

.character-pill, .world-pill {
    font-size: 0.75rem;
    font-weight: 700;
    font-family: var(--font-display);
    padding: 4px 12px;
    border-radius: var(--border-radius-full);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-glass);
    color: #fff;
}

.character-pill {
    border-color: var(--neon-cyan);
    color: var(--neon-cyan);
}

.world-pill {
    border-color: var(--neon-gold);
    color: var(--neon-gold);
}

/* Action Buttons Container */
.menu-action-buttons {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.menu-grid-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

/* Footer Navigation */
.menu-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.footer-link {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.78rem;
    font-family: var(--font-display);
}

/* Responsive Scaling for Small/Tall Screens */
@media (max-height: 680px) {
    .menu-content-wrapper {
        gap: 10px;
    }
    .menu-hero-card {
        padding: 8px;
    }
    .hero-preview-stage {
        height: 80px;
    }
    #menu-bird-preview-canvas {
        height: 80px;
    }
}
