/* ===== Variables ===== */
:root {
    /* 10x Ultra Premium Dark Mode */
    --bg-primary: #050505;
    --bg-secondary: rgba(22, 22, 24, 0.4);
    --bg-tertiary: rgba(28, 28, 30, 0.5);
    --bg-card: rgba(15, 15, 17, 0.6);

    /* 10x Vibrant Accents */
    --blue-primary: #00F0FF;
    /* Cyan Electric */
    --blue-light: #66F5FF;
    --blue-dark: #00B3CC;
    --blue-glow: rgba(0, 240, 255, 0.3);

    --orange-primary: #7B61FF;
    /* Deep Purple / Violet */
    --orange-light: #A390FF;
    --orange-dark: #583BB8;
    --orange-glow: rgba(123, 97, 255, 0.3);

    --green-primary: #00FF66;
    /* Neon Terminal Green */

    /* Text */
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1AA;
    --text-muted: #71717A;

    /* Advanced Glass Borders */
    --border: rgba(255, 255, 255, 0.08);
    --border-light: rgba(255, 255, 255, 0.04);
    --glass-edge: inset 0 1px 0 rgba(255, 255, 255, 0.1);

    /* Premium Geometry */
    --radius: 16px;
    --radius-lg: 32px;

    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Reset ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow: hidden !important;
    height: 100% !important;
    height: 100dvh !important;
    position: fixed !important;
    width: 100% !important;
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE and Edge */
}

/* Hide scrollbar fully for Chrome, Safari and Opera */
html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
    width: 0 !important;
    height: 0 !important;
    background: transparent !important;
}

html::-webkit-scrollbar-track,
body::-webkit-scrollbar-track,
html::-webkit-scrollbar-thumb,
body::-webkit-scrollbar-thumb {
    display: none !important;
    width: 0 !important;
    background: transparent !important;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    font-size: 16px;
    overflow: hidden !important;
    height: 100% !important;
    height: 100dvh !important;
    position: fixed !important;
    width: 100%;
    
    /* Anti-Copy: Prevent text selection */
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    
    /* Mobile Optimization */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    -webkit-touch-callout: none;
}

/* 10x Animated Ambient Background Glow */
.ambient-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    background: var(--bg-primary);
    pointer-events: none;
}

.ambient-glow::before,
.ambient-glow::after {
    content: '';
    position: absolute;
    width: 800px;
    height: 800px;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: floatGlow 20s infinite alternate ease-in-out;
}

.ambient-glow::before {
    background: radial-gradient(circle, var(--blue-primary), transparent 70%);
    top: -20%;
    left: -10%;
}

.ambient-glow::after {
    background: radial-gradient(circle, var(--orange-primary), transparent 70%);
    bottom: -20%;
    right: -10%;
    animation-delay: -10s;
}

/* 10x WOW Factor: Physical Noise Texture */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 9990;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Boot Terminal Loader — matches chiusura-2.0.js terminal-window style */
.boot-terminal-window {
    width: 92%;
    max-width: 660px;
}

.boot-body {
    padding: 0.9rem 1.25rem 1rem;
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 0.85rem;
    color: #00e060;
    min-height: unset;
}

.boot-header-line {
    margin-bottom: 0.85rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(0, 230, 96, 0.12);
    font-size: 0.8rem;
    line-height: 1.5;
}

.boot-user {
    color: #32ff7e;
    font-weight: 600;
}

.boot-sep {
    color: rgba(255, 255, 255, 0.35);
}

.boot-path {
    color: #64d8ff;
}

.boot-command {
    color: #fff;
    opacity: 0.85;
}

.boot-log {
    height: auto;
    min-height: 340px;
    max-height: 70vh;
    overflow-y: hidden;
    display: flex;
    flex-direction: column;
}

.boot-line {
    margin: 2px 0;
    font-size: 0.8rem;
    line-height: 1.55;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.boot-line.ok {
    color: #32ff7e;
}

.boot-line.info {
    color: rgba(160, 210, 160, 0.7);
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(100px, 50px) scale(1.1);
    }
}

/* ===== Scroll Reveal Animations ===== */
.reveal-element {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1), transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ===== Container ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* ===== Typography ===== */
h1,
h2,
h3,
h4 {
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    letter-spacing: -0.04em;
}

h2 {
    font-size: clamp(2rem, 5vw, 3rem);
}

h3 {
    font-size: 1.5rem;
}

p {
    color: var(--text-secondary);
}

strong {
    color: var(--text-primary);
    font-weight: 600;
}

.text-accent {
    color: var(--orange-primary);
}

/* ===== Navigation ===== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1rem 0;
    background: rgba(10, 10, 11, 0.7);
    /* Translucent dark */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 101;
}

.logo-dot {
    color: var(--orange-primary);
    /* Apple Blue dot */
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color var(--transition);
}

.nav-links a:hover {
    color: var(--text-primary);
}

.logo-dot {
    color: var(--text-secondary);
}

.lang-toggle {
    background: transparent;
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--blue-primary);
    border-radius: 6px;
    padding: 0 0.75rem;
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.lang-toggle:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--blue-primary);
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.2);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: nowrap;
    z-index: 101;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(0, 240, 255, 0.3);
    border-radius: 6px;
    cursor: pointer;
    padding: 0 0.75rem;
    height: 36px;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 101;
    transition: all var(--transition);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.menu-toggle:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: var(--blue-primary);
}

.menu-toggle.active {
    border-color: var(--orange-primary);
}

.menu-toggle .prompt-icon {
    font-family: 'Fira Code', 'Monaco', monospace;
    font-size: 1.1rem;
    color: var(--blue-primary);
    font-weight: 700;
    line-height: 1;
    animation: terminalBlink 1s step-end infinite;
}

@keyframes terminalBlink {
    50% {
        opacity: 0.5;
    }
}

/* Mobile Menu Active State */
.nav-links.active {
    display: flex;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(10, 10, 11, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 100;
    animation: fadeIn 0.3s ease;
}

.nav-links.active a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.menu-toggle.active .prompt-icon {
    color: var(--orange-primary);
    transform: rotate(90deg);
}

/* ===== Hero Section ===== */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-bg-grid {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(var(--border) 1px, transparent 1px),
        linear-gradient(90deg, var(--border) 1px, transparent 1px);
    background-size: 80px 80px;
    opacity: 0.15;
    mask-image: radial-gradient(ellipse at center, black 0%, transparent 80%);
}

.hero .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    text-align: center;
    width: 100%;
    margin-top: 4rem;
    /* Push down to clear fixed nav */
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    box-shadow: var(--glass-edge), 0 0 20px rgba(0, 240, 255, 0.1);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.8125rem;
    color: var(--blue-light);
    margin-bottom: 2rem;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.5);
}

.hero-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Center everything */
    width: 100%;
}

.hero-content .btn-magic {
    align-self: center;
    /* Override flex-start */
    margin-top: 1.5rem;
    padding: 0.8rem 1.8rem;
    /* Perfectly proportioned */
    font-size: 0.95rem;
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.15), inset 0 0 8px rgba(0, 255, 102, 0.05);
    animation: floatingHeroBtn 4s ease-in-out infinite;
    z-index: 10;
}

@keyframes floatingHeroBtn {

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

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

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--blue-primary);
    /* Use cyan now instead of green */
    border-radius: 50%;
    animation: pulse 2s infinite;
    box-shadow: 0 0 10px var(--blue-primary);
}

.hero-title {
    position: relative;
    z-index: 3;
    margin-bottom: 1.5rem;
    line-height: 1;
    letter-spacing: -0.06em;
    /* Massive 10x scaling that breaks grid slightly on large screens */
    font-size: clamp(4rem, 12vw, 8rem);
    font-weight: 800;

    background: linear-gradient(180deg, #FFFFFF 0%, #71717A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;

    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.5));
    width: 100%;
    /* No horizontal overflow */
    max-width: 1200px;
}

.hero-subtitle {
    position: relative;
    z-index: 3;
    font-size: clamp(1.25rem, 3vw, 1.75rem);
    color: var(--text-secondary);
    margin-bottom: 3rem;
    max-width: 800px;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition);
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.2);
    background: #FFFFFF;
}

.btn-icon {
    font-size: 0.875rem;
}

/* Magic Terminal Button - The Hybrid Element */
.btn-magic {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(40, 40, 44, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--blue-primary);
    /* Terminal green accent */
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--border-light);
    border-radius: 100px;
    text-decoration: none;
    font-family: 'Fira Code', 'Monaco', monospace;
    /* Keep terminal font here */
    font-weight: 500;
    font-size: 0.9rem;
    transition: all var(--transition);
    margin-top: 1rem;
}

.btn-magic::before {
    content: '>_';
    color: var(--text-secondary);
    font-weight: 700;
}

.btn-magic:hover {
    background: rgba(50, 215, 75, 0.1);
    border-color: rgba(50, 215, 75, 0.3);
    color: var(--blue-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--blue-glow);
}

.footer-cta .btn-magic {
    margin: 1.5rem auto 0;
    padding: 0.9rem 2rem;
    font-size: 1rem;
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.15), inset 0 0 8px rgba(0, 255, 102, 0.05);
    animation: floatingHeroBtn 4s ease-in-out infinite;
    z-index: 10;
}

@keyframes floatingHeroBtn {

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

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

/* Slash Spinner Animation */
.btn-magic .btn-icon {
    display: inline-block;
    min-width: 1.2ch;
    font-weight: 700;
    color: inherit;
}

.btn-magic .btn-icon::after {
    content: "/";
    animation: slashSpinner 0.6s infinite step-end;
    display: inline-block;
}

@keyframes slashSpinner {
    0% {
        content: "/";
    }

    25% {
        content: "-";
    }

    50% {
        content: "\\";
    }

    75% {
        content: "|";
    }
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }

    100% {
        transform: translateY(200%);
    }
}



/* Hero Visual - 3D Floating Terminal */
.hero-visual {
    width: 100%;
    max-width: 650px;
    margin: 4rem auto 0;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateX(10deg) translateY(0);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

.hero-visual:hover {
    transform: perspective(1000px) rotateX(2deg) translateY(-10px);
}

.hero-visual .terminal-window {
    /* No extra box-shadow glow — keep clean */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), var(--glass-edge);
    pointer-events: auto;
    will-change: transform;
}

/* Terminal Window */
.terminal-window {
    background: var(--bg-card);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), var(--glass-edge);
}

.terminal-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid var(--border-light);
}

.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.terminal-dot.red {
    background: #ef4444;
}

.terminal-dot.yellow {
    background: #eab308;
}

.terminal-dot.green {
    background: #22c55e;
}

.terminal-title {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.terminal-body {
    padding: 1.5rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.8;
    min-height: 200px;
    /* Prevent layout shift during typing animation */
}

/* ===== Hero Hacker Terminal ===== */
.hero-terminal-body {
    height: 210px;
    box-sizing: border-box;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 1rem 1.5rem;
}

.hero-term-line {
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    color: rgba(180, 200, 180, 0.7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-term-current {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
    flex-wrap: nowrap;
    overflow: hidden;
}

.t-prompt {
    color: #32D74B;
    font-weight: 500;
    flex-shrink: 0;
}

.t-sym {
    color: var(--text-muted);
    flex-shrink: 0;
    margin-left: 0.1rem;
}

.t-typing {
    color: var(--text-primary);
    flex: 1;
}

.t-cursor {
    color: #0AF;
    animation: termCursorBlink 0.9s step-end infinite;
    flex-shrink: 0;
    font-size: 0.75rem;
}

@keyframes termCursorBlink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

.t-ok {
    color: #32D74B;
    font-weight: 600;
}

.t-warn {
    color: #FFD60A;
}

.t-cyan {
    color: #0AF;
}

.code-keyword {
    color: var(--blue-light);
}

.code-var {
    color: var(--text-primary);
}

.code-string {
    color: #a5d6a7;
}

.code-boolean {
    color: var(--orange-light);
}

.code-comment {
    color: var(--text-muted);
}

/* ===== Section Styles ===== */
.section {
    padding: 6rem 0;
    border-top: 1px solid var(--border);
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 3rem;
}

.section-number {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--orange-primary);
    letter-spacing: 0.1em;
}

/* ===== Manifesto Section ===== */
.manifesto-content {
    max-width: 800px;
    margin: 0 auto;
}

.manifesto-quote {
    font-size: 1.5rem;
    color: var(--text-primary);
    border-left: 3px solid var(--orange-primary);
    padding-left: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 500;
}

.manifesto-text {
    font-size: 1.125rem;
    line-height: 1.8;
}

/* ===== Project Section ===== */
.project {
    background: var(--bg-secondary);
}

.project-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.project-name {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.project-tagline {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.stack-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    border-radius: 100px;
    font-weight: 500;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.project-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(50, 215, 75, 0.1);
    border: 1px solid rgba(50, 215, 75, 0.2);
    color: var(--blue-primary);
    padding: 0.5rem 1rem;
    border-radius: 100px;
    font-size: 0.875rem;
    font-weight: 500;
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #22c55e;
}

.status-indicator.live {
    animation: pulse 2s infinite;
}

/* Project Blocks - 10x Bento Box Layout */
.project-blocks {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    /* 4 column base for bento */
    gap: 1.5rem;
    grid-auto-flow: dense;
}

.block {
    background: var(--bg-card);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: relative;
    transition: all var(--transition);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), var(--glass-edge);
    display: flex;
    flex-direction: column;
}

/* Asymmetric Span Rules */
.block:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

.block:nth-child(2) {
    grid-column: span 2;
}

.block:nth-child(3) {
    grid-column: span 2;
}

.block:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--glass-edge), 0 0 30px rgba(0, 240, 255, 0.1);
    border-color: rgba(0, 240, 255, 0.3);
    z-index: 2;
}

/* 10x WOW Factor: 3D Glare Element */
.tilt-glare {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.5s ease;
    mix-blend-mode: overlay;
    z-index: 10;
    border-radius: inherit;
    /* Inherit the radius of the card */
}

.block-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0;
    border-bottom: none;
}

.block-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border-radius: var(--radius);
}

.block-problem .block-icon {
    background: rgba(255, 69, 58, 0.1);
    color: #FF453A;
    box-shadow: 0 0 20px rgba(255, 69, 58, 0.2);
}

.block-solution .block-icon {
    background: rgba(50, 215, 75, 0.1);
    color: #32D74B;
    box-shadow: 0 0 20px rgba(50, 215, 75, 0.2);
}

.block-vision .block-icon {
    background: rgba(10, 132, 255, 0.1);
    color: #0A84FF;
    box-shadow: 0 0 20px rgba(10, 132, 255, 0.2);
}

.block h4 {
    font-size: 1.25rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.block p {
    font-size: 1rem;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    flex-grow: 1;
}

/* Block Stats */
.block-stats {
    display: flex;
    gap: 2rem;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--orange-primary);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Solution Results */
.solution-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.result-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.result-icon.down::after {
    content: 'v';
    color: var(--blue-primary);
}

.result-icon.down i {
    display: none;
}

.result-icon.up::after {
    content: '^';
    color: var(--orange-primary);
}

.result-icon.up i {
    display: none;
}

/* Vision Roadmap */
.vision-roadmap {
    display: flex;
    gap: 0.5rem;
}

.roadmap-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.step-marker {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--border-light);
    border: 2px solid var(--bg-card);
}

.roadmap-step.done .step-marker {
    background: #22c55e;
}

.roadmap-step.current .step-marker {
    background: var(--blue-primary);
    box-shadow: 0 0 10px var(--blue-glow);
}

.roadmap-step span:not(.step-marker) {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-align: center;
}

/* ===== Experience Section ===== */
.timeline {
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    display: flex;
    gap: 2rem;
}

.timeline-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.marker-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--border-light);
    border: 3px solid var(--bg-primary);
    flex-shrink: 0;
}

.marker-dot.current {
    border-color: var(--orange-primary);
    background: var(--orange-primary);
    box-shadow: 0 0 12px var(--orange-glow);
}

.marker-line {
    width: 2px;
    flex: 1;
    background: var(--border-light);
    min-height: 40px;
}

.timeline-content {
    padding-bottom: 3rem;
}

.timeline-header {
    margin-bottom: 1rem;
}

.timeline-badge {
    display: inline-block;
    background: rgba(10, 132, 255, 0.1);
    /* Soft Apple Blue */
    border: 1px solid rgba(10, 132, 255, 0.2);
    color: var(--orange-primary);
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.375rem 0.75rem;
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.timeline-header h3 {
    margin-bottom: 0.25rem;
}

.timeline-company {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.timeline-content>p {
    margin-bottom: 1rem;
    line-height: 1.7;
}

.timeline-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.timeline-tags span {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
    border-radius: 100px;
    font-weight: 500;
}

/* ===== Skills Section - Bento Box ===== */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    grid-auto-flow: dense;
}

.skill-category {
    background: var(--bg-card);
    backdrop-filter: blur(30px) saturate(150%);
    -webkit-backdrop-filter: blur(30px) saturate(150%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3), var(--glass-edge);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

/* Asymmetric Span Rules for Skills */
.skill-category:nth-child(1) {
    grid-column: span 2;
    grid-row: span 2;
}

.skill-category:nth-child(2) {
    grid-column: span 2;
}

.skill-category:nth-child(3) {
    grid-column: span 2;
}

.skill-category:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--glass-edge), 0 0 30px rgba(123, 97, 255, 0.1);
    border-color: rgba(123, 97, 255, 0.3);
    z-index: 2;
}

.skill-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.skill-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    font-size: 1rem;
    color: var(--text-primary);
}

.skill-header h4 {
    font-size: 1rem;
    color: var(--text-primary);
}

.skill-list {
    list-style: none;
    margin-bottom: 1rem;
}

.skill-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.skill-name {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.skill-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    overflow: hidden;
    border: none;
}

.skill-fill {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #0A84FF, #32D74B);
    /* Apple modern gradient */
    border-radius: 100px;
    border: none;
}

.skill-list.text-only li {
    justify-content: flex-start;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.skill-list.text-only li:last-child {
    border-bottom: none;
}

.skill-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0;
}

/* ===== Hero Stats Strip ===== */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 3rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    width: 100%;
    max-width: 700px;
}

.hero-stat {
    flex: 1;
    text-align: center;
}

.hero-stat-value {
    display: block;
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--blue-primary);
    letter-spacing: -0.03em;
    line-height: 1;
    margin-bottom: 0.3rem;
    text-shadow: 0 0 20px rgba(0, 240, 255, 0.4);
}

.hero-stat-label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    line-height: 1.3;
}

.hero-stat-divider {
    width: 1px;
    height: 40px;
    background: var(--border-light);
    flex-shrink: 0;
}

/* ===== Values Bento Grid ===== */
.values-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
    margin-top: 3rem;
}

.value-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.value-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--blue-primary), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.value-card:hover::before {
    opacity: 1;
}

.value-card:hover {
    border-color: rgba(0, 240, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), var(--glass-edge);
}

.value-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 1rem;
}

.value-card h4 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.value-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* ===== Process Section ===== */
.process-section {
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 3rem;
    margin-top: -1rem;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.process-step {
    position: relative;
}

.process-step:not(:last-child)::after {
    content: '→';
    position: absolute;
    right: -1rem;
    top: 1.5rem;
    color: var(--text-muted);
    font-size: 1rem;
    z-index: 1;
}

.process-number {
    font-size: 3rem;
    font-weight: 800;
    color: rgba(0, 240, 255, 0.15);
    font-family: 'Fira Code', monospace;
    line-height: 1;
    margin-bottom: 1rem;
    letter-spacing: -0.05em;
}

.process-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.process-content p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* ===== Timeline Enhancements ===== */
.timeline-period {
    font-family: 'Fira Code', monospace;
    font-size: 0.75rem;
    color: var(--blue-primary);
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 100px;
    padding: 0.2rem 0.75rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

.timeline-achievements {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1rem 0;
}

.achievement {
    font-size: 0.75rem;
    color: var(--green-primary);
    background: rgba(50, 215, 75, 0.08);
    border: 1px solid rgba(50, 215, 75, 0.2);
    border-radius: 100px;
    padding: 0.2rem 0.75rem;
    font-weight: 500;
}

/* ===== Language Badges ===== */
.language-badges {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
}

.lang-badge {
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ===== Goal Section Enhancements ===== */
.goal-perks {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.perk-tag {
    font-size: 0.8rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-light);
    border-radius: 100px;
    padding: 0.3rem 0.9rem;
}

/* ===== Goal Section ===== */
.goal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    justify-content: center;
    transition: all 0.5s ease;
}

.salary-block {
    justify-self: center;
    width: 100%;
    max-width: 560px;
}

.goal-grid.hidden-ral {
    grid-template-columns: 1fr;
}

#secret-trigger {
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.salary-block.hidden-ral {
    display: none;
}

.salary-block.reveal-ral {
    display: block;
    animation: rockDrop 0.6s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

.salary-block.reveal-ral::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 10px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    filter: blur(5px);
    animation: dustCloud 0.8s ease-out forwards;
    animation-delay: 0.4s;
    pointer-events: none;
}

@keyframes rockDrop {
    0% {
        transform: translateY(-500px) rotate(5deg);
        opacity: 0;
        box-shadow: 0 0 0 transparent;
    }

    60% {
        transform: translateY(20px) rotate(-2deg);
        opacity: 1;
        box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
    }

    80% {
        transform: translateY(-10px) rotate(1deg);
    }

    100% {
        transform: translateY(0) rotate(0);
        box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), var(--glass-edge);
    }
}

@keyframes dustCloud {
    0% {
        width: 0;
        opacity: 0.8;
        height: 10px;
    }

    50% {
        width: 60vw;
        max-width: 300px;
        opacity: 0.5;
        height: 40px;
        transform: translateX(-50%) translateY(-10px);
    }

    100% {
        width: 90vw;
        max-width: 500px;
        opacity: 0;
        height: 60px;
        transform: translateX(-50%) translateY(-20px);
    }
}

.goal-content h3 {
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
}

.goal-title {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 1rem;
}

.goal-text {
    font-size: 1rem;
    line-height: 1.7;
}

.salary-block {
    background: var(--bg-card);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4), var(--glass-edge);
}

