/* Base Styles from Game Styling for Consistency */
:root {
    /* Core Palette */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #1e293b;
    --bg-elevated: #334155;
    --bg-overlay: rgba(0, 0, 0, 0.75);

    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    --correct: #10b981;
    --present: #f59e0b;
    --absent: #475569;
    --border: #334155;
    --border-active: #64748b;

    --btn-bg: #475569;
    --btn-hover: #64748b;

    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --accent-light: #60a5fa;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.5), 0 10px 10px -5px rgba(0, 0, 0, 0.4);

    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;

    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

body.theme-light {
    --bg-primary: #f8fafc;
    --bg-secondary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-elevated: #e2e8f0;
    --bg-overlay: rgba(0, 0, 0, 0.4);

    --text-primary: #0f172a;
    --text-secondary: #334155;
    --text-muted: #64748b;

    --border: #e2e8f0;
    --border-active: #94a3b8;

    --btn-bg: #cbd5e1;
    --btn-hover: #94a3b8;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.1);
}

/* Light mode: fix hardcoded dark values */
body.theme-light {
    background-image:
        radial-gradient(at 0% 0%, hsla(210, 40%, 94%, 1) 0px, transparent 50%),
        radial-gradient(at 50% 0%, hsla(220, 30%, 96%, 1) 0px, transparent 50%),
        radial-gradient(at 100% 0%, hsla(210, 40%, 94%, 1) 0px, transparent 50%);
}

body.theme-light .card {
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.07);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

body.theme-light .card:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 0 0 1px rgba(255, 255, 255, 0.9);
}

body.theme-light .pattern-box {
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08), 0 0 40px rgba(59, 130, 246, 0.06);
}

body.theme-light .pattern-box::after {
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.06), transparent, rgba(0, 0, 0, 0.02));
}

body.theme-light .title {
    background: linear-gradient(to bottom, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-light .info-section-title {
    background: linear-gradient(to bottom, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-light .footer-logo {
    background: linear-gradient(135deg, #1e293b 0%, #475569 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.theme-light .hero-stats {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-light .hero-stat-divider {
    background: rgba(0, 0, 0, 0.1);
}

body.theme-light .footer-bottom {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

body.theme-light .footer-description {
    color: rgba(51, 65, 85, 0.6);
}

body.theme-light .footer-link:hover {
    color: #0f172a;
}

body.theme-light .bg-glow {
    background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.05), transparent 70%);
}

body.theme-light .modal-overlay {
    background: rgba(248, 250, 252, 0.85);
}

body.theme-light .modal-content {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

body.theme-light .section-badge {
    background: #e2e8f0;
    color: var(--accent);
}

body.theme-light .footer::before {
    opacity: 0.5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 50% 0%, hsla(217, 32%, 18%, 1) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(222, 47%, 12%, 1) 0px, transparent 50%);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    transition: background-color var(--transition-base), color var(--transition-base);
}

.bg-glow {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 1400px;
    height: 800px;
    background: radial-gradient(circle at 50% 0%, rgba(59, 130, 246, 0.08), transparent 70%);
    pointer-events: none;
    z-index: -1;
}

/* Layout */
.container {
    max-width: 1440px;
    margin: 0 auto;
    padding: 1rem 1.25rem 3rem;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    padding: 0;
    padding-top: 0.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 900;
    letter-spacing: -0.04em;
    margin-bottom: 0.75rem;
    background: linear-gradient(to bottom, #fff 0%, #cbd5e1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
    max-width: 1100px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto 0.5rem;
    letter-spacing: -0.01em;
}

@media (max-width: 480px) {
    .header {
        padding: 0 2.5rem;
        /* Ensure space for the button */
        margin-bottom: 2rem;
    }

    .title {
        font-size: 1.75rem;
        /* Smaller font on mobile */
    }
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.125rem;
}

/* Navigation Overlay & Panel (Identical to Game) */
.nav-overlay {
    position: fixed;
    inset: 0;
    background-color: var(--bg-overlay);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.nav-overlay.active {
    opacity: 1;
    visibility: visible;
}

.nav-panel {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background-color: var(--bg-card);
    z-index: 1001;
    box-shadow: var(--shadow-xl);
    transition: transform var(--transition-base);
    overflow-y: auto;
}

.nav-panel.active {
    transform: translateX(320px);
}

.nav-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.5rem;
}

.nav-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.nav-header h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close-nav {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-close-nav:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-align: left;
    font-family: inherit;
}

.nav-link:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent);
    color: white;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 1rem 0;
}

.nav-section-label {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin: 0.5rem 1rem 0.35rem;
}

.nav-link--current {
    background: rgba(59, 130, 246, 0.15);
    color: var(--accent-light);
}

.nav-setting {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
}

.setting-icon {
    color: var(--text-muted);
    display: flex;
    align-items: center;
}

.setting-text {
    flex-grow: 1;
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Feature Grid */
.main-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .main-grid {
        grid-template-columns: minmax(260px, 350px) minmax(0, 1fr);
        align-items: start;
    }
}

.sidebar {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

@media (min-width: 768px) {
    .sidebar {
        gap: 1.5rem;
    }
}

.card {
    background: rgba(30, 41, 59, 0.7);
    /* Translucent for glass effect */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    /* Soft border */
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
    padding: 1.75rem;
    transition: all var(--transition-base);
}

.card:hover {
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-xl), inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
}

/* Input Styles */
.input-field {
    margin-bottom: 1.25rem;
}

.input-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--text-secondary);
}

.text-input {
    width: 100%;
    background: var(--bg-primary);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.text-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
}

.pattern-box {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    align-items: center;
    background: rgba(30, 41, 59, 0.5);
    /* Lighter glass */
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 3rem;
    border-radius: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-xl), 0 0 40px rgba(59, 130, 246, 0.1);
    max-width: 1100px;
    margin: 0 auto 5rem;
    position: relative;
    transition: all var(--transition-base);
}

