/* ==========================================================================
   ORDFAIL CSS DESIGN SYSTEM & MODERN STYLESHEET
   ========================================================================== */

/* Modern CSS Reset & Variable Definitions */
:root {
    --font-heading: Arial, Helvetica, sans-serif;
    --font-body: Arial, Helvetica, sans-serif;

    --paper: #f4f2ec;
    --ink: #18211e;
    --muted: #61706a;
    --line: #d7ded7;
    --white: #fffdfc;
    --surface-strong: #f8fbf8;
    --surface-soft: #eef5f1;
    --surface-soft-line: #bfd0c6;
    --surface-search: #eaf1ee;
    --surface-search-line: #cadbd3;
    --surface-active: #e8f2ed;
    --surface-success: #dff2e7;
    --surface-danger: #ffd6d2;
    --surface-disabled: #e7ebea;
    --floating-surface: rgba(255, 255, 255, 0.92);
    --floating-surface-strong: rgba(248, 251, 248, 0.96);
    --frame-surface: rgba(23, 33, 33, 0.92);
    --frame-line: rgba(255, 255, 255, 0.24);
    --popup-line: rgba(255, 255, 255, 0.18);
    --leaf: #2f7d55;
    --leaf-dark: #235f42;
    --gold: #d9aa2e;
    --coral: #d96459;
    --blue: #3975a6;
    --critical: #b73228;
    --critical-strong: #c84d4d;
    --status-neutral-text: #61706a;
    --status-neutral-bg: #f5f8f6;
    --status-neutral-line: #dae5de;
    --status-info-text: #365467;
    --status-info-bg: #eef6fb;
    --status-info-line: #cddfed;
    --status-warning-text: #7a5900;
    --status-warning-bg: #fff4d4;
    --status-warning-line: #efcf72;
    --status-success-text: #1f5d40;
    --status-success-bg: #e8f5ee;
    --status-success-line: #b8dec8;
    --status-danger-text: #5f4851;
    --status-danger-bg: #eef1f2;
    --status-danger-line: #cad4d7;
    --wordle-text: #121213;
    --wordle-key: #d3d6da;
    --wordle-border: #d3d6da;
    --wordle-fill-border: #878a8c;
    --crossword-panel: #ffffff;
    --crossword-panel-line: #c6d0cb;
    --crossword-grid-bg: #18211e;
    --crossword-cell: #f7faf8;
    --crossword-ink: #18211e;
    --crossword-muted: #6b7a73;
    --crossword-cell-number: rgba(255, 253, 252, 0.92);
    --crossword-active: #cfe0fb;
    --crossword-selected: #2454c7;
    --crossword-correct: #cbe8d4;
    --crossword-wrong: #f2c7c2;
    --wordle-correct: #2f8f63;
    --wordle-correct-dark: #1e6948;
    --wordle-present: #f0c44c;
    --wordle-present-dark: #b88410;
    --wordle-absent: #647278;
    --wordle-absent-dark: #49545a;
    --bg-dark: var(--paper);
    --bg-gradient: none;
    --page-glow: radial-gradient(circle at top right, rgba(53, 82, 71, 0.12), transparent 38%);
    --panel-bg: rgba(255, 255, 255, 0.92);
    --panel-border: var(--line);
    --panel-border-hover: var(--ink);
    --text-primary: var(--ink);
    --text-secondary: var(--muted);
    --text-muted: #7a887f;
    --accent-color: var(--leaf);
    --accent-glow: rgba(47, 125, 85, 0.18);
    --accent-gradient: linear-gradient(135deg, #355247 0%, #274238 100%);
    --danger-color: var(--critical);
    --danger-glow: rgba(183, 50, 40, 0.18);
    --success-color: var(--leaf);
    --success-glow: rgba(47, 125, 85, 0.18);
    --card-glow: 0 18px 44px rgba(23, 33, 33, 0.12);
    --shadow: 0 18px 44px rgba(23, 33, 33, 0.12);
    --shadow-strong: 0 24px 54px rgba(23, 33, 33, 0.18);
    --shadow-soft: 0 10px 22px rgba(23, 33, 33, 0.08);
    --shadow-soft-hover: 0 14px 28px rgba(23, 33, 33, 0.11);
    --powerup-freeze: #3d90c2;
    --powerup-nuke: #d96459;
    --powerup-slow: #d9aa2e;
    --powerup-shield: #2f7d55;
}

body.theme-neon {
    --accent-color: var(--leaf);
    --accent-glow: rgba(47, 125, 85, 0.18);
    --accent-gradient: linear-gradient(135deg, #355247 0%, #274238 100%);
}

body.theme-midnight {
    --paper: #111816;
    --ink: #edf3ef;
    --muted: #9eada6;
    --line: #2b3732;
    --white: #18211e;
    --surface-strong: #1e2824;
    --surface-soft: #202b26;
    --surface-soft-line: #3b4b44;
    --floating-surface: rgba(24, 33, 30, 0.92);
    --floating-surface-strong: rgba(30, 40, 36, 0.96);
    --panel-bg: rgba(30, 40, 36, 0.92);
    --panel-border: #314039;
    --panel-border-hover: #7db498;
    --text-primary: #edf3ef;
    --text-secondary: #9eada6;
    --text-muted: #b7c4be;
    --accent-color: #7db498;
    --accent-glow: rgba(125, 180, 152, 0.18);
    --accent-gradient: linear-gradient(135deg, #7db498 0%, #274238 100%);
    --danger-color: #ff8f88;
    --success-color: #7db498;
    --page-glow: radial-gradient(circle at top right, rgba(111, 168, 136, 0.16), transparent 42%);
}

body.theme-emerald {
    --paper: #f1f7f4;
    --accent-color: #2f7d55;
    --accent-glow: rgba(47, 125, 85, 0.18);
    --accent-gradient: linear-gradient(135deg, #34a06f 0%, #1f5d40 100%);
}

body.theme-sunset {
    --paper: #fbf4f2;
    --accent-color: #d96459;
    --accent-glow: rgba(217, 100, 89, 0.2);
    --accent-gradient: linear-gradient(135deg, #d96459 0%, #9d3a33 100%);
}

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

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--page-glow), var(--paper);
    font-family: var(--font-body);
    line-height: 1.5;
    transition: background-color 180ms ease, color 180ms ease;
    overflow-x: hidden;
    position: relative;
}

/* Background Grid Overlay */
.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(24, 33, 30, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(24, 33, 30, 0.035) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    pointer-events: none;
}

.bg-glow {
    position: fixed;
    top: -20%;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, rgba(53, 82, 71, 0.16), transparent 65%);
    filter: blur(150px);
    opacity: 0.25;
    z-index: -1;
    pointer-events: none;
    border-radius: 50%;
}

/* Glassmorphic Panel Base Styles */
.glass-panel {
    background: var(--floating-surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-panel:hover {
    border-color: var(--panel-border-hover);
}

.glass-panel-glow {
    background: var(--floating-surface-strong);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-strong);
}

/* Dashboard Layout */
.app-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 28px;
    min-height: 100vh;
    height: auto;
}

/* Sidebars styling */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
    overflow-y: auto;
    padding-bottom: 20px;
}

/* Scrollbar styles for sidebars */
.sidebar::-webkit-scrollbar,
.top-scores-container::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track,
.top-scores-container::-webkit-scrollbar-track {
    background: var(--surface-soft);
    border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb,
.top-scores-container::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover,
.top-scores-container::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

.sidebar h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mobile-close-btn {
    display: none;
}

/* Left Sidebar specifics */
.brand-container {
    padding: 10px 0;
    text-align: left;
}

.lektoren-title {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    background: linear-gradient(135deg, #f472b6 0%, #d946ef 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -1px;
    text-shadow: 0 0 30px rgba(217, 70, 239, 0.4);
}

.brand-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: -2px;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.nav-btn-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-radius: 12px;
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.nav-btn-link:hover {
    background: var(--surface-strong);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft-hover);
}

.nav-btn-link.special-link {
    background: linear-gradient(135deg, rgba(53, 82, 71, 0.12) 0%, rgba(47, 125, 85, 0.12) 100%);
    border-color: rgba(47, 125, 85, 0.2);
}

.nav-btn-link.special-link:hover {
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft-hover);
}

.language-links-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.btn-lang {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    border-radius: 10px;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-lang:hover {
    background: var(--surface-soft);
    border-color: var(--accent-color);
    color: var(--text-primary);
    transform: scale(1.03);
}

.sidebar-footer p {
    font-size: 0.75rem;
    line-height: 1.5;
    color: var(--text-muted);
}

/* Main Content Area */
.main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: auto;
    overflow-y: visible;
    padding-right: 0;
}

.mobile-header {
    display: none;
}

/* Game Container - Wraps all screens */
.game-container {
    height: 80vh;
    width: 100%;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    min-height: 550px;
}

/* Screens rendering */
.screen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 5;
}