.salary-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
}

.salary-range {
    margin-bottom: 1.5rem;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.5rem;
}

.salary-amount {
    display: inline-block;
    font-size: 3rem;
    font-weight: 800;
    background: linear-gradient(135deg, #FF9500, #FFCC00);
    /* Apple Warning/Gold */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0;
    letter-spacing: -0.04em;
}

.salary-type {
    font-size: 1.125rem;
    color: var(--text-muted);
    font-weight: 500;
}

.salary-justification {
    font-size: 0.9375rem;
    line-height: 1.6;
    margin: 0;
    color: var(--text-secondary);
}

/* ===== Footer ===== */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 4rem 0 2rem;
}

.footer-cta {
    text-align: center;
    margin-bottom: 3rem;
}

.footer-cta h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.footer-slogan {
    font-size: 1.125rem;
    color: var(--orange-primary);
    font-weight: 500;
}

/* Final Bridge Terminal */
.final-bridge-terminal {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto 3rem;
    text-align: left;
}

.bridge-terminal-body {
    min-height: 504px;
    display: flex;
    flex-direction: column;
}

.ascii-art {
    display: block;
    white-space: pre;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    /* Match top terminal 14px */
    line-height: 1.2;
    /* Slight increase for readability but tight enough for art */
    color: var(--text-primary);
    /* Clean white text */
    overflow-x: auto;
    padding-bottom: 1rem;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
    text-align: left;
    margin: 0 auto;
}

.terminal-message {
    margin-top: 1rem;
    color: #22c55e;
    font-family: 'Monaco', 'Consolas', monospace;
    font-weight: 700;
    animation: blink 2s infinite;
    text-align: center;
    /* Ensure centering */
}

/* ===== Fullscreen Goat Game Overlay ===== */
body.game-active {
    overflow: hidden !important;
    background: #000000 !important;
}

body.game-active>*:not(#game-overlay) {
    display: none !important;
}

.game-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    padding: 0;
}

/* ===== MUTE BUTTON PREMIUM STYLE ===== */
.hud-mute-btn {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), inset 0 0 10px rgba(0, 240, 255, 0.05);
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1001;
    pointer-events: auto;
}

.hud-static-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 500;
    /* Above game-hud (100) and menus (200) */
}

.hud-mute-btn:hover {
    background: rgba(0, 240, 255, 0.1);
    border-color: #00f0ff;
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
}

.hud-mute-btn:active {
    transform: scale(0.92);
}

.hud-mute-btn.muted {
    border-color: rgba(255, 69, 58, 0.4);
    color: #FF453A;
    background: rgba(255, 69, 58, 0.05);
}

.hud-mute-btn.muted:hover {
    background: rgba(255, 69, 58, 0.1);
    border-color: #FF453A;
    box-shadow: 0 0 20px rgba(255, 69, 58, 0.25);
}

/* Positioning adjustments for HUD */
.hud-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
    /* Tightened */
}

/* Clear the flex row for top scores */
.hud-top .hud-right {
    flex-direction: column;
    align-items: flex-end;
}

@media (max-width: 768px) {
    .hud-mute-btn {
        width: 40px;
        height: 40px;
        font-size: 1.1rem;
        border-radius: 10px;
        top: 20px;
        left: 20px;
    }
}

.hidden {
    display: none !important;
}



/* Close Button */
.close-game-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 240, 255, 0.08);
    border: 1px solid rgba(0, 240, 255, 0.3);
    color: var(--blue-primary);
    font-size: 1.6rem;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.25s ease;
    font-family: 'Fira Code', monospace;
}

.close-game-btn:hover {
    background: rgba(255, 69, 58, 0.15);
    border-color: #FF453A;
    color: #FF453A;
    box-shadow: 0 0 15px rgba(255, 69, 58, 0.3);
}

/* Terminal Frame */
.game-frame {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    height: 100dvh;
    /* Dynamic viewport height for modern mobile browsers */
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    position: relative;
    background: transparent;
}

/* ===== HTML HUD Layer ===== */
.game-hud {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    padding: 0.5rem;
    padding-top: max(0.5rem, env(safe-area-inset-top));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 1rem));
    padding-left: max(0.8rem, env(safe-area-inset-left));
    padding-right: max(0.8rem, env(safe-area-inset-right));
    font-family: 'Orbitron', sans-serif;
    color: #fff;
}

.hud-top,
.hud-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.hud-top {
    align-items: flex-start;
}

/* Side columns with minimum widths for symmetric centering and cyberpunk style */
.hud-top .hud-left {
    position: absolute;
    top: 76px;
    left: 20px;
    min-width: 120px;
    max-width: 50%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    pointer-events: none;
    z-index: 100;
}

.hud-top .hud-right {
    min-width: 140px;
    max-width: 50%;
    background: linear-gradient(135deg, rgba(8, 16, 28, 0.88), rgba(15, 30, 54, 0.75));
    border: 1.5px solid rgba(0, 240, 255, 0.2);
    border-right: 4px solid #00f0ff;
    padding: 10px 16px;
    border-radius: 8px 0 0 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), inset 0 0 10px rgba(0, 240, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.hud-top .hud-right:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 8px 32px rgba(0, 240, 255, 0.1), inset 0 0 15px rgba(0, 240, 255, 0.1);
}

.hud-center-col {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.2rem;
    text-align: center;
    min-width: 0;
}

.hud-right {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.hud-label {
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    margin-bottom: 1px;
    text-transform: uppercase;
}

.hud-value {
    font-size: 1.5rem;
    font-weight: 900;
    line-height: 1;
    letter-spacing: 2px;
    margin-bottom: 6px;
}

#hud-highscore {
    color: #00f0ff;
    text-shadow: 0 0 6px rgba(0, 240, 255, 0.4);
}

#hud-score {
    color: #39ff14; /* Electric green */
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.4);
    margin-bottom: 0;
}

.hud-combo {
    position: relative;
    left: auto;
    top: auto;
    background: linear-gradient(90deg, rgba(255, 0, 127, 0.8), rgba(255, 110, 0, 0.65));
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-left: 4px solid #fff;
    padding: 6px 12px;
    border-radius: 6px 16px 16px 6px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 900;
    letter-spacing: 1.5px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    box-shadow: 0 4px 15px rgba(255, 0, 127, 0.35), inset 0 0 10px rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 6px;
    animation: comboPulse 1.2s infinite alternate;
    pointer-events: none;
    will-change: transform, box-shadow;
}

.hud-combo:empty {
    display: none !important;
}

@keyframes comboPulse {
    0% {
        box-shadow: 0 4px 12px rgba(255, 0, 127, 0.25), inset 0 0 8px rgba(255, 255, 255, 0.15);
        filter: brightness(1);
    }
    100% {
        box-shadow: 0 4px 20px rgba(255, 0, 127, 0.55), inset 0 0 15px rgba(255, 255, 255, 0.3);
        filter: brightness(1.15);
    }
}

@media (max-width: 768px) {
    .hud-combo {
        position: relative;
        left: auto;
        top: auto;
        font-size: 0.8rem;
        padding: 4px 8px;
        border-radius: 4px 10px 10px 4px;
    }

    .hud-value {
        font-size: 1.2rem;
    }

    .hud-label {
        font-size: 0.5rem;
    }

    .hud-top .hud-right {
        margin-top: 0;
        padding: 6px 12px;
        min-width: 110px;
    }
}

.hud-coins-wrap {
    background: linear-gradient(135deg, rgba(20, 15, 5, 0.8), rgba(40, 30, 8, 0.45));
    border: 1px solid rgba(255, 215, 0, 0.25);
    border-right: 4px solid #ffd700; /* Gold */
    padding: 8px 16px;
    border-radius: 20px 8px 8px 20px;
    font-size: 1.6rem;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 6px rgba(255, 215, 0, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 8px rgba(255, 215, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 8px;
    pointer-events: auto;
    transition: all 0.3s ease;
}

.hud-coins-wrap:hover {
    border-color: rgba(255, 215, 0, 0.45);
    box-shadow: 0 4px 20px rgba(255, 215, 0, 0.15), inset 0 0 12px rgba(255, 215, 0, 0.1);
}

.hud-coin-icon {
    display: inline-block;
    color: #ffd700;
    animation: coinPulse 1.5s infinite ease-in-out;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6));
}

@keyframes coinPulse {
    0% { transform: scale(1); filter: brightness(1); }
    50% { transform: scale(1.15) rotate(15deg); filter: brightness(1.25); }
    100% { transform: scale(1); filter: brightness(1); }
}

.hud-event-banner {
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 2.5px;
    padding: 6px 16px;
    background: repeating-linear-gradient(
        45deg,
        rgba(255, 0, 127, 0.15),
        rgba(255, 0, 127, 0.15) 10px,
        rgba(10, 10, 20, 0.9) 10px,
        rgba(10, 10, 20, 0.9) 20px
    );
    border: 1.5px solid #ff007f;
    color: #ff007f;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.25), inset 0 0 10px rgba(255, 0, 127, 0.1);
    animation: bannerEntrance 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), bannerPulse 1s infinite alternate;
    white-space: nowrap;
    pointer-events: auto;
    text-shadow: 0 0 6px rgba(255, 0, 127, 0.5);
    font-family: 'Orbitron', sans-serif;
    text-transform: uppercase;
}

@keyframes bannerEntrance {
    from { transform: translateY(-20px) scale(0.9); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes bannerPulse {
    from {
        border-color: #ff007f;
        box-shadow: 0 0 12px rgba(255, 0, 127, 0.2);
    }
    to {
        border-color: #ff66b2;
        box-shadow: 0 0 20px rgba(255, 0, 127, 0.45);
    }
}

.hud-event-banner:empty {
    display: none !important;
}

/* SUPER POTATO CSS OPTIMIZATIONS */
.game-hud.perf-level-3 * {
    text-shadow: none !important;
    animation-duration: 0.1s !important;
    /* Fast as symbols for stability */
}

.game-hud.perf-level-4 * {
    text-shadow: none !important;
    box-shadow: none !important;
    animation: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border-color: rgba(255, 255, 255, 0.1) !important;
}

.game-hud.perf-level-4 .hud-mute-btn,
.game-hud.perf-level-4 .hud-event-banner {
    border: none !important;
    background: rgba(0, 0, 0, 0.5) !important;
}

.game-hud.perf-level-4 .neon-text-gold,
.game-hud.perf-level-4 .neon-text-cyan,
.game-hud.perf-level-4 .neon-text-pink {
    text-shadow: none !important;
}

/* === STABILITY MODE (perf-level-2): stop persistent CSS animations ===
   coinPulse and comboPulse run every frame on the compositor — stop them
   in Stability and Potato. Leave hover/transition effects intact. */
.game-hud.perf-level-2 .hud-coin-icon,
.game-hud.perf-level-3 .hud-coin-icon {
    animation: none !important;
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6));
}

.game-hud.perf-level-2 .hud-combo,
.game-hud.perf-level-3 .hud-combo {
    animation: none !important;
}

/* === MOBILE: disable decorative animations + remove GPU-heavy backdrop-filter ===
   backdrop-filter: blur() triggers a full compositor pass on EVERY FRAME on mobile.
   Removing it from all active HUD elements gives the biggest single GPU win on mobile. */
@media (max-width: 768px) {
    .hud-coin-icon,
    .hud-combo,
    .cyber-btn-glitch {
        animation: none !important;
    }
    #game-hud,
    #game-hud *,
    #hud-static-layer,
    #hud-static-layer *,
    .hud-top,
    .hud-top *,
    .hud-fps,
    .hud-mute-btn,
    .music-hud-widget,
    .powerup-badge,
    .powerup-badge-minimal,
    .hud-theme-cycle-btn,
    .hud-settings-btn,
    .game-menu-overlay,
    .glass-panel,
    .retro-modal,
    .shop-modal-panel,
    .meta-progression-panel,
    .cyber-box,
    .level-complete-container,
    .leaderboard-container,
    .guestbook-container,
    .multiplayer-container {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* Menu Overlays */
.game-menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 4, 8, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.game-menu-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: scale(1.08);
}

.glass-panel {
    background: rgba(8, 14, 22, 0.78);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(0, 240, 255, 0.22);
    border-radius: 24px;
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8), 
                0 0 30px rgba(0, 240, 255, 0.1),
                inset 0 0 40px rgba(0, 240, 255, 0.03);
    max-width: 520px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    scrollbar-width: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.glass-panel::-webkit-scrollbar { display: none; }

.game-menu-overlay.start-active .menu-title:not(.gameover-text) {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.8rem;
    font-weight: 900;
    letter-spacing: 5px;
    margin: 0.5rem 0;
    text-transform: uppercase;
    background: linear-gradient(to bottom, #ffffff 25%, #00f0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(0, 240, 255, 0.6));
    animation: titlePulse 3s ease-in-out infinite alternate;
}

@keyframes titlePulse {
    0% { filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5)); }
    100% { filter: drop-shadow(0 0 20px rgba(0, 240, 255, 0.8)); }
}

.menu-title.gameover-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 3.4rem;
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #FF453A;
    text-shadow: 0 0 10px rgba(255, 69, 58, 0.6), 0 0 30px rgba(255, 69, 58, 0.3);
    animation: glitchFlicker 2.5s infinite;
    margin-bottom: 1.5rem;
}

@keyframes glitchFlicker {
    0%, 100% { opacity: 1; transform: skewX(0deg); }
    31.9% { opacity: 1; }
    32% { opacity: 0.85; transform: skewX(2deg); filter: hue-rotate(15deg); }
    32.5% { opacity: 1; transform: skewX(0deg); filter: none; }
    47% { transform: scaleY(1); }
    47.1% { transform: scaleY(0.9) skewX(-3deg); opacity: 0.9; }
    47.4% { transform: scaleY(1) skewX(0deg); opacity: 1; }
    91% { opacity: 1; }
    91.1% { opacity: 0.7; transform: skewX(4deg); }
    91.3% { opacity: 1; transform: skewX(0deg); }
}

.menu-subtitle {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    letter-spacing: 5px;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 3rem;
}

.pulse-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
    animation: tapPulse 1.4s infinite alternate;
    margin: 1.5rem 0 0.5rem 0;
    cursor: pointer;
}

@keyframes tapPulse {
    0% { opacity: 0.35; transform: scale(0.97); text-shadow: 0 0 5px rgba(255, 255, 255, 0.2); }
    100% { opacity: 1; transform: scale(1.03); text-shadow: 0 0 15px rgba(255, 255, 255, 0.8); }
}

.hero-goat-img-wrap {
    position: relative;
    width: 130px;
    height: 130px;
    margin: 0.75rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 240, 255, 0.02);
    border-radius: 50%;
}

.hero-goat-img {
    max-height: 95px;
    max-width: 95px;
    object-fit: contain;
    z-index: 2;
    animation: floatGoat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.45));
    transition: all 0.3s ease;
}

.hero-goat-img-wrap::before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 2px dashed rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.15);
    animation: spinRing 25s linear infinite;
    z-index: 1;
    pointer-events: none;
}

.hero-goat-img-wrap::after {
    content: '';
    position: absolute;
    width: 82%;
    height: 82%;
    border-radius: 50%;
    border: 1px solid rgba(255, 0, 255, 0.2);
    box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.1);
    z-index: 1;
    pointer-events: none;
}