.pattern-box::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent, rgba(255, 255, 255, 0.05));
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.hero-row {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.row-label {
    font-size: 0.75rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.pattern-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    max-width: 100%;
}

.hero-actions {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 1.5rem;
}

.hero-row--toggle {
    align-items: flex-start;
}

.row-hint {
    width: 100%;
    max-width: 420px;
    text-align: center;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--text-muted);
    margin: 0;
}

.row-hint strong {
    color: var(--text-secondary);
    font-weight: 600;
}

.teal-dot {
    background: #14b8a6;
    box-shadow: 0 0 6px #14b8a6;
}

.must-include-input {
    border-color: #14b8a6 !important;
}

.must-include-input:focus {
    border-color: #2dd4bf !important;
    box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.2) !important;
}

.repeat-toggle {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    text-align: left;
    max-width: 480px;
    margin: 0 auto;
    padding: 0.5rem 0;
}

.repeat-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.repeat-toggle-ui {
    flex-shrink: 0;
    width: 2.75rem;
    height: 1.5rem;
    border-radius: 999px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    position: relative;
    transition: background var(--transition-base);
}

.repeat-toggle-ui::after {
    content: '';
    position: absolute;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background: white;
    top: 0.15rem;
    left: 0.2rem;
    transition: transform var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.repeat-toggle input:checked+.repeat-toggle-ui {
    background: var(--accent);
    border-color: var(--accent);
}

.repeat-toggle input:checked+.repeat-toggle-ui::after {
    transform: translateX(1.2rem);
}

.repeat-toggle input:focus-visible+.repeat-toggle-ui {
    outline: 2px solid var(--accent-light);
    outline-offset: 2px;
}

.repeat-toggle-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.repeat-toggle-text strong {
    color: var(--text-primary);
}

.hero-excludes {
    max-width: 400px;
    text-align: center;
}

.char-input {
    width: 3.5rem;
    height: 3.5rem;
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-weight: 800;
    text-align: center;
    color: var(--text-primary);
    text-transform: uppercase;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.char-input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2);
    transform: translateY(-2px);
}

.char-input:not(:placeholder-shown) {
    border-color: var(--accent-light);
}

@media (max-width: 480px) {

    .char-input,
    .wrong-pos-input {
        width: 3rem;
        height: 3rem;
        font-size: 1.25rem;
        gap: 0.25rem;
    }
}