.screen.active-screen, 
.screen[style*="display: block"] {
    display: block !important;
}

/* Menu Screen Styles */
#menu-screen {
    overflow-y: auto;
}

.menu-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 10px;
}

.menu-header .lektoren-title {
    font-size: 3.5rem;
    margin-bottom: 2px;
}

.menu-header .brand-subtitle {
    margin-bottom: 20px;
    font-size: 1rem;
    letter-spacing: 3px;
}

.menu-card {
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 20px;
    width: 100%;
}

#menu-screen .wallet-badge {
    position: absolute;
    top: 24px;
    right: 24px;
    margin: 0;
    z-index: 10;
}

.mascot-emoji {
    font-size: 3.5rem;
    margin-bottom: 5px;
    display: inline-block;
}

.menu-card h2 {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

.menu-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 500px;
    margin: 0 auto;
}

.wallet-badge {
    align-self: center;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(47, 125, 85, 0.08);
    border: 1px solid rgba(47, 125, 85, 0.18);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--leaf);
    box-shadow: var(--shadow-soft);
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
}

.group-label {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
}

.version-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 8px;
    width: 100%;
}

.version-item, .order-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text-secondary);
    font-family: var(--font-body);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.version-item:hover, .order-item:hover {
    background: var(--surface-soft);
    border-color: var(--accent-color);
    transform: translateY(-1px);
}