@keyframes spinRing {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes floatGoat {
    0%, 100% { transform: translateY(0px) scale(1); }
    50% { transform: translateY(-8px) scale(1.02); }
}

/* On Game Over, hide the active character image and technological scanner wrap */
.game-menu-overlay:not(.start-active) .hero-goat-img-wrap {
    display: none !important;
}

@media (max-height: 600px) {
    .game-menu-overlay.start-active .menu-title:not(.gameover-text) { font-size: 2rem; }
    .hero-goat-img-wrap { display: none !important; }
    .glass-panel { padding: 1rem; }
    .missions-container { margin: 10px 0; }
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.stat-box {
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.2rem;
    border-radius: 16px;
    box-shadow: inset 0 0 15px rgba(255, 255, 255, 0.02), 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.stat-box:hover {
    border-color: rgba(0, 240, 255, 0.25);
    background: rgba(0, 240, 255, 0.015);
    box-shadow: 0 8px 20px rgba(0, 240, 255, 0.05);
    transform: translateY(-2px);
}

.stat-box label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
}

.stat-box span {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: 1px;
    display: block;
    background: linear-gradient(135deg, #ffffff 40%, #a0a0a0 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-box:first-child span {
    background: linear-gradient(135deg, #00f0ff 40%, #00a0ff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(0, 240, 255, 0.3);
}

.stat-box:last-child span {
    background: linear-gradient(135deg, #ffd700 40%, #ffaa00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
}

.new-record-badge {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #000;
    padding: 0.6rem 2rem;
    border-radius: 30px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    font-size: 0.85rem;
    letter-spacing: 2px;
    display: inline-block;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.5), 0 5px 15px rgba(0, 0, 0, 0.4);
    animation: popInAndGlow 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), badgePulse 1.2s ease-in-out infinite alternate;
    border: 1px solid #fff;
    position: relative;
    overflow: hidden;
}

.new-record-badge::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 40%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
    transform: skewX(-25deg);
    animation: badgeShine 2.5s infinite;
}

@keyframes badgeShine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

@keyframes popInAndGlow {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes badgePulse {
    from { transform: scale(1); box-shadow: 0 0 15px rgba(255, 215, 0, 0.4); }
    to { transform: scale(1.05); box-shadow: 0 0 30px rgba(255, 215, 0, 0.8); }
}

/* Neon Text Utilities */
.neon-text-red {
    color: #FF453A;
}

.neon-text-green {
    color: #32D74B;
}

.neon-text-cyan {
    color: #00f0ff;
}

.neon-text-gold {
    color: #ffd700;
}

/* Animations */
@keyframes neon-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

@keyframes slideIn {
    from {
        transform: translateX(-20px);
        opacity: 0;
    }

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

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

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

@keyframes popIn {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Canvas Wrap & Display */
.game-canvas-wrap {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    flex: 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Sotto al game-hud (z-index: 100) */
}

.dino-canvas {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Ensures absolutely no letterboxing */
    display: block;
    image-rendering: auto;
    will-change: transform;
    background: #000;
}

/* Responsive Mobile Overrides */
@media (max-width: 768px) {
    .hero-goat-img {
        max-height: 180px;
        margin-top: 5px;
        margin-bottom: 5px;
    }

    .game-hud {
        /* Mobile overrides: reduce baseline padding, let safe-area-inset handle edges */
        padding: 0.8rem;
        padding-top: max(1rem, env(safe-area-inset-top));
        padding-bottom: max(2vh, env(safe-area-inset-bottom, 2vh));
    }

    .hud-top .hud-left {
        position: absolute !important;
        top: 80px !important;
        left: 20px !important;
        min-width: 0;
        max-width: 50%;
        gap: 6px;
    }

    .hud-top .hud-right {
        min-width: 100px;
        max-width: 50%;
        padding: 6px 12px;
        border-radius: 6px 0 0 10px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
        margin-left: auto !important;
    }

    .hud-value {
        font-size: 1rem;
        margin-bottom: 2px;
        letter-spacing: 0.5px;
    }

    .hud-label {
        font-size: 0.45rem;
        letter-spacing: 1px;
    }

    .hud-combo {
        position: relative;
        left: auto;
        top: auto;
        font-size: 0.78rem;
        padding: 4px 8px;
        border-radius: 4px 10px 10px 4px;
        box-shadow: 0 3px 10px rgba(255, 0, 127, 0.25);
    }

    .hud-coins-wrap {
        font-size: 1.15rem;
        padding: 4px 12px;
        border-radius: 16px 6px 6px 16px;
        gap: 6px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    }

    .hud-top {
        position: relative;
    }

    /* Su mobile l'evento viene sganciato dal flex della prima riga per non sovrapporsi */
    .hud-top .hud-center-col {
        position: absolute;
        width: 100%;
        left: 0;
        top: 3.5rem;
        /* Posizionato sotto Score e Combo */
        pointer-events: none;
    }

    .hud-event-banner {
        font-size: 0.65rem;
        padding: 0.2rem 0.5rem;
        letter-spacing: 2px;
        white-space: nowrap;
    }

    .glass-panel {
        padding: 1.5rem;
        padding-bottom: 1.5rem;
        /* Match HUD padding for consistency */
        border-radius: 16px;
    }

    .menu-title {
        font-size: 2.6rem;
        letter-spacing: 0;
    }

    /* Alleggerimento del carico grafico delle font ombreggiate su mobile */
    .neon-text-red,
    .neon-text-green,
    .neon-text-cyan,
    .neon-text-gold {
        text-shadow: none !important;
        /* Disabilita ombre pesanti su Mobile */
    }

    .menu-subtitle {
        font-size: 0.7rem;
        letter-spacing: 2px;
        margin-bottom: 1.5rem;
    }

    .pulse-text {
        font-size: 1.1rem;
        margin: 0.5rem 0 1rem 0;
    }

    .stats-grid {
        gap: 1rem;
        margin: 1rem 0;
    }

    .stat-box {
        padding: 0.8rem;
    }

    .stat-box span {
        font-size: 1.2rem;
    }

    .close-game-btn {
        top: 10px;
        right: 10px;
        width: 36px;
        height: 36px;
        font-size: 18px;
    }
}

/* Landscape Mobile or Small Height Optimization */
@media (max-height: 500px) and (max-width: 900px) {
    .glass-panel {
        padding: 1rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
        max-height: 90vh;
        overflow-y: auto;
    }

    .menu-title {
        font-size: 1.8rem;
    }

    .menu-subtitle {
        margin-bottom: 0.5rem;
    }

    .stats-grid {
        margin: 0.5rem 0;
    }

    .hud-value {
        font-size: 1.2rem;
        margin-bottom: 0.2rem;
    }
}

/* Mobile Touch Controls (hidden on desktop) */
.game-touch-controls {
    display: none;
    gap: 1rem;
    width: 90%;
    max-width: 500px;
}

.touch-btn {
    flex: 1;
    padding: 1.2rem 1rem;
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    letter-spacing: 1px;
}

.touch-jump {
    background: linear-gradient(135deg, rgba(0, 240, 255, 0.15), rgba(0, 240, 255, 0.05));
    border: 2px solid rgba(0, 240, 255, 0.4);
    color: #00f0ff;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.1);
}

.touch-jump:active {
    background: rgba(0, 240, 255, 0.25);
    box-shadow: 0 0 28px rgba(0, 240, 255, 0.3);
    transform: scale(0.97);
}

.touch-duck {
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(255, 107, 53, 0.05));
    border: 2px solid rgba(255, 107, 53, 0.4);
    color: #ff6b35;
    box-shadow: 0 0 18px rgba(255, 107, 53, 0.1);
}

.touch-duck:active {
    background: rgba(255, 107, 53, 0.25);
    box-shadow: 0 0 28px rgba(255, 107, 53, 0.3);
    transform: scale(0.97);
}

/* Show touch controls on mobile */
@media (max-width: 768px) {
    .game-touch-controls {
        display: flex;
    }

    .game-overlay {
        padding: 0;
        background: #030a08;
    }

    .game-frame {
        width: 100vw;
        max-width: 100vw;
        border: none;
        border-radius: 0;
        box-shadow: none;
        height: 100vh;
        height: 100dvh;
        /* Use dynamic viewport height if supported */
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .game-frame-header {
        display: none;
        /* Hide top bar to maximize space */
    }

    .game-canvas-wrap {
        width: 100vw;
    }

    .dino-canvas {
        object-fit: cover;
    }

    .close-game-btn {
        top: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
        font-size: 1.5rem;
        background: rgba(0, 0, 0, 0.5);
        color: #fff;
        border-color: rgba(255, 255, 255, 0.2);
    }
}

/* ===== Desktop enhancements ===== */
@media (min-width: 769px) {
    .game-frame {
        box-shadow:
            0 0 60px rgba(0, 240, 255, 0.12),
            0 20px 80px rgba(0, 0, 0, 0.5),
            inset 0 0 40px rgba(0, 240, 255, 0.04);
    }
}

.footer-contacts {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    padding-bottom: 0;
    border-bottom: none;
}

.contact-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    padding: 1.5rem 2rem;
    background: var(--bg-card);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: all var(--transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), var(--glass-edge);
}

.contact-item:hover {
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4), var(--glass-edge);
}

.contact-icon {
    font-size: 1.25rem;
}

.contact-label {
    font-size: 0.6875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.contact-value {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.contact-item:hover .contact-value {
    color: var(--text-primary);
}

/* Contact Terminal Styles */
.footer-contacts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.contact-terminal {
    text-decoration: none;
    display: block;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    pointer-events: auto !important;
    position: relative;
    z-index: 5;
}

.contact-terminal:hover {
    transform: translateY(-4px);
}

.contact-terminal .terminal-window {
    height: 100%;
    pointer-events: none;
    /* Let parent handle clicks */
}

.final-bridge-terminal {
    cursor: pointer;
    pointer-events: auto !important;
    position: relative;
    z-index: 10;
}

.contact-body {
    padding: 1.5rem 1rem;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.contact-prompt {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.prompt-symbol {
    color: var(--blue-primary);
    margin-right: 0.5rem;
}

.prompt-command {
    color: var(--text-secondary);
}

.terminal-spinner {
    display: inline-block;
    margin-left: 4px;
    width: 1ch;
    font-family: 'Monaco', 'Consolas', monospace;
}

.terminal-spinner::after {
    content: '/';
    animation: spinnerRotate 0.4s steps(4, end) infinite;
}

@keyframes spinnerRotate {
    0% {
        content: '/';
    }

    25% {
        content: '−';
    }

    50% {
        content: '\\';
    }

    75% {
        content: '|';
    }

    100% {
        content: '/';
    }
}

.contact-output {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
}

.contact-output .contact-icon {
    font-size: 1.25rem;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.contact-output .contact-value {
    color: var(--text-primary);
    font-weight: 600;
}

/* Phone Terminal - Green Theme */
.contact-phone-terminal .terminal-window {
    border-color: var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
}

.contact-phone-terminal:hover .terminal-window {
    border-color: rgba(50, 215, 75, 0.3);
    box-shadow: 0 10px 30px rgba(50, 215, 75, 0.15);
}

.contact-phone-terminal .terminal-title {
    color: #32D74B;
}

.contact-phone-terminal .prompt-symbol {
    color: #32D74B;
}

.contact-phone-terminal .contact-output .contact-icon {
    background: rgba(50, 215, 75, 0.1);
    border: 1px solid rgba(50, 215, 75, 0.2);
    border-radius: var(--radius);
    color: #32D74B;
}

.contact-phone-terminal .contact-value {
    color: var(--text-primary) !important;
}

/* Email Terminal - Orange Theme */
.contact-email-terminal .terminal-window {
    border-color: var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
}

.contact-email-terminal:hover .terminal-window {
    border-color: rgba(255, 149, 0, 0.3);
    box-shadow: 0 10px 30px rgba(255, 149, 0, 0.15);
}

.contact-email-terminal .terminal-title {
    color: #FF9500;
}

.contact-email-terminal .prompt-symbol {
    color: #FF9500;
}

.contact-email-terminal .email-icon {
    background: rgba(255, 149, 0, 0.1);
    border: 1px solid rgba(255, 149, 0, 0.2);
    color: #FF9500;
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: none;
    filter: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.contact-email-terminal .contact-value {
    color: var(--text-primary) !important;
}

/* LinkedIn Terminal - Blue Theme */
.contact-linkedin-terminal .terminal-window {
    border-color: var(--border-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-lg);
}

.contact-linkedin-terminal:hover .terminal-window {
    border-color: rgba(10, 132, 255, 0.3);
    box-shadow: 0 10px 30px rgba(10, 132, 255, 0.15);
}

.contact-linkedin-terminal .terminal-title {
    color: #0A84FF;
}

.contact-linkedin-terminal .prompt-symbol {
    color: #0A84FF;
}

.contact-linkedin-terminal .contact-output .contact-icon {
    background: rgba(10, 132, 255, 0.1);
    border: 1px solid rgba(10, 132, 255, 0.2);
    color: #0A84FF;
    width: 28px;
    height: 28px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1rem;
    box-shadow: none;
}

.contact-linkedin-terminal .contact-value {
    color: var(--text-primary) !important;
}

.footer-bottom {
    padding-top: 2rem;
    text-align: center;
    border-top: 1px dashed var(--border-light);
    margin-top: 4rem;

}

.footer-bottom p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ===== GLOBAL Loader Styles (All Screen Sizes) ===== */
body.loading {
    overflow: hidden;
    /* Prevent scroll during boot */
}

.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: none;
}

.loader.hidden {
    animation: terminalGlitchOut 1s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.boot-terminal {
    width: 90%;
    max-width: 800px;
    font-family: 'Monaco', 'Consolas', 'Courier New', monospace;
    font-size: 0.875rem;
    color: #00ff00;
    line-height: 1.4;
}

.boot-header {
    margin-bottom: 1rem;
    color: #00ff00;
    font-weight: 600;
}

.boot-user {
    color: #00ff00;
}

.boot-path {
    color: #5599ff;
}

.boot-command {
    color: #00ff00;
    animation: bootCursor 0.8s step-end infinite;
}

.boot-log {
    white-space: pre-wrap;
    overflow-y: auto;
    max-height: 70vh;
    scrollbar-width: thin;
    scrollbar-color: #00ff00 #000;
}

.boot-line {
    opacity: 0;
    animation: bootFadeIn 0.1s forwards;
}

.boot-line.ok {
    color: #00ff00;
}

.boot-line.info {
    color: #5599ff;
}

.boot-line.warn {
    color: #ffaa00;
}

/* ========== EPIC Transition Effects (Optimized for Smooth Performance) ========== */

/* Hardware acceleration */
.loader,
.scanline-overlay {
    will-change: transform, opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* Terminal Shatter/Zoom Out - 10x WOW entrance */
@keyframes terminalGlitchOut {
    0% {
        opacity: 1;
        transform: scale(1) translate3d(0, 0, 0);
        filter: blur(0px) brightness(1);
    }

    /* Dramatic pause / energy gather */
    10% {
        transform: scale(0.98) translate3d(0, 0, 0);
        filter: blur(1px) brightness(1.5);
    }

    20% {
        transform: scale(1.02) translate3d(-10px, 5px, 0) skewX(2deg);
        filter: hue-rotate(90deg) brightness(2);
        opacity: 1;
    }

    30% {
        transform: scale(0.95) translate3d(10px, -5px, 0) skewX(-2deg);
        filter: hue-rotate(-90deg) brightness(3);
        opacity: 0.9;
    }

    /* The Shatter & Zoom */
    40% {
        transform: scale(1.2) translate3d(0, 0, 0);
        filter: brightness(4) blur(4px);
        opacity: 1;
        box-shadow: 0 0 100px rgba(0, 240, 255, 0.8);
    }

    60% {
        transform: scale(2) translate3d(0, 0, 0);
        filter: brightness(2) blur(10px);
        opacity: 0.5;
        box-shadow: inset 0 0 200px rgba(123, 97, 255, 0.8);
    }

    80% {
        transform: scale(4) translate3d(0, 50px, 0);
        filter: blur(20px);
        opacity: 0.2;
    }

    100% {
        transform: scale(10) translate3d(0, 100px, 0);
        filter: blur(30px);
        opacity: 0;
        visibility: hidden;
    }
}

@keyframes bootFadeIn {
    to {
        opacity: 1;
    }
}

@keyframes bootCursor {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0;
    }
}

/* Enhanced Scanline Sweep - CRT effect */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
        linear-gradient(to bottom,
            transparent 0%,
            rgba(0, 255, 0, 0.08) 50%,
            transparent 100%),
        repeating-linear-gradient(to bottom,
            transparent 0px,
            transparent 2px,
            rgba(0, 0, 0, 0.3) 2px,
            rgba(0, 0, 0, 0.3) 4px);
    background-size: 100% 8px, 100% 4px;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    animation: epicScanline 1.5s 0.2s ease-out forwards;
}

@keyframes epicScanline {
    0% {
        opacity: 0;
        transform: translateY(-100%) translate3d(0, 0, 0);
    }

    30% {
        opacity: 1;
    }

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

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
    }


    .project-blocks {
        grid-template-columns: 1fr;
        /* Collapse bento to single column */
    }

    .process-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-step:not(:last-child)::after {
        display: none;
    }

    .values-grid {
        grid-template-columns: 1fr;
    }

    .goal-grid {
        grid-template-columns: 1fr;
    }

    /* Reset span rules for mobile bento */
    .block:nth-child(1),
    .block:nth-child(2),
    .block:nth-child(3) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .skills-grid {
        grid-template-columns: 1fr;
    }

    .skill-category:nth-child(1),
    .skill-category:nth-child(2),
    .skill-category:nth-child(3) {
        grid-column: span 1;
        grid-row: span 1;
    }

    .goal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .hero {
        padding: 7rem 0 3rem;
    }

    /* ===== Goal & Salary Section ===== */
    .goal {
        position: relative;
        z-index: 5;
    }

    .goal-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
        align-items: center;
        margin-top: 3rem;
    }

    .goal-content h3 {
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--blue-primary);
        margin-bottom: 0.5rem;
    }

    .goal-title {
        font-size: 1.5rem;
        font-weight: 700;
        color: var(--text-primary);
        margin-bottom: 1.5rem;
    }

    .goal-text {
        font-size: 1.125rem;
        line-height: 1.7;
        color: var(--text-secondary);
        margin-bottom: 2rem;
    }

    .goal-perks {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .perk-tag {
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        padding: 0.75rem 1.25rem;
        border-radius: 100px;
        font-size: 0.875rem;
        color: var(--text-primary);
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        transition: var(--transition);
    }

    .perk-tag:hover {
        border-color: var(--blue-glow);
        background: rgba(0, 240, 255, 0.05);
    }

    /* Salary Block */
    .salary-block {
        background: var(--bg-card);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border: 1px solid var(--border);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05),
            0 20px 40px rgba(0, 0, 0, 0.4);
        border-radius: var(--radius-lg);
        padding: 2.5rem;
        position: relative;
        overflow: hidden;
        transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .salary-block::before {
        content: '';
        position: absolute;
        inset: 0;
        background: radial-gradient(circle at top right, var(--orange-glow), transparent 60%);
        opacity: 0.5;
        pointer-events: none;
    }

    .hidden-ral {
        opacity: 0;
        transform: translateY(20px);
        filter: blur(5px);
        pointer-events: none;
    }

    .hidden-ral.revealed {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
        pointer-events: auto;
    }

    .salary-label {
        display: block;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        color: var(--orange-primary);
        margin-bottom: 1rem;
    }

    .salary-range {
        display: flex;
        align-items: flex-end;
        gap: 1rem;
        margin-bottom: 1.5rem;
        padding-bottom: 1.5rem;
        border-bottom: 1px solid var(--border);
    }

    .salary-amount {
        font-size: 2.5rem;
        font-weight: 700;
        color: var(--text-primary);
        line-height: 1;
        text-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    }

    .salary-type {
        font-size: 1rem;
        color: var(--text-secondary);
        margin-bottom: 0.25rem;
    }

    .salary-justification {
        font-size: 1rem;
        line-height: 1.6;
        color: var(--text-secondary);
    }

    /* Fix mobile contrast */
    @media (max-width: 768px) {
        .goal-grid {
            grid-template-columns: 1fr;
            gap: 2rem;
        }

        .salary-block {
            padding: 1.5rem;
            /* Replace blur with solid background on mobile if blur is buggy */
            background: #0f0f11;
            backdrop-filter: none;
            -webkit-backdrop-filter: none;
        }

        .salary-amount {
            font-size: 2rem;
        }
    }

    .section {
        padding: 4rem 0;
    }

    .hero-stats {
        flex-wrap: wrap;
        gap: 1rem;
        padding: 1.25rem;
    }

    .hero-stat {
        flex: 1 1 40%;
    }

    .hero-stat-divider {
        display: none;
    }

    .process-grid {
        grid-template-columns: 1fr;
    }

    .values-grid {
        grid-template-columns: 1fr;
    }

    .timeline-achievements {
        flex-direction: column;
    }

    /* Force Centering for Mobile/Tablet */
    .hero-content {
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .hero-content .btn-magic {
        align-self: center;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-badge {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 1rem;
    }

    .hero-title,
    .hero-subtitle {
        text-align: center;
    }

    /* Mobile H1: clamp to avoid filling entire viewport */
    .hero-title {
        font-size: clamp(1.9rem, 9vw, 2.5rem);
        letter-spacing: -0.03em;
        line-height: 1.2;
    }

    /* Hero badge: allow text to wrap gracefully */
    .hero-badge {
        white-space: normal;
        text-align: center;
        font-size: 0.78rem;
        padding: 0.35rem 0.9rem;
    }

    /* Hero terminal body: smaller font so lines don't wrap */
    .hero-terminal-body {
        font-size: 0.72rem;
        height: 185px;
        padding: 0.75rem 1rem;
    }

    .hero-term-line,
    .hero-term-current {
        font-size: 0.72rem;
    }

    /* Hero visual: cap width on mobile */
    .hero-visual {
        width: 100%;
        max-width: 500px;
    }

    /* Hero stats: scale down numbers slightly */
    .hero-stat-value {
        font-size: 1.35rem;
    }

    .hero-stat-label {
        font-size: 0.62rem;
    }

    /* Manifesto quote: smaller on mobile */
    .manifesto-quote {
        font-size: 1rem;
    }

    /* Boot terminal: tighter on phones */
    .boot-terminal-window {
        width: 100%;
        max-width: 96vw;
        margin: 0 auto;
    }

    .boot-body {
        padding: 0.75rem 1rem;
        font-size: 0.75rem;
    }

    .boot-log {
        height: auto;
        min-height: 360px;
        max-height: 80vh;
    }

    .boot-line {
        font-size: 0.74rem;
    }

    /* Fix terminal height on mobile to prevent layout shifts */
    .terminal-body {
        height: 220px;
        min-height: 220px;
    }

    /* Force boot body to auto height to allow min-height: 420px */
    .boot-body {
        height: auto !important;
        min-height: 420px !important;
    }

    /* Allow bridge terminal to expand */
    .final-bridge-terminal .terminal-body {
        height: auto;
        min-height: auto;
    }

    /* Bridge Message - Tiny single line for mobile */
    .terminal-message {
        font-size: 0.55rem;
        /* Drastically reduced */
        line-height: 1.2;
        padding: 0.4rem;
        margin-top: 0.5rem;
        text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        letter-spacing: -0.5px;
        /* Condense text */
    }

    /* Restored Mobile Contacts Layout + Added Spacing */
    .footer-contacts {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 0.5rem;
        flex-wrap: nowrap;
        padding: 0 0.5rem;
        margin-bottom: 6rem;
        /* Generous spacing */
    }

    /* Contact Terminal Improvements - Compact for mobile */
    .contact-terminal {
        margin-bottom: 0;
        width: auto;
        flex: 1;
        min-width: 0;
    }

    .contact-terminal .terminal-window {
        max-width: 100%;
        width: 100%;
        height: 100%;
    }

    /* Ensure dots are tiny */
    .contact-terminal .terminal-dot {
        width: 5px !important;
        height: 5px !important;
        margin: 0 1px !important;
    }

    .contact-body {
        padding: 0.5rem;
        min-height: auto;
        height: auto;
        gap: 0.5rem;
        align-items: center;
        justify-content: center;
    }

    .contact-prompt {
        font-size: 0.65rem;
        text-align: center;
        width: 100%;
    }

    .contact-output {
        flex-direction: row;
        justify-content: center;
        width: 100%;
        gap: 0;
    }

    .contact-output .contact-value {
        display: none !important;
        /* Hide text to fit 3 in a row */
    }

    .contact-output .contact-icon {
        flex-shrink: 0;
        font-size: 1.5rem;
        /* Larger icon since it's the main element */
    }

    /* Terminal header compact */
    .contact-terminal .terminal-header {
        padding: 0.4rem;
        justify-content: center;
    }

    .contact-terminal .terminal-title {
        display: none;
        /* Hide title to save space */
    }



    /* Spinner visibility */
    .terminal-spinner {
        display: inline-block;
        /* Restore visibility */
        font-size: 0.65rem;
        margin-left: 2px;
    }

    .timeline-item {
        gap: 1rem;
    }

    .timeline-content {
        padding-left: 0.5rem;
    }

    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .footer-cta h2 {
        font-size: 2rem;
    }

    .salary-amount {
        font-size: 2rem;
    }

    /* Ensure ascii fits on mobile */
    /* Ensure ascii fits on mobile but is readable/scrollable */
    /* Bridge Terminal - Maximize Width */
    .footer-cta {
        width: 100%;
        padding: 0;
        margin: 0 0 2rem 0;
    }

    .final-bridge-terminal {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 0 3rem 0;
        border-radius: 1rem;
        overflow: hidden;
        touch-action: pan-y;
        /* Pass vertical scroll to the page */
    }

    .final-bridge-terminal .terminal-body {
        /* Let height adapt to content on mobile instead of trapping scroll */
        height: auto !important;
        min-height: 0 !important;
        display: flex;
        flex-direction: column;
        justify-content: center;
        overflow: hidden;
        /* Prevent internal scroll from stealing page scroll */
        touch-action: pan-y;
        /* Pass vertical scroll to the page */
    }

    /* Ensure ascii fits on mobile */
    .ascii-art {
        font-size: 1.6vw;
        /* Responsive font sizing */
        line-height: 1.0;
        overflow-x: hidden;
        white-space: pre;
        display: block;
        width: fit-content;
        /* Allow centering */
        margin: 0 auto;
        /* Center the block */
        text-align: left;
        /* Keep left align INSIDE the block */
        padding-left: 0;
        font-family: 'Monaco', 'Consolas', monospace;
    }

    @media (max-width: 480px) {
        .container {
            padding: 0 16px;
        }

        .block-stats {
            flex-wrap: wrap;
        }

        .vision-roadmap {
            flex-wrap: wrap;
        }

        .roadmap-step {
            min-width: 70px;
        }

        /* Improve button touch area */
        .btn-primary {
            width: 100%;
            justify-content: center;
        }

        /* Better spacing on small phones */
        .hero-badge {
            margin-bottom: 1rem;
            margin-left: auto;
            margin-right: auto;
        }

        .hero-content {
            text-align: center;
            display: flex;
            flex-direction: column;
            align-items: center;
        }

        .hero-subtitle {
            margin-bottom: 1.5rem;
        }

        /* Bridge Message - Tiny single line for mobile */
        .terminal-message {
            font-size: 0.55rem;
            /* Drastically reduced */
            line-height: 1.2;
            padding: 0.4rem;
            margin-top: 0.5rem;
            text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
            font-weight: 600;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            letter-spacing: -0.5px;
            /* Condense text */
        }

        /* Contact Terminal Improvements */
        /* ... existing rules ... */

        /* Ensure dots are tiny */
        .contact-terminal .terminal-dot {
            width: 5px !important;
            height: 5px !important;
            margin: 0 1px !important;
        }

        /* Spinner visibility */
        .terminal-spinner {
            display: inline-block;
            font-size: 0.6rem;
            margin-left: 2px;
        }

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

        .manifesto-quote {
            text-align: center;
            border-left: none;
            border-top: 3px solid var(--orange-primary);
            padding-left: 0;
            padding-top: 1.5rem;
        }

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

        .boot-terminal-window {
            width: 100%;
            max-width: 98vw;
        }

        .boot-log {
            min-height: 420px;
            max-height: 85vh;
            font-size: 0.65rem;
        }

        .boot-line {
            line-height: 1.2;
            white-space: normal;
            word-break: break-all;
        }

        /* Faster animations on mobile */
        @keyframes terminalGlitchOut {
            0% {
                opacity: 1;
                transform: scale(1);
                filter: blur(0px) brightness(1);
            }

            20% {
                transform: scale(1.05) translate3d(-5px, 2px, 0);
                filter: hue-rotate(90deg) brightness(2);
            }

            40% {
                transform: scale(0.95);
                filter: brightness(3);
            }

            60% {
                transform: scale(1.5);
                filter: blur(5px);
                opacity: 0.8;
                box-shadow: 0 0 50px rgba(0, 240, 255, 0.5);
            }

            100% {
                transform: scale(4);
                filter: blur(20px);
                opacity: 0;
                visibility: hidden;
            }
        }
    }

    @media (max-width: 480px) {
        .boot-terminal {
            width: 98%;
            font-size: 0.65rem;
            padding: 0 5px;
        }

        .boot-header {
            font-size: 0.65rem;
            margin-bottom: 0.5rem;
            word-break: break-all;
        }

        .boot-log {
            max-height: 55vh;
            font-size: 0.65rem;
        }

        .boot-line {
            line-height: 1.2;
        }

        /* Even faster on very small screens */
        .scanline-overlay {
            animation: epicScanline 0.5s 0.2s ease-out forwards;
        }
    }

    /* iOS Safari specific fixes */
    @supports (-webkit-touch-callout: none) {
        .loader {
            /* Prevent scroll during boot */
            position: fixed;
            -webkit-overflow-scrolling: touch;
        }

        .boot-terminal {
            /* Better rendering on iOS */
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
        }

        .boot-log {
            /* Smooth scrolling on iOS */
            -webkit-overflow-scrolling: touch;
        }
    }

    /* Android Chrome specific optimizations */
    @media (max-width: 768px) and (orientation: portrait) {
        .boot-log {
            /* Adjust for mobile portrait */
            max-height: 50vh;
        }
    }

    @media (max-width: 768px) and (orientation: landscape) {
        .boot-terminal {
            font-size: 0.6rem;
        }

        .boot-log {
            /* More space in landscape mode */
            max-height: 40vh;
        }
    }

    /* ===== Extreme 10x CSS Scroll Reveals ===== */
    .reveal-element {
        opacity: 0;
        transform: translateY(40px) scale(0.95);
        transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
        will-change: opacity, transform;
    }

    .reveal-element.revealed {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Better spacing on small phones */
.hero-badge {
    margin-bottom: 1rem;
    margin-left: auto;
    margin-right: auto;
}

.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.hero-subtitle {
    margin-bottom: 1.5rem;
}

/* Bridge Message - Tiny single line for mobile */
.terminal-message {
    font-size: 0.55rem;
    /* Drastically reduced */
    line-height: 1.2;
    padding: 0.4rem;
    margin-top: 0.5rem;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.5);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.5px;
    /* Condense text */
}

/* Contact Terminal Improvements */
/* ... existing rules ... */

/* Ensure dots are tiny */
.contact-terminal .terminal-dot {
    width: 5px !important;
    height: 5px !important;
    margin: 0 1px !important;
}

/* Spinner visibility */
.terminal-spinner {
    display: inline-block;
    font-size: 0.6rem;
    margin-left: 2px;
}

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

.manifesto-quote {
    text-align: center;
    border-left: none;
    border-top: 3px solid var(--orange-primary);
    padding-left: 0;
    padding-top: 1.5rem;
}

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

@media (max-width: 768px) {
    .boot-terminal-window {
        width: 100%;
        max-width: 98vw;
    }

    .boot-log {
        min-height: 420px;
        max-height: 85vh;
        font-size: 0.65rem;
    }

    .boot-line {
        line-height: 1.2;
        white-space: normal;
        word-break: break-all;
    }
}

/* Faster animations on mobile */
@keyframes terminalGlitchOut {
    0% {
        opacity: 1;
        transform: scale(1);
        filter: blur(0px) brightness(1);
    }

    20% {
        transform: scale(1.05) translate3d(-5px, 2px, 0);
        filter: hue-rotate(90deg) brightness(2);
    }

    40% {
        transform: scale(0.95);
        filter: brightness(3);
    }

    60% {
        transform: scale(1.5);
        filter: blur(5px);
        opacity: 0.8;
        box-shadow: 0 0 50px rgba(0, 240, 255, 0.5);
    }

    100% {
        transform: scale(4);
        filter: blur(20px);
        opacity: 0;
        visibility: hidden;
    }
}

@media (max-width: 480px) {
    .boot-terminal {
        width: 98%;
        font-size: 0.65rem;
        padding: 0 5px;
    }

    .boot-header {
        font-size: 0.65rem;
        margin-bottom: 0.5rem;
        word-break: break-all;
    }

    .boot-log {
        max-height: 55vh;
        font-size: 0.65rem;
    }

    .boot-line {
        line-height: 1.2;
    }

    /* Even faster on very small screens */
    .scanline-overlay {
        animation: epicScanline 0.5s 0.2s ease-out forwards;
    }
}

/* iOS Safari specific fixes */
@supports (-webkit-touch-callout: none) {
    .loader {
        /* Prevent scroll during boot */
        position: fixed;
        -webkit-overflow-scrolling: touch;
    }

    .boot-terminal {
        /* Better rendering on iOS */
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }

    .boot-log {
        /* Smooth scrolling on iOS */
        -webkit-overflow-scrolling: touch;
    }
}

/* Android Chrome specific optimizations */
@media (max-width: 768px) and (orientation: portrait) {
    .boot-log {
        /* Adjust for mobile portrait */
        max-height: 50vh;
    }
}

@media (max-width: 930px) and (orientation: landscape) {
    .boot-terminal {
        font-size: 0.6rem;
    }

    .boot-log {
        /* More space in landscape mode */
        max-height: 40vh;
    }

    /* Compact HUD in Landscape */
    .hud-value {
        font-size: 1.1rem !important;
    }
    .hud-label {
        font-size: 0.45rem !important;
    }
    .hud-top .hud-left {
        position: absolute !important;
        top: 60px !important;
        left: 20px !important;
        gap: 4px !important;
    }
    .hud-combo {
        position: relative !important;
        left: auto !important;
        top: auto !important;
        font-size: 0.75rem !important;
        padding: 3px 6px !important;
    }
    .hud-top, .hud-bottom {
        padding: 0.2rem 0 !important;
    }
    .hud-bottom {
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: flex-end !important;
    }
    .hud-powerups-list {
        justify-content: flex-start !important;
        margin-bottom: 3px !important;
    }
    .hud-settings-btn {
        width: 32px !important;
        height: 32px !important;
        font-size: 1.2rem !important;
        line-height: 32px !important;
    }
}

/* ===== Extreme 10x CSS Scroll Reveals ===== */
.reveal-element {
    opacity: 0;
    transform: translateY(40px) scale(0.95);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.reveal-element.revealed {
    opacity: 1;
    transform: translateY(0) scale(1);
}


/* ===== Powerup Badges HUD ===== */
.hud-powerups-list {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    /* allow wrapping to rows if too many buffs */
    margin-top: 0;
    width: 100%;
    margin-bottom: 20px;
    /* spacing from bottom edge */
}

.powerup-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 12px;
    border-radius: 20px;
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    white-space: nowrap;
    font-weight: 700;
    letter-spacing: 0.5px;
    border: 2px solid;
    background: rgba(5, 5, 10, 0.88);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

@keyframes badge-pop {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.powerup-icon {
    font-size: 1.5rem;
    /* Icona più grande */
    line-height: 1;
}

.powerup-time {
    font-family: 'Fira Code', monospace;
    font-size: 1rem;
    font-weight: 700;
    opacity: 1.0;
}

/* Distinct powerup styles - leggeri con colore neon */
.badge-magnet {
    border-color: #dd00ff;
    color: #ee88ff;
}

.badge-star {
    border-color: #ffcc00;
    color: #ffe066;
}

.badge-slow {
    border-color: #00cc44;
    color: #55ff88;
}

.badge-shield {
    border-color: #00ccff;
    color: #66ddff;
}

.badge-shield-l2 {
    border-color: #cc00ff;
    color: #ff88ff;
    box-shadow: 0 0 10px rgba(204, 0, 255, 0.4);
}

.badge-shield-regen {
    border-color: #ffaa00;
    color: #ffcc44;
    animation: shieldRegenPulse 0.9s ease-in-out infinite alternate;
}

@keyframes shieldRegenPulse {
    from { box-shadow: 0 0 5px rgba(255, 170, 0, 0.35); opacity: 0.75; }
    to   { box-shadow: 0 0 18px rgba(255, 170, 0, 0.95); opacity: 1; }
}

.badge-shrink {
    border-color: #ff4f00;
    color: #ff7733;
}

.badge-x2 {
    border-color: #4400ff;
    color: #8844ff;
}

.badge-wings {
    border-color: #ffd700;
    color: #ffeb9b;
}

.badge-revive {
    border-color: #00ffff;
    color: #ccffff;
}

.badge-armor {
    border-color: #0066ff;
    color: #33a6ff;
    box-shadow: 0 0 8px rgba(0, 102, 255, 0.4);
}

.badge-ghost {
    border-color: #8e8e93;
    color: #d1d1d6;
}

.badge-hacker {
    border-color: #30d158;
    color: #32d74b;
}

@media (max-width: 1024px) {

    /* HUD Adjustments for Mobile/Tablet */
    .hud-combo {
        position: relative;
        left: auto;
        top: auto;
        font-size: 0.9rem;
    }

    .hud-value {
        font-size: 1.2rem;
    }

    .hud-label {
        font-size: 0.5rem;
    }

    /* Force Wrapping Powerup List */
    .hud-powerups-list {
        display: flex !important;
        flex-direction: row !important;
        gap: 6px !important;
        flex-wrap: wrap !important;
        /* ALLOW rows to prevent going off-screen */
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin-bottom: 0 !important;
        /* Removed margin as we use padding on container instead */
    }

    /* Badge compatto su mobile */
    .powerup-badge {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
        border-width: 2px !important;
        gap: 4px !important;
        flex-shrink: 0;
    }

    .powerup-badge .powerup-name {
        display: none !important;
    }

    .powerup-icon {
        font-size: 1.1rem !important;
    }

    .powerup-time {
        font-size: 0.85rem !important;
    }

    /* HUD Bottom Row adjustments */
    .hud-bottom {
        flex-direction: column-reverse;
        /* Stack items vertically, coins at bottom, badges above */
        align-items: flex-end;
        gap: 6px;
        position: relative;
        margin-bottom: 4px !important;
        margin-right: 6px !important;
    }

    .hud-event-banner {
        margin-top: -10px;
    }

    .hud-bottom .hud-center-col {
        width: 100% !important;
        justify-content: center;
        display: flex;
        padding: 0 4px;
        pointer-events: none;
    }

    .hud-bottom .hud-right {
        margin-left: auto;
        justify-content: flex-end;
        z-index: 101;
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }

    /* Menu & GameOver Graphics Fix for Mobile */
    .glass-panel {
        padding: 1.5rem 1rem;
        max-width: 92%;
        border-radius: 12px;
    }

    .menu-title {
        font-size: 1.8rem;
        margin-bottom: 0.2rem;
    }

    .hero-goat-img {
        max-height: 100px;
        margin: 5px auto;
    }

    .stats-grid {
        gap: 0.8rem;
        margin: 0.5rem 0;
    }

    .stat-box {
        padding: 0.8rem;
    }

    .pulse-text {
        font-size: 0.9rem;
        margin: 1rem 0;
    }
}

.hidden {
    display: none !important;
}

/* Performance Mode HUD Optimizations */
.perf-level-3 .powerup-badge,
.perf-level-4 .powerup-badge {
    backdrop-filter: none !important;
    background: rgba(5, 5, 10, 0.9) !important;
}

.perf-level-4 .powerup-badge-minimal {
    border-width: 1px !important;
    background: #000 !important;
}

/* ===== SETTINGS MODAL & PANEL OVERHAUL (v99) ===== */
.settings-modal {
    z-index: 99999 !important; /* Above regular menus, shops, everything */
}

/* Custom Settings Panel */
.settings-panel {
    position: relative !important;
    background: rgba(8, 14, 24, 0.94) !important;
    border: 1px solid rgba(0, 240, 255, 0.3) !important;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.15), inset 0 0 15px rgba(0, 240, 255, 0.05) !important;
    width: 92% !important;
    max-width: 680px !important; /* Perfect desktop width */
    padding: 24px !important;
    border-radius: 16px !important;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.settings-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    width: 100%;
}

.settings-header .menu-title {
    font-size: 1.8rem;
    margin: 0;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
}

/* Responsive Two-Column Body */
.settings-body {
    display: flex;
    gap: 24px;
    width: 100%;
    text-align: left;
    box-sizing: border-box;
    max-height: 70vh;
    overflow-y: auto;
    padding-right: 6px;
}

/* Slim Neon Scrollbar */
.settings-body::-webkit-scrollbar {
    width: 4px;
}
.settings-body::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
.settings-body::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.35);
    border-radius: 4px;
    box-shadow: 0 0 5px rgba(0, 240, 255, 0.3);
}
.settings-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 240, 255, 0.6);
}

.settings-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0; /* Prevents overflow inside flex box */
}

/* Premium Cyberpunk Group Container */
.settings-group {
    background: rgba(5, 9, 16, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 12px;
    padding: 18px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.settings-group:hover {
    border-color: rgba(0, 240, 255, 0.12);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.group-label {
    display: block;
    font-size: 0.82rem;
    letter-spacing: 2px;
    font-weight: 900;
    margin-bottom: 4px;
    font-family: 'Orbitron', sans-serif;
}

/* Custom Control Row (Label + Control side-by-side or stacked) */
.settings-control-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.settings-control-row span {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Inter', sans-serif;
    font-weight: 500;
}

/* Premium Cyber Select Dropdowns */
.settings-select {
    width: 100%;
    background: rgba(4, 7, 13, 0.75);
    border: 1px solid rgba(0, 240, 255, 0.2);
    color: #fff;
    padding: 10px 14px;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.settings-select:focus, .settings-select:hover {
    border-color: #00f0ff;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.25), inset 0 0 6px rgba(0, 240, 255, 0.05);
}

.settings-select option {
    background: #060b13;
    color: #fff;
}

/* Toggle Switch Row */
.settings-toggle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    font-family: 'Inter', sans-serif;
}

.settings-toggle-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Custom Inline Select */
.inline-select {
    width: auto !important;
    padding: 5px 10px !important;
    font-size: 0.82rem !important;
    margin: 0 !important;
}

/* Premium Switch & Slider styles */
.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 22px;
    flex-shrink: 0;
}

.switch input { 
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(255, 255, 255, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.slider:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    bottom: 3px;
    background-color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
}

input:checked + .slider {
    background-color: rgba(0, 240, 255, 0.12);
    border-color: #00f0ff;
    box-shadow: 0 0 8px rgba(0, 240, 255, 0.2);
}

input:checked + .slider:before {
    transform: translateX(22px);
    background-color: #00f0ff;
    box-shadow: 0 0 5px #00f0ff;
}

/* Row for Install Button */
.install-row {
    border: none !important;
    padding: 6px 0 0 0 !important;
}

/* Premium Cyber Install Button */
.install-btn {
    width: 100% !important;
    font-family: 'Orbitron', sans-serif !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px !important;
    border-radius: 8px !important;
    border: 1px solid #00f0ff !important;
    color: #00f0ff !important;
    background: rgba(0, 240, 255, 0.05) !important;
    cursor: pointer;
    transition: all 0.3s ease;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.1);
    animation: installGlowPulse 2.5s infinite alternate;
}

.install-btn:hover {
    background: #00f0ff !important;
    color: #000 !important;
    text-shadow: none !important;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4) !important;
    transform: translateY(-1px);
}

.install-btn:active {
    transform: scale(0.98);
}

@keyframes installGlowPulse {
    0% { border-color: rgba(0, 240, 255, 0.35); box-shadow: 0 0 8px rgba(0, 240, 255, 0.08); }
    100% { border-color: rgba(0, 240, 255, 0.9); box-shadow: 0 0 16px rgba(0, 240, 255, 0.25); }
}

/* WIDESCREEN & DESKTOP: side-by-side columns */
@media (min-width: 769px) {
    .settings-panel {
        padding: 28px !important;
    }
}

/* LANDSCAPE MOBILE: Full-Screen Container with Compact, Scaled-Down Settings Controls */
@media (max-height: 580px) and (orientation: landscape) {
    .settings-panel {
        width: 96vw !important;
        max-width: 96vw !important;
        height: 92vh !important;
        max-height: 92vh !important;
        transform: none !important;
        padding: 10px 18px !important;
        margin: auto !important;
        display: flex !important;
        flex-direction: column !important;
        border-radius: 12px !important;
        box-sizing: border-box !important;
    }
    
    .settings-header {
        margin-bottom: 6px !important;
    }
    
    .settings-header .menu-title {
        font-size: 1.35rem !important;
        letter-spacing: 1.5px !important;
    }
    
    .settings-body {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 10px !important;
        height: calc(92vh - 45px) !important;
        max-height: calc(92vh - 45px) !important;
        overflow-y: auto !important;
        padding-right: 4px !important;
    }
    
    .settings-column {
        gap: 8px !important;
    }
    
    .settings-group {
        padding: 8px 12px !important;
        gap: 6px !important;
        border-radius: 8px !important;
        background: rgba(4, 12, 22, 0.92) !important;
        border: 1px solid rgba(0, 240, 255, 0.3) !important;
    }
    
    .group-label {
        font-size: 0.75rem !important;
        letter-spacing: 1.5px !important;
        margin-bottom: 2px !important;
    }
    
    .settings-control-row {
        gap: 4px !important;
    }
    
    .settings-control-row span, .settings-toggle-row {
        font-size: 0.78rem !important;
        padding: 2px 0 !important;
    }
    
    .settings-select {
        padding: 4px 8px !important;
        font-size: 0.78rem !important;
        height: 32px !important;
        border-radius: 6px !important;
    }
    
    .inline-select {
        padding: 2px 6px !important;
        font-size: 0.75rem !important;
        height: 26px !important;
    }
    
    .install-btn {
        padding: 5px 10px !important;
        font-size: 0.78rem !important;
        border-radius: 6px !important;
    }

    .switch {
        transform: scale(0.82) !important;
        transform-origin: center right !important;
    }
}

/* PORTRAIT MOBILE: single-column stacking with neon scrollbar */
@media (max-width: 580px) {
    .settings-panel {
        width: 90% !important;
        max-height: 85vh !important;
        padding: 18px !important;
    }
    
    .settings-header {
        margin-bottom: 14px !important;
    }
    
    .settings-header .menu-title {
        font-size: 1.5rem !important;
    }
    
    .settings-body {
        flex-direction: column !important;
        gap: 14px !important;
        max-height: 62vh !important;
        padding-right: 4px !important;
    }
    
    .settings-column {
        gap: 14px !important;
    }
    
    .settings-group {
        padding: 14px !important;
        gap: 10px !important;
    }
    
    .group-label {
        font-size: 0.78rem !important;
    }
    
    .settings-control-row span, .settings-toggle-row {
        font-size: 0.82rem !important;
    }
    
    .settings-select {
        padding: 8px 12px !important;
        font-size: 0.85rem !important;
    }
}

/* Custom Settings Button replacing mute */
.hud-settings-btn {
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1.5px solid rgba(0, 240, 255, 0.3);
    color: #00f0ff;
    width: 42px; height: 42px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    position: absolute; top: 20px; left: 20px; z-index: 1001;
    pointer-events: auto;
}

.hud-settings-btn:hover {
    background: rgba(0, 240, 255, 0.1); border-color: #00f0ff;
    transform: scale(1.05) rotate(45deg); /* Spin on hover! */
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.25);
}

.hud-settings-btn:active { transform: scale(0.92); }

@media (max-width: 768px) {
    .hud-settings-btn {
        width: 46px; height: 46px; font-size: 1.4rem;
        background: rgba(0, 0, 0, 0.6);
    }
}

/* ===== PWA Install Popup ===== */
.pwa-popup {
    position: fixed;
    bottom: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 400px;
    z-index: 9999;
    transition: bottom 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pwa-popup.show {
    bottom: 30px;
}

.pwa-popup-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: rgba(15, 15, 17, 0.95);
    border: 1px solid var(--blue-primary);
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 240, 255, 0.2);
    text-align: center;
}

.pwa-icon {
    width: 60px;
    height: 60px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(0, 240, 255, 0.5));
}

.pwa-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
}

.pwa-text p {
    margin: 0 0 1.2rem 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.pwa-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
}

.pwa-btn {
    flex: 1;
    padding: 0.7rem;
    border-radius: 8px;
    border: none;
    font-family: 'Orbitron', monospace;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pwa-btn.cancel {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--text-secondary);
}

.pwa-btn.cancel:hover {
    background: rgba(255,255,255,0.1);
    color: white;
}

.pwa-btn.install {
    background: var(--blue-primary);
    color: #000;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.4);
}

.pwa-btn.install:hover {
    background: #fff;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.6);
}

/* ===== META-PROGRESSION & MISSIONS ===== */
.meta-progression-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    margin: 0.8rem 0;
    padding: 0.8rem 1.2rem;
    background: rgba(0, 240, 255, 0.03);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 16px;
    width: 100%;
    box-sizing: border-box;
}

.meta-stats-col {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
    flex-wrap: wrap;
}

.meta-coins {
    font-size: 1.4rem;
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cyber-btn-small {
    background: linear-gradient(135deg, rgba(127, 0, 255, 0.15) 0%, rgba(255, 0, 127, 0.15) 100%);
    color: #ff007f;
    border: 2px solid #ff007f;
    padding: 0.6rem 1.4rem;
    border-radius: 12px;
    font-family: 'Orbitron', monospace;
    font-weight: 900;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.3);
    text-shadow: 0 0 8px rgba(255, 0, 127, 0.6);
    letter-spacing: 1px;
}

.cyber-btn-small:hover {
    background: linear-gradient(135deg, #7f00ff 0%, #ff007f 100%);
    color: #ffffff;
    border-color: #ffffff;
    box-shadow: 0 0 25px rgba(255, 0, 127, 0.6), 0 0 10px rgba(127, 0, 255, 0.4);
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
    transform: translateY(-3px) scale(1.03);
}

.cyber-btn-small:active {
    transform: translateY(-1px) scale(0.98);
}

/* Hide the main GOATING title when Game Over is active to clear vertical space */
.game-menu-overlay:not(.start-active) .menu-title-wrapper {
    display: none !important;
}

/* Dynamically position the Progression panel as a beautiful centered capsule on Game Over */
.game-menu-overlay:not(.start-active) .meta-progression-panel {
    position: relative;
    top: auto;
    right: auto;
    margin: 0 auto 1.5rem auto;
    padding: 0.5rem 1.2rem;
    background: rgba(5, 12, 20, 0.85);
    border: 1px solid rgba(255, 0, 255, 0.4);
    border-radius: 14px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), 0 0 15px rgba(255, 0, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    animation: floatBadgeIn 0.5s ease-out;
    z-index: 210;
    width: fit-content;
    box-sizing: border-box;
}

@keyframes floatBadgeIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.game-menu-overlay:not(.start-active) .meta-coins {
    font-size: 1.1rem;
}

.game-menu-overlay:not(.start-active) .cyber-btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

.game-menu-overlay:not(.start-active):not(.gameover-active) .missions-container {
    display: none !important;
}

.missions-container {
    width: 100%;
    max-width: 460px;
    margin: 0.5rem auto 1.5rem auto;
    padding: 1.2rem;
    background: rgba(0, 240, 255, 0.02);
    border: 1px solid rgba(0, 240, 255, 0.12);
    border-radius: 18px;
    box-shadow: inset 0 0 20px rgba(0, 240, 255, 0.02);
}

.missions-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--blue-primary);
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.4);
    margin-bottom: 0.8rem;
    text-transform: uppercase;
    text-align: center;
}

