/* NovexEmpire - Menu / Launcher Styles */

/* ═══════════════════════════════════════════════
   FACTORY ILLUSTRATION (CSS/SVG background)
   ═══════════════════════════════════════════════ */

.factory-scene {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.factory-scene svg {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* Ambient glow from factory lights */
.factory-scene::after {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 400px at 35% 55%, rgba(0, 212, 170, 0.06) 0%, transparent 70%),
        radial-gradient(ellipse 500px 350px at 65% 45%, rgba(99, 102, 241, 0.05) 0%, transparent 70%),
        radial-gradient(ellipse 300px 200px at 50% 60%, rgba(217, 119, 6, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

/* Vignette overlay to push focus center */
.scene-vignette {
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        radial-gradient(ellipse at 50% 40%, transparent 20%, rgba(12, 13, 16, 0.5) 60%, rgba(12, 13, 16, 0.92) 100%);
    pointer-events: none;
}

/* Animated smoke puffs */
@keyframes smokeRise {
    0% { transform: translateY(0) scale(1); opacity: 0.4; }
    50% { opacity: 0.2; }
    100% { transform: translateY(-60px) scale(2.5); opacity: 0; }
}

.smoke-puff {
    animation: smokeRise linear infinite;
    transform-origin: center;
}

/* Conveyor belt animation */
@keyframes conveyorMove {
    0% { transform: translateX(0); }
    100% { transform: translateX(12px); }
}

.conveyor-items {
    animation: conveyorMove 1.5s linear infinite;
}

/* Truck driving animation */
@keyframes truckDrive {
    0% { transform: translateX(-40px); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateX(40px); opacity: 0; }
}

.truck-moving {
    animation: truckDrive 12s linear infinite;
}

.truck-moving-2 {
    animation: truckDrive 15s linear infinite 4s;
}

/* Window glow pulse */
@keyframes windowPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.window-glow {
    animation: windowPulse 4s ease-in-out infinite;
}

.window-glow-2 {
    animation: windowPulse 5s ease-in-out infinite 1.5s;
}

/* ═══════════════════════════════════════════════
   LAYOUT — Grid launcher
   ═══════════════════════════════════════════════ */

#menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: 1fr 380px;
    grid-template-rows: 1fr auto;
    height: 100dvh;
    padding: 40px;
    gap: 0 40px;
    pointer-events: auto;
    font-family: var(--font-body);
    color: var(--light);
    overflow: hidden;
}

/* ═══════════════════════════════════════════════
   LEFT: TITLE + PLAY
   ═══════════════════════════════════════════════ */

.menu-title-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 80px;
}

.menu-title-novex {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 96px;
    letter-spacing: 0.08em;
    line-height: 0.9;
    background: linear-gradient(135deg, #e8e6e3 0%, #c0bdb8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 20px rgba(0, 0, 0, 0.5));
    margin-bottom: 4px;
}

.menu-title-empire {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 52px;
    letter-spacing: 0.25em;
    color: var(--color-primary, #00d4aa);
    filter: drop-shadow(0 0 20px rgba(0, 212, 170, 0.3));
    margin-bottom: 16px;
}

.menu-title-divider {
    width: 80px;
    height: 2px;
    background: linear-gradient(90deg, var(--color-primary, #00d4aa), transparent);
    margin-bottom: 14px;
}

.menu-title-tagline {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--menu-text-dim, #8a8a95);
    margin-bottom: 48px;
}

/* ── Play Button ── */
.menu-play-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 18px 52px;
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--gradient-start, #6366f1), #7c3aed);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow:
        0 4px 24px rgba(99, 102, 241, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    width: fit-content;
}

.menu-play-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 36px rgba(99, 102, 241, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.menu-play-btn:active {
    transform: translateY(0);
}

.menu-play-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* ═══════════════════════════════════════════════
   RIGHT: SIDEBAR (saves + actions)
   ═══════════════════════════════════════════════ */

.menu-sidebar {
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    padding: 20px 0;
    scrollbar-width: thin;
    scrollbar-color: var(--menu-border, #2a2a32) transparent;
}

.sidebar-label {
    font-family: var(--font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--menu-text-muted, #5a5a65);
    padding: 0 4px;
    margin-bottom: -4px;
}

/* ── Save Cards — compact sidebar style ── */
.save-card {
    background: rgba(21, 23, 32, 0.8);
    backdrop-filter: blur(12px);
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 10px;
    padding: 14px 16px 14px 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.save-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--card-accent, var(--color-primary, #00d4aa));
    border-radius: 10px 0 0 10px;
}

.save-card:hover {
    background: rgba(28, 30, 42, 0.9);
    border-color: var(--card-accent, var(--color-primary, #00d4aa));
    transform: translateX(-2px);
}

.save-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.save-card-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--light);
}

.save-card-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.save-card-badge.easy {
    color: var(--success);
    border-color: rgba(34, 197, 94, 0.3);
    background: rgba(34, 197, 94, 0.08);
}

.save-card-badge.real {
    color: var(--accent);
    border-color: rgba(217, 119, 6, 0.3);
    background: rgba(217, 119, 6, 0.08);
}

.save-card-bottom {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.save-card-day {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--menu-text-dim, #8a8a95);
}

.save-card-day strong {
    color: var(--light);
    font-weight: 500;
}

.save-card-cash {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 500;
    color: var(--gold, #d4a017);
}

.save-card-continue {
    font-family: var(--font-display);
    font-size: 8px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--color-primary, #00d4aa);
    color: #000;
    padding: 2px 6px;
    border-radius: 3px;
    margin-right: 8px;
}

.save-card-delete {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--menu-text-muted, #5a5a65);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0;
}

.save-card:hover .save-card-delete {
    opacity: 1;
}

.save-card-delete:hover {
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
}

/* ── New Game Card — horizontal flex ── */
.new-game-card {
    background: transparent;
    border: 1px dashed var(--menu-border, #2a2a32);
    border-radius: 10px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.new-game-card:hover {
    border-color: var(--color-primary, #00d4aa);
    border-style: solid;
    background: rgba(0, 212, 170, 0.15);
}

.new-game-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(0, 212, 170, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-primary, #00d4aa);
    font-size: 20px;
    font-weight: 300;
    flex-shrink: 0;
    transition: background 0.2s;
}

.new-game-card:hover .new-game-icon {
    background: rgba(0, 212, 170, 0.25);
}

.new-game-text {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--menu-text-dim, #8a8a95);
    transition: color 0.2s;
}

.new-game-card:hover .new-game-text {
    color: var(--light);
}

.new-game-sub {
    font-size: 11px;
    color: var(--menu-text-muted, #5a5a65);
    margin-top: 2px;
}

/* ═══════════════════════════════════════════════
   BOTTOM BAR
   ═══════════════════════════════════════════════ */

.menu-bottom-bar {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.bottom-links {
    display: flex;
    gap: 24px;
}

.bottom-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--menu-text-muted, #5a5a65);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 6px 0;
}

.bottom-link:hover {
    color: var(--menu-text-dim, #8a8a95);
}

.bottom-link svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.bottom-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.version-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--menu-text-muted, #5a5a65);
    letter-spacing: 0.05em;
}

/* ── Account Button (fixed top-right, glass) ── */
.account-btn {
    position: fixed;
    top: 28px;
    right: 40px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(21, 23, 32, 0.7);
    backdrop-filter: blur(12px);
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 8px;
    padding: 8px 14px;
    color: var(--menu-text-dim, #8a8a95);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.account-btn:hover {
    color: var(--light);
    border-color: var(--color-primary, #00d4aa);
}

.account-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ── Menu Mute Button (bottom-right, 36px circle with SVG icon) ── */
.menu-mute-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--menu-border, #2a2a32);
    background: rgba(21, 23, 32, 0.6);
    color: var(--menu-text-dim, #8a8a95);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.menu-mute-btn:hover {
    border-color: var(--accent, #d97706);
    color: var(--light);
}

.menu-mute-btn svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ═══════════════════════════════════════════════
   ENTRANCE ANIMATIONS
   ═══════════════════════════════════════════════ */

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

@keyframes fadeInRight {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.menu-title-novex { animation: fadeInUp 0.8s ease-out 0.2s both; }
.menu-title-empire { animation: fadeInUp 0.8s ease-out 0.35s both; }
.menu-title-divider { animation: fadeIn 0.8s ease-out 0.5s both; }
.menu-title-tagline { animation: fadeInUp 0.6s ease-out 0.55s both; }
.menu-play-btn { animation: fadeInUp 0.6s ease-out 0.7s both; }

.sidebar-label { animation: fadeInRight 0.5s ease-out 0.6s both; }
.save-card:nth-child(2) { animation: fadeInRight 0.5s ease-out 0.7s both; }
.save-card:nth-child(3) { animation: fadeInRight 0.5s ease-out 0.8s both; }
.save-card:nth-child(4) { animation: fadeInRight 0.5s ease-out 0.9s both; }
.new-game-card { animation: fadeInRight 0.5s ease-out 1.0s both; }

.menu-bottom-bar { animation: fadeIn 0.6s ease-out 1.1s both; }
.account-btn { animation: fadeIn 0.6s ease-out 0.8s both; }

/* ═══════════════════════════════════════════════
   KEPT SECTIONS — Login, Buttons, Difficulty, etc.
   ═══════════════════════════════════════════════ */

/* ── Login Card ── */
.menu-login-card {
    background: var(--menu-surface, #1e1e24);
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 12px;
    padding: 36px;
    width: 380px;
    max-width: 100%;
    animation: menuFadeInUp 0.4s ease-out;
}

.menu-login-card h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 24px;
    text-align: center;
    color: var(--light);
}

.menu-login-card .login-error {
    color: var(--danger);
    font-size: 13px;
    display: none;
    margin-bottom: 12px;
    text-align: center;
}

.menu-login-card input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 10px;
    background: var(--menu-bg, #111113);
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 8px;
    color: var(--light);
    font-size: 14px;
    font-family: var(--font-body);
    transition: border-color 0.2s;
    outline: none;
}

.menu-login-card input:focus {
    border-color: var(--primary-light);
}

.menu-login-card input::placeholder {
    color: var(--menu-text-muted, #5a5a65);
}

.menu-login-buttons {
    display: flex;
    gap: 10px;
    margin-top: 6px;
}

.menu-form-toggle {
    display: block;
    width: 100%;
    margin-top: 16px;
    padding: 0;
    background: none;
    border: none;
    color: var(--menu-text-muted, #5a5a65);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    transition: color 0.2s;
}

.menu-form-toggle:hover {
    color: var(--primary-light);
}

.btn-primary {
    flex: 1;
    padding: 12px;
    background: var(--primary);
    border: 1px solid var(--primary-light);
    border-radius: 8px;
    color: var(--light);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-light);
    box-shadow: 0 0 20px rgba(14, 165, 151, 0.3);
}

.btn-ghost {
    flex: 1;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 8px;
    color: var(--menu-text-dim, #8a8a95);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    border-color: var(--primary-light);
    color: var(--light);
}

/* ── Save Cards Header ── */
.menu-saves-header {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--menu-text-dim, #8a8a95);
    margin-bottom: 20px;
    text-align: center;
}

/* ── Difficulty Picker ── */
.menu-difficulty-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    width: 100%;
    max-width: 560px;
    animation: menuFadeInUp 0.4s ease-out;
}

.difficulty-card {
    background: var(--menu-surface, #1e1e24);
    border: 2px solid var(--menu-border, #2a2a32);
    border-radius: 12px;
    padding: 32px 24px;
    cursor: pointer;
    text-align: center;
    transition: all 0.25s ease;
    position: relative;
    overflow: hidden;
}

.difficulty-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--card-accent);
    border-radius: 12px 0 0 12px;
}

.difficulty-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

.difficulty-card.easy {
    --card-accent: var(--success);
}

.difficulty-card.easy:hover {
    border-color: var(--success);
}

.difficulty-card.real {
    --card-accent: var(--accent);
}

.difficulty-card.real:hover {
    border-color: var(--accent);
}

.difficulty-card-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--light);
}

.difficulty-card-desc {
    font-size: 14px;
    color: var(--menu-text-dim, #8a8a95);
    line-height: 1.7;
}

.menu-back-btn {
    margin-top: 24px;
    background: none;
    border: none;
    color: var(--menu-text-dim, #8a8a95);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    transition: color 0.2s;
    padding: 8px 16px;
}

.menu-back-btn:hover {
    color: var(--light);
}

/* ── Account Menu (dropdown) ── */
.menu-account-trigger {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 200;
    background: rgba(30, 30, 36, 0.8);
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 8px;
    padding: 8px 16px;
    color: var(--menu-text-dim, #8a8a95);
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
}

.menu-account-trigger:hover {
    color: var(--light);
    border-color: var(--primary-light);
}

.menu-account-dropdown {
    position: fixed;
    top: var(--hud-height);
    right: 24px;
    z-index: 200;
    background: var(--menu-surface, #1e1e24);
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 10px;
    padding: 20px;
    width: 260px;
    animation: menuFadeInUp 0.2s ease-out;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
}

.menu-account-dropdown .account-name {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 15px;
    margin-bottom: 2px;
}

.menu-account-dropdown .account-email {
    font-size: 12px;
    color: var(--menu-text-muted, #5a5a65);
    margin-bottom: 16px;
}

.menu-account-dropdown button {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    font-size: 13px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: var(--danger);
    margin-bottom: 8px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.08);
}

.btn-close-menu {
    background: transparent;
    border: 1px solid var(--menu-border, #2a2a32);
    color: var(--menu-text-dim, #8a8a95);
}

.btn-close-menu:hover {
    border-color: var(--menu-text-muted, #5a5a65);
    color: var(--light);
}

/* ── Delete Confirmation Modal ── */
.menu-delete-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 300;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: menuFadeIn 0.2s ease-out;
    backdrop-filter: blur(4px);
}

.menu-delete-modal {
    background: var(--menu-surface, #1e1e24);
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 12px;
    padding: 32px;
    width: 340px;
    text-align: center;
    animation: menuFadeInUp 0.3s ease-out;
}

.menu-delete-modal h3 {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
}

.menu-delete-modal p {
    font-size: 14px;
    color: var(--menu-text-dim, #8a8a95);
    margin-bottom: 24px;
    line-height: 1.5;
}

.menu-delete-modal .modal-buttons {
    display: flex;
    gap: 10px;
}

.btn-cancel {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 8px;
    color: var(--menu-text-dim, #8a8a95);
    font-size: 14px;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    border-color: var(--menu-text-muted, #5a5a65);
    color: var(--light);
}

.btn-danger {
    flex: 1;
    padding: 10px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 8px;
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

/* ── Profile Card ── */
.menu-profile-card {
    background: var(--menu-surface, #1e1e24);
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 12px;
    padding: 36px;
    width: 420px;
    max-width: 100%;
    animation: menuFadeInUp 0.4s ease-out;
}

.menu-profile-card h3 {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 24px;
    color: var(--light);
}

.menu-profile-card label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--menu-text-dim, #8a8a95);
    margin-bottom: 6px;
}

.menu-profile-card input {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 16px;
    background: var(--menu-bg, #111113);
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 8px;
    color: var(--light);
    font-size: 14px;
    font-family: var(--font-body);
    transition: border-color 0.2s;
    outline: none;
}

.menu-profile-card input:focus {
    border-color: var(--primary-light);
}

.profile-section-divider {
    border: none;
    border-top: 1px solid var(--menu-border, #2a2a32);
    margin: 24px 0;
}

.profile-section-label {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--menu-text-muted, #5a5a65);
    margin-bottom: 16px;
}

.profile-message {
    font-size: 13px;
    text-align: center;
    margin-bottom: 12px;
    display: none;
}

.profile-message.error { color: var(--danger); }
.profile-message.success { color: var(--success); }

.btn-danger-outline {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 8px;
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-body);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-danger-outline:hover {
    background: rgba(239, 68, 68, 0.08);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.15);
}

/* ── Empty State ── */
.menu-empty-state {
    text-align: center;
    padding: 40px 0;
    animation: menuFadeInUp 0.4s ease-out;
}

.menu-empty-state p {
    color: var(--menu-text-muted, #5a5a65);
    font-size: 15px;
    margin-bottom: 24px;
}

/* ── Loading Text ── */
.menu-loading {
    color: var(--menu-text-dim, #8a8a95);
    font-size: 16px;
    padding: 40px 0;
    text-align: center;
}

.menu-loading-save {
    color: var(--menu-text-dim, #8a8a95);
    font-size: 14px;
    text-align: center;
    margin-top: 20px;
    animation: menuPulse 1.5s ease-in-out infinite;
}

/* ── Legacy Animations (used by kept sections) ── */
@keyframes menuFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes menuFadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes menuPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* ── Leaderboard ── */
.menu-leaderboard-btn {
    display: block;
    margin: 20px auto 0;
    padding: 10px 28px;
    background: transparent;
    border: 1px solid var(--menu-border, #2a2a32);
    border-radius: 8px;
    color: var(--light);
    font-family: var(--font-body);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
}
.menu-leaderboard-btn:hover {
    border-color: #6366f1;
    color: #a5b4fc;
    background: rgba(99, 102, 241, 0.08);
}

.leaderboard-filters {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
}
.leaderboard-filter {
    padding: 6px 16px;
    border-radius: 6px;
    border: 1px solid var(--menu-border, #2a2a32);
    background: transparent;
    color: #8a8a95;
    font-family: var(--font-body);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.leaderboard-filter:hover {
    border-color: #6366f1;
    color: #c7d2fe;
}
.leaderboard-filter.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #a5b4fc;
}

.leaderboard-table-wrap {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 8px;
    border: 1px solid var(--menu-border, #2a2a32);
    margin-bottom: 16px;
}
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.leaderboard-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}
.leaderboard-table th {
    background: #1a1a22;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #8a8a95;
    border-bottom: 1px solid var(--menu-border, #2a2a32);
}
.leaderboard-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: #c8c8d0;
}
.leaderboard-table tbody tr:hover {
    background: rgba(255,255,255,0.03);
}
.leaderboard-table tr.lb-me {
    background: rgba(99, 102, 241, 0.1);
}
.leaderboard-table tr.lb-me td {
    color: #c7d2fe;
    font-weight: 500;
}
.lb-rank {
    width: 40px;
    text-align: center;
    font-weight: 600;
    color: #6366f1;
}
.lb-score {
    font-weight: 600;
    font-family: var(--font-mono, monospace);
    color: #a5b4fc;
}
.lb-revenue {
    font-family: var(--font-mono, monospace);
}
.leaderboard-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6a6a75;
    font-size: 14px;
}

/* ═══════════════════════════════════════════════
   SETTINGS PANEL
   ═══════════════════════════════════════════════ */

.settings-panel {
    max-width: 520px;
    width: 100%;
    padding: 0 20px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.settings-tab-bar {
    display: flex;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 16px;
    gap: 0;
}

.settings-tab {
    background: none;
    border: none;
    color: var(--menu-text-muted, #5a5a65);
    padding: 10px 16px;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
}

.settings-tab:hover {
    color: var(--menu-text-dim, #8a8a95);
}

.settings-tab.active {
    color: #c8c8d0;
    border-bottom-color: #6366f1;
}

.settings-tab-content {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 8px;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.settings-label {
    font-size: 13px;
    color: #c8c8d0;
}

.settings-note {
    font-size: 11px;
    opacity: 0.5;
    margin-left: 4px;
}

.settings-toggle {
    min-width: 50px;
    padding: 5px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(21, 23, 32, 0.8);
    color: #8a8a95;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.settings-toggle.on {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #c7d2fe;
}

.settings-toggle.wide {
    width: 100%;
    padding: 8px 12px;
}

.settings-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.settings-hint {
    font-size: 11px;
    opacity: 0.5;
    margin: 0;
    color: #a0a0ad;
}

.settings-subsection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-slider-label {
    font-size: 13px;
    min-width: 50px;
    color: #c8c8d0;
}

.settings-slider {
    flex: 1;
    accent-color: #6366f1;
}

.settings-slider-value {
    font-size: 12px;
    min-width: 28px;
    text-align: right;
    opacity: 0.7;
    color: #c8c8d0;
}

.settings-preset-row {
    display: flex;
    gap: 6px;
}

.settings-preset-btn {
    flex: 1;
    padding: 6px 4px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(21, 23, 32, 0.8);
    color: #8a8a95;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}

.settings-preset-btn:hover {
    border-color: #6366f1;
    color: #c7d2fe;
}

.settings-preset-btn.active {
    background: rgba(99, 102, 241, 0.15);
    border-color: #6366f1;
    color: #c7d2fe;
}

/* ═══════════════════════════════════════════════
   ABOUT PAGE
   ═══════════════════════════════════════════════ */

.about-page {
    max-width: 640px;
    width: 100%;
    padding: 0 20px;
    max-height: 85vh;
    overflow-y: auto;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 16px;
}

.about-section h3 {
    font-family: var(--font-heading, 'Exo 2', sans-serif);
    font-size: 15px;
    font-weight: 600;
    color: #c7d2fe;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
}

.about-section p {
    font-size: 14px;
    line-height: 1.7;
    color: #a0a0ad;
}

.about-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.about-list li {
    font-size: 14px;
    line-height: 1.6;
    color: #a0a0ad;
    padding-left: 16px;
    position: relative;
}

.about-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #6366f1;
}

.about-list li strong {
    color: #c8c8d0;
}

.about-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 20px;
    text-align: center;
}

.about-footer p {
    display: flex;
    align-items: center;
    justify-content: center;
}

.about-credit {
    font-size: 12px !important;
    color: #5a5a65 !important;
    margin-top: 4px;
}

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */

@media (max-width: 900px) {
    #menu-overlay {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr auto;
        padding: 24px;
        overflow-y: auto;
    }
    .menu-title-area { padding-bottom: 24px; }
    .menu-title-novex { font-size: 56px; }
    .menu-title-empire { font-size: 32px; }
    .menu-sidebar { padding: 0; }
}

@media (max-width: 640px) {
    #menu-overlay {
        display: flex;
        flex-direction: column;
        padding: 16px;
        gap: 12px;
        overflow-y: auto;
        height: 100dvh;
        -webkit-overflow-scrolling: touch;
    }
    .menu-title-area {
        padding-bottom: 12px;
        text-align: center;
        align-items: center;
        flex-shrink: 0;
    }
    .menu-title-novex { font-size: 42px; }
    .menu-title-empire { font-size: 24px; letter-spacing: 0.18em; }
    .menu-title-tagline { font-size: 11px; margin-bottom: 24px; }
    .menu-play-btn {
        padding: 14px 36px;
        font-size: 15px;
    }
    .menu-sidebar {
        flex: 1 1 auto;
        overflow-y: auto;
        min-height: 0;
    }
    .menu-login-card {
        padding: 24px;
    }
    .menu-login-card input:focus {
        /* Ensure input scrolls into view when keyboard opens */
        scroll-margin-bottom: 120px;
    }
    .menu-bottom-bar {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px 0;
    }
    .bottom-links {
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
    }
    .bottom-link {
        font-size: 11px;
        gap: 4px;
    }
    .bottom-link svg {
        width: 14px;
        height: 14px;
    }
    .bottom-right {
        width: 100%;
        justify-content: center;
    }
    .menu-difficulty-grid {
        grid-template-columns: 1fr;
    }
    .menu-login-card {
        width: 100%;
    }
}