.version-item.active, .order-item.active {
    background: var(--accent-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 15px var(--accent-glow);
    font-weight: 700;
}

.version-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--surface-soft);
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 800;
}

.version-title {
    flex: 1;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.order-options {
    display: flex;
    gap: 12px;
}

.order-item {
    flex: 1;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
}

.order-icon {
    font-size: 1.15rem;
}

.menu-actions {
    display: flex;
    gap: 15px;
    width: 100%;
    margin-top: 10px;
}

.menu-actions .btn-primary {
    flex: 2;
}

.menu-actions .btn-secondary {
    flex: 1;
}

/* Button styling */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: 30px;
    border: none;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-primary {
    background: var(--accent-gradient);
    color: #fff;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.glow-btn {
    box-shadow: 0 0 20px rgba(217, 70, 239, 0.3);
}

.btn-secondary {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: var(--surface-soft);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.daily-btn {
    background: linear-gradient(135deg, rgba(47, 125, 85, 0.12) 0%, rgba(53, 82, 71, 0.12) 100%);
    border: 1px solid rgba(47, 125, 85, 0.2);
    color: var(--leaf);
}

.daily-btn:hover {
    background: linear-gradient(135deg, rgba(47, 125, 85, 0.18) 0%, rgba(53, 82, 71, 0.18) 100%);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft-hover);
}

.mini-btn {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 8px;
    min-width: unset;
}

/* Shop Theme Section */
.shop-section {
    border-top: 1px solid var(--line);
    padding-top: 20px;
    text-align: left;
}

.shop-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.themes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
}

.theme-btn {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    cursor: pointer;
    transition: all 0.25s ease;
    width: 100%;
}

.theme-btn:hover {
    transform: translateY(-2px);
    background: var(--surface-soft);
    border-color: var(--accent-color);
}

.theme-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.theme-status {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-weight: 700;
}

/* Active Theme Selection Styling */
.theme-btn.active {
    border-color: var(--accent-color);
    background: rgba(47, 125, 85, 0.08);
    box-shadow: var(--shadow-soft);
}
.theme-btn.active .theme-status {
    color: var(--accent-color);
}

.theme-btn.owned .theme-status {
    color: var(--success-color);
}

.theme-btn.locked .theme-status {
    color: #fbbf24;
}

/* Game Interface Layout */
.game-layout {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: var(--floating-surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 15px;
    box-shadow: var(--shadow);
}

/* Stats dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(6, 1fr) auto;
    gap: 10px;
    background: var(--surface-strong);
    padding: 10px 15px;
    border-radius: 14px;
    border: 1px solid var(--line);
    margin-top: 15px;
}

.header-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
}

.stat-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.stat-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.lives-box .stat-value {
    letter-spacing: -2px;
    font-size: 0.95rem;
}

/* Streak and Multiplier Progress */
.streak-bar-wrapper {
    margin-bottom: 12px;
    background: var(--surface-strong);
    border-radius: 10px;
    padding: 8px 12px;
    border: 1px solid var(--line);
}

.streak-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

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

.multiplier-badge {
    background: var(--accent-gradient);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: var(--shadow-soft);
}

.streak-bar-track {
    width: 100%;
    height: 6px;
    background: var(--surface-soft);
    border-radius: 3px;
    overflow: hidden;
}

#streak-bar-inner {
    height: 100%;
    width: 0%;
    background: var(--accent-gradient);
    border-radius: 3px;
    box-shadow: 0 0 10px var(--accent-color);
    transition: width 0.3s cubic-bezier(0.1, 0.8, 0.3, 1);
}