.mission-list {
    display: flex;
    flex-direction: row;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
}

.mission-item {
    flex: 1;
    min-width: 120px;
    background: linear-gradient(135deg, rgba(12, 22, 28, 0.9) 0%, rgba(6, 12, 16, 0.8) 100%);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-left: 3px solid var(--blue-primary);
    border-radius: 10px;
    padding: 0.6rem;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.mission-item:hover {
    border-color: rgba(0, 240, 255, 0.4);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.1);
    transform: translateY(-2px);
}

.mission-item::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.1), transparent);
    transform: skewX(-20deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { left: -100%; }
    20% { left: 200%; }
    100% { left: 200%; }
}

.mission-desc {
    font-size: 0.7rem;
    line-height: 1.25;
    margin-bottom: 0.5rem;
    color: #e0e6ed;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    z-index: 1;
}

.mission-item.completed {
    border-left-color: #32D74B;
    border-color: rgba(50, 215, 75, 0.3);
    background: linear-gradient(135deg, rgba(6, 28, 12, 0.9) 0%, rgba(3, 14, 6, 0.8) 100%);
}

.mission-item.completed .mission-desc {
    color: #c2ffd0;
    text-shadow: 0 0 5px rgba(50, 215, 75, 0.2);
}

.mission-item.completed::before {
    background: linear-gradient(90deg, transparent, rgba(50, 215, 75, 0.15), transparent);
}