/* Wrong Position & Excluded Styles */
.wrong-pos-grid {
    display: grid;
    grid-template-columns: repeat(var(--word-len, 5), 1fr);
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    max-width: 100%;
}

.wrong-pos-input {
    width: 3.5rem;
    height: 3.5rem;
    background: var(--bg-primary);
    border: 2px solid var(--present);
    border-radius: var(--radius-md);
    font-size: 1.5rem;
    font-weight: 800;
    padding: 0;
    text-align: center;
    color: var(--text-primary);
    text-transform: uppercase;
    transition: all 0.2s ease;
}

.wrong-pos-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.3);
    transform: translateY(-2px);
    border-color: var(--present);
}

.wrong-pos-input::placeholder {
    opacity: 0.3;
}

.excluded-input {
    border-color: var(--absent) !important;
}

.excluded-input:focus {
    border-color: var(--text-muted) !important;
    box-shadow: 0 0 0 4px rgba(71, 85, 105, 0.2) !important;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    border-radius: 100px;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.65rem;
    border: 1px solid transparent;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary:not(:disabled):hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: transparent;
    border-color: var(--border);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--bg-elevated);
    border-color: var(--border-active);
    color: var(--text-primary);
}

/* Dictionary Toggle */
.dictionary-controls {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.25rem;
    background: var(--bg-primary);
    border-radius: var(--radius-md);
}

.toggle-item {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-muted);
}

.toggle-item.active {
    background: var(--bg-card);
    color: var(--accent);
    box-shadow: var(--shadow-sm);
}

/* Sidebar */
.sidebar-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.sidebar-label--spaced {
    margin-top: 1rem;
}

.select-input {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: border-color var(--transition-fast);
}

.select-input:hover,
.select-input:focus {
    outline: none;
    border-color: var(--accent);
}

.checkbox-inline {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
    accent-color: var(--accent);
    vertical-align: middle;
}

/* Results Area */
.results-card {
    display: flex;
    flex-direction: column;
    min-height: 400px;
    max-height: calc(100vh - 250px);
    padding: 0;
    overflow: hidden;
}

.results-info {
    padding: 1.5rem 1.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-card);
    z-index: 10;
}

.results-heading {
    flex: 1 1 auto;
    min-width: 0;
}

.results-actions {
    flex-shrink: 0;
}

.results-list {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    min-height: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    justify-content: center;
    align-content: start;
    gap: 0.75rem;
}

body[data-word-length="6"] .results-list,
body[data-word-length="7"] .results-list,
body[data-word-length="8"] .results-list {
    grid-template-columns: repeat(auto-fill, minmax(5.5rem, 1fr));
}

/* Block layout: flex would split each letter into a flex item and break words */
.word-item {
    position: relative;
    display: block;
    padding: 0.625rem 0.5rem;
    background: var(--bg-primary);
    border: 1px solid transparent;
    border-radius: var(--radius-md);
    text-align: center;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--text-secondary);
    line-height: 1.2;
}

.word-score {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    opacity: 0.85;
    letter-spacing: 0;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.word-item:hover .word-score {
    color: var(--accent);
    opacity: 1;
}

.word-item:hover {
    border-color: var(--accent);
    background: var(--bg-card);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    z-index: 2;
}

/* Letter Highlighting */
.char-match {
    color: var(--correct);
}

/* Visual Tracker */
.tracker-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.25rem;
    margin-top: 1rem;
}

.tracker-letter {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    color: var(--text-muted);
}

.tracker-letter.included {
    background: var(--correct);
    border-color: var(--correct);
    color: white;
}

.tracker-letter.excluded {
    background: var(--absent);
    border-color: var(--absent);
    color: white;
    opacity: 0.5;
}

/* Toggle Switch */
.toggle {
    position: relative;
    display: inline-block;
    width: 3rem;
    height: 1.75rem;
    cursor: pointer;
    flex-shrink: 0;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: var(--bg-elevated);
    border-radius: 1.75rem;
    transition: all var(--transition-base);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 1.25rem;
    width: 1.25rem;
    left: 0.25rem;
    bottom: 0.25rem;
    background: white;
    border-radius: 50%;
    transition: all var(--transition-base);
}

.toggle input:checked+.toggle-slider {
    background: var(--accent);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(1.25rem);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 20px;
    border: 2px solid transparent;
    background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-muted);
}