/* Interactive typing canvas */
.game-area {
    flex: 1;
    width: 100%;
    position: relative;
    background: linear-gradient(180deg, var(--surface-strong), var(--surface-soft));
    border-radius: 16px;
    border: 1px solid var(--line);
    overflow: hidden;
    margin-bottom: 15px;
    box-shadow: inset 0 0 20px rgba(23, 33, 33, 0.06);
}

.danger-line {
    position: absolute;
    bottom: 80px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, var(--danger-color) 20%, #ff5e97 50%, var(--danger-color) 80%, transparent 100%);
    box-shadow: 0 0 12px var(--danger-color);
    z-index: 4;
}

.danger-zone {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: linear-gradient(to top, rgba(255, 0, 85, 0.08), transparent);
    pointer-events: none;
    z-index: 2;
}

.student-character-game {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 3rem;
    z-index: 5;
    filter: drop-shadow(0 0 10px rgba(53, 82, 71, 0.16));
    animation: characterFloat 3s ease-in-out infinite;
}

@keyframes characterFloat {
    0%, 100% { transform: translate(-50%, 0) scale(1); }
    50% { transform: translate(-50%, -6px) scale(1.05); }
}

/* Falling words styling */
.falling-word {
    position: absolute;
    transform: translateX(-50%);
    padding: 6px 14px;
    background: var(--white);
    border: 1px solid var(--line);
    border-radius: 30px;
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
    color: var(--text-primary);
    box-shadow: var(--shadow-soft);
    z-index: 10;
    transition: transform 0.1s ease, border-color 0.1s ease, background-color 0.1s ease;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.falling-word.being-typed {
    background: var(--surface-soft);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft);
    transform: translateX(-50%) scale(1.08);
}

.falling-word.danger {
    border-color: var(--danger-color);
    background: rgba(183, 50, 40, 0.08);
    box-shadow: var(--shadow-soft);
    animation: wordPanic 0.4s infinite;
}

@keyframes wordPanic {
    0%, 100% { transform: translateX(-50%) scale(1); }
    50% { transform: translateX(-50%) scale(1.04) rotate(1deg); }
}

/* Word letters highlight styles */
.typed-chars {
    color: var(--success-color);
    text-shadow: 0 0 8px var(--success-glow);
}

/* Power-ups decorations on falling words */
.pup-badge {
    font-size: 0.75rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 20px;
    text-transform: uppercase;
    color: #fff;
    box-shadow: 0 0 8px currentColor;
}

.pup-badge.freeze { background-color: var(--powerup-freeze); }
.pup-badge.nuke { background-color: var(--powerup-nuke); }
.pup-badge.slow { background-color: var(--powerup-slow); }
.pup-badge.shield { background-color: var(--powerup-shield); }

.falling-word.has-powerup {
    border-width: 2px;
}
.falling-word.pup-freeze { border-color: var(--powerup-freeze); box-shadow: 0 0 10px rgba(0, 210, 255, 0.2); }
.falling-word.pup-nuke { border-color: var(--powerup-nuke); box-shadow: 0 0 10px rgba(255, 51, 102, 0.2); }
.falling-word.pup-slow { border-color: var(--powerup-slow); box-shadow: 0 0 10px rgba(255, 153, 0, 0.2); }
.falling-word.pup-shield { border-color: var(--powerup-shield); box-shadow: 0 0 10px rgba(153, 51, 255, 0.2); }