.mission-progress-bar {
    width: 100%;
    height: 5px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.05);
    margin-top: 3px;
    position: relative;
    z-index: 1;
}

.mission-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c6ff, #0072ff);
    box-shadow: 0 0 8px rgba(0, 198, 255, 0.6);
    width: 0%;
    transition: width 1s cubic-bezier(0.4, 0, 0.2, 1);
}

.mission-item.completed .mission-progress-fill {
    background: linear-gradient(90deg, #32D74B, #00FF87);
    box-shadow: 0 0 8px rgba(50, 215, 75, 0.6);
}

/* Shop and Settings styling overhaul */
.settings-modal .glass-panel {
    background: rgba(6, 12, 20, 0.92);
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 20px 50px rgba(0, 240, 255, 0.15);
}

.shop-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 240, 255, 0.02);
    border: 1px solid rgba(0, 240, 255, 0.1);
    padding: 0.8rem 1rem;
    margin-bottom: 0.8rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.shop-item:hover {
    border-color: rgba(0, 240, 255, 0.35);
    background: rgba(0, 240, 255, 0.04);
    box-shadow: 0 4px 15px rgba(0, 240, 255, 0.05);
}

.shop-item-info h4 {
    margin: 0 0 0.2rem 0;
    color: #ffffff;
    font-size: 0.95rem;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 1px;
}

.shop-item-info p {
    margin: 0;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}

.shop-item-level {
    font-size: 0.65rem;
    color: var(--blue-primary);
    margin-top: 0.2rem;
    font-weight: 700;
}

.shop-item-buy {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.btn-buy {
    background: linear-gradient(135deg, #00f0ff 0%, #0072ff 100%);
    color: #000000;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.25s ease;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.3);
    margin-top: 0.3rem;
}

.btn-buy:hover:not(:disabled) {
    background: #ffffff;
    color: #000000;
    box-shadow: 0 0 15px rgba(255,255,255,0.7);
    transform: translateY(-2px);
}

.btn-buy:disabled {
    background: #2a2d32;
    color: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: none;
    cursor: not-allowed;
}

.shop-item-cost {
    font-weight: 900;
    color: #ffd700;
    font-size: 0.85rem;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.3);
}

/* ===== DECIPHERED DATABASE / LORE ARCHIVE TERMINAL UI ===== */
.lore-entry-card {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: linear-gradient(135deg, rgba(8, 14, 26, 0.95) 0%, rgba(12, 22, 38, 0.95) 100%) !important;
    border: 1px solid rgba(0, 240, 255, 0.25) !important;
    border-radius: 12px !important;
    padding: 14px 16px !important;
    margin-bottom: 14px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), inset 0 0 15px rgba(0, 240, 255, 0.03) !important;
    transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}

.lore-entry-card:hover {
    border-color: rgba(0, 240, 255, 0.5) !important;
    box-shadow: 0 6px 24px rgba(0, 240, 255, 0.12), inset 0 0 20px rgba(0, 240, 255, 0.06) !important;
}

.lore-entry-card.locked {
    border-color: rgba(255, 0, 127, 0.25) !important;
    background: linear-gradient(135deg, rgba(16, 10, 20, 0.9) 0%, rgba(24, 12, 28, 0.9) 100%) !important;
}

.lore-entry-card.locked:hover {
    border-color: rgba(255, 0, 127, 0.5) !important;
    box-shadow: 0 6px 24px rgba(255, 0, 127, 0.12) !important;
}

.lore-header-row {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 10px !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.lore-title-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-wrap: wrap !important;
}

.lore-title {
    margin: 0 !important;
    font-family: 'Orbitron', monospace, sans-serif !important;
    font-size: clamp(0.85rem, 2.4vw, 1.02rem) !important;
    font-weight: 800 !important;
    letter-spacing: 0.8px !important;
    color: #00ffff !important;
    text-shadow: 0 0 10px rgba(0, 240, 255, 0.4) !important;
}

.lore-entry-card.locked .lore-title {
    color: #a1a1aa !important;
    text-shadow: none !important;
}

.lore-badge-unlocked {
    display: inline-flex !important;
    align-items: center !important;
    font-family: 'Orbitron', monospace !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    background: rgba(50, 215, 75, 0.15) !important;
    color: #32d74b !important;
    border: 1px solid rgba(50, 215, 75, 0.6) !important;
    text-shadow: 0 0 6px rgba(50, 215, 75, 0.4) !important;
    letter-spacing: 1px !important;
    white-space: nowrap !important;
}

.lore-badge-locked {
    display: inline-flex !important;
    align-items: center !important;
    font-family: 'Orbitron', monospace !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    padding: 3px 8px !important;
    border-radius: 4px !important;
    background: rgba(255, 59, 48, 0.15) !important;
    color: #ff3b30 !important;
    border: 1px solid rgba(255, 59, 48, 0.6) !important;
    letter-spacing: 1px !important;
    white-space: nowrap !important;
}

.lore-content-terminal {
    width: 100% !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    font-family: 'Fira Code', 'Courier New', monospace !important;
    font-size: clamp(0.75rem, 1.8vw, 0.83rem) !important;
    line-height: 1.6 !important;
    color: #e2e8f0 !important;
    background: rgba(3, 8, 16, 0.85) !important;
    border: 1px solid rgba(0, 240, 255, 0.18) !important;
    border-left: 4px solid #00f0ff !important;
    border-radius: 8px !important;
    padding: 12px 14px !important;
    word-break: break-word !important;
}

.lore-locked-body {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    gap: 12px !important;
}

.lore-locked-desc {
    margin: 0 !important;
    font-family: 'Fira Code', monospace !important;
    font-size: clamp(0.72rem, 1.7vw, 0.8rem) !important;
    color: #94a3b8 !important;
    line-height: 1.4 !important;
}

.lore-buy-action {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    gap: 6px !important;
    flex-shrink: 0 !important;
}

.lore-cost-tag {
    font-family: 'Orbitron', monospace !important;
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    color: #ffd700 !important;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.4) !important;
    white-space: nowrap !important;
}

.close-game-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(0, 240, 255, 0.05);
    border: 1px solid rgba(0, 240, 255, 0.25);
    color: #00f0ff;
    font-size: 1.5rem;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10001;
    transition: all 0.25s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.close-game-btn:hover {
    background: rgba(255, 69, 58, 0.15);
    border-color: #FF453A;
    color: #FF453A;
    box-shadow: 0 0 15px rgba(255, 69, 58, 0.4);
    transform: scale(1.05);
}

/* Responsive Mobile Overrides */
@media (max-width: 768px) {
    .game-menu-overlay {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        padding: 16px 0 !important;
    }

    .glass-panel {
        padding: 1rem 1.2rem;
        border-radius: 20px;
        max-width: 92%;
        margin: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .game-menu-overlay.start-active .menu-title:not(.gameover-text) {
        font-size: 2.5rem;
        letter-spacing: 2px;
        margin: 0.3rem 0;
    }

    .hero-goat-img-wrap {
        display: none !important;
    }

    .hero-goat-img {
        max-height: 95px;
        max-width: 95px;
    }

    .meta-progression-panel {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0.6rem 0.8rem;
        gap: 0.6rem;
        border-radius: 12px;
        margin: 0.5rem 0;
    }

    .meta-stats-col {
        align-items: center;
        width: 100%;
    }

    .meta-coins {
        font-size: 1.1rem;
    }

    .cyber-btn-small {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
        border-radius: 10px;
    }

    .user-profile-panel {
        margin-top: 8px !important;
        margin-bottom: 3px !important;
        padding-top: 8px !important;
    }

    .menu-tabs {
        margin: 0.4rem auto 0.3rem auto !important;
    }

    .missions-container {
        padding: 0.6rem;
        border-radius: 14px;
        margin: 0.3rem auto 0.6rem auto;
    }

    .missions-title {
        font-size: 0.75rem;
        margin-bottom: 0.4rem;
    }

    .mission-list {
        gap: 0.4rem;
    }

    .mission-item {
        padding: 0.5rem;
        min-width: 100px;
        border-radius: 8px;
    }

    .mission-desc {
        font-size: 0.65rem;
        margin-bottom: 0.3rem;
    }

    .pulse-text {
        font-size: 0.95rem;
        margin: 0.6rem 0 0.2rem 0;
        letter-spacing: 2px;
    }

    /* Game Over Mobile */
    .menu-title.gameover-text {
        font-size: 2rem;
        margin-bottom: 0.6rem;
    }

    .stats-grid {
        gap: 0.6rem;
        margin: 0.6rem 0;
    }

    .stat-box {
        padding: 0.5rem 0.6rem;
        border-radius: 12px;
    }

    .cyber-nickname-container {
        margin-top: 10px;
        padding: 0.5rem;
    }

    .cyber-input {
        margin: 4px auto;
        font-size: 1.1rem !important;
        padding: 4px 8px;
        width: 140px;
    }

    .stat-box label {
        font-size: 0.65rem;
        letter-spacing: 1px;
    }

    .stat-box span {
        font-size: 1.5rem;
    }

    .new-record-badge {
        padding: 0.4rem 1.4rem;
        font-size: 0.75rem;
        margin-bottom: 1rem;
    }

    /* Game Over panel placement centered on mobile to avoid overlapping */
    .game-menu-overlay:not(.start-active) .meta-progression-panel {
        top: auto;
        right: auto;
        margin: 0 auto 1rem auto;
        padding: 0.4rem 0.7rem;
        border-radius: 10px;
        gap: 0.6rem;
    }

    .game-menu-overlay:not(.start-active) .meta-coins {
        font-size: 0.9rem;
    }

    .game-menu-overlay:not(.start-active) .cyber-btn-small {
        padding: 0.4rem 0.7rem;
        font-size: 0.7rem;
        border-radius: 8px;
    }
}

/* Specific Height Overrides for Landscape or Extra Small Phones */
@media (max-height: 720px) {
    .glass-panel {
        padding: 0.8rem 1rem;
        border-radius: 16px;
        max-height: 92vh;
    }

    .game-menu-overlay.start-active .menu-title:not(.gameover-text) {
        font-size: 1.8rem;
        margin: 0.1rem 0;
    }

    .hero-goat-img-wrap {
        display: none !important; /* Hide character entirely if display is very short */
    }

    .meta-progression-panel {
        margin: 0.3rem 0;
        padding: 0.3rem 0.6rem;
    }

    .missions-container {
        margin: 0.3rem auto 0.6rem auto;
        padding: 0.5rem;
    }

    .mission-desc {
        font-size: 0.6rem;
        margin-bottom: 0.2rem;
    }

    .stats-grid {
        margin: 0.5rem 0;
        gap: 0.6rem;
    }

    .stat-box {
        padding: 0.5rem;
    }

    .stat-box span {
        font-size: 1.2rem;
    }

    .pulse-text {
        font-size: 0.9rem;
        margin: 0.5rem 0 0 0;
    }
}

/* CRT SCREEN EFFECTS */
.crt-effects-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    pointer-events: none;
    overflow: hidden;
    display: none;
}

/* When active, show the effects */
.crt-enabled .crt-effects-container {
    display: block;
}

.crt-scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        rgba(18, 16, 16, 0) 50%, 
        rgba(0, 0, 0, 0.25) 50%
    );
    background-size: 100% 4px;
    z-index: 11;
}

.crt-flicker {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(18, 16, 16, 0.02);
    opacity: 0.15;
    z-index: 12;
    animation: crt-flicker-anim 0.15s infinite;
}

@keyframes crt-flicker-anim {
    0% { opacity: 0.15; }
    50% { opacity: 0.18; }
    100% { opacity: 0.14; }
}

.crt-curve {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.8),
                inset 0 0 20px rgba(0, 240, 255, 0.2);
    background: radial-gradient(circle at center, transparent 60%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 13;
}

/* Subtle chromatic aberration on canvas under crt mode */
.crt-enabled .dino-canvas {
    animation: crt-chromatic 3s infinite alternate;
}

@keyframes crt-chromatic {
    0% {
        text-shadow: 0.5px 0 0 rgba(255,0,0,0.5), -0.5px 0 0 rgba(0,0,255,0.5);
        filter: contrast(1.05) brightness(1.02);
    }
    100% {
        text-shadow: -0.5px 0 0 rgba(255,0,0,0.5), 0.5px 0 0 rgba(0,0,255,0.5);
        filter: contrast(1) brightness(1);
    }
}

/* LEADERBOARD & NICKNAME STYLES */
.leaderboard-container {
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(0, 240, 255, 0.15);
    border-radius: 14px;
    padding: 0.8rem;
    width: 90%;
    max-width: 320px;
    margin: 0.6rem auto;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5), inset 0 0 10px rgba(0, 240, 255, 0.05);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.leaderboard-title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.8rem;
    font-weight: 900;
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
    letter-spacing: 2px;
    text-align: center;
    margin-bottom: 0.6rem;
    border-bottom: 1px dashed rgba(0, 240, 255, 0.2);
    padding-bottom: 0.4rem;
}

.leaderboard-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    max-height: 240px;
    overflow-y: auto;
    padding-right: 4px;
}

/* Custom scrollbar for leaderboard list */
.leaderboard-list::-webkit-scrollbar {
    width: 4px;
}
.leaderboard-list::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.1);
}
.leaderboard-list::-webkit-scrollbar-thumb {
    background: rgba(0, 240, 255, 0.4);
    border-radius: 2px;
}

.leaderboard-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.6rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
}

.leaderboard-item:hover {
    background: rgba(0, 240, 255, 0.05);
    border-color: rgba(0, 240, 255, 0.2);
}

.leaderboard-item.highlight {
    background: rgba(255, 0, 127, 0.08);
    border-color: rgba(255, 0, 127, 0.4);
    box-shadow: 0 0 8px rgba(255, 0, 127, 0.15);
}

.leaderboard-rank {
    font-weight: 900;
    width: 20px;
    color: #fff;
    opacity: 0.8;
}

.leaderboard-item:nth-child(1) .leaderboard-rank {
    color: #ffe700;
    text-shadow: 0 0 5px rgba(255, 231, 0, 0.8);
    font-size: 0.85rem;
}

.leaderboard-item:nth-child(2) .leaderboard-rank {
    color: #d1d1d1;
    text-shadow: 0 0 5px rgba(209, 209, 209, 0.8);
}

.leaderboard-item:nth-child(3) .leaderboard-rank {
    color: #c97d3e;
    text-shadow: 0 0 5px rgba(201, 125, 62, 0.8);
}

.leaderboard-name {
    flex-grow: 1;
    margin-left: 0.5rem;
    color: #e0e0e0;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.leaderboard-item.highlight .leaderboard-name {
    color: #ff007f;
    text-shadow: 0 0 5px rgba(255, 0, 127, 0.5);
    font-weight: bold;
}

.leaderboard-score {
    font-weight: 700;
    color: #39ff14;
    text-shadow: 0 0 5px rgba(57, 255, 20, 0.4);
}

/* NICKNAME ARCADE WRAPPER */
.cyber-nickname-container {
    background: rgba(255, 0, 127, 0.03);
    border: 1px solid rgba(255, 0, 127, 0.2);
    border-radius: 12px;
    padding: 0.8rem;
    box-shadow: inset 0 0 10px rgba(255, 0, 127, 0.05);
    margin-top: 15px;
    text-align: center;
    animation: neon-pulsing 2s infinite alternate;
}

@keyframes neon-pulsing {
    0% { border-color: rgba(255, 0, 127, 0.2); }
    100% { border-color: rgba(255, 0, 127, 0.4); }
}

.cyber-input {
    background: rgba(0, 0, 0, 0.6) !important;
    border: 2px solid #ff007f !important;
    border-radius: 8px;
    color: #fff !important;
    font-family: 'Orbitron', sans-serif !important;
    font-size: 1.2rem !important;
    padding: 6px 12px;
    text-align: center;
    text-transform: uppercase;
    width: 150px;
    margin: 8px auto;
    display: block;
    outline: none;
    box-shadow: 0 0 10px rgba(255, 0, 127, 0.2);
    text-shadow: 0 0 5px #ff007f;
    transition: all 0.3s ease;
}

.cyber-input:focus {
    box-shadow: 0 0 15px rgba(255, 0, 127, 0.5), inset 0 0 5px rgba(255, 0, 127, 0.3);
    border-color: #ff00af !important;
}

/* Mobile responsivity overrides for leaderboard */
@media (max-width: 768px) {
    .leaderboard-container {
        padding: 0.6rem;
        margin: 0.4rem auto;
        max-width: 280px;
    }
    .leaderboard-list {
        max-height: 160px;
    }
    .leaderboard-item {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* TABS FOR MENU SECTIONS - 2x2 Cyberpunk Grid */
.menu-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.45rem;
    margin: 0.6rem auto 0.4rem auto;
    width: 100%;
    max-width: 480px;
    z-index: 10;
}

.tab-btn {
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #8899a6;
    padding: 0.45rem 0.6rem;
    border-radius: 10px;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 1px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    backdrop-filter: blur(5px);
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    white-space: nowrap;
}

.tab-btn:hover {
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
}

.tab-btn.active, .tab-btn#tab-btn-missions.active {
    background: rgba(0, 240, 255, 0.08);
    border-color: #00f0ff;
    color: #00f0ff;
    box-shadow: 0 0 12px rgba(0, 240, 255, 0.4), inset 0 0 8px rgba(0, 240, 255, 0.1);
    text-shadow: 0 0 5px rgba(0, 240, 255, 0.6);
}

.tab-btn#tab-btn-multiplayer.active {
    background: rgba(255, 0, 127, 0.08);
    border-color: #ff007f;
    color: #ff007f;
    box-shadow: 0 0 12px rgba(255, 0, 127, 0.4), inset 0 0 8px rgba(255, 0, 127, 0.1);
    text-shadow: 0 0 5px rgba(255, 0, 127, 0.6);
}

.tab-btn#tab-btn-leaderboard.active {
    background: rgba(255, 170, 0, 0.08);
    border-color: #ffaa00;
    color: #ffaa00;
    box-shadow: 0 0 12px rgba(255, 170, 0, 0.4), inset 0 0 8px rgba(255, 170, 0, 0.1);
    text-shadow: 0 0 5px rgba(255, 170, 0, 0.6);
}