/* Utility Classes */
.mb-4 {
    margin-bottom: 1rem;
}

.mt-4 {
    margin-top: 1rem;
}

.mt-6 {
    margin-top: 2rem;
}

.text-xs {
    font-size: 0.75rem;
}

.text-muted {
    color: var(--text-muted);
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.gap-2 {
    gap: 0.5rem;
}

.w-full {
    width: 100%;
}

.results-count {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* Info Section & Premium Cards */
.info-section {
    margin-top: 6rem;
    padding-bottom: 2rem;
}

.info-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .info-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .info-content {
        grid-template-columns: repeat(3, 1fr);
    }
}

.info-box {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 2.5rem 2rem 2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.info-box:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.info-box h2 {
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-family: 'Outfit', sans-serif;
    letter-spacing: -0.02em;
}

.info-icon-wrapper {
    width: 3rem;
    height: 3rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Color Themes */
.info-box.blue:hover {
    border-color: #3b82f6;
}

.info-box.yellow:hover {
    border-color: #f59e0b;
}

.info-box.green:hover {
    border-color: #10b981;
}

.info-box.purple:hover {
    border-color: #8b5cf6;
}

.info-icon-wrapper.blue {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.info-icon-wrapper.yellow {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.info-icon-wrapper.green {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.info-icon-wrapper.purple {
    background: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}

.card-status-bar.blue {
    background: linear-gradient(90deg, #3b82f6, #60a5fa);
}

.card-status-bar.purple {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}

.info-box p {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    color: var(--text-secondary);
}

.info-box ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: auto;
}

.clean-list li {
    font-size: 0.95rem;
    line-height: 1.5;
    padding-left: 1.5rem;
    position: relative;
    color: var(--text-secondary);
}

.clean-list li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 800;
}

.feature-labels {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem !important;
}

.feature-labels li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    background: var(--bg-elevated);
    border-radius: 0.5rem;
    font-size: 1rem;
}

/* Showcase Section */
.showcase-section {
    margin: 6rem auto 4rem;
    text-align: center;
    max-width: 1000px;
}

.section-badge {
    display: inline-block;
    padding: 0.35rem 0.875rem;
    background: var(--bg-elevated);
    color: var(--accent-light);
    border-radius: 2rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
}

.showcase-title {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.showcase-subtitle {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 3.5rem;
    font-size: 1.1rem;
    line-height: 1.6;
}

.showcase-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 0 1rem;
}

.showcase-card {
    position: relative;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.showcase-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--accent);
}

.card-status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
}

.card-status-bar.green {
    background: linear-gradient(90deg, var(--correct), #34d399);
}

.card-status-bar.yellow {
    background: linear-gradient(90deg, var(--present), #fbbf24);
}

.card-status-bar.gray {
    background: linear-gradient(90deg, var(--absent), #64748b);
}

.showcase-icon {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.showcase-icon.green {
    background: rgba(16, 185, 129, 0.1);
    color: var(--correct);
}

.showcase-icon.yellow {
    background: rgba(245, 158, 11, 0.1);
    color: var(--present);
}

.showcase-icon.gray {
    background: rgba(71, 85, 105, 0.1);
    color: var(--text-muted);
}

.showcase-visual {
    display: flex;
    gap: 0.35rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.mini-box {
    width: 2.25rem;
    height: 2.25rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    background: var(--bg-primary);
}

.mini-box.correct {
    background: var(--correct);
    color: white;
    border-color: var(--correct);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.mini-box.present {
    background: var(--present);
    color: white;
    border-color: var(--present);
    box-shadow: 0 4px 0 rgba(0, 0, 0, 0.1);
}

.mini-box.empty {
    opacity: 0.3;
}

.excluded-demo {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.bad-letter {
    width: 2.25rem;
    height: 2.25rem;
    background: var(--absent);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    text-decoration: line-through;
    opacity: 0.8;
    box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.2);
}

.showcase-card h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.showcase-card p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    text-align: center;
}

.footer {
    width: 100%;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    margin-top: 8rem;
    padding: 6rem 1.5rem 4rem;
    position: relative;
    overflow: hidden;
}

/* Subtle glow at the top of the footer */
.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--accent-light), transparent);
    opacity: 0.3;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3rem;
    text-align: center;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-logo {
    font-family: 'Outfit', sans-serif;
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.footer-tagline {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 2.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 0.5rem 0.25rem;
    transition: all var(--transition-base);
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    transition: width var(--transition-base);
}

.footer-link:hover {
    color: #fff;
}

.footer-link:hover::after {
    width: 100%;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    width: 100%;
}

.footer-copyright {
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    margin: 0;
}

.footer-description {
    color: rgba(148, 163, 184, 0.5);
    /* Very muted text */
    font-size: 0.75rem;
    margin: 0;
}



.btn-menu {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 2;
    border: none;
    background: var(--bg-elevated);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.btn-menu:hover {
    background: var(--btn-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Title Row — help button styles consolidated below with .btn-help */
.title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 0.5rem;
    width: 100%;
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.modal-content {
    position: relative;
    width: 95%;
    max-width: 900px;
    max-height: 90vh;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 3rem 2rem 2rem;
    overflow-y: auto;
    box-shadow: var(--shadow-xl), 0 0 0 1px rgba(255, 255, 255, 0.05);
    transform: scale(0.9) translateY(30px);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal.show .modal-content {
    transform: scale(1) translateY(0);
}

.modal-content .showcase-section {
    margin-top: 0;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
    border-color: #ef4444;
}

@media (max-width: 640px) {
    .modal-content {
        padding: 3rem 1rem 1rem;
    }
}

/* =============================================
   HOMEPAGE OVERHAUL — NEW ELEMENTS
   ============================================= */

/* Hero Stats Bar */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 3rem;
    margin-top: 0.5rem;
    padding: 1.25rem 3rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(8px);
}

.hero-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.125rem;
}

.hero-stat-num {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.hero-stat-divider {
    width: 1px;
    height: 2.5rem;
    background: rgba(255, 255, 255, 0.08);
}

/* Row Label Colored Dots */
.row-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.row-label-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.green-dot {
    background: var(--correct);
    box-shadow: 0 0 6px var(--correct);
}

.yellow-dot {
    background: var(--present);
    box-shadow: 0 0 6px var(--present);
}

.gray-dot {
    background: var(--absent);
    box-shadow: 0 0 6px var(--absent);
}

/* Play Wordle Card Link */
.play-wordle-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #6aaa64 0%, #538d4e 100%);
    border-radius: var(--radius-xl);
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    transition: all var(--transition-base);
    box-shadow: 0 4px 20px rgba(106, 170, 100, 0.3);
}

.play-wordle-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(106, 170, 100, 0.4);
}

.play-wordle-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Help Button */
.btn-help {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    width: auto;
    height: auto;
    min-height: 2.5rem;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--accent-light);
    border-radius: 100px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    transition: all var(--transition-base);
    margin-top: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.btn-help:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent);
    color: var(--accent-light);
    transform: translateY(-1px);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

/* Info Section Header */
.info-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.info-section-title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(to bottom, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.75rem;
}

.info-section-sub {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
}

/* Info Section spacing from main grid */
.info-section {
    margin-top: 6rem;
    padding-bottom: 2rem;
}

/* Responsive: stack hero stats on mobile */
@media (max-width: 600px) {
    .hero-stats {
        flex-wrap: wrap;
        justify-content: center;
        border-radius: var(--radius-xl);
        gap: 1rem;
        padding: 0.75rem 1.25rem;
    }

    .hero-stat-num {
        font-size: 1.1rem;
    }

    .pattern-box {
        padding: 1.5rem 1rem;
    }

    .wrong-pos-grid {
        gap: 0.35rem;
    }
}

.tools-section {
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    margin-bottom: 4rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.tool-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 1.5rem;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.tool-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-blue);
    box-shadow: var(--shadow-xl), 0 0 20px rgba(59, 130, 246, 0.1);
    background: rgba(30, 41, 59, 0.8);
}

.tool-card-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-gradient);
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.tool-card-info h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 0.125rem 0;
}

.tool-card-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0;
}

.footer-trust {
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

@media (max-width: 640px) {
    .tools-grid {
        grid-template-columns: 1fr;
    }
}