/* Screen effects for active power-ups */
.overlay-status {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    padding: 6px 16px;
    border-radius: 20px;
    font-family: var(--font-heading);
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 1px;
    color: #fff;
    z-index: 20;
    animation: overlayPop 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

@keyframes overlayPop {
    0% { transform: translateX(-50%) scale(0.6); opacity: 0; }
    100% { transform: translateX(-50%) scale(1); opacity: 1; }
}

.overlay-status-freeze { background: var(--powerup-freeze); box-shadow: 0 0 15px var(--powerup-freeze); }
.overlay-status-slow { background: var(--powerup-slow); box-shadow: 0 0 15px var(--powerup-slow); }
.overlay-status-shield { background: var(--powerup-shield); box-shadow: 0 0 15px var(--powerup-shield); }
.overlay-status-nuke { background: var(--powerup-nuke); box-shadow: 0 0 15px var(--powerup-nuke); }

/* Typing Interface Input */
.input-container {
    text-align: center;
    width: 100%;
}

#word-input {
    width: 100%;
    max-width: 450px;
    padding: 14px 20px;
    border-radius: 30px;
    border: 2px solid var(--panel-border);
    background: rgba(0, 0, 0, 0.3);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1.15rem;
    text-align: center;
    letter-spacing: 0.5px;
    transition: all 0.25s ease;
}

#word-input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 20px var(--accent-glow);
    background: rgba(0, 0, 0, 0.5);
    transform: translateY(-1px);
}

#word-input::placeholder {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Particle / Nuke effects */
.particle {
    position: absolute;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 12;
}

.nuke-flash {
    animation: screenNukeFlash 0.5s ease-out;
}

@keyframes screenNukeFlash {
    0% { background-color: rgba(255, 51, 102, 0.6); }
    100% { background-color: rgba(0,0,0,0.4); }
}

.success-flash {
    animation: screenSuccessFlash 0.3s ease-out;
}

@keyframes screenSuccessFlash {
    0% { box-shadow: inset 0 0 30px rgba(0, 255, 204, 0.2); }
    100% { box-shadow: inset 0 0 20px rgba(0,0,0,0.6); }
}

.error-flash {
    animation: screenErrorFlash 0.3s ease-out;
}

@keyframes screenErrorFlash {
    0% { box-shadow: inset 0 0 30px rgba(255, 0, 85, 0.25); }
    100% { box-shadow: inset 0 0 20px rgba(0,0,0,0.6); }
}

/* Level complete & Gameover cards details */
#next-level-btn {
    align-self: center;
    min-width: 250px;
    margin-top: 10px;
}

.stats-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    width: 100%;
    margin: 20px 0;
}

.summary-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    padding: 12px;
    border-radius: 12px;
}

.summary-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.summary-val {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.level-celebration, .pause-header, .gameover-header {
    text-align: center;
    margin-bottom: 10px;
}

.level-celebration h2, .gameover-header h2 {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 800;
}

.celebration-text, .gameover-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.bounce-anim {
    animation: mascotBounce 1.5s infinite ease-in-out;
}

@keyframes mascotBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

.sad-anim {
    animation: mascotSad 2.5s infinite;
}

@keyframes mascotSad {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

.coins-earned-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 30px;
    background: rgba(47, 125, 85, 0.08);
    border: 1px solid rgba(47, 125, 85, 0.2);
    font-family: var(--font-heading);
    font-weight: 800;
    color: var(--leaf);
    font-size: 1rem;
    margin: 10px 0;
    width: 100%;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 10px rgba(251, 191, 36, 0.1); }
    50% { box-shadow: 0 0 20px rgba(251, 191, 36, 0.3); }
}

.gameover-actions, .pause-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
}

.gameover-actions .btn-primary,
.gameover-actions .btn-secondary,
.pause-actions .btn-primary,
.pause-actions .btn-secondary {
    width: 100%;
    min-width: unset;
}

/* Info and Guide panel under game screen */
.info-table-container {
    width: 100%;
}

.guide-panel h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-align: left;
}

.guide-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.guide-card {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 15px;
    text-align: left;
    transition: all 0.25s ease;
}

.guide-card:hover {
    background: var(--surface-soft);
    border-color: var(--accent-color);
    transform: translateY(-2px);
}

.guide-icon {
    font-size: 1.5rem;
    display: inline-block;
    margin-bottom: 8px;
}