.tab-btn#tab-btn-guestbook.active {
    background: rgba(0, 255, 102, 0.08);
    border-color: #00ff66;
    color: #00ff66;
    box-shadow: 0 0 12px rgba(0, 255, 102, 0.4), inset 0 0 8px rgba(0, 255, 102, 0.1);
    text-shadow: 0 0 5px rgba(0, 255, 102, 0.6);
}

.tab-btn:active {
    transform: translateY(0);
}

/* Ensure hidden elements are completely collapsed and not occupying layout space */
.missions-container.hidden,
.leaderboard-container.hidden {
    display: none !important;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .menu-tabs {
        max-width: 320px;
        gap: 0.5rem;
    }
    .tab-btn {
        padding: 0.4rem 0.6rem;
        font-size: 0.7rem;
        border-radius: 8px;
    }
}

/* Hide tabs and panels when not start-active (e.g. gameplay or gameover) */
.game-menu-overlay:not(.start-active):not(.gameover-active) .menu-tabs {
    display: none !important;
}

.game-menu-overlay:not(.start-active):not(.gameover-active) .leaderboard-container {
    display: none !important;
}

/* Specific Height Overrides for Landscape or Extra Small Phones - v70 */
@media (max-height: 720px) {
    .leaderboard-container {
        margin: 0.3rem auto 0.6rem auto;
        padding: 0.5rem;
        max-width: 280px;
    }
    .leaderboard-list {
        max-height: 110px;
    }
}

/* ==========================================================================
   MUSIC HUD WIDGET STYLES (v94)
   ========================================================================== */
.music-hud-widget {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(10, 20, 30, 0.65);
    border: 1px solid rgba(0, 240, 255, 0.2);
    border-radius: 12px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(0, 240, 255, 0.05);
    z-index: 100;
    cursor: pointer;
    user-select: none;
    pointer-events: auto;
    overflow: hidden;
    width: 240px;
    max-width: 240px;
    height: 46px;
    box-sizing: border-box;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: floatInMusicWidget 0.5s ease-out;
}

.music-hud-widget .music-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.4s ease;
    max-width: 200px;
    opacity: 1;
    overflow: hidden;
    white-space: nowrap;
}

/* Collapsed state: shrinks to a beautiful glowing circular music button */
.music-hud-widget.collapsed {
    max-width: 46px !important;
    width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    gap: 0 !important;
    justify-content: center !important;
    border-radius: 50% !important;
    border-color: rgba(0, 240, 255, 0.4) !important;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2) !important;
}

.music-hud-widget.collapsed .music-info {
    max-width: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    pointer-events: none;
}

.music-hud-widget:hover {
    border-color: rgba(0, 240, 255, 0.55);
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.3), inset 0 0 10px rgba(0, 240, 255, 0.1);
    transform: translateY(-2px);
}

.music-hud-widget:active {
    transform: scale(0.95);
}

.music-hud-widget.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(15px);
}

/* Premium Muted State Styles */
.music-hud-widget.muted {
    opacity: 0.55;
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.music-hud-widget.muted:hover {
    opacity: 0.8;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.music-hud-widget.muted .eq-bar {
    background-color: #555;
    box-shadow: none;
    animation-play-state: paused !important;
}

.music-hud-widget.muted .music-track-name {
    color: #888;
    text-shadow: none;
}

.music-hud-widget.collapsed.muted {
    border-color: rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.1) !important;
}

@keyframes floatInMusicWidget {
    from { transform: translateY(15px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Equalizer Bars Animation */
.music-equalizer {
    display: flex;
    align-items: flex-end;
    gap: 3px;
    width: 20px;
    height: 18px;
}

.eq-bar {
    width: 3px;
    height: 15%; /* Default flat/low state when muted/paused */
    background-color: #00f0ff;
    border-radius: 1px;
    box-shadow: 0 0 5px #00f0ff;
    transition: height 0.35s ease, opacity 0.3s ease;
}

/* Only run smooth hardware-accelerated GPU animations when BGM is actively playing */
.music-hud-widget.playing .eq-bar {
    animation: eq-bounce 2.2s ease-in-out infinite alternate;
}

.music-hud-widget.playing .eq-bar:nth-child(1) { animation-duration: 1.4s; animation-delay: 0.1s; }
.music-hud-widget.playing .eq-bar:nth-child(2) { animation-duration: 1.9s; animation-delay: 0.3s; }
.music-hud-widget.playing .eq-bar:nth-child(3) { animation-duration: 1.6s; animation-delay: 0.2s; }
.music-hud-widget.playing .eq-bar:nth-child(4) { animation-duration: 2.1s; animation-delay: 0.0s; }

/* Keep flat/inactive if muted */
.music-hud-widget.muted .eq-bar {
    height: 15% !important;
    animation: none !important;
    opacity: 0.5;
}

/* Completely disable animations in Potato & Super Potato modes (perfLevel >= 3) to optimize battery */
.perf-level-3 .music-hud-widget .eq-bar,
.perf-level-4 .music-hud-widget .eq-bar {
    animation: none !important;
    height: 15% !important;
}

/* Disable eq-bar animations in Stability mode (perfLevel 2) */
.perf-level-2 .music-hud-widget .eq-bar {
    animation: none !important;
    height: 15% !important;
}

/* On mobile: always freeze eq-bars regardless of perf level */
@media (max-width: 768px) {
    .music-hud-widget .eq-bar {
        animation: none !important;
        height: 15% !important;
    }
    .music-hud-widget {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

@keyframes eq-bounce {
    0% { height: 15%; }
    100% { height: 100%; }
}

.music-info {
    display: flex;
    flex-direction: column;
    font-family: 'Orbitron', sans-serif;
    text-align: left;
}

.music-track-label {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.45);
    letter-spacing: 1.5px;
    font-weight: 700;
}

.music-track-name {
    font-size: 0.75rem;
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
    font-weight: 900;
    letter-spacing: 0.5px;
}

/* Responsivity for smaller devices */
@media (max-width: 768px) {
    .music-hud-widget {
        top: 20px;
        left: 80px;
        bottom: auto;
        padding: 6px 10px;
        gap: 8px;
        width: 220px;
        max-width: 220px;
        height: 46px;
        box-sizing: border-box;
    }
    .music-track-label {
        font-size: 0.5rem;
    }
    .music-track-name {
        font-size: 0.65rem;
    }
}

/* LANDSCAPE MOBILE SCREEN ZOOM REDUCTION & SCROLL OPTIMIZATION (v118) */
@media (max-width: 980px) and (orientation: landscape) {
    /* Scale individual HUD components instead of scaling the container to keep edges perfectly snapped */
    .hud-top .hud-right {
        transform: scale(0.85) !important;
        transform-origin: top right !important;
        margin-top: 10px !important;
        margin-right: 10px !important;
    }

    .hud-top .hud-left {
        transform: scale(0.8) !important;
        transform-origin: top left !important;
        top: 60px !important;
        left: 20px !important;
    }

    /* Reposition and fix bottom HUD (powerups + coins) in landscape mobile */
    .hud-bottom {
        transform: none !important; /* Remove container scale completely */
        width: 100% !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        margin-bottom: 0 !important;
        box-sizing: border-box !important;
        padding-left: max(20px, env(safe-area-inset-left, 20px)) !important;
        padding-right: max(20px, env(safe-area-inset-right, 20px)) !important;
    }

    /* Scale individual bottom components to keep them clean and unshifted */
    .hud-powerups-list {
        transform: scale(0.8) !important;
        transform-origin: bottom left !important;
        margin-bottom: 0 !important;
        display: flex !important;
        gap: 6px !important;
    }

    .hud-bottom .hud-right {
        transform: scale(0.85) !important;
        transform-origin: bottom right !important;
        margin-bottom: 0 !important;
        margin-right: 10px !important;
    }

    /* Keep settings button compact and aligned */
    .hud-settings-btn {
        transform: scale(0.8) !important;
        top: 10px !important;
        left: 10px !important;
    }

    /* Keep music widget compact and aligned */
    .music-hud-widget {
        transform: scale(0.8) !important;
        transform-origin: top left !important;
        top: 10px !important;
        left: 70px !important;
    }

    /* Full-Screen Menu & Shop Overlays in Landscape Mobile */
    .game-menu-overlay {
        align-items: center !important;
        justify-content: center !important;
        padding: 0 !important;
        overflow: hidden !important;
    }

    /* Expand glass panel overlays (Menu & Shop) to Full Screen */
    .game-menu-overlay .glass-panel {
        width: 98vw !important;
        max-width: 98vw !important;
        height: 96vh !important;
        max-height: 96vh !important;
        transform: none !important;
        margin: auto !important;
        padding: 14px 20px !important;
        border-radius: 14px !important;
        box-shadow: 0 0 30px rgba(0, 240, 255, 0.25) !important;
        box-sizing: border-box !important;
    }

    /* Make text and padding within menu panel more compact in landscape mobile */
    .menu-title {
        font-size: 1.8rem !important;
    }
    
    .pulse-text {
        margin: 0.5rem 0 !important;
        font-size: 0.88rem !important;
    }
}

/* ===== Anti-Cheat Cyber Toast Overlay ===== */
.cyber-anticheat-toast {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(-50px);
    background: rgba(5, 5, 8, 0.85);
    backdrop-filter: blur(12px) saturate(180%);
    -webkit-backdrop-filter: blur(12px) saturate(180%);
    border: 1px solid rgba(0, 240, 255, 0.3);
    box-shadow: 0 0 20px rgba(0, 240, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 999999;
    font-family: 'Orbitron', 'Fira Code', monospace;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #00f0ff;
    text-shadow: 0 0 8px rgba(0, 240, 255, 0.6);
    pointer-events: none;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    animation: anticheatSlideIn 4s forwards ease-in-out;
}

.cyber-anticheat-toast .shield-icon {
    font-size: 1.1rem;
    animation: pulseShield 1.5s infinite ease-in-out;
}

.cyber-anticheat-toast .toast-text {
    background: linear-gradient(90deg, #00f0ff 0%, #00ff66 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

@keyframes anticheatSlideIn {
    0% {
        transform: translateX(-50%) translateY(-50px);
        opacity: 0;
    }
    10% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
    85% {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
        filter: blur(0);
    }
    100% {
        transform: translateX(-50%) translateY(-30px);
        opacity: 0;
        filter: blur(4px);
    }
}

@keyframes pulseShield {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px #00f0ff);
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 8px #00ff66);
    }
}

/* ===== Firebase & Google Profile Panel Styles ===== */
.user-profile-panel {
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    padding: 10px;
    transition: all 0.3s ease;
}

.user-profile-panel:hover {
    background: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.02);
}

.google-btn {
    background: rgba(66, 133, 244, 0.08) !important;
    border: 1px solid rgba(66, 133, 244, 0.4) !important;
    color: #4285F4 !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.google-btn:hover {
    background: rgba(66, 133, 244, 0.18) !important;
    border-color: #4285F4 !important;
    box-shadow: 0 0 15px rgba(66, 133, 244, 0.4) !important;
    transform: translateY(-2px);
}

.google-btn:active {
    transform: translateY(1px);
}

.btn-google-icon {
    margin-right: 6px;
    font-size: 0.9rem;
    vertical-align: middle;
}

.guest-notice {
    letter-spacing: 0.5px;
    opacity: 0.7;
    animation: pulseNotice 2s infinite alternate ease-in-out;
}

@keyframes pulseNotice {
    0% { opacity: 0.5; }
    100% { opacity: 0.85; }
}

.logout-btn {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logout-btn:hover {
    background: rgba(255, 0, 85, 0.15) !important;
    border-color: #ff0055 !important;
    box-shadow: 0 0 12px rgba(255, 0, 85, 0.4) !important;
    transform: scale(1.05);
}

.logout-btn:active {
    transform: scale(0.95);
}

.user-info {
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-info:hover {
    opacity: 0.85;
}

.user-avatar {
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.3);
    animation: pulseAvatar 3s infinite ease-in-out;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.user-avatar:hover {
    transform: rotate(360deg) scale(1.1);
}

@keyframes pulseAvatar {
    0%, 100% { border-color: #00ff66; box-shadow: 0 0 8px rgba(0, 255, 102, 0.3); }
    50% { border-color: #00f0ff; box-shadow: 0 0 15px rgba(0, 240, 255, 0.5); }
}

/* Custom PWA nickname input styling */
#pwa-nickname-input:focus {
    border-color: #00ff66 !important;
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.3) !important;
}

/* Claimable completed mission styles (v130) */
.mission-item.unclaimed-claimable {
    animation: claimableGlow 1.5s infinite alternate ease-in-out;
    transition: all 0.2s ease;
    cursor: pointer;
}
.mission-item.unclaimed-claimable:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(0, 255, 102, 0.4);
    background: rgba(0, 255, 102, 0.08) !important;
}
@keyframes claimableGlow {
    0% { border-color: rgba(0, 255, 102, 0.3); box-shadow: 0 0 5px rgba(0, 255, 102, 0.1); }
    100% { border-color: rgba(0, 255, 102, 0.8); box-shadow: 0 0 15px rgba(0, 255, 102, 0.35); }
}
/* -- PERFORMANCE: disable backdrop-filter on Stability / Potato / Super-Potato -- */
/* Applied via JS-managed body classes: perf-level-2, perf-level-3, perf-level-4  */
.perf-level-2 *,
.perf-level-3 *,
.perf-level-4 * {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Also kill it on narrow/mobile screens where the GPU can't sustain blur compositing */
@media (max-width: 900px) {
    * {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }
}

/* ===== Holographic Level Up Visual Styles (v152) ===== */
.lvlup-toast.active {
    opacity: 1 !important;
    transform: translate(-50%, -50%) scale(1.1) !important;
}

.player-rank-card {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.player-rank-card:hover {
    border-color: rgba(0, 240, 255, 0.4) !important;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25) !important;
}

/* ==========================================================================
   SUPER GRAPHIC OPTIMIZATION FOR MOBILE (v155)
   ========================================================================== */
@media (max-width: 768px) {
    /* 1. Viewport / Scrollbar settings for the overlay - Restore smooth page scrolling */
    .game-menu-overlay {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: flex-start !important; /* Start from top to scroll down */
        overflow-y: auto !important; /* Enable native page scroll */
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch;
        padding-top: calc(max(16px, env(safe-area-inset-top, 16px)) + 50px) !important;
        padding-bottom: max(24px, env(safe-area-inset-bottom, 24px)) !important;
        padding-left: max(12px, env(safe-area-inset-left, 12px)) !important;
        padding-right: max(12px, env(safe-area-inset-right, 12px)) !important;
        height: 100% !important; /* Fixed height relative to viewport to activate scrollbar */
        box-sizing: border-box !important;
    }
    
    .game-menu-overlay::-webkit-scrollbar {
        width: 5px !important;
        display: block !important;
    }
    .game-menu-overlay::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.3) !important;
    }
    .game-menu-overlay::-webkit-scrollbar-thumb {
        background: rgba(0, 240, 255, 0.3) !important;
        border-radius: 3px !important;
        box-shadow: 0 0 8px rgba(0, 240, 255, 0.45) !important;
    }

    /* 2. Glass Panel Layout - Let it grow naturally to prevent overlaps and squishing */
    .glass-panel {
        padding: 1rem 1.2rem !important;
        border-radius: 20px !important;
        max-width: 93% !important;
        margin: 12px auto !important;
        box-sizing: border-box !important;
        max-height: none !important; /* No height restriction to prevent bugs */
        overflow: visible !important;
        transform: none !important;
        display: block !important; /* Restore default display block */
    }

    /* Prevent squishing of the player rank card inside the main menu container */
    #player-rank-card.glass-panel {
        width: 100% !important;
        max-width: 100% !important;
        margin: 8px 0 0 0 !important;
        padding: 8px 12px !important;
        box-sizing: border-box !important;
        max-height: none !important;
        overflow: visible !important;
        display: flex !important;
        flex-direction: column !important;
    }

    /* 3. Settings Gear Button - repositioned to top-left with safe margins and safe touch target */
    .hud-settings-btn {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.25rem !important;
        top: max(16px, env(safe-area-inset-top, 16px)) !important;
        left: max(16px, env(safe-area-inset-left, 16px)) !important;
        right: auto !important;
        border-radius: 10px !important;
        background: rgba(0, 0, 0, 0.75) !important;
        border: 1.5px solid rgba(0, 240, 255, 0.5) !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5), 0 0 10px rgba(0, 240, 255, 0.2) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        z-index: 1001 !important;
        transform: none !important;
        pointer-events: auto !important;
    }

    /* 4. Music Widget - repositioned to top-left next to settings button */
    .music-hud-widget {
        top: max(16px, env(safe-area-inset-top, 16px)) !important;
        left: calc(max(16px, env(safe-area-inset-left, 16px)) + 52px) !important;
        bottom: auto !important;
        right: auto !important;
        transform: scale(0.85) !important;
        transform-origin: top left !important;
        z-index: 1001 !important;
    }
    .music-hud-widget:not(.collapsed) {
        max-width: min(180px, calc(100vw - 210px)) !important;
    }

    /* 4b. Mobile Skip Tutorial Button - Ultimate Cyberpunk Pill */
    #mobile-skip-tutorial-btn, .cyber-skip-pill {
        position: fixed !important;
        top: max(10px, env(safe-area-inset-top, 10px)) !important;
        right: max(12px, env(safe-area-inset-right, 12px)) !important;
        left: auto !important;
        bottom: auto !important;
        transform: none !important;
        z-index: 10005 !important;
        display: none;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
        padding: 0 16px !important;
        height: 36px !important;
        min-height: 36px !important;
        line-height: 1 !important;
        box-sizing: border-box !important;
        width: auto !important;
        min-width: 90px !important;
        font-family: 'Orbitron', sans-serif !important;
        font-size: 0.82rem !important;
        font-weight: 800 !important;
        letter-spacing: 1px !important;
        color: #ffffff !important;
        text-shadow: 0 0 10px rgba(255, 0, 102, 0.9), 0 0 20px rgba(255, 0, 102, 0.5) !important;
        border-radius: 18px !important;
        background: linear-gradient(135deg, rgba(255, 0, 102, 0.85) 0%, rgba(180, 0, 80, 0.95) 100%) !important;
        border: 1.5px solid #ff3399 !important;
        box-shadow: 0 4px 16px rgba(255, 0, 102, 0.55), inset 0 0 12px rgba(255, 255, 255, 0.25) !important;
        pointer-events: auto !important;
        cursor: pointer !important;
    }

    #mobile-skip-tutorial-btn .skip-icon, .cyber-skip-pill .skip-icon {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 0.85rem !important;
        line-height: 1 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    #mobile-skip-tutorial-btn.visible, .cyber-skip-pill.visible {
        display: inline-flex !important;
    }

    /* 5. FPS Counter - unified fixed positioning */
    .hud-fps {
        white-space: nowrap !important;
    }

    /* 6. Combo Multiplier Container - positioned below FPS counter */
    .hud-top .hud-left {
        top: calc(max(16px, env(safe-area-inset-top, 16px)) + 82px) !important;
        left: max(16px, env(safe-area-inset-left, 16px)) !important;
        position: absolute !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 6px !important;
        align-items: flex-start !important;
        min-width: 100px !important;
        z-index: 100 !important;
    }
    .hud-combo {
        font-size: 0.8rem !important;
        padding: 4px 8px !important;
        border-radius: 5px 12px 12px 5px !important;
        margin-top: 0 !important;
    }

    /* 7. Multiplayer Telemetry - positioned below Combo container */
    .hud-multiplayer-telemetry {
        top: calc(max(16px, env(safe-area-inset-top, 16px)) + 118px) !important;
        left: max(16px, env(safe-area-inset-left, 16px)) !important;
        transform: scale(0.8) !important;
        transform-origin: top left !important;
        z-index: 100 !important;
    }

    /* 8. Menu title spacing */
    .game-menu-overlay.start-active .menu-title:not(.gameover-text) {
        font-size: 2.1rem !important;
        letter-spacing: 1px !important;
        margin: 0.2rem 0 !important;
    }

    /* 9. Meta progression & coins section styling */
    .meta-progression-panel {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.5rem !important;
        margin: 0.4rem 0 !important;
        padding: 0.5rem 0.8rem !important;
        background: rgba(0, 240, 255, 0.04) !important;
        border: 1px solid rgba(0, 240, 255, 0.2) !important;
        border-radius: 12px !important;
        width: 100% !important;
    }
    .meta-stats-col {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-around !important;
        align-items: center !important;
        width: 100% !important;
        gap: 0.5rem !important;
    }
    .meta-coins {
        font-size: 1.15rem !important;
        text-shadow: 0 0 8px rgba(255, 215, 0, 0.5) !important;
    }
    #menu-record {
        font-size: 0.72rem !important;
        text-shadow: 0 0 6px rgba(0, 240, 255, 0.5) !important;
    }
    .meta-progression-panel .cyber-btn-small {
        font-size: 0.75rem !important;
        padding: 0.45rem 1rem !important;
        border-radius: 8px !important;
        margin: 2px 0 0 0 !important;
        width: auto !important;
        max-width: 100% !important;
        display: inline-block !important;
    }

    /* 10. Premium Glass Segmented Tab Bar - 2x2 Grid */
    .menu-tabs {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        background: rgba(0, 4, 8, 0.55) !important;
        border: 1px solid rgba(0, 240, 255, 0.2) !important;
        border-radius: 12px !important;
        padding: 5px !important;
        gap: 6px !important;
        margin: 0.6rem 0 0.4rem 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        max-width: 100% !important;
    }
    .tab-btn {
        flex: 1 !important;
        background: transparent !important;
        border: 1px solid transparent !important;
        color: rgba(255, 255, 255, 0.55) !important;
        font-size: 0.62rem !important;
        padding: 8px 2px !important;
        border-radius: 8px !important;
        text-shadow: none !important;
        box-shadow: none !important;
        font-weight: 800 !important;
        letter-spacing: 0.5px !important;
        transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    .tab-btn.active {
        background: rgba(0, 240, 255, 0.16) !important;
        border-color: rgba(0, 240, 255, 0.45) !important;
        color: #00f0ff !important;
        text-shadow: 0 0 5px rgba(0, 240, 255, 0.6) !important;
        box-shadow: 0 0 10px rgba(0, 240, 255, 0.25) !important;
    }
    .tab-btn#tab-btn-leaderboard.active {
        background: rgba(255, 0, 127, 0.16) !important;
        border-color: rgba(255, 0, 127, 0.45) !important;
        color: #ff007f !important;
        text-shadow: 0 0 5px rgba(255, 0, 127, 0.6) !important;
        box-shadow: 0 0 10px rgba(255, 0, 127, 0.25) !important;
    }

    /* 11. Tab panels full-width expanders - No display overrides to respect the hidden class */
    .missions-container, .leaderboard-container, .multiplayer-container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        margin-top: 8px !important;
        box-sizing: border-box !important;
    }
    .missions-title, .leaderboard-title, .multiplayer-title {
        font-size: 0.78rem !important;
        letter-spacing: 1px !important;
        margin-bottom: 0.6rem !important;
        color: #00f0ff !important;
        text-shadow: 0 0 6px rgba(0, 240, 255, 0.5) !important;
        text-align: center !important;
        border-bottom: 1px dashed rgba(0, 240, 255, 0.2) !important;
        padding-bottom: 4px !important;
    }
    .leaderboard-title {
        color: #ff007f !important;
        text-shadow: 0 0 6px rgba(255, 0, 127, 0.5) !important;
        border-bottom: 1px dashed rgba(255, 0, 127, 0.2) !important;
    }

    /* 12. Active Lists - Custom layout, no flex box height locks */
    .mission-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
    }
    .mission-item {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        padding: 0.6rem 0.8rem !important;
        border-radius: 8px !important;
        border: 1px solid rgba(0, 240, 255, 0.15) !important;
        border-left: 4px solid #00f0ff !important;
        background: linear-gradient(135deg, rgba(16, 28, 38, 0.8) 0%, rgba(8, 16, 22, 0.9) 100%) !important;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.25) !important;
        margin-bottom: 2px !important;
    }
    .mission-item.completed {
        border-left-color: #32D74B !important;
        border-color: rgba(50, 215, 75, 0.3) !important;
        background: linear-gradient(135deg, rgba(6, 28, 12, 0.8) 0%, rgba(3, 14, 6, 0.9) 100%) !important;
    }
    .mission-desc {
        font-size: 0.68rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.25rem !important;
    }
    .mission-progress-bar {
        height: 6px !important;
        margin-top: 5px !important;
        border-radius: 3px !important;
    }

    /* 13. Leaderboard list - let it expand naturally inside the scrolled menu panel to avoid nested scroll traps */
    .leaderboard-list {
        max-height: none !important;
        overflow-y: visible !important;
        padding-right: 0 !important;
    }
    .leaderboard-item {
        padding: 0.3rem 0.5rem !important;
        font-size: 0.72rem !important;
        margin-bottom: 4px !important;
        border-radius: 6px !important;
    }

    /* 14. Multiplayer Lobby view on mobile */
    .multi-actions-row {
        margin-bottom: 10px !important;
    }
    .cyber-btn-large {
        padding: 12px 10px !important;
        font-size: 0.82rem !important;
    }
    .cyber-btn-large small {
        font-size: 0.52rem !important;
        margin-top: 2px !important;
    }
    .divider-text {
        font-size: 0.6rem !important;
        margin: 8px 0 !important;
    }
    .join-lobby-row {
        gap: 8px !important;
    }
    .join-lobby-row .cyber-input {
        font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
        height: 38px !important;
        padding: 6px 10px !important;
    }
    .join-lobby-row .cyber-btn-small {
        height: 38px !important;
        font-size: 0.72rem !important;
    }
    .lobby-players-grid {
        gap: 10px !important;
        margin: 10px 0 !important;
    }
    .lobby-player-card {
        padding: 8px 4px !important;
        border-radius: 8px !important;
    }
    .player-avatar-wrap img {
        width: 36px !important;
        height: 36px !important;
    }
    .player-name {
        font-size: 0.68rem !important;
        max-width: 90px !important;
    }
    .player-ping {
        font-size: 0.52rem !important;
    }
    .ready-badge-btn, .ready-badge {
        font-size: 0.54rem !important;
        padding: 2px 6px !important;
        border-radius: 3px !important;
    }
    .lobby-controls {
        padding-top: 8px !important;
        gap: 8px !important;
    }

    /* 15. Game Over screen adjustments */
    .stats-grid {
        gap: 0.8rem !important;
        margin: 8px 0 !important;
    }
    .stat-box {
        padding: 8px !important;
        border-radius: 8px !important;
    }

    /* 16. Black Market Shop Overlay & Cards (Full height flow with overlay scroll) */
    #shop-modal .menu-content {
        max-height: none !important;
        height: auto !important;
    }
    .shop-body {
        max-height: none !important;
        overflow-y: visible !important;
        padding-right: 0 !important;
    }
    .shop-item {
        padding: 0.6rem 0.8rem !important;
        margin-bottom: 0.6rem !important;
        background: rgba(10, 20, 30, 0.75) !important;
        border: 1px solid rgba(0, 240, 255, 0.18) !important;
        border-radius: 10px !important;
    }
    .shop-item-info h4 {
        font-size: 0.85rem !important;
        margin-bottom: 0.15rem !important;
    }
    .shop-item-info p {
        font-size: 0.68rem !important;
        line-height: 1.25 !important;
    }
    .shop-item-level {
        font-size: 0.6rem !important;
        margin-top: 0.15rem !important;
    }
    .shop-item-cost {
        font-size: 0.82rem !important;
        font-weight: 800 !important;
        color: #ffd700 !important;
        text-shadow: 0 0 5px rgba(255, 215, 0, 0.4) !important;
        font-family: 'Orbitron', monospace !important;
    }
    .btn-buy {
        padding: 0.4rem 0.8rem !important;
        font-size: 0.75rem !important;
        margin-top: 0.2rem !important;
        border-radius: 6px !important;
    }

    .level-select-title {
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        white-space: nowrap !important;
    }

    .level-select-buttons-grid {
        display: grid !important;
        grid-template-columns: repeat(5, 1fr) !important;
        gap: 8px !important;
        width: 100% !important;
    }
}

