/* =========================================
   RECIRCULATION WIDGET (VANILLA CSS)
   ========================================= */
.recirc-wrapper {
    max-width: 56rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.recirc-title {
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: #1f2937;
    /* light text */
}

.recirc-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 768px) {
    .recirc-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.recirc-card {
    position: relative;
    overflow: hidden;
    border-radius: 0.75rem;
    background-color: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-align: center;
    height: 100%;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.recirc-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.recirc-card-overlay {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.recirc-card:hover .recirc-card-overlay {
    opacity: 0.1;
}

.recirc-card-icon {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.recirc-card:hover .recirc-card-icon {
    transform: scale(1.1);
}

.recirc-card-label {
    font-weight: 700;
    font-size: 0.875rem;
    color: #1f2937;
    transition: color 0.3s ease;
    z-index: 2;
}

.recirc-card:hover .recirc-card-label {
    color: #3A86FF;
    /* Accent color */
}

/* --- Dark Mode Support --- */
html.dark .recirc-title {
    color: #e5e7eb;
}

html.dark .recirc-card {
    background-color: #1f2937;
    border-color: #374151;
}

html.dark .recirc-card-label {
    color: #ffffff;
}

/* --- Data-Theme Gradients --- */
.recirc-card-overlay[data-theme="calcudoku"] {
    background: linear-gradient(to bottom right, #4ade80, #3b82f6);
}

.recirc-card-overlay[data-theme="daily-equation"] {
    background: linear-gradient(to bottom right, #c084fc, #ec4899);
}

.recirc-card-overlay[data-theme="missing-digits"] {
    background: linear-gradient(to bottom right, #facc15, #f97316);
}

.recirc-card-overlay[data-theme="number-sequence"] {
    background: linear-gradient(to bottom right, #60a5fa, #6366f1);
}

.recirc-card-overlay[data-theme="make-24"] {
    background: linear-gradient(to bottom right, #f87171, #ec4899);
}

.recirc-card-overlay[data-theme="math-merge"] {
    background: linear-gradient(to bottom right, #818cf8, #a855f7);
}

.recirc-card-overlay[data-theme="sudoku"] {
    background: linear-gradient(to bottom right, #3b82f6, #06b6d4);
}

.recirc-card-overlay[data-theme="futoshiki"] {
    background: linear-gradient(to bottom right, #2dd4bf, #10b981);
}

.recirc-card-overlay[data-theme="daily-mosaic"] {
    background: linear-gradient(to bottom right, #fbbf24, #f43f5e);
}

.recirc-card-overlay[data-theme="lone-number"] {
    background: linear-gradient(to bottom right, #6b7280, #334155);
}

/* =========================================
   TRACK A MACRO LAYOUT (VANILLA CSS)
   ========================================= */
.track-a-layout {
    flex-grow: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.track-a-layout>* {
    min-width: 0;
}

@media (min-width: 640px) {
    .track-a-layout {
        padding: 0 1.5rem;
    }
}

@media (min-width: 1280px) {
    .track-a-layout {
        grid-template-columns: 65% calc(35% - 2rem);
    }
}

.track-a-sidebar {
    width: 100%;
    margin: 0 auto;
    display: block;
}

@media (min-width: 1280px) {
    .track-a-sidebar {
        position: sticky;
        top: 3rem;
        margin-top: 1.25rem;
        height: max-content;
    }
}

/* --- Game Page Wide Modifier --- */
.track-a-layout.game-layout-wide {
    max-width: 1440px;
}

@media (min-width: 1024px) and (max-width: 1279px) {
    .track-a-layout.game-layout-wide {
        /* Shift sticky sidebars further to the right by using a fixed width for the right column */
        grid-template-columns: 1fr;
    }
}

@media (min-width: 1280px) {
    .track-a-layout.game-layout-wide {
        grid-template-columns: 1fr 320px;
        gap: 3rem;
    }
}

.left-ad-sidebar {
    display: none;
}

@media (min-width: 1600px) {
    .left-ad-sidebar {
        display: block;
    }

    .track-a-layout.game-layout-wide {
        grid-template-columns: 160px 1fr 320px !important;
        gap: 2rem !important;
    }
}

/* Responsive horizontal override for Game pages on iPad Pro/Tablet */
@media (min-width: 768px) and (max-width: 1279px) {
    .track-a-layout.game-layout-wide .sidebar-sticky-wrapper {
        position: static;
        width: 100%;
        max-width: 970px;
        min-height: 90px;
        height: auto;
        margin: 0 auto 2rem auto;
        display: flex;
        justify-content: center;
    }
}

.puzzle-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    width: 100%;
    margin-bottom: 1.5rem;
}

@media (min-width: 640px) {
    .puzzle-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .puzzle-grid.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================================
   PUZZLE GRID 3-COLUMN MODIFIER OVERRIDE
   ========================================= */
@media (min-width: 640px) {
    .puzzle-grid.cols-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1280px) {
    .puzzle-grid.cols-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* =========================================
   HERO BANNER (HOMEPAGE)
   ========================================= */
.hero-banner {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-surface-accent) 100%);
    border: 1px solid var(--color-border-accent);
    box-shadow: 0 10px 30px -5px rgba(59, 130, 246, 0.15);
    padding: 2rem 1.5rem;
    text-align: center;
    text-decoration: none;
    margin-top: 2rem;
    margin-bottom: 2rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.hero-banner:hover {
    transform: translateY(-2px);
    border-color: var(--accent, #3A86FF);
    box-shadow: 0 14px 40px -10px rgba(59, 130, 246, 0.25);
}

.hero-banner-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent, #3A86FF) 0%, transparent 60%);
    opacity: 0.08;
    pointer-events: none;
}

.hero-banner-title {
    position: relative;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 800;
    color: var(--color-text-main);
    margin: 0 0 0.75rem;
}

.hero-banner-title span {
    color: var(--accent, #3A86FF);
}

.hero-banner-text {
    position: relative;
    color: var(--color-text-muted);
    font-size: 1.125rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.6;
    max-width: 40rem;
    margin: 0 auto 1.5rem;
}

.hero-banner-btn {
    position: relative;
    display: inline-block;
    background-color: var(--accent, #3A86FF);
    color: #ffffff;
    font-weight: 700;
    font-size: 1.05rem;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.4);
    transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
}

.hero-banner:hover .hero-banner-btn {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
}

/* =========================================
   CATEGORY HEADER (HOMEPAGE SECTION LABELS)
   ========================================= */
.category-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1.5rem 0 1rem;
}

.category-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.category-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin: 0;
}

/* =========================================
   PREMIUM PUZZLE CARD (HOMEPAGE GAME GRID)
   ========================================= */
.premium-puzzle-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    padding: 1.25rem;
    text-decoration: none;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.premium-puzzle-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent, #3A86FF);
    box-shadow: 0 0 20px rgba(58, 134, 255, 0.25), 0 0 8px rgba(58, 134, 255, 0.15);
}

.puzzle-card-icon {
    font-size: 1.875rem;
    margin-bottom: 0.5rem;
}

.puzzle-card-title {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-text-main);
    margin: 0 0 0.375rem;
    transition: color 0.15s ease;
}

.premium-puzzle-card:hover .puzzle-card-title {
    color: var(--accent, #3A86FF);
}

.puzzle-card-desc {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin: 0;
    flex-grow: 1;
}

.puzzle-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    margin-top: 0;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* =========================================
   STICKY SIDEBAR (VANILLA CSS)
   ========================================= */
.sidebar-sticky-wrapper {
    position: sticky;
    top: 6rem;
    /* Desktop default */
    width: 300px;
    height: auto;
    min-height: 200px;
}

/* Desktop default styling for the sticky card to ensure 300x600px dimensions & internals */
.sidebar-sticky-wrapper .premium-sidebar-card {
    height: auto;
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
}

.sidebar-sticky-wrapper .premium-sidebar-card .sidebar-card-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    color: var(--color-text-main);
    margin-top: 0;
}

.sidebar-sticky-wrapper .premium-sidebar-card .sidebar-card-desc {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    line-height: 1.625;
}

.sidebar-sticky-wrapper .premium-sidebar-card .premium-card-btn {
    background: linear-gradient(90deg, #3b82f6 0%, #2563eb 100%);
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    text-align: center;
    display: block;
    width: 100%;
    text-decoration: none;
    box-shadow: 0 4px 14px 0 rgba(59, 130, 246, 0.5);
    transition: all 0.3s ease;
}

.sidebar-sticky-wrapper .premium-sidebar-card .premium-card-btn:hover {
    background: linear-gradient(90deg, #2563eb 0%, #1d4ed8 100%);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.7);
    transform: scale(1.02);
}

.sidebar-sticky-wrapper .premium-sidebar-card .sidebar-checklist {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.sidebar-sticky-wrapper .premium-sidebar-card .sidebar-checklist li {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-sticky-wrapper .premium-sidebar-card .check-icon {
    color: #4ade80;
}

/* Tablet override for ALL pages where sidebar stacks below content */
@media (min-width: 768px) and (max-width: 1279px) {
    .sidebar-sticky-wrapper {
        position: static;
        width: 100%;
        max-width: 970px;
        min-height: 90px;
        height: auto;
        margin: 0 auto 2rem auto;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .sidebar-sticky-wrapper .premium-sidebar-card {
        flex-direction: row;
        width: 100%;
        height: auto;
        padding: 1.5rem;
        align-items: center;
        justify-content: center;
        gap: 2rem;
    }

    .sidebar-sticky-wrapper .premium-sidebar-card .sidebar-card-title {
        margin: 0;
        font-size: 1.5rem;
    }

    .sidebar-sticky-wrapper .premium-sidebar-card .sidebar-card-desc,
    .sidebar-sticky-wrapper .premium-sidebar-card .sidebar-card-footer,
    .sidebar-sticky-wrapper .premium-sidebar-card .sidebar-checklist {
        display: none;
    }

    .sidebar-sticky-wrapper .premium-sidebar-card .premium-card-btn {
        margin: 0;
        width: auto;
        white-space: nowrap;
    }
}

/* Mobile override: Hide the massive card above the footer */
@media (max-width: 767px) {
    .sidebar-sticky-wrapper {
        display: none !important;
    }
}

/* =========================================
   GLOBAL MODALS & TOASTS (VANILLA CSS)
   ========================================= */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.modal-backdrop-dark {
    background-color: rgba(0, 0, 0, 0.7);
}

.modal-backdrop.hidden {
    display: none !important;
}

.scrollable-modal {
    overflow-y: auto;
}

.modal-card {
    background-color: var(--color-surface);
    color: var(--color-text-main);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    padding: 1.5rem;
    width: 91.666667%;
    max-width: 28rem;
    position: relative;
    border: 1px solid var(--color-border);
}

.modal-card-scroll {
    margin: 2rem auto;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header-row {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
    position: relative;
}

.modal-title {
    font-size: 1.875rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-text-main);
    text-align: center;
}

.modal-close-btn {
    font-size: 1.875rem;
    font-weight: 700;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--color-text-muted);
    transition: color 0.15s ease;
    line-height: 1;
    position: absolute;
    right: 0;
}

.modal-close-btn:hover {
    color: var(--accent);
}

.modal-button-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
}

.diff-btn {
    width: 100%;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.diff-easy {
    background-color: #22c55e;
}

.diff-easy:hover {
    background-color: #16a34a;
}

.diff-medium {
    background-color: #eab308;
}

.diff-medium:hover {
    background-color: #ca8a04;
}

.diff-hard {
    background-color: #ef4444;
}

.diff-hard:hover {
    background-color: #dc2626;
}

.modal-body-stack {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.modal-section {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-section.border-none {
    border-bottom: none;
    padding-bottom: 0;
}

.modal-section-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.75rem;
    margin-top: 0;
}

.modal-label {
    font-weight: 700;
    font-size: 0.875rem;
}

.modal-select {
    width: 100%;
    padding: 0.5rem;
    margin-top: 0.25rem;
    border-radius: var(--radius-md);
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    color: var(--color-text-main);
}

.modal-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.25rem;
    margin-bottom: 0;
    text-align: center;
}

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

.toggle-switch-label {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.toggle-slider {
    width: 2.75rem;
    height: 1.5rem;
    background-color: var(--color-border);
    border-radius: 9999px;
    position: relative;
    transition: background-color 0.15s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    background-color: #ffffff;
    border: 1px solid var(--color-border);
    border-radius: 9999px;
    height: 1.25rem;
    width: 1.25rem;
    transition: transform 0.15s ease;
}

.toggle-input:checked~.toggle-slider {
    background-color: var(--accent);
}

.toggle-input:checked~.toggle-slider::after {
    transform: translateX(100%);
    border-color: #ffffff;
}

.modal-danger-btn {
    width: 100%;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    font-weight: 600;
    border: 1px solid rgba(239, 68, 68, 0.3);
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.modal-danger-btn:hover {
    background-color: rgba(239, 68, 68, 0.2);
}

.modal-footer-text {
    padding-top: 0.5rem;
    text-align: center;
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.modal-footer-sub {
    margin-top: 0.25rem;
}

.modal-content-space {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}


.toast-notification {
    position: fixed;
    top: 6rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 0.75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 50;
    font-size: 1.125rem;
    font-weight: 500;
    transition: opacity 0.3s ease;
    width: max-content;
    max-width: 90vw;
}

.toast-icon {
    width: 32px;
    height: auto;
    object-fit: contain;
    flex-shrink: 0;
}

.toast-notification.hidden {
    display: none !important;
}

/* =========================================
   BASE LAYOUT (VANILLA CSS)
   ========================================= */
.ui-layout-base {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: ui-sans-serif, system-ui, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;
    overflow-x: hidden;
    transition: background-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--color-surface-muted, #f8fafc);
    color: var(--color-text-main, #1a1a1a);
}

html.dark .ui-layout-base {
    background-color: var(--color-surface-muted, #0f172a);
    color: var(--color-text-main, #ffffff);
}

/* ================================================================= MAIN.JS DYNAMIC UI STYLES ================================================================= */

/* --- Cookie Consent Banner --- */
.dmg-cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #0f172a;
    border-top: 1px solid #1e293b;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
}

.dmg-cookie-banner.is-visible {
    transform: translateY(0);
}

@media (min-width: 768px) {
    .dmg-cookie-banner {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        padding: 1.5rem;
    }

    .dmg-cookie-text-wrapper {
        max-width: none;
        white-space: nowrap;
    }
}

.dmg-cookie-text-wrapper {
    flex: 1;
}

.dmg-cookie-text {
    font-size: 0.875rem;
    color: #ffffff;
    margin: 0;
}

.dmg-cookie-text a {
    color: var(--accent);
    text-decoration: underline;
}

.dmg-cookie-btn-group {
    display: flex;
    gap: 1rem;
}

.dmg-cookie-btn-decline,
.dmg-cookie-btn-accept {
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 500;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.dmg-cookie-btn-decline {
    background-color: transparent;
    color: var(--color-text-muted);
    border: 1px solid var(--color-border);
}

.dmg-cookie-btn-decline:hover {
    background-color: var(--color-surface-muted);
}

.dmg-cookie-btn-accept {
    background-color: var(--accent);
    color: #fff;
    border: none;
}

.dmg-cookie-btn-accept:hover {
    background-color: var(--color-primary-hover);
}

/* --- Game Selection Menu --- */
.dmg-game-menu-container {
    width: 100%;
}

.dmg-game-menu {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .dmg-game-menu {
        flex-direction: row;
        justify-content: space-between;
    }
}

.dmg-game-cards-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 28rem;
}

.dmg-game-card {
    display: block;
    background-color: var(--game-bg, var(--accent));
    color: #fff;
    border-radius: 0.5rem;
    padding: 1rem;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
}

.dmg-game-card:hover {
    background-color: var(--game-hover, var(--color-primary-hover));
    transform: translateY(-2px);
}

.dmg-game-card-content {
    display: flex;
    flex-direction: column;
}

.dmg-game-card-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.dmg-game-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.dmg-game-card-desc {
    font-size: 0.875rem;
    opacity: 0.9;
    margin: 0;
}

.dmg-game-menu-mascot {
    display: none;
}

@media (min-width: 1024px) {
    .dmg-game-menu-mascot {
        display: block;
        width: 28rem;
        height: auto;
    }
}

.dmg-xp-badge-wrapper {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

.dmg-xp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    font-size: 0.875rem;
}

.dmg-xp-badge-icon {
    font-size: 1rem;
}

.dmg-xp-badge-value {
    font-weight: 700;
    color: var(--accent);
}

.dmg-xp-badge-label {
    color: var(--color-text-muted);
}

/* --- Stats Modal / Game Content --- */
.dmg-end-state-container {
    text-align: center;
    margin-top: 3rem;
}

.dmg-end-state-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.dmg-end-state-solution-desc {
    font-size: 1.125rem;
    color: var(--color-text-main);
    margin-bottom: 1rem;
}

.dmg-end-state-solution-val {
    font-weight: 700;
}

.dmg-end-state-msg {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.dmg-end-state-btn {
    background-color: var(--accent);
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 0.25rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.dmg-end-state-btn:hover {
    background-color: var(--color-primary-hover);
}

.dmg-stats-mascot-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
}

.dmg-stats-mascot {
    width: 5rem;
    height: auto;
    margin-bottom: 0.5rem;
}

.dmg-stats-mascot-text {
    font-style: italic;
    color: var(--color-text-muted);
    text-align: center;
    margin: 0;
}

.dmg-stats-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.dmg-stats-solution-desc {
    font-size: 1.125rem;
    margin-bottom: 1rem;
}

.dmg-stats-solution-val {
    font-weight: 700;
}

.dmg-pattern-box {
    background-color: var(--color-surface-muted);
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
    width: 100%;
}

.dmg-pattern-box-title {
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--color-text-main);
}

.dmg-pattern-box-desc {
    margin: 0;
    color: var(--color-text-main);
}

.dmg-stats-section {
    width: 100%;
    margin-bottom: 1.5rem;
}

.dmg-stats-section-title {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--color-text-muted);
    margin: 0 0 1rem 0;
    text-align: center;
}

.dmg-stats-grid {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-bottom: 1.5rem;
    width: 100%;
}

.dmg-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dmg-stat-val {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: var(--color-text-main);
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.dmg-stat-streak-icon {
    font-size: 1rem;
    opacity: 0.3;
}

.dmg-stat-streak-icon.is-active {
    opacity: 1;
}

.dmg-stat-label {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin: 0;
    text-transform: uppercase;
}

.dmg-xp-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.dmg-xp-bar-track {
    width: 100%;
    height: 0.75rem;
    background-color: transparent;
    border: 1px solid #cbd5e1;
    border-radius: 9999px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.dmg-xp-bar-fill {
    height: 100%;
    background-color: var(--accent);
    transition: width 0.5s ease-out;
}

.dmg-xp-label {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    font-weight: 500;
}

.dmg-xp-earned-text {
    color: var(--accent);
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.dmg-xp-earned-text-small {
    font-size: 1.25rem;
}

.dmg-loss-cta-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* --- Error Container (Main.js generic fallback) --- */
.dmg-error-container {
    text-align: center;
    margin-top: 3rem;
}

.dmg-error-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ef4444;
    margin-bottom: 1rem;
}

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

.dmg-error-btn {
    background-color: var(--accent);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    margin-top: 1rem;
}

.dmg-error-btn:hover {
    background-color: var(--color-primary-hover);
}

/* --- Dark Mode Overrides --- */
.dark .dmg-cookie-banner {
    background-color: #0f172a;
}

.dark .dmg-cookie-btn-decline:hover {
    background-color: var(--color-border);
}

.dark .dmg-pattern-box {
    background-color: var(--color-surface-accent);
}

.dark .dmg-xp-badge {
    background-color: var(--color-surface-accent);
}

/* --- Toast --- */
.dmg-toast {
    position: fixed;
    top: 6rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    background-color: var(--color-primary);
    color: #ffffff;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    font-size: 1.125rem;
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.dmg-toast.is-hidden {
    display: none !important;
    opacity: 0;
    pointer-events: none;
}

/* --- Global Blog Link Override --- */
.blog-action-link,
.dark .blog-action-link,
header a.text-accent[href*="blog"],
header a.text-accent[href*="blog"]:hover,
.dark header a.text-accent[href*="blog"],
.dark header a.text-accent[href*="blog"]:hover {
    color: #ffffff !important;
    margin-right: 1rem;
    font-size: 1.125rem;
    font-weight: 700;
    text-decoration: none;
    transition: opacity 0.15s ease;
}

.blog-action-link:hover {
    opacity: 0.8;
}

/* --- PREMIUM CARDS --- */
.premium-sidebar-card {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
}

.premium-sidebar-card .card-asset-overlay {
    background: linear-gradient(0deg, var(--color-surface), transparent);
}

.premium-sidebar-card h2,
.premium-sidebar-card h3 {
    font-size: 1.75rem;
    font-weight: 900;
    color: var(--color-text-main) !important;
    line-height: 1.2 !important;
    margin-top: 0 !important;
    margin-bottom: 0.75rem !important;
    border: none !important;
    padding: 0 !important;
}

.premium-sidebar-card p {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.4;
    margin-bottom: 1.25rem;
}

.ui-btn-primary,
.premium-card-btn {
    display: block;
    width: fit-content;
    background-color: #3b82f6;
    color: #000000 !important;
    font-weight: 900;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    text-decoration: none;
    text-align: center;
    transition: transform 0.2s ease;
}

.ui-btn-primary:hover,
.premium-card-btn:hover {
    transform: scale(1.05);
}

.mobile-only-break {
    display: none;
}

@media (max-width: 767px) {
    .mobile-only-break {
        display: block;
    }
}

/* =========================================
   DONATION BUTTON & RESPONSIVE FOOTER
   ========================================= */
.btn-donate {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #FFDD00;
    color: #000000 !important;
    font-weight: 700;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-size: 0.875rem;
    transition: transform 0.2s, background-color 0.2s;
    border: 2px solid transparent;
    gap: 0.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

.btn-donate:hover {
    transform: scale(1.05);
    background-color: #FFEA4D;
}

html.dark .btn-donate {
    box-shadow: none;
}

.footer-donate-wrapper {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    z-index: 10;
}

.mobile-nav-donate {
    padding: 1rem;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-donate .btn-donate {
    width: 100%;
}

/* =========================================
   MOBILE HAMBURGER BUTTON
   ========================================= */
.hamburger-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

@media (max-width: 639px) {
    .hamburger-btn {
        display: flex;
    }
}

.hamburger-line {
    width: 22px;
    height: 2px;
    background-color: #ffffff;
    border-radius: 1px;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger-btn.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger-btn.active .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* =========================================
   MOBILE NAVIGATION BACKDROP & DRAWER
   ========================================= */
.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 60;
}

.mobile-nav-backdrop.open {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: min(320px, 85vw);
    background-color: var(--color-surface);
    color: var(--color-text-main);
    box-shadow: var(--shadow-xl);
    border-left: 1px solid var(--color-border);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 61;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.mobile-nav-drawer.open {
    transform: translateX(0);
}

html.dark .mobile-nav-drawer {
    box-shadow: none;
}

.mobile-close-btn-custom {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.15s ease;
}

.mobile-close-btn-custom:hover {
    color: var(--accent, #3A86FF);
}

.mobile-nav-stats {
    display: flex;
    justify-content: flex-start;
    gap: 1rem;
    align-items: center;
    padding: 2.5rem 1rem 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-section {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.mobile-nav-section h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    margin: 0 0 0.5rem;
}

.mobile-nav-link,
.mobile-nav-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.5rem;
    color: var(--color-text-main);
    text-decoration: none;
    background: transparent;
    border: none;
    font-size: 0.95rem;
    cursor: pointer;
    border-radius: 0.375rem;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.mobile-nav-link:hover,
.mobile-nav-btn:hover {
    background-color: var(--color-border);
}

.mobile-nav-link.active {
    color: var(--accent, #3A86FF);
    font-weight: 700;
    background-color: rgba(58, 134, 255, 0.08);
}

/* Custom Dropdown Chevron for Difficulty Select */
#mobile-difficulty-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2364748b%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem top 50%;
    background-size: 0.65rem auto;
    padding-right: 2.5rem;
}

html.dark #mobile-difficulty-select {
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23cbd5e1%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
}

.mobile-nav-section.mobile-nav-footer {
    display: flex;
    gap: 0.5rem;
    border-bottom: none;
}

.mobile-nav-section.mobile-nav-footer .mobile-nav-btn {
    text-align: center;
}

.mobile-nav-legal {
    padding: 1rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.mobile-nav-legal a {
    color: var(--color-text-muted);
    text-decoration: underline;
}

.mobile-nav-legal a:hover {
    color: var(--accent, #3A86FF);
}

/* =========================================
   BACK TO TOP BUTTON
   ========================================= */
.ui-back-to-top {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: var(--accent, #3A86FF);
    color: #ffffff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-xl);
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 40;
}

/* ASSUMPTION: main.js toggles a `.visible` class on scroll.
   If it uses a different class name, rename this selector to match. */
.ui-back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.ui-back-to-top svg,
.ui-back-to-top img {
    width: 20px;
    height: 20px;
}

/* =========================================
   STATE & ACCESSIBILITY UTILITIES
   ========================================= */
.ui-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* =========================================
   UTILITY WHITELIST
   ========================================= */
.cursor-pointer {
    cursor: pointer;
}

/* =========================================
   MISSING BEM LAYOUT: SITE HEADER
   ========================================= */
.site-header {
    width: 100%;
    background-color: var(--header-footer-bg, #111827);
    border-bottom: 2px solid var(--accent, #3A86FF);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-inner {
    max-width: 80rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    width: 100%;
}

.header-left {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.header-center {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.5rem;
}

.header-logo-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: clamp(20px, 3vw, 32px);
    font-weight: 800;
    color: #ffffff;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.15s ease;
}

.header-logo-link:hover {
    opacity: 0.8;
}

.header-mascot {
    height: 4rem;
    width: auto;
    object-fit: contain;
}

/* Mobile Constraints */
@media (max-width: 767px) {
    .header-left .desktop-stats {
        display: none !important;
    }

    .header-right .desktop-actions {
        display: none !important;
    }

    .header-logo-link {
        position: relative;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 1.25rem;
    }

    .header-row {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
        min-height: 3.75rem !important;
    }

    .header-mascot {
        position: absolute;
        right: 100%;
        top: 50%;
        transform: translateY(-44%);
        margin-right: 0.375rem;
        height: 3.85rem !important;
        margin-bottom: 0 !important;
    }
}

/* Desktop Constraints */
@media (min-width: 768px) {
    .header-row {
        padding-top: 0.25rem !important;
        padding-bottom: 0 !important;
    }

    .header-mascot {
        height: 3.5rem !important;
        margin-bottom: -2px !important;
    }
}

/* =========================================
   GLOBAL STATE MODIFIERS (Vanilla Replacements)
   ========================================= */
.is-hidden {
    display: none !important;
}

.is-flex {
    display: flex !important;
}

.is-relative {
    position: relative !important;
}

.is-inline-block {
    display: inline-block !important;
}

/* Accessibility & Reset Utilities */
.is-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.is-border-none {
    border: none !important;
}

/* =========================================
   MIGRATED COMPONENTS FROM MAIN.MIN.CSS
   ========================================= */

/* Symptom 1 (Mascots) */
.category-gecko {
    width: 72px;
    height: auto;
    margin-left: 0.25rem;
    transition: transform 0.3s ease;
}

.category-header:hover .category-gecko {
    transform: translateY(-2px);
}

.faq-mascot {
    height: 4.5rem;
    width: auto;
    filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.1));
}

@media (min-width: 640px) {
    .faq-mascot {
        height: 5.5rem;
    }
}

/* Symptom 2 (Header Spacing) */
.mobile-header-spacer {
    width: 48px;
    flex-shrink: 0;
}

.mobile-header-spacer {
    display: block;
}

@media (min-width: 640px) {
    .mobile-header-spacer {
        display: none !important;
    }
}

.desktop-stats {
    display: none;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 640px) {
    .desktop-stats {
        display: flex !important;
    }
}

.streak-icon {
    font-size: 1rem;
}

.streak-count-text,
.level-display-text {
    font-size: 0.875rem;
    color: var(--nav-link-color, #f8fafc);
}

.stats-divider {
    margin: 0 0.25rem;
    color: var(--nav-link-color, #f8fafc);
}

.xp-progress-wrapper {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.xp-track {
    width: 4rem;
    background-color: #374151;
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
}

@media (min-width: 640px) {
    .xp-track {
        width: 5rem;
    }
}

.xp-fill {
    background-color: var(--accent);
    height: 0.5rem;
    border-radius: 9999px;
    transition: width 0.5s ease-in-out;
}

.xp-text {
    color: #9ca3af;
    font-size: 0.75rem;
    white-space: nowrap;
}

.xp-label {
    font-weight: 700;
}

.desktop-actions {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

@media (min-width: 640px) {
    .desktop-actions {
        display: flex !important;
    }
}

.header-action-btn {
    padding: 0.5rem;
    font-size: 1.125rem;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: opacity 0.15s ease;
}

@media (min-width: 640px) {
    .header-action-btn {
        font-size: 1.25rem;
    }
}

.header-action-btn:hover {
    opacity: 0.8;
}

/* =========================================
   IPAD HEADER OPTIMIZATION (640px - 1023px)
   ========================================= */
@media (min-width: 640px) and (max-width: 1023px) {

    /* Hide numeric XP to free up left side space */
    .xp-text {
        display: none !important;
    }

    /* Tighten gaps for breathing room */
    .desktop-stats,
    .desktop-actions {
        gap: 0.25rem !important;
    }

    /* Reduce logo size slightly to prevent collision */
    .header-logo-link {
        font-size: clamp(18px, 2.5vw, 24px) !important;
        gap: 0.5rem !important;
    }

    /* Reduce right-side margin */
    .blog-action-link {
        margin-right: 0.5rem !important;
    }
}

/* Symptom 3 (FAQ) */
details>summary {
    list-style: none;
}

details>summary::-webkit-details-marker {
    display: none;
}

.faq-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
    color: inherit;
}

.faq-chevron-svg {
    width: 20px !important;
    height: 20px !important;
}

details[open] .faq-chevron {
    transform: rotate(180deg);
}

.faq-container {
    width: 100%;
    text-align: left;
    max-width: 800px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
    font-family: ui-sans-serif, system-ui, sans-serif;
}

.faq-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.faq-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--faq-title);
    margin: 0;
    text-align: center;
}

#homepage-faq {
    --faq-bg: #ffffff;
    --faq-text: #475569;
    --faq-border: #e2e8f0;
    --faq-title: #1e293b;
    --faq-icon: #3b82f6;
    --faq-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.dark #homepage-faq {
    --faq-bg: #1e293b;
    --faq-text: #cbd5e1;
    --faq-border: #334155;
    --faq-title: #f8fafc;
    --faq-icon: #60a5fa;
    --faq-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

#homepage-faq details {
    background: var(--faq-bg);
    border: 1px solid var(--faq-border);
    color: var(--faq-text);
    border-radius: 12px;
    margin-bottom: 12px;
    box-shadow: var(--faq-shadow);
    transition: all 0.2s ease-in-out;
}

#homepage-faq details:hover {
    transform: translateY(-2px);
}

#homepage-faq summary {
    padding: 20px;
    font-weight: 700;
    color: var(--faq-title);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    list-style: none;
}

#homepage-faq summary::-webkit-details-marker {
    display: none;
}

#homepage-faq .faq-content {
    padding: 0 20px 20px 20px;
    font-size: 15px;
    line-height: 1.6;
    opacity: 0.9;
}

/* Symptom 4 (Footer) */
.site-footer {
    width: 100%;
    border-top: 1px solid var(--color-border);
    padding: 1rem;
    text-align: center;
    font-size: 0.875rem;
    flex-shrink: 0;
    background-color: var(--header-footer-bg) !important;
    color: var(--nav-link-color) !important;
    position: relative;
}

.footer-inner {
    max-width: 56rem;
    margin: 0 auto;
    position: relative;
}

.footer-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem 1rem;
    margin-bottom: 0.5rem;
    font-size: 1rem;
    white-space: nowrap;
}

@media (min-width: 640px) {
    .footer-nav {
        gap: 0.5rem 1.5rem;
        font-size: 1.25rem;
    }
}

.footer-link {
    color: #93bbff !important;
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    font-size: 1.125rem;
    transition: color 0.15s ease;
}

.footer-link:hover {
    color: #ffffff !important;
    text-decoration: underline;
}

.footer-divider {
    display: inline-block;
    width: 1px;
    height: 1rem;
    background-color: #4b5563;
    margin: 0 0.25rem;
}

.footer-copy {
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #ffffff;
}

.ui-skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
    background-color: var(--accent, #3A86FF);
    color: #ffffff;
    border-radius: var(--radius-lg, 0.5rem);
    font-weight: 700;
    z-index: 110;
}

.ui-skip-link:focus {
    position: absolute;
    width: auto;
    height: auto;
    padding: 0.5rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    top: 1rem;
    left: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1), 0 0 0 2px #ffffff;
    outline: none;
}

.ui-loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    background-color: var(--color-surface, #ffffff);
}

html.dark .ui-loading-overlay {
    background-color: var(--color-surface-dark, #121213);
}

.ui-loading-overlay.hidden {
    display: none !important;
}

.ui-loading-content {
    text-align: center;
}

.ui-loading-icon {
    font-size: 2.25rem;
    animation: ui-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes ui-pulse {


    0%,
    100% {
        opacity: 1;
    }


    50% {
        opacity: 0.5;
    }
}

.ui-loading-text {
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

/* ── Footer Gecko ─────────────────────────────────── */
footer {
    position: relative;
}

footer::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 180px;
    transform: translateY(-50%);
    width: 70px;
    height: 70px;
    background-image: url('../img/gecko-sleeping.webp');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
}

@media (min-width: 1280px) {

    footer::after {
        width: 140px;
        height: 140px;
    }
}

@media (min-width: 768px) and (max-width: 1279px) {

    footer::after {
        right: 40px;
        top: auto;
        bottom: 90px;
        transform: none;
    }
}

@media (max-width: 767px) {
    footer::after {
        display: none !important;
    }
}

/* Tablet Gecko Adjustment */
@media (min-width: 768px) and (max-width: 1279px) {
    footer::after {
        right: 220px;
        top: 65%;
        width: 55px;
        height: 55px;
    }
}

/* iPad Pro Specific Footer Gecko Adjustment */
@media (min-width: 1024px) and (max-width: 1279px) {
    footer::after {
        /* 1. Make the gecko bigger */
        width: 95px;
        height: 95px;

        /* 2. Move it higher up (decrease the percentage to move it up) */
        top: 35%;

        /* 3. Shift it slightly left so it sits directly under 'Privacy' */
        right: 220px;
    }
}

/* iPad Specific Footer Gecko Adjustment */
@media (min-width: 768px) and (max-width: 1023px) {
    footer::after {
        /* 1. Make the gecko bigger */
        width: 95px;
        height: 95px;

        /* 2. Move it higher up into the empty space */
        /* Decrease this percentage to move it even higher (e.g., 30%) */
        top: 45%;

        /* 3. Move it completely to the right edge */
        /* Decrease this pixel value to push it further right (e.g., 40px) */
        right: 60px;
    }
}

/* =========================================
   BENEFITS GRID AND CARD STYLING
   ========================================= */
.benefits-grid {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
    margin-top: 2rem;
    width: 100%;
}

@media (min-width: 768px) {

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

.benefit-card {
    background-color: #ffffff;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    text-align: left;
    height: 100%;
}

.dark .benefit-card {
    background-color: #1f2937;
}

.benefit-card:hover {
    transform: translateY(-2px);
    border-color: var(--accent, #3A86FF);
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

.benefit-card h3 {
    margin-top: 0 !important;
}

.benefit-card p,
.benefit-card ul {
    margin-bottom: 0 !important;
}

/* =========================================
   BENEFITS SECTION (VANILLA CSS)
   ========================================= */
.benefits-section {
    padding-top: 2rem;
    padding-bottom: 2rem;
    border-top: 1px solid var(--color-border);
    color: var(--color-text-main);
}

.benefits-main-title {
    font-size: 1.875rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
    color: var(--color-text-main);
}

.benefits-intro {
    font-size: 1.125rem;
    line-height: 1.75;
    margin-bottom: 2.5rem;
    color: var(--color-text-muted);
}

.benefit-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.benefit-card-text {
    font-size: 0.875rem;
    line-height: 1.625;
    color: var(--color-text-muted);
    margin: 0;
}

.benefits-author {
    font-size: 0.75rem;
    text-align: center;
    color: var(--color-text-muted);
    margin-top: 2rem;
}

.benefits-author a {
    color: var(--accent);
    text-decoration: underline;
}

.benefits-author a:hover {
    color: var(--color-primary-hover);
}

.in-feed-ad-slot {
    min-height: 250px;
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 2rem auto;
}

.in-feed-ad-slot:empty {
    display: none;
}

.above-footer-ad-slot {
    min-height: 250px;
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 2rem auto;
}

.above-footer-ad-slot:empty {
    display: none;
}

.badge-popular {
    background-color: #15803d !important;
    color: #ffffff !important;
}

.badge-new {
    background-color: #7e22ce !important;
    color: #ffffff !important;
}

.badge-classic {
    background-color: #1d4ed8 !important;
    color: #ffffff !important;
}

/* --- Modals & Settings (Migrated from games.css) --- */
.ui-modal-header {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

html.dark .ui-modal-header {
    border-bottom-color: #334155;
}

.ui-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    text-align: center;
    width: 100%;
}

html.dark .ui-modal-title {
    color: #f8fafc;
}

.ui-modal-header .modal-close-btn {
    position: absolute;
    top: -0.1rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s ease;
}

.ui-modal-header .modal-close-btn:hover {
    color: #3b82f6;
}

html.dark .ui-modal-header .modal-close-btn {
    color: #94a3b8;
}

html.dark .ui-modal-header .modal-close-btn:hover {
    color: #60a5fa;
}

.ui-modal-body {
    padding: 0;
}

.ui-settings-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid #e2e8f0;
}

html.dark .ui-settings-section {
    border-bottom-color: #334155;
}

.ui-settings-section:first-child {
    padding-top: 0;
}

.ui-settings-section:last-child {
    border-bottom: none;
}

.ui-settings-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 1rem;
}

html.dark .ui-settings-title {
    color: #60a5fa;
}

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

.ui-settings-label {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

html.dark .ui-settings-label {
    color: #f8fafc;
}

.ui-settings-hint {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

html.dark .ui-settings-hint {
    color: #94a3b8;
}

.ui-settings-select {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    border-radius: 0.5rem;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    color: #1e293b;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

html.dark .ui-settings-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f8fafc;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.ui-settings-footer {
    text-align: center;
    padding-top: 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

html.dark .ui-settings-footer {
    color: #94a3b8;
}

.ui-settings-footer p {
    margin-bottom: 0.25rem;
}

.ui-btn-danger {
    width: 100%;
    background-color: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #fca5a5;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.ui-btn-danger:hover {
    background-color: #fecaca;
}

html.dark .ui-btn-danger {
    background-color: rgba(185, 28, 28, 0.2);
    color: #f87171;
    border-color: #7f1d1d;
}

html.dark .ui-btn-danger:hover {
    background-color: rgba(185, 28, 28, 0.4);
}

.check-icon {
    color: #4ade80;
}

.faq-item {
    border-bottom: 1px solid #e5e7eb;
}

/* =================================================================
   MOBILE IN-ARTICLE AD SLOTS
   ================================================================= */

/* Mobile: show ad containers only when populated (collapse when empty) */
@media (max-width: 767px) {
    .mobile-in-article-ad {
        display: block;
        width: 100%;
        min-height: 250px;
        margin: 1.5rem auto;
        background: transparent;
        border: none;
    }

    .mobile-in-article-ad:empty {
        display: none !important;
    }

    /* Recirculation: compact mobile padding to remove dead space */
    .recirc-wrapper {
        padding: 1.25rem 0.75rem !important;
    }

    .recirc-title {
        margin-bottom: 0.75rem !important;
    }
}

/* Desktop: hide ad containers */
@media (min-width: 768px) {
    .mobile-in-article-ad {
        display: none;
    }
}

.ad-container-mobile {
    display: block;
    margin: 2rem auto;
    /* Strict 150px gap from game controls */
    width: 100%;
    max-width: 650px;
    min-height: 250px;
    /* Reserve space to prevent CLS */
}

.ad-container-mobile:empty {
    display: none !important;
}

.ui-toast {
    position: fixed;
    top: 6rem;
    left: 50%;
    transform: translateX(-50%);
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 50;
    font-size: 1.125rem;
}

.ui-toast.hidden {
    display: none !important;
}

.ui-toast.is-flex {
    display: flex !important;
}

/* Global Responsive Visibility Handlers */
.mobile-only-flex {
    display: flex !important;
}

.desktop-only-flex {
    display: none !important;
}

@media (min-width: 1024px) {
    .mobile-only-flex {
        display: none !important;
    }

    .desktop-only-flex {
        display: flex !important;
    }
}

/* Hide Timer Mode */
body.hide-timer-mode .timer-display {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* =========================================
   CONFETTI ANIMATION
   ========================================= */
.confetti {
    position: fixed;
    top: -20px;
    animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translate3d(0, 0, 0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translate3d(var(--sway), 110vh, 0) rotate(720deg);
        opacity: 0;
    }
}

/* =========================================
   UI MODALS & SETTINGS (GLOBAL)
   ========================================= */

.ui-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 50;
}

.ui-modal-overlay.hidden {
    display: none;
}

.ui-modal-card {
    background-color: #ffffff;
    color: #1e293b;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    padding: 1.5rem;
    width: 91.666667%;
    max-width: 28rem;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

html.dark .ui-modal-card {
    background-color: #1e293b;
    color: #f8fafc;
}

/* Difficulty Button Style */
.ui-btn-difficulty {
    display: block;
    margin: 0 auto;
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1.125rem;
    font-weight: 500;
    text-align: center;
    border-radius: 0.5rem;
    background-color: transparent;
    border: 1.5px solid #cbd5e1;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s;
}

.ui-btn-difficulty:hover:not(:disabled) {
    background-color: #f8fafc;
}

html.dark .ui-btn-difficulty {
    border: 1.5px solid #475569;
    color: #e2e8f0;
}

html.dark .ui-btn-difficulty:hover:not(:disabled) {
    background-color: #334155;
}

.ui-btn-difficulty:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: transparent;
}

.ui-btn-modal-green {
    display: block;
    margin: 0 auto;
    position: static !important;
    width: 100%;
    background-color: #22c55e;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ui-btn-modal-green:hover {
    background-color: #16a34a;
}

.ui-btn-modal-yellow {
    display: block;
    margin: 0 auto;
    position: static !important;
    width: 100%;
    background-color: #eab308;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ui-btn-modal-yellow:hover {
    background-color: #ca8a04;
}

.ui-btn-modal-red {
    width: 100%;
    background-color: #ef4444;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ui-btn-modal-red:hover {
    background-color: #dc2626;
}

.ui-btn-modal-gray {
    display: block;
    margin: 0 auto;
    position: static !important;
    width: 100%;
    background-color: #64748b;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    font-size: 1.125rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.ui-btn-modal-gray:hover {
    background-color: #475569;
}

.dmg-cta-primary {
    display: block;
    width: 100%;
    max-width: 280px;
    background-color: #3A86FF;
    color: #ffffff;
    font-weight: bold;
    font-size: 1.1rem;
    padding: 14px 24px;
    border-radius: 10px;
    text-decoration: none;
    text-align: center;
    box-shadow: 0 4px 12px rgba(58, 134, 255, 0.3);
    margin: 0 auto 12px auto;
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
    cursor: pointer;
}

.dmg-cta-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(58, 134, 255, 0.4);
    color: #ffffff;
}

.dmg-cta-tertiary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: fit-content;
    margin: 0 auto;
    color: #3A86FF;
    font-weight: 600;
    font-size: 1rem;
    padding: 10px 20px;
    border: 2px solid #3A86FF;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.2s;
    background: transparent;
}

.dmg-cta-tertiary:hover {
    background: rgba(58, 134, 255, 0.1);
}

.dmg-share-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
    margin-top: 1.5rem;
}

.dmg-share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    max-width: 280px;
    background-color: #3b82f6;
    color: white;
    font-weight: bold;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    transition: all 0.3s;
    transform: scale(1);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    margin: 0 auto;
    border: none;
    cursor: pointer;
}

.dmg-share-btn:hover {
    background-color: #2563eb;
    transform: scale(1.05);
}

.dmg-share-dropdown {
    position: absolute;
    bottom: 100%;
    margin-bottom: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    z-index: 100;
    overflow: hidden;
}

.dmg-share-dropdown.is-hidden {
    display: none;
}

.dmg-share-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    text-decoration: none;
    color: #333;
    font-weight: 600;
    border-bottom: 1px solid #eee;
    background: none;
    text-align: left;
    transition: background 0.2s;
}

.dmg-share-option:hover {
    background: #f3f4f6;
    color: #333;
}

.dmg-share-option-btn {
    width: 100%;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.dmg-share-icon-facebook {
    width: 32px;
    height: 32px;
    background: #1877F2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dmg-share-icon-x {
    width: 32px;
    height: 32px;
    background: #000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dmg-share-icon-reddit {
    width: 32px;
    height: 32px;
    background: #FF4500;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dmg-share-icon-email {
    width: 32px;
    height: 32px;
    background: #EA4335;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dmg-share-icon-copy {
    width: 32px;
    height: 32px;
    background: #6B7280;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dark .dmg-share-icon-x {
    background-color: #333333;
}

.dmg-modal-body .dmg-share-wrapper {
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    display: block;
}

/* Settings Modal Component */
.ui-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

html.dark .ui-modal-header {
    border-bottom-color: #334155;
}

.ui-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    text-align: center;
    width: 100%;
}

html.dark .ui-modal-title {
    color: #f8fafc;
}

/* Redefine modal-close-btn to work universally inside ui-modal-header */
.ui-modal-header .modal-close-btn {
    position: absolute;
    top: -0.1rem;
    right: 0.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    transition: color 0.2s ease;
}

.ui-modal-header .modal-close-btn:hover {
    color: #3b82f6;
}

html.dark .ui-modal-header .modal-close-btn {
    color: #94a3b8;
}

html.dark .ui-modal-header .modal-close-btn:hover {
    color: #60a5fa;
}

.ui-modal-body {
    padding: 0;
}

/* Settings Modal Specifics */
.ui-settings-section {
    padding: 1.25rem 0;
    border-bottom: 1px solid #e2e8f0;
}

html.dark .ui-settings-section {
    border-bottom-color: #334155;
}

.ui-settings-section:first-child {
    padding-top: 0;
}

.ui-settings-section:last-child {
    border-bottom: none;
}

.ui-settings-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 1rem;
}

html.dark .ui-settings-title {
    color: #60a5fa;
}

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

.ui-settings-label {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
}

html.dark .ui-settings-label {
    color: #f8fafc;
}

.ui-settings-hint {
    font-size: 0.875rem;
    color: #64748b;
    margin-top: 0.25rem;
}

html.dark .ui-settings-hint {
    color: #94a3b8;
}

.ui-settings-select {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    border-radius: 0.5rem;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    font-size: 1rem;
    color: #1e293b;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231e293b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1em;
}

html.dark .ui-settings-select {
    background-color: #0f172a;
    border-color: #334155;
    color: #f8fafc;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f8fafc' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
}

.ui-settings-footer {
    text-align: center;
    padding-top: 1.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

html.dark .ui-settings-footer {
    color: #94a3b8;
}

/* Toggle Switch */
.ui-toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: pointer;
}

.ui-toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.ui-toggle-slider {
    width: 2.75rem;
    height: 1.5rem;
    background-color: #cbd5e1;
    border-radius: 9999px;
    position: relative;
    transition: background-color 0.2s;
}

.ui-toggle-slider::after {
    content: '';
    position: absolute;
    top: 0.125rem;
    left: 0.125rem;
    width: 1.25rem;
    height: 1.25rem;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ui-toggle-switch input:checked+.ui-toggle-slider {
    background-color: #3b82f6;
}

.ui-toggle-switch input:checked+.ui-toggle-slider::after {
    transform: translateX(1.25rem);
}

html.dark .ui-toggle-slider {
    background-color: #475569;
}

.ui-settings-footer p {
    margin-bottom: 0.25rem;
}

.ui-btn-danger {
    width: 100%;
    background-color: #fee2e2;
    color: #b91c1c;
    font-weight: 600;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #fca5a5;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.ui-btn-danger:hover {
    background-color: #fecaca;
}

html.dark .ui-btn-danger {
    background-color: rgba(185, 28, 28, 0.2);
    color: #f87171;
    border-color: #7f1d1d;
}

html.dark .ui-btn-danger:hover {
    background-color: rgba(185, 28, 28, 0.4);
}