.guide-card h4 {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.guide-card p {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Right Sidebar: High scores and tips */
.scores-panel {
    display: flex;
    flex-direction: column;
    height: auto;
}

.top-scores-container {
    flex: 1;
    overflow-y: auto;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--surface-strong);
}

.top-scores-table {
    width: 100%;
    border-collapse: collapse;
}

.top-scores-table th {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    padding: 10px 8px;
    text-align: center;
    border-bottom: 1px solid var(--line);
    background: var(--surface-soft);
    position: sticky;
    top: 0;
    z-index: 10;
}

.top-scores-table td {
    padding: 8px 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: center;
    border-bottom: 1px solid var(--line);
}

.top-scores-table tbody tr:hover {
    background: var(--surface-soft);
}

/* Special Podium Rankings Styling */
.top-scores-table tbody tr:nth-child(1) td {
    color: var(--gold);
    font-weight: 700;
    background: rgba(217, 170, 46, 0.05);
}

.top-scores-table tbody tr:nth-child(2) td {
    color: #cbd5e1;
    font-weight: 700;
    background: rgba(203, 213, 225, 0.03);
}

.top-scores-table tbody tr:nth-child(3) td {
    color: #cd7f32;
    font-weight: 700;
    background: rgba(205, 127, 50, 0.03);
}

/* Tips Panel */
.tips-panel ul {
    list-style-type: none;
    padding: 0;
}

.tips-panel li {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.45;
    position: relative;
    padding-left: 15px;
    margin-bottom: 10px;
}

.tips-panel li::before {
    content: '✦';
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-color);
}

/* Top 10 Celebration overlay card style */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeInOverlay 0.4s ease-out;
}

.celebration-content {
    background: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%);
    border: 3px solid #fbbf24;
    border-radius: 30px;
    padding: 50px 60px;
    max-width: 90vw;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 50px rgba(251, 191, 36, 0.3);
    animation: zoomBounce 0.6s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.celebration-trophy {
    font-size: 5rem;
    animation: trophyFloat 2s ease-in-out infinite;
    margin-bottom: 15px;
    filter: drop-shadow(0 0 15px rgba(251, 191, 36, 0.4));
}

@keyframes trophyFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
}

.celebration-title {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    background: linear-gradient(90deg, #fbbf24 0%, #fef08a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 5px;
}

.celebration-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.celebration-rank {
    font-family: var(--font-heading);
    font-size: 3.5rem;
    font-weight: 900;
    color: #fbbf24;
    text-shadow: 0 0 20px rgba(251, 191, 36, 0.4);
    margin-bottom: 10px;
}

.celebration-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

@keyframes zoomBounce {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.05); }
    100% { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   RESPONSIVE LAYOUT BREAKPOINTS
   ========================================================================== */

/* Tablet and smaller desktop layouts */
@media (max-width: 1200px) {
    .app-dashboard {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 15px;
    }
    
    .stats-dashboard {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .stats-dashboard button,
    .stats-dashboard .header-controls {
        grid-column: span 3;
    }

    .stats-dashboard .header-controls {
        display: flex;
        gap: 8px;
        width: 100%;
    }

    .stats-dashboard .header-controls button {
        grid-column: auto;
        flex: 1;
        width: 100%;
        margin: 0;
    }
    
    .guide-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile & Small Tablet Overlay Drawer System */
@media (max-width: 1024px) {
    .app-dashboard {
        grid-template-columns: 1fr;
        padding-top: 15px;
        height: auto;
        overflow-y: auto;
    }
    
    .main-content {
        padding-right: 0;
        height: auto;
        overflow-y: visible;
    }
    
    /* Sliding overlay panels for sidebars */
    .sidebar {
        position: fixed;
        top: 0;
        height: 100vh;
        width: 300px;
        z-index: 1000;
        background: var(--bg-dark);
        background-image: var(--bg-gradient);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.8);
        padding: 60px 20px 20px 20px;
        transition: transform 0.3s cubic-bezier(0.1, 0.9, 0.2, 1);
    }
    
    .sidebar-left {
        left: 0;
        transform: translateX(-100%);
        border-right: 1px solid var(--panel-border);
    }
    
    .sidebar-right {
        right: 0;
        transform: translateX(100%);
        border-left: 1px solid var(--panel-border);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .mobile-close-btn {
        display: block;
        position: absolute;
        top: 15px;
        right: 20px;
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.1);
        color: var(--text-primary);
        font-size: 1.1rem;
        width: 35px;
        height: 35px;
        border-radius: 50%;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Mobile header toggles */
    .mobile-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 50px;
        background: rgba(10, 6, 22, 0.85);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid var(--panel-border);
        padding: 0 15px;
        z-index: 900;
    }
    
    .mobile-toggle-btn {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
        color: var(--text-primary);
        padding: 6px 14px;
        border-radius: 8px;
        font-family: var(--font-heading);
        font-weight: 700;
        font-size: 0.8rem;
        cursor: pointer;
        transition: all 0.2s ease;
    }
    
    .mobile-toggle-btn:hover {
        background: rgba(255, 255, 255, 0.1);
        border-color: var(--accent-color);
    }
    
    .mobile-logo {
        font-family: var(--font-heading);
        font-size: 1.25rem;
        font-weight: 900;
        background: var(--accent-gradient);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }
    
    /* Responsive adjustment on game canvas */
    .game-container {
        height: calc(100vh - 120px);
        min-height: 520px;
    }
}

/* Phone Portrait Breakpoints */
@media (max-width: 600px) {
    .stats-dashboard {
        grid-template-columns: repeat(3, 1fr);
        padding: 8px;
        font-size: 0.8rem;
    }
    
    .stat-value {
        font-size: 0.95rem;
    }
    
    .version-list {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .menu-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
        padding: 12px 20px;
    }
    
    .guide-grid {
        grid-template-columns: 1fr;
    }
    
    .celebration-content {
        padding: 30px 20px;
    }
    
    .celebration-title {
        font-size: 1.75rem;
    }
    
    .celebration-rank {
        font-size: 2.5rem;
    }
}

/* ==========================================================================
   NEW STYLES FOR GAME MODES & BOOSTS
   ========================================================================== */

/* Game Mode Selection */
.mode-options {
    display: flex;
    gap: 12px;
}
.mode-item {
    flex: 1;
    justify-content: center;
    padding: 12px;
    font-size: 0.95rem;
}



/* Roguelite Boost Cards Selection Screen */
.boost-selection-area {
    margin: 20px 0;
    border-top: 1px solid var(--line);
    padding-top: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}
.boost-selection-title {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--leaf);
    text-shadow: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.boost-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    width: 100%;
    max-width: 500px;
}
.boost-card {
    background: var(--surface-strong);
    border: 2px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}
.boost-card:hover {
    transform: translateY(-5px) scale(1.02);
    background: var(--surface-soft);
    border-color: var(--accent-color);
    box-shadow: var(--shadow-soft-hover);
}
.boost-card.selected {
    background: rgba(47, 125, 85, 0.08);
    border-color: var(--success-color);
    box-shadow: var(--shadow-soft);
    transform: scale(1.05);
}
.boost-card-icon {
    font-size: 2.2rem;
    margin-bottom: 2px;
}
.boost-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-primary);
}
.boost-card-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.boost-card-cost {
    font-size: 0.7rem;
    font-weight: 700;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    padding: 2px 6px;
    border-radius: 8px;
    margin-top: auto;
}
.active-boosts-display {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
    justify-content: center;
}
.boost-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.25);
    color: #fbbf24;
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
}