/* ===== RESUME COUNTDOWN OVERLAY ===== */
#resume-countdown-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(5, 5, 10, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99999; /* make sure it overlays everything including HUD */
    pointer-events: none;
    border-radius: 20px;
}

#resume-countdown-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 10rem;
    font-weight: 900;
    color: #00f0ff;
    text-shadow: 0 0 20px #00f0ff, 0 0 40px #00f0ff, 0 0 60px #ff0055;
    opacity: 0;
}

@keyframes countdownTick {
    0% {
        transform: scale(2);
        opacity: 0;
    }
    15% {
        transform: scale(1);
        opacity: 1;
    }
    85% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.5);
        opacity: 0;
    }
}

.countdown-animate {
    animation: countdownTick 1s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==========================================================================
   WIDESCREEN DESKTOP DESIGNER DASHBOARD (v155) - min-width: 769px
   ========================================================================== */
@media (min-width: 769px) {
    /* Main Widescreen Dashboard Container */
    .game-menu-overlay .menu-content {
        max-width: 1180px !important;
        width: 92% !important;
        height: 730px !important;
        min-height: 660px !important;
        max-height: 90vh !important;
        padding: 2rem 2.4rem !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        overflow: hidden !important; /* Block double scroll bars on main wrapper */
        background: linear-gradient(135deg, rgba(8, 14, 26, 0.88) 0%, rgba(4, 8, 16, 0.94) 100%) !important;
        backdrop-filter: blur(30px) saturate(200%) !important;
        -webkit-backdrop-filter: blur(30px) saturate(200%) !important;
        border: 1.5px solid rgba(0, 240, 255, 0.35) !important;
        border-radius: 24px !important;
        box-shadow: 0 30px 80px rgba(0, 0, 0, 0.9), 
                    0 0 40px rgba(0, 240, 255, 0.25),
                    0 0 80px rgba(255, 0, 127, 0.12),
                    inset 0 0 50px rgba(0, 240, 255, 0.05) !important;
    }

    .game-menu-overlay.start-active .menu-header {
        margin-left: calc(320px + 2rem) !important;
        text-align: center !important;
        margin-bottom: 0.4rem !important;
    }
    .game-menu-overlay.start-active .menu-title:not(.gameover-text) {
        font-size: 2.6rem !important;
        letter-spacing: 4px !important;
        margin: 0 !important;
    }

    .menu-grid-container {
        display: flex !important;
        flex-direction: row !important;
        gap: 2rem !important;
        width: 100% !important;
        margin-top: 0.4rem !important;
        box-sizing: border-box !important;
        flex: 1 !important;
        min-height: 0 !important; /* Enable children to shrink and scroll properly */
        overflow: hidden !important;
    }

    /* Left Column: Widescreen Identity Scanner */
    .menu-column-left {
        flex: 0 0 320px !important;
        max-width: 320px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        align-items: center !important;
        height: 100% !important;
        box-sizing: border-box !important;
        gap: 12px !important;
    }

    .game-menu-overlay .hero-goat-img-wrap,
    .game-menu-overlay:not(.start-active) .hero-goat-img-wrap {
        display: flex !important;
        width: 140px !important;
        height: 140px !important;
        margin: 0 auto !important;
        background: rgba(0, 240, 255, 0.04) !important;
        border: 2px solid rgba(0, 240, 255, 0.5) !important;
        border-radius: 50% !important;
        position: relative !important;
        left: 0 !important;
        box-shadow: 0 0 25px rgba(0, 240, 255, 0.35), 
                    inset 0 0 15px rgba(0, 240, 255, 0.15),
                    0 0 40px rgba(255, 0, 127, 0.2) !important;
        align-items: center !important;
        justify-content: center !important;
        transition: all 0.3s ease !important;
    }
    .game-menu-overlay.start-active .hero-goat-img-wrap {
        top: 0 !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    .hero-goat-img {
        max-height: 110px !important;
        max-width: 110px !important;
        filter: drop-shadow(0 0 12px rgba(0, 240, 255, 0.4)) !important;
    }

    /* Unified high-tech telemetry card for progression */
    .meta-progression-panel {
        margin: 0 !important;
        padding: 14px 18px !important;
        background: linear-gradient(135deg, rgba(10, 18, 30, 0.65) 0%, rgba(5, 10, 18, 0.8) 100%) !important;
        border: 1px solid rgba(0, 240, 255, 0.2) !important;
        border-radius: 14px !important;
        box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.03) !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
    }
    .meta-stats-col {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        flex-direction: row !important;
    }
    .meta-coins {
        font-size: 1.25rem !important;
        font-weight: 800 !important;
        font-family: 'Orbitron', monospace !important;
        color: #ffd700 !important;
        text-shadow: 0 0 12px rgba(255, 215, 0, 0.6) !important;
    }
    #menu-record.neon-text-cyan {
        font-size: 0.8rem !important;
        font-family: 'Orbitron', monospace !important;
        color: #00f0ff !important;
        text-shadow: 0 0 10px rgba(0, 240, 255, 0.6) !important;
    }
    .meta-buttons-row {
        width: 100% !important;
    }
    .meta-buttons-row .cyber-btn-small {
        width: 100% !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.82rem !important;
        font-weight: 800 !important;
        letter-spacing: 1.5px !important;
        border-radius: 10px !important;
        background: linear-gradient(135deg, rgba(255, 0, 127, 0.15) 0%, rgba(0, 240, 255, 0.1) 100%) !important;
        border: 1px solid rgba(255, 0, 127, 0.4) !important;
        color: #ff00aa !important;
        text-shadow: 0 0 8px rgba(255, 0, 127, 0.5) !important;
        transition: all 0.3s ease !important;
        cursor: pointer !important;
    }
    .meta-buttons-row .cyber-btn-small:hover {
        background: linear-gradient(135deg, rgba(255, 0, 127, 0.25) 0%, rgba(0, 240, 255, 0.2) 100%) !important;
        border-color: rgba(255, 0, 127, 0.8) !important;
        color: #ffffff !important;
        box-shadow: 0 0 20px rgba(255, 0, 127, 0.4), inset 0 0 10px rgba(255, 0, 127, 0.2) !important;
        transform: translateY(-2px) !important;
    }

    /* Player rank container card */
    .player-rank-card {
        margin: 0 !important;
        padding: 14px 18px !important;
        background: linear-gradient(135deg, rgba(10, 18, 30, 0.65) 0%, rgba(5, 10, 18, 0.8) 100%) !important;
        border: 1px solid rgba(0, 240, 255, 0.2) !important;
        box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.03) !important;
        border-radius: 14px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
    }

    /* Google Login/Local Tag styled as a high-tech badge card */
    .user-profile-panel-inner {
        border-top: none !important;
        padding: 14px 18px !important;
        background: linear-gradient(135deg, rgba(10, 18, 30, 0.65) 0%, rgba(5, 10, 18, 0.8) 100%) !important;
        border: 1px solid rgba(0, 240, 255, 0.2) !important;
        border-radius: 14px !important;
        box-shadow: inset 0 0 15px rgba(0, 240, 255, 0.03) !important;
        transition: all 0.3s ease !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin-top: 0 !important; /* Stack profile card naturally */
    }
    .user-profile-panel-inner:hover,
    .player-rank-card:hover,
    .meta-progression-panel:hover {
        border-color: rgba(0, 240, 255, 0.45) !important;
        box-shadow: 0 0 20px rgba(0, 240, 255, 0.2), inset 0 0 12px rgba(0, 240, 255, 0.05) !important;
    }

    /* Right Column: Console Terminal wrapper */
    .menu-column-right {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        height: 100% !important;
        box-sizing: border-box !important;
        gap: 14px !important;
        min-width: 0 !important;
    }

    /* Dashboard Tabs - 2x2 Grid */
    .menu-tabs {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
        width: 100% !important;
        margin: 0 !important;
        max-width: none !important;
        background: rgba(4, 8, 16, 0.45) !important;
        padding: 6px !important;
        border: 1px solid rgba(0, 240, 255, 0.15) !important;
        border-radius: 14px !important;
        box-sizing: border-box !important;
    }

    .tab-btn {
        width: 100% !important;
        box-sizing: border-box !important;
        font-family: 'Orbitron', sans-serif !important;
        font-size: 0.72rem !important;
        font-weight: 800 !important;
        letter-spacing: 0.5px !important;
        padding: 8px 6px !important;
        border-radius: 8px !important;
        color: #8899a6 !important;
        background: rgba(0, 0, 0, 0.55) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        cursor: pointer !important;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
        text-align: center !important;
        justify-content: center !important;
        align-items: center !important;
        display: flex !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }
    .tab-btn:hover {
        color: #00f0ff !important;
        background: rgba(0, 240, 255, 0.1) !important;
        border-color: rgba(0, 240, 255, 0.35) !important;
        text-shadow: 0 0 8px rgba(0, 240, 255, 0.6) !important;
        transform: translateY(-2px) !important;
    }
    .tab-btn.active {
        color: #ffffff !important;
        background: linear-gradient(135deg, rgba(0, 240, 255, 0.22) 0%, rgba(0, 180, 255, 0.15) 100%) !important;
        border-color: #00f0ff !important;
        box-shadow: 0 0 18px rgba(0, 240, 255, 0.35), inset 0 0 10px rgba(0, 240, 255, 0.1) !important;
        text-shadow: 0 0 8px rgba(0, 240, 255, 0.8) !important;
    }
    .tab-btn#tab-btn-leaderboard.active {
        color: #ffffff !important;
        background: linear-gradient(135deg, rgba(255, 0, 127, 0.22) 0%, rgba(255, 0, 200, 0.15) 100%) !important;
        border-color: #ff007f !important;
        box-shadow: 0 0 18px rgba(255, 0, 127, 0.35), inset 0 0 10px rgba(255, 0, 127, 0.1) !important;
        text-shadow: 0 0 8px rgba(255, 0, 127, 0.8) !important;
    }
    .tab-btn#tab-btn-multiplayer.active {
        color: #ffffff !important;
        background: linear-gradient(135deg, rgba(0, 255, 102, 0.22) 0%, rgba(0, 240, 255, 0.15) 100%) !important;
        border-color: #00ff66 !important;
        box-shadow: 0 0 18px rgba(0, 255, 102, 0.35), inset 0 0 10px rgba(0, 255, 102, 0.1) !important;
        text-shadow: 0 0 8px rgba(0, 255, 102, 0.8) !important;
    }

    /* Spacious central scroll deck */
    .menu-panels-wrapper {
        flex: 1 !important;
        min-height: 280px !important;
        max-height: none !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        background: rgba(4, 8, 16, 0.55) !important;
        border: 1px solid rgba(0, 240, 255, 0.18) !important;
        border-radius: 16px !important;
        padding: 16px 20px !important;
        box-shadow: inset 0 0 25px rgba(0, 240, 255, 0.04) !important;
        scrollbar-width: thin !important;
        scrollbar-color: rgba(0, 240, 255, 0.4) rgba(0, 240, 255, 0.05) !important;
        box-sizing: border-box !important;
    }

    /* Custom neon scrollbar for menu wrapper (only when content actually exceeds height) */
    .menu-panels-wrapper::-webkit-scrollbar {
        display: block !important;
        width: 6px !important;
        height: 0px !important;
    }
    .menu-panels-wrapper::-webkit-scrollbar-track {
        background: rgba(0, 240, 255, 0.03) !important;
        border-radius: 4px !important;
    }
    .menu-panels-wrapper::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, #00f0ff 0%, #ff00aa 100%) !important;
        border-radius: 4px !important;
        box-shadow: 0 0 12px rgba(0, 240, 255, 0.4) !important;
    }
    .menu-panels-wrapper::-webkit-scrollbar-thumb:hover {
        background: #ffffff !important;
        box-shadow: 0 0 18px rgba(255, 255, 255, 0.9) !important;
    }

    /* Avoid inner scrollbars on leaderboard lists */
    .leaderboard-list {
        max-height: none !important;
        overflow-y: visible !important;
        overflow-x: hidden !important;
        padding-right: 0 !important;
    }

    /* Adapt tabs content directly to the large wrapper */
    .missions-container,
    .leaderboard-container,
    .multiplayer-container {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        overflow: hidden !important;
        backdrop-filter: none !important;
    }

    .missions-title,
    .leaderboard-title,
    .multiplayer-title {
        font-family: 'Orbitron', sans-serif !important;
        font-size: 0.92rem !important;
        font-weight: 800 !important;
        letter-spacing: 2px !important;
        margin-bottom: 0.65rem !important;
        padding-bottom: 0.45rem !important;
        border-bottom: 1px solid rgba(0, 240, 255, 0.18) !important;
        text-align: left !important;
        text-shadow: 0 0 10px rgba(0, 240, 255, 0.5) !important;
    }
    .leaderboard-title {
        color: #ff007f !important;
        border-bottom-color: rgba(255, 0, 127, 0.2) !important;
        text-shadow: 0 0 10px rgba(255, 0, 127, 0.5) !important;
    }
    .multiplayer-title {
        color: #00ff66 !important;
        border-bottom-color: rgba(0, 255, 102, 0.2) !important;
        text-shadow: 0 0 10px rgba(0, 255, 102, 0.5) !important;
    }

    /* Clean leaderboard alignment */
    .leaderboard-item {
        display: flex !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0.6rem 0.9rem !important;
        margin-bottom: 8px !important;
        border-radius: 10px !important;
        background: rgba(14, 20, 32, 0.6) !important;
        border: 1px solid rgba(255, 255, 255, 0.08) !important;
        transition: all 0.25s ease !important;
    }
    .leaderboard-item:hover {
        background: rgba(0, 240, 255, 0.08) !important;
        border-color: rgba(0, 240, 255, 0.3) !important;
        box-shadow: 0 4px 15px rgba(0, 240, 255, 0.15) !important;
        transform: translateX(3px) !important;
    }
    .leaderboard-rank {
        order: 1 !important;
        flex-shrink: 0 !important;
        width: 32px !important;
    }
    .leaderboard-name {
        order: 2 !important;
        flex-grow: 1 !important;
        margin-left: 0.5rem !important;
    }
    .leaderboard-score {
        order: 3 !important;
        flex-shrink: 0 !important;
        font-family: 'Orbitron', monospace !important;
        color: #39ff14 !important;
        text-shadow: 0 0 8px rgba(57, 255, 20, 0.5) !important;
    }

    /* Desktop vertical checklist style for active missions */
    .mission-list {
        display: flex !important;
        flex-direction: column !important;
        gap: 8px !important;
        width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: hidden !important;
    }
    .game-menu-overlay .mission-item,
    .mission-item {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        gap: 5px !important;
        padding: 9px 14px !important;
        margin-bottom: 0 !important;
        border-radius: 10px !important;
        border: 1px solid rgba(0, 240, 255, 0.2) !important;
        border-left: 4px solid #00f0ff !important;
        background: linear-gradient(135deg, rgba(14, 26, 40, 0.75) 0%, rgba(6, 14, 22, 0.88) 100%) !important;
        overflow: hidden !important;
        min-height: auto !important;
        transition: all 0.3s ease !important;
        box-sizing: border-box !important;
    }
    .game-menu-overlay .mission-item:hover,
    .mission-item:hover {
        border-color: rgba(0, 240, 255, 0.6) !important;
        box-shadow: 0 6px 22px rgba(0, 240, 255, 0.2), inset 0 0 12px rgba(0, 240, 255, 0.05) !important;
        transform: translateY(-1px) !important;
    }
    .game-menu-overlay .mission-item.completed,
    .mission-item.completed {
        border-left-color: #32D74B !important;
        border-color: rgba(50, 215, 75, 0.35) !important;
        background: linear-gradient(135deg, rgba(6, 28, 14, 0.65) 0%, rgba(3, 14, 7, 0.8) 100%) !important;
    }
    .game-menu-overlay .mission-item.completed:hover,
    .mission-item.completed:hover {
        border-color: rgba(50, 215, 75, 0.7) !important;
        box-shadow: 0 6px 22px rgba(50, 215, 75, 0.25) !important;
    }
    .mission-desc {
        font-family: 'Inter', sans-serif !important;
        font-size: 0.78rem !important;
        line-height: 1.35 !important;
        color: #e2e8f0 !important;
        margin: 0 !important;
        font-weight: 500 !important;
    }

    /* Holographic CTA bars at the bottom of the column */
    #menu-start-section,
    #menu-over-section {
        margin-top: auto !important;
        border-radius: 14px !important;
        padding: 0 !important;
        text-align: center !important;
        cursor: pointer !important;
        transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
        overflow: hidden !important;
    }
    #menu-start-section:not(.hidden),
    #menu-over-section:not(.hidden) {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
    }
    #menu-start-section {
        background: linear-gradient(135deg, rgba(0, 255, 102, 0.14) 0%, rgba(0, 240, 255, 0.08) 100%) !important;
        border: 1.5px solid rgba(0, 255, 102, 0.6) !important;
        box-shadow: 0 0 25px rgba(0, 255, 102, 0.3), inset 0 0 15px rgba(0, 255, 102, 0.08) !important;
        margin-top: 10px !important;
    }
    #menu-start-section:hover {
        background: linear-gradient(135deg, rgba(0, 255, 102, 0.28) 0%, rgba(0, 240, 255, 0.2) 100%) !important;
        border-color: #00ff66 !important;
        box-shadow: 0 0 40px rgba(0, 255, 102, 0.55), inset 0 0 25px rgba(0, 255, 102, 0.2) !important;
        transform: translateY(-3px) scale(1.01) !important;
    }
    #menu-start-section .cyber-btn-large {
        width: 100% !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        font-family: 'Orbitron', sans-serif !important;
        font-size: 1.2rem !important;
        font-weight: 900 !important;
        letter-spacing: 3px !important;
        color: #ffffff !important;
        text-shadow: 0 0 12px rgba(0, 255, 102, 0.8), 0 0 25px rgba(0, 255, 102, 0.5) !important;
        padding: 13px !important;
        pointer-events: none !important;
        text-transform: uppercase !important;
    }
    #menu-over-section {
        background: rgba(255, 0, 127, 0.04) !important;
        border: 1px solid rgba(255, 0, 127, 0.25) !important;
        box-shadow: inset 0 0 10px rgba(255, 0, 127, 0.02) !important;
        padding: 0.6rem 1.2rem !important;
        margin-top: 6px !important;
    }
    #menu-over-section:hover {
        background: rgba(255, 0, 127, 0.08) !important;
        border-color: rgba(255, 0, 127, 0.55) !important;
        box-shadow: 0 0 20px rgba(255, 0, 127, 0.18), inset 0 0 12px rgba(255, 0, 127, 0.04) !important;
    }
    #menu-over-section .menu-title.gameover-text {
        font-size: 2.0rem !important;
        margin-bottom: 0.5rem !important;
    }
    #menu-over-section .stats-grid {
        gap: 0.8rem !important;
        margin: 0.5rem 0 !important;
        width: 100% !important;
    }
    #menu-over-section .stat-box {
        padding: 0.5rem 0.8rem !important;
        border-radius: 10px !important;
    }
    #menu-over-section .stat-box span {
        font-size: 1.6rem !important;
    }
    #menu-over-section .pulse-text {
        font-size: 0.85rem !important;
        margin-top: 6px !important;
    }
}