@media (max-width: 600px) {
    .boost-cards-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   MODAL OVERLAY & POPUP STYLES
   ========================================================================== */

/* Modal Backdrop */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(4, 3, 8, 0.8);
    backdrop-filter: blur(12px) saturate(140%);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    z-index: 12000; /* Must be above pause screen */
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: auto;
}

/* Modal Entry Animations */
@keyframes modalFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes modalScaleIn {
    from {
        transform: scale(0.92) translateY(15px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.modal-overlay.active {
    display: flex;
    animation: modalFadeIn 0.25s ease-out forwards;
}

.modal-overlay.active .modal-content {
    animation: modalScaleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Glassmorphic Modal Content Container */
.modal-content {
    position: relative;
    width: 92%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 28px;
    padding: 35px 30px;
    background: var(--floating-surface-strong);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-strong);
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 3px;
}

/* Premium Close Button */
.modal-close-btn {
    position: absolute;
    top: 22px;
    right: 22px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--line);
    background: var(--surface-strong);
    color: var(--text-secondary);
    font-size: 1.6rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    z-index: 10;
}

.modal-close-btn:hover {
    background: var(--surface-soft);
    color: var(--text-primary);
    border-color: var(--panel-border-hover);
    transform: rotate(90deg);
    box-shadow: var(--shadow-soft-hover);
}

/* Modal Titles & Structure */
.modal-header {
    margin-bottom: 24px;
    text-align: left;
}

.modal-header h2 {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0 0 6px 0;
    letter-spacing: -0.5px;
}

.modal-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
}

.modal-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 15px;
    flex-wrap: wrap;
    text-align: left;
}

.modal-header-row h2 {
    font-family: var(--font-heading);
    font-size: 1.9rem;
    font-weight: 800;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    letter-spacing: -0.5px;
}

.shop-wallet {
    margin: 0 !important;
    padding: 8px 16px !important;
    font-size: 0.95rem !important;
    background: rgba(251, 191, 36, 0.08) !important;
    border: 1px solid rgba(251, 191, 36, 0.25) !important;
    border-radius: 14px !important;
    align-self: center !important;
}

/* Menu Actions & Layout Fixes */
.menu-actions-column {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    margin-top: 15px;
}

.menu-secondary-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
}

@media (max-width: 600px) {
    .menu-secondary-actions {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   CUSTOM WORDLISTS STYLES
   ========================================================================== */

/* Active Custom List Banner in Menu */
.custom-list-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(168, 85, 247, 0.1);
    border: 1px dashed rgba(168, 85, 247, 0.4);
    border-radius: 16px;
    padding: 12px 18px;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(168, 85, 247, 0.05);
    animation: bannerPulse 3s infinite ease-in-out;
}

@keyframes bannerPulse {
    0%, 100% { border-color: rgba(168, 85, 247, 0.4); box-shadow: 0 0 15px rgba(168, 85, 247, 0.05); }
    50% { border-color: rgba(168, 85, 247, 0.7); box-shadow: 0 0 25px rgba(168, 85, 247, 0.15); }
}

.custom-list-banner-content {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.banner-icon {
    font-size: 1.6rem;
    animation: bounceSlow 2s infinite ease-in-out;
}

@keyframes bounceSlow {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.banner-text-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.banner-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.banner-title strong {
    color: #a855f7;
    text-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.banner-desc {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.btn-save-shared {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.4);
    color: var(--text-primary);
    padding: 3px 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 5px;
    cursor: pointer;
    align-self: flex-start;
    transition: all 0.2s ease;
}

.btn-save-shared:hover {
    background: rgba(168, 85, 247, 0.4);
    border-color: #a855f7;
    box-shadow: 0 0 8px rgba(168, 85, 247, 0.3);
}

.btn-clear-custom {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0 5px;
    line-height: 1;
    transition: color 0.2s;
}

.btn-clear-custom:hover {
    color: #ff4757;
}

/* Modal Wide Layout for Custom Lists */
.custom-modal-wide {
    max-width: 900px !important;
    width: 95% !important;
}

.custom-lists-layout {
    display: grid;
    grid-template-columns: 1.1fr 1.3fr;
    gap: 30px;
    margin-top: 10px;
    text-align: left;
}

@media (max-width: 768px) {
    .custom-lists-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.list-creator-section, .list-manager-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.list-creator-section h3, .list-manager-section h3 {
    font-family: var(--font-heading);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    border-bottom: 1px solid var(--line);
    padding-bottom: 8px;
    margin: 0;
}

/* Inputs & Form Styling */
.input-field-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.input-field-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-field-group input[type="text"],
.input-field-group textarea {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.input-field-group input[type="text"]:focus,
.input-field-group textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    background: var(--surface-soft);
    box-shadow: var(--shadow-soft);
}

.input-field-group textarea {
    resize: vertical;
    min-height: 120px;
}

.creator-actions {
    display: flex;
    gap: 10px;
}

/* Saved Lists List Display */
.saved-lists-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 45vh;
    overflow-y: auto;
    padding-right: 5px;
    scrollbar-width: thin;
    scrollbar-color: var(--line) transparent;
}

.saved-lists-container::-webkit-scrollbar {
    width: 4px;
}

.saved-lists-container::-webkit-scrollbar-thumb {
    background: var(--line);
    border-radius: 2px;
}

.custom-list-card {
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-list-card:hover {
    border-color: var(--accent-color);
    background: var(--surface-soft);
    transform: translateY(-2px);
}

.active-list-card {
    background: rgba(168, 85, 247, 0.05);
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: inset 0 0 15px rgba(168, 85, 247, 0.1);
}

.list-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.list-card-title {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-word-count-badge {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
}

.active-list-card .list-word-count-badge {
    background: rgba(47, 125, 85, 0.12);
    border-color: rgba(47, 125, 85, 0.25);
    color: var(--text-primary);
}

.list-card-preview {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.list-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.btn-danger-icon {
    background: rgba(183, 50, 40, 0.08);
    border: 1px solid rgba(183, 50, 40, 0.18);
    color: var(--critical);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: auto;
    padding: 0;
    line-height: 1;
}

.btn-danger-icon:hover {
    background: rgba(183, 50, 40, 0.18);
    border-color: var(--critical);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

/* Empty State */
.no-lists-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: var(--surface-soft);
    border: 1px dashed var(--line);
    border-radius: 16px;
    text-align: center;
}

.no-lists-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    opacity: 0.5;
}

.no-lists-message p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 250px;
    line-height: 1.4;
}