/* Stack on Mobile screens */
@media (max-width: 768px) {
    .menu-grid-container {
        flex-direction: column;
        gap: 1rem;
    }
    .menu-column-left {
        max-width: 100%;
    }
    .menu-panels-wrapper {
        min-height: auto;
        max-height: none;
        overflow-y: visible;
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
    }
}

/* =========================================================
   MASTER CYBERPUNK UI OVERHAUL & MOBILE OPTIMIZATION (v5.1)
   ========================================================= */

/* 1. UNIVERSAL ANTI-OVERFLOW & BOX CONTAINMENT ENGINE */
*, *::before, *::after {
    box-sizing: border-box !important;
}

/* Ensure no text ever clips or overflows outside cards or modals */
p, h1, h2, h3, h4, h5, h6, span, label, button, div, a, li, td, th {
    overflow-wrap: anywhere !important;
    word-break: break-word !important;
    hyphens: auto;
}

/* Flex items containment fix (prevents flex children from pushing parents wide) */
.glass-panel, .menu-card, .shop-item, .mission-item, .modal-content, .leaderboard-row, .hud-card, .settings-panel, .settings-group, .narrative-panel, .narrative-content {
    min-width: 0 !important;
    box-sizing: border-box !important;
}

/* 2. CUSTOM CYBERPUNK NEON SCROLLBARS */
::-webkit-scrollbar {
    width: 6px !important;
    height: 6px !important;
}
::-webkit-scrollbar-track {
    background: rgba(4, 8, 16, 0.6) !important;
    border-radius: 10px !important;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #00f0ff 0%, #ff00aa 100%) !important;
    border-radius: 10px !important;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.6) !important;
}
::-webkit-scrollbar-thumb:hover {
    background: #ffffff !important;
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.9) !important;
}

/* 3. MODAL & OVERLAY CONTAINMENT & GLASSMORPHISM */
.modal, .overlay, #narrative-overlay, #campaign-level-complete-overlay {
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: max(10px, env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-left)) !important;
}

.modal-content, .glass-panel {
    max-width: 96vw !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    border-radius: 16px !important;
    border: 1.5px solid rgba(0, 240, 255, 0.35) !important;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.7), inset 0 0 20px rgba(0, 240, 255, 0.08) !important;
}

/* MOBILE GPU BOOST: Disattiva i filtri real-time backdrop-filter su mobile per eliminare qualsiasi scatto e garantire 60 FPS fissi */
@media (max-width: 900px) {
    .modal, .overlay, #narrative-overlay, #campaign-level-complete-overlay, .modal-content, .glass-panel {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        background: rgba(4, 8, 16, 0.97) !important;
    }
    .touch-btn, .shop-item, .mission-item {
        box-shadow: none !important;
    }
}

/* 4. BLACK MARKET (SHOP) TEXT & LAYOUT OPTIMIZATION */
.shop-item {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 0.8rem !important;
    padding: 0.9rem 1.1rem !important;
    background: linear-gradient(135deg, rgba(6, 16, 28, 0.85) 0%, rgba(10, 24, 42, 0.9) 100%) !important;
    border: 1px solid rgba(0, 240, 255, 0.2) !important;
    border-radius: 12px !important;
    margin-bottom: 0.8rem !important;
    width: 100% !important;
}

.shop-item-info {
    flex: 1 1 auto !important;
    min-width: 0 !important;
}

.shop-item-info h4 {
    font-size: clamp(0.85rem, 2.5vw, 1.05rem) !important;
    margin: 0 0 0.25rem 0 !important;
    color: #ffffff !important;
    line-height: 1.3 !important;
}

.shop-item-info p {
    font-size: clamp(0.7rem, 2vw, 0.82rem) !important;
    color: rgba(255, 255, 255, 0.65) !important;
    line-height: 1.35 !important;
    margin: 0 !important;
}

.shop-item-buy {
    flex: 0 0 auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-end !important;
    justify-content: center !important;
}

.btn-buy {
    font-size: clamp(0.75rem, 2.2vw, 0.9rem) !important;
    padding: 0.5rem 1.1rem !important;
    white-space: nowrap !important;
}

/* 5. MISSION CARD & LEADERBOARD RESPONSIVENESS */
@media (max-width: 768px) {
    .mission-item, .leaderboard-row {
        width: 100% !important;
        padding: 0.8rem 1rem !important;
        margin-bottom: 0.6rem !important;
        border-radius: 10px !important;
        box-sizing: border-box !important;
    }
}

.mission-item h4, .mission-item p {
    margin: 0 !important;
    line-height: 1.35 !important;
}

/* 6. MOBILE TOUCH CONTROLS ERGONOMICS */
#touch-controls, .mobile-touch-container {
    padding-bottom: max(10px, env(safe-area-inset-bottom)) !important;
    padding-left: max(10px, env(safe-area-inset-left)) !important;
    padding-right: max(10px, env(safe-area-inset-right)) !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

.touch-btn {
    border-radius: 14px !important;
    background: rgba(0, 240, 255, 0.12) !important;
    border: 2px solid rgba(0, 240, 255, 0.4) !important;
    backdrop-filter: blur(8px) !important;
    -webkit-backdrop-filter: blur(8px) !important;
    box-shadow: 0 0 15px rgba(0, 240, 255, 0.25) !important;
    transition: transform 0.1s ease, background 0.1s ease !important;
    touch-action: manipulation !important;
}

.touch-btn:active {
    transform: scale(0.91) !important;
    background: rgba(0, 240, 255, 0.35) !important;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.7) !important;
}

/* 7. DYNAMIC HUD & MOBILE BANNER SCALING */
#hud-container {
    padding-top: max(6px, env(safe-area-inset-top)) !important;
    padding-left: max(10px, env(safe-area-inset-left)) !important;
    padding-right: max(10px, env(safe-area-inset-right)) !important;
}

#hud-container span, #hud-container div {
    font-size: clamp(0.75rem, 2.5vw, 1.1rem) !important;
}

/* 8. MEDIA QUERIES FOR SMALL SCREENS & PORTRAIT/LANDSCAPE MOBILE */
@media (max-width: 600px) {
    .shop-item {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 0.6rem !important;
    }
    .shop-item-buy {
        align-items: flex-end !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        width: 100% !important;
        border-top: 1px solid rgba(255, 255, 255, 0.08) !important;
        padding-top: 0.5rem !important;
    }
    .modal-content {
        padding: 1rem !important;
        width: 95vw !important;
    }
    #menu-start-section button, #menu-over-section button {
        width: 100% !important;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    .modal-content, .glass-panel {
        max-height: 94vh !important;
        padding: 0.6rem 0.9rem !important;
    }
    .shop-item {
        padding: 0.5rem 0.8rem !important;
        margin-bottom: 0.4rem !important;
    }
}

/* ===== CYBERPUNK GLASSMORPHISM INTERACTIVE TUTORIAL FRAMEWORK ===== */

/* Overlay Container */
.tutorial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: auto;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 8, 16, 0.5);
    padding: 16px;
    box-sizing: border-box;
}

/* Main Dialog Box with Glassmorphism */
#tutorial-dialog-box,
.tutorial-dialog-box {
    position: relative;
    width: 100%;
    max-width: 540px;
    background: rgba(6, 10, 22, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 240, 255, 0.4);
    box-shadow: 0 0 30px rgba(0, 240, 255, 0.25), inset 0 0 15px rgba(0, 240, 255, 0.1);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 10002;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-height: 90vh;
    overflow-y: auto;
}

/* Sci-Fi Corner Brackets */
.tut-corner {
    position: absolute;
    width: 16px;
    height: 16px;
    pointer-events: none;
    z-index: 2;
    transition: border-color 0.3s ease;
}

.tut-corner-tl {
    top: -2px;
    left: -2px;
    border-top: 3px solid var(--neon-glow, #00F0FF);
    border-left: 3px solid var(--neon-glow, #00F0FF);
    border-top-left-radius: 8px;
}

.tut-corner-tr {
    top: -2px;
    right: -2px;
    border-top: 3px solid var(--neon-glow, #00F0FF);
    border-right: 3px solid var(--neon-glow, #00F0FF);
    border-top-right-radius: 8px;
}

.tut-corner-bl {
    bottom: -2px;
    left: -2px;
    border-bottom: 3px solid var(--neon-glow, #00F0FF);
    border-left: 3px solid var(--neon-glow, #00F0FF);
    border-bottom-left-radius: 8px;
}

.tut-corner-br {
    bottom: -2px;
    right: -2px;
    border-bottom: 3px solid var(--neon-glow, #00F0FF);
    border-right: 3px solid var(--neon-glow, #00F0FF);
    border-bottom-right-radius: 8px;
}

/* Theme Classes */
.theme-cyan {
    --neon-glow: #00F0FF;
    border-color: rgba(0, 240, 255, 0.6) !important;
    box-shadow: 0 0 25px rgba(0, 240, 255, 0.3), inset 0 0 15px rgba(0, 240, 255, 0.1) !important;
}

.theme-magenta {
    --neon-glow: #FF007F;
    border-color: rgba(255, 0, 127, 0.6) !important;
    box-shadow: 0 0 25px rgba(255, 0, 127, 0.3), inset 0 0 15px rgba(255, 0, 127, 0.1) !important;
}

.theme-gold {
    --neon-glow: #FFD700;
    border-color: rgba(255, 215, 0, 0.6) !important;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.3), inset 0 0 15px rgba(255, 215, 0, 0.1) !important;
}

.theme-green {
    --neon-glow: #00FF66;
    border-color: rgba(0, 255, 102, 0.6) !important;
    box-shadow: 0 0 25px rgba(0, 255, 102, 0.3), inset 0 0 15px rgba(0, 255, 102, 0.1) !important;
}

/* Header & Typography Hierarchy */
#tutorial-header,
.tutorial-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

#tutorial-title,
.tutorial-title {
    font-family: 'Orbitron', 'Rajdhani', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #FFFFFF;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    text-shadow: 0 0 10px var(--neon-glow, #00F0FF);
    margin: 0;
    line-height: 1.3;
}

#tutorial-badge,
.tutorial-badge {
    font-family: 'Orbitron', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--neon-glow, #00F0FF);
    background: rgba(0, 240, 255, 0.12);
    border: 1px solid var(--neon-glow, #00F0FF);
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 1px;
    text-shadow: 0 0 6px var(--neon-glow, #00F0FF);
    white-space: nowrap;
    text-transform: uppercase;
}

/* Body & Content */
#tutorial-body,
.tutorial-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

#tutorial-text,
.tutorial-text {
    font-family: 'Rajdhani', 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    color: #F1F5F9;
    line-height: 1.5;
    margin: 0;
    word-break: break-word;
}

#tutorial-subtext,
.tutorial-subtext {
    font-family: 'Rajdhani', 'Inter', sans-serif;
    font-size: 0.92rem;
    font-weight: 500;
    color: #94A3B8;
    line-height: 1.4;
    margin: 0;
    word-break: break-word;
}

/* Cyberpunk Key Badges */
#tutorial-key-badges,
.tutorial-key-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-top: 6px;
}

.cyber-key {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.95));
    border: 1px solid var(--neon-glow, #00F0FF);
    color: var(--neon-glow, #00F0FF);
    padding: 4px 10px;
    border-radius: 6px;
    font-family: monospace;
    font-weight: bold;
    font-size: 0.85rem;
    box-shadow: 0 0 10px rgba(0, 240, 255, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 5px var(--neon-glow, #00F0FF);
    letter-spacing: 0.5px;
    white-space: nowrap;
}

/* Footer & Step Dots */
#tutorial-footer,
.tutorial-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 8px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

#tutorial-dots-container,
.tutorial-step-dots {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    max-width: 65%;
}

.tutorial-step-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.tutorial-step-dot.dot-active {
    background: var(--neon-glow, #00F0FF);
    border-color: #FFFFFF;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.tutorial-step-dot.dot-completed {
    background: var(--neon-glow, #00FF66);
    border-color: rgba(0, 255, 102, 0.8);
    box-shadow: 0 0 8px var(--neon-glow, #00FF66);
    opacity: 0.9;
}

@keyframes dotPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 8px var(--neon-glow, #00F0FF);
    }
    50% {
        transform: scale(1.4);
        box-shadow: 0 0 16px var(--neon-glow, #00F0FF);
    }
}

/* Interactive Tutorial Buttons Touch Target */
#tutorial-skip-btn,
.tutorial-dialog-box button {
    min-height: 44px;
    min-width: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Target Highlight Focus Ring */
#tutorial-target-highlight,
.tutorial-target-highlight {
    position: fixed;
    pointer-events: none;
    border: 2px solid var(--neon-glow, #00F0FF);
    border-radius: 12px;
    box-shadow: 0 0 20px var(--neon-glow, #00F0FF), inset 0 0 15px var(--neon-glow, #00F0FF);
    z-index: 10001;
    transition: all 0.3s ease-out;
    animation: targetPulse 2s infinite ease-in-out;
}

@keyframes targetPulse {
    0%, 100% {
        box-shadow: 0 0 15px var(--neon-glow, #00F0FF), inset 0 0 10px var(--neon-glow, #00F0FF);
        border-color: var(--neon-glow, #00F0FF);
    }
    50% {
        box-shadow: 0 0 30px var(--neon-glow, #00F0FF), inset 0 0 20px var(--neon-glow, #00F0FF);
        border-color: #FFFFFF;
    }
}

/* Responsive Mobile Layout Rules */
@media (max-width: 600px) {
    .tutorial-overlay {
        padding: 10px;
    }

    #tutorial-dialog-box,
    .tutorial-dialog-box {
        padding: 16px;
        max-width: 96vw;
        gap: 10px;
        border-radius: 12px;
    }

    #tutorial-title,
    .tutorial-title {
        font-size: 1.05rem;
    }

    #tutorial-text,
    .tutorial-text {
        font-size: 0.95rem;
    }

    #tutorial-subtext,
    .tutorial-subtext {
        font-size: 0.85rem;
    }

    #tutorial-footer,
    .tutorial-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    #tutorial-dots-container,
    .tutorial-step-dots {
        max-width: 100%;
        justify-content: center;
    }

    #tutorial-skip-btn {
        width: 100%;
    }
}

@media (max-height: 500px) and (orientation: landscape) {
    #tutorial-dialog-box,
    .tutorial-dialog-box {
        padding: 12px 16px;
        max-height: 94vh;
        gap: 8px;
    }

    #tutorial-footer,
    .tutorial-footer {
        margin-top: 4px;
        padding-top: 6px;
        flex-direction: row;
    }
}

/* ═══ DEFINITIVE UNIFIED HUD OVERRIDES: FPS COUNTER & MOBILE SKIP BUTTON ═══ */
#hud-fps, .hud-fps {
    position: fixed !important;
    top: calc(max(16px, env(safe-area-inset-top, 16px)) + 50px) !important;
    left: max(16px, env(safe-area-inset-left, 16px)) !important;
    right: auto !important;
    bottom: auto !important;
    margin: 0 !important;
    z-index: 10002 !important;
    color: #32D74B !important;
    font-family: 'Orbitron', sans-serif !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 1px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    writing-mode: horizontal-tb !important;
    flex-direction: row !important;
    pointer-events: none !important;
    display: inline-flex;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    height: 24px !important;
    padding: 0 8px !important;
    background: linear-gradient(135deg, rgba(8, 20, 12, 0.92), rgba(15, 35, 20, 0.85)) !important;
    border: 1.5px solid rgba(50, 215, 75, 0.4) !important;
    border-left: 3.5px solid #32d74b !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4), inset 0 0 6px rgba(50, 215, 75, 0.15) !important;
    text-shadow: 0 0 6px rgba(50, 215, 75, 0.6) !important;
}

#hud-fps.visible, .hud-fps.visible {
    display: inline-flex !important;
}

@media (min-width: 769px) {
    #hud-fps, .hud-fps {
        top: 64px !important;
        left: 16px !important;
        height: 24px !important;
    }
}

/* ===== CYBER GUESTBOOK SPECIFIC STYLES ===== */
#guestbook-panel {
    display: flex;
    flex-direction: column;
}

#guestbook-input {
    flex: 1 !important;
    height: 38px !important;
    min-width: 0 !important;
    width: 100% !important;
    max-width: none !important;
    background: rgba(0, 10, 20, 0.85) !important;
    border: 1.5px solid #00ff66 !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    font-family: 'Orbitron', sans-serif !important;
    font-size: 0.75rem !important;
    padding: 0 10px !important;
    margin: 0 !important;
    display: block !important;
    outline: none !important;
    text-transform: none !important;
    box-sizing: border-box !important;
    box-shadow: inset 0 0 6px rgba(0, 255, 102, 0.15) !important;
    text-shadow: none !important;
}

#guestbook-input:focus {
    border-color: #00ffaa !important;
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.4), inset 0 0 6px rgba(0, 255, 102, 0.2) !important;
}

#btn-send-guestbook {
    height: 38px !important;
    width: auto !important;
    padding: 0 14px !important;
    font-family: 'Orbitron', sans-serif !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    border: 1.5px solid #00ff66 !important;
    border-radius: 8px !important;
    background: rgba(0, 255, 102, 0.2) !important;
    color: #00ff66 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    white-space: nowrap !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    box-shadow: 0 0 10px rgba(0, 255, 102, 0.3) !important;
    text-shadow: 0 0 5px #00ff66 !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    transform: none !important;
}

#btn-send-guestbook:hover {
    background: rgba(0, 255, 102, 0.35) !important;
    box-shadow: 0 0 16px rgba(0, 255, 102, 0.6) !important;
}

#btn-refresh-guestbook {
    height: 24px !important;
    min-height: 24px !important;
    width: auto !important;
    min-width: fit-content !important;
    padding: 0 6px !important;
    font-family: 'Orbitron', sans-serif !important;
    font-size: 0.55rem !important;
    font-weight: 800 !important;
    letter-spacing: 0.5px !important;
    border: 1px solid #00ff66 !important;
    border-radius: 6px !important;
    background: rgba(0, 255, 102, 0.12) !important;
    color: #00ff66 !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    white-space: nowrap !important;
    box-shadow: 0 0 8px rgba(0, 255, 102, 0.2) !important;
    text-shadow: 0 0 4px #00ff66 !important;
    margin: 0 !important;
    box-sizing: border-box !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    transform: none !important;
}

#btn-refresh-guestbook:hover {
    background: rgba(0, 255, 102, 0.25) !important;
}
