/**
 * SEO Guru Crossword - Frontend Styles (Bilingual Hindi & English Universal News Edition)
 * Brand: Created by SEO Guru (seogru.in)
 */

:root {
    --sg-primary: #2563eb;
    --sg-primary-hover: #1d4ed8;
    --sg-primary-light: #eff6ff;
    --sg-primary-glow: rgba(37, 99, 235, 0.25);
    --sg-secondary: #10b981;
    --sg-secondary-light: #ecfdf5;
    --sg-accent: #f59e0b;
    --sg-danger: #ef4444;
    --sg-danger-light: #fef2f2;
    --sg-wa-green: #25d366;
    --sg-wa-dark: #128c7e;
    --sg-bg: #ffffff;
    --sg-surface: #f8fafc;
    --sg-border: #e2e8f0;
    --sg-text: #0f172a;
    --sg-text-muted: #64748b;
    --sg-cell-bg: #ffffff;
    --sg-cell-blocked: #0f172a;
    --sg-cell-border: #cbd5e1;
    --sg-cell-word-hl: #e0f2fe;
    --sg-cell-active: #93c5fd;
    --sg-cell-correct: #dcfce7;
    --sg-cell-error: #fee2e2;
    --sg-cell-revealed: #fef3c7;
    --sg-radius: 14px;
    --sg-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

.seo-guru-crossword-wrapper.theme-dark {
    --sg-bg: #0f172a;
    --sg-surface: #1e293b;
    --sg-border: #334155;
    --sg-text: #f8fafc;
    --sg-text-muted: #94a3b8;
    --sg-cell-bg: #1e293b;
    --sg-cell-blocked: #020617;
    --sg-cell-border: #475569;
    --sg-cell-word-hl: #1e3a8a;
    --sg-cell-active: #2563eb;
    --sg-cell-correct: #064e3b;
    --sg-cell-error: #7f1d1d;
    --sg-cell-revealed: #78350f;
    --sg-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5);
}

.seo-guru-crossword-wrapper {
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Mukta", "Noto Sans Devanagari", sans-serif;
    background: var(--sg-bg);
    color: var(--sg-text);
    border: 1px solid var(--sg-border);
    border-radius: var(--sg-radius);
    padding: 24px;
    margin: 24px auto;
    max-width: 1100px;
    box-shadow: var(--sg-shadow);
    position: relative;
    user-select: none;
    -webkit-user-select: none;
}

.seo-guru-crossword-wrapper *,
.seo-guru-crossword-wrapper *::before,
.seo-guru-crossword-wrapper *::after {
    box-sizing: border-box;
}

/* Brand Header & Language Switcher Bar */
.sg-brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--sg-border);
    margin-bottom: 18px;
    flex-wrap: wrap;
    gap: 12px;
}

.sg-brand-link {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.sg-brand-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border: 1px solid #bfdbfe;
    padding: 6px 14px;
    border-radius: 9999px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.seo-guru-crossword-wrapper.theme-dark .sg-brand-badge {
    background: linear-gradient(135deg, #1e3a8a 0%, #172554 100%);
    border-color: #1e40af;
}

.sg-brand-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

.sg-logo-icon {
    font-size: 1.2rem;
}

.sg-brand-name {
    font-weight: 800;
    color: var(--sg-primary);
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}

.sg-brand-pill {
    font-size: 0.75rem;
    font-weight: 600;
    color: #1d4ed8;
    background: rgba(255, 255, 255, 0.85);
    padding: 2px 8px;
    border-radius: 9999px;
}

/* Language Toggle Button Pill */
.sg-lang-switcher {
    display: inline-flex;
    align-items: center;
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-radius: 9999px;
    padding: 3px;
    gap: 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.sg-lang-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--sg-text-muted);
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-family: inherit;
}

.sg-lang-btn.active {
    background: var(--sg-primary);
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

/* Fixed Modal Overlay for Engagement Gate */
.sg-gateway-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.sg-gateway-card {
    position: relative;
    background: var(--sg-bg);
    border: 1px solid var(--sg-border);
    border-radius: 18px;
    padding: 28px 24px;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    animation: sgModalPop 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
}

.sg-gate-close-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--sg-text-muted);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
}

.sg-gate-close-btn:hover {
    color: var(--sg-text);
}

.sg-gateway-badge {
    display: inline-block;
    background: #fef3c7;
    color: #92400e;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 9999px;
    margin-bottom: 8px;
}

.sg-gateway-card h3 {
    margin: 0 0 6px 0;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--sg-text);
}

.sg-gateway-sub {
    margin: 0 0 16px 0;
    color: var(--sg-text-muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.sg-gate-tabs {
    display: flex;
    gap: 6px;
    background: var(--sg-surface);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 16px;
    border: 1px solid var(--sg-border);
}

.sg-gate-tab {
    flex: 1;
    padding: 8px 6px;
    background: transparent;
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sg-text-muted);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sg-gate-tab.active {
    background: var(--sg-primary);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.sg-gate-content {
    display: none;
    text-align: left;
    margin-bottom: 16px;
}

.sg-gate-content.active {
    display: block;
}

.sg-wa-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 14px;
}

.sg-wa-box strong {
    color: #166534;
    font-size: 0.9rem;
    display: block;
    margin-bottom: 2px;
}

.sg-wa-box p {
    margin: 0;
    font-size: 0.8rem;
    color: #15803d;
}

.sg-wa-icon {
    font-size: 1.8rem;
}

.sg-btn-whatsapp {
    width: 100%;
    background: var(--sg-wa-green) !important;
    color: #ffffff !important;
    border: none !important;
    font-size: 0.95rem !important;
    padding: 12px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3) !important;
    text-decoration: none;
}

.sg-news-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 12px;
}

.sg-news-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-radius: 10px;
    padding: 10px 12px;
}

.sg-news-item.read {
    background: #ecfdf5;
    border-color: #a7f3d0;
}

.sg-news-check {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--sg-text-muted);
}

.sg-news-item.read .sg-news-check {
    color: var(--sg-secondary);
}

.sg-news-info {
    flex: 1;
}

.sg-news-info strong {
    font-size: 0.85rem;
    color: var(--sg-text);
    display: block;
    line-height: 1.3;
}

.sg-news-info p {
    margin: 2px 0 0 0;
    font-size: 0.75rem;
    color: var(--sg-text-muted);
}

.sg-btn-read-news {
    padding: 6px 12px;
    font-size: 0.75rem;
    background: var(--sg-primary);
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.sg-gateway-footer {
    border-top: 1px solid var(--sg-border);
    padding-top: 10px;
    text-align: center;
}

.sg-gate-skip-btn {
    background: none;
    border: none;
    color: var(--sg-primary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 4px 8px;
}

/* Toolbar */
.sg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 16px;
}

.sg-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sg-puzzle-title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--sg-text);
}

.sg-diff-pill {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 9999px;
}

.sg-diff-easy {
    background: #dcfce7;
    color: #166534;
}

.sg-cat-pill {
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    color: var(--sg-text-muted);
    padding: 3px 10px;
    border-radius: 9999px;
}

.sg-toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.sg-timer-box {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    padding: 6px 12px;
    border-radius: 8px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--sg-text);
}

.sg-btn-timer-pause {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 0.85rem;
    opacity: 0.7;
}

.sg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--sg-border);
    background: var(--sg-surface);
    color: var(--sg-text);
    cursor: pointer;
    transition: all 0.2s ease;
}

.sg-btn:hover {
    background: var(--sg-border);
    transform: translateY(-1px);
}

.sg-btn-icon {
    padding: 8px 10px;
    font-size: 1rem;
}

.sg-hint-btn {
    color: #d97706;
    background: #fffbeb;
    border-color: #fde68a;
}

.sg-hint-count {
    font-weight: 800;
    font-size: 0.8rem;
    background: #f59e0b;
    color: #fff;
    padding: 1px 6px;
    border-radius: 9999px;
}

.sg-puzzle-dropdown-wrap select {
    padding: 6px 10px;
    font-size: 0.85rem;
    border-radius: 8px;
    border: 1px solid var(--sg-border);
    background: var(--sg-surface);
    color: var(--sg-text);
    cursor: pointer;
}

/* Active Clue Strip with Navigation Arrows (Mobile First) */
.sg-active-clue-bar {
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-left: 4px solid var(--sg-primary);
    padding: 8px 12px;
    border-radius: 10px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 620px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.sg-clue-nav-btn {
    background: var(--sg-primary-light);
    color: var(--sg-primary);
    border: 1px solid var(--sg-border);
    border-radius: 8px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 800;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
    user-select: none;
    -webkit-user-select: none;
}

.sg-clue-nav-btn:hover {
    background: var(--sg-primary);
    color: #ffffff;
}

.sg-clue-nav-btn:active {
    transform: scale(0.92);
}

.sg-active-clue-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.sg-active-clue-tag {
    font-weight: 800;
    font-size: 0.75rem;
    background: var(--sg-primary);
    color: #ffffff;
    padding: 3px 8px;
    border-radius: 5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sg-active-clue-text {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--sg-text);
    line-height: 1.4;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Main Layout: Centered Single Column (No Squished Sidebars) */
.sg-game-layout {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 620px;
    margin: 0 auto;
    box-sizing: border-box;
}

.sg-grid-area {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* Hidden Proxy Input for Mobile Native Device Keyboard */
.sg-hidden-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 1px;
    opacity: 0.001;
    border: none;
    padding: 0;
    margin: 0;
    outline: none;
    background: transparent;
    font-size: 16px;
    pointer-events: auto;
    z-index: 0;
}

/* Fluid Responsive Crossword Grid Container */
.sg-grid-container {
    display: inline-grid;
    gap: 1px;
    background-color: var(--sg-cell-border);
    border: 2px solid var(--sg-cell-border);
    border-radius: 8px;
    overflow: hidden;
    max-width: 100%;
    width: fit-content;
    margin: 0 auto;
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.sg-grid-container:focus {
    box-shadow: 0 0 0 3px var(--sg-primary-glow);
}

/* Fluid Responsive Cell */
.sg-cell {
    position: relative;
    background: var(--sg-cell-bg);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-sizing: border-box;
    /* Computed safely via JS for 100% browser compatibility */
    width: var(--cell-size, 38px);
    height: var(--cell-size, 38px);
    min-width: 20px;
    min-height: 20px;
    max-width: 48px;
    max-height: 48px;
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

.sg-cell.sg-blocked {
    background: var(--sg-cell-blocked);
    cursor: default;
}

.sg-cell-num {
    position: absolute;
    top: 2px;
    left: 2px;
    font-size: clamp(0.55rem, calc(20px / var(--grid-cols, 10) * 8), 0.72rem);
    font-weight: 700;
    line-height: 1;
    color: var(--sg-text-muted);
    pointer-events: none;
}

.sg-cell-letter {
    font-size: clamp(0.85rem, calc(360px / var(--grid-cols, 10) * 0.55), 1.4rem);
    font-weight: 800;
    color: var(--sg-text);
    line-height: 1;
    pointer-events: none;
    font-family: inherit;
    text-transform: uppercase;
}

/* Cell States */
.sg-cell.sg-word-active {
    background-color: var(--sg-cell-word-hl);
}

.sg-cell.sg-focused {
    background-color: var(--sg-cell-active) !important;
    box-shadow: inset 0 0 0 2px var(--sg-primary);
    z-index: 2;
}

.sg-cell.sg-correct {
    background-color: var(--sg-cell-correct);
    animation: sgPop 0.3s ease;
}

.sg-cell.sg-incorrect {
    background-color: var(--sg-cell-error) !important;
    animation: sgShake 0.4s ease;
}

.sg-cell.sg-revealed {
    background-color: var(--sg-cell-revealed);
}

@keyframes sgPop {
    0% { transform: scale(0.9); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

@keyframes sgShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-3px); }
    40%, 80% { transform: translateX(3px); }
}

/* Grid Actions */
.sg-grid-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    margin-top: 14px;
    width: 100%;
}

.sg-grid-actions .sg-btn {
    flex: 1 1 auto;
    font-size: 0.8rem;
    padding: 7px 11px;
    white-space: nowrap;
}

/* On-Screen Keypads (Hindi & English) - Strictly Isolated & Mobile Responsive (Hidden by default) */
.seo-guru-crossword-wrapper .sg-hindi-keypad,
.seo-guru-crossword-wrapper .sg-english-keypad {
    display: none;
    flex-direction: column;
    width: 100%;
    max-width: 580px;
    margin: 14px auto 0 auto;
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-radius: 12px;
    padding: 10px 8px;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    box-sizing: border-box;
}

.seo-guru-crossword-wrapper .sg-hindi-keypad.sg-visible,
.seo-guru-crossword-wrapper .sg-english-keypad.sg-visible {
    display: flex !important;
}

.seo-guru-crossword-wrapper .sg-keypad-header {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-bottom: 6px !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
}

.seo-guru-crossword-wrapper .sg-keypad-title {
    font-size: 0.8rem !important;
    font-weight: 700 !important;
    color: var(--sg-text-muted) !important;
}

.seo-guru-crossword-wrapper .sg-keypad-dir-hint {
    font-size: 0.78rem !important;
    color: var(--sg-text-muted) !important;
}

.seo-guru-crossword-wrapper .sg-keypad-dir-hint strong {
    color: var(--sg-primary) !important;
}

.seo-guru-crossword-wrapper .sg-key-row {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: center !important;
    align-items: stretch !important;
    gap: 3px !important;
    width: 100% !important;
    margin: 0 0 4px 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

.seo-guru-crossword-wrapper .sg-key-row-middle {
    padding: 0 14px !important;
}

.seo-guru-crossword-wrapper .sg-key {
    flex: 1 1 0px !important;
    min-width: 0 !important;
    height: 42px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: var(--sg-bg) !important;
    border: 1px solid var(--sg-border) !important;
    border-radius: 6px !important;
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    color: var(--sg-text) !important;
    cursor: pointer !important;
    font-family: inherit !important;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
    transition: transform 0.06s ease, background 0.08s ease !important;
}

.seo-guru-crossword-wrapper .sg-key:active {
    transform: scale(0.94) !important;
    background: var(--sg-border) !important;
}

.seo-guru-crossword-wrapper .sg-key-matra {
    background: #f8fafc !important;
    color: var(--sg-primary) !important;
    font-size: 1.15rem !important;
    font-weight: 800 !important;
}

.seo-guru-crossword-wrapper .sg-key-action {
    flex: 1.8 1 0px !important;
    font-size: 0.8rem !important;
    background: var(--sg-primary-light) !important;
    color: var(--sg-primary) !important;
    font-weight: 800 !important;
}

.seo-guru-crossword-wrapper .sg-key-delete {
    flex: 1.8 1 0px !important;
    font-size: 0.82rem !important;
    background: #fee2e2 !important;
    color: #b91c1c !important;
    font-weight: 800 !important;
}

@media (max-width: 480px) {
    .seo-guru-crossword-wrapper .sg-key {
        height: 38px !important;
        font-size: 0.95rem !important;
    }
    .seo-guru-crossword-wrapper .sg-key-action,
    .seo-guru-crossword-wrapper .sg-key-delete {
        font-size: 0.72rem !important;
    }
}

/* Collapsible Full-Width All Clues Section (Mobile Friendly) */
.sg-all-clues-wrapper {
    width: 100%;
    margin-top: 18px;
    box-sizing: border-box;
}

.sg-btn-all-clues-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--sg-text);
    cursor: pointer;
    transition: background 0.15s ease;
}

.sg-btn-all-clues-toggle:hover {
    background: var(--sg-border);
}

.sg-toggle-caret {
    transition: transform 0.2s ease;
    font-size: 0.95rem;
}

.sg-all-clues-wrapper.expanded .sg-toggle-caret {
    transform: rotate(180deg);
}

.sg-all-clues-dropdown {
    margin-top: 10px;
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.sg-clues-grid-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

@media (max-width: 600px) {
    .sg-clues-grid-two-col {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

.sg-clues-col-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--sg-border);
    margin-bottom: 10px;
}

.sg-clues-col-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--sg-text);
}

.sg-clues-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 380px;
    overflow-y: auto;
}

.sg-clue-item {
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 4px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    font-size: 0.88rem;
    line-height: 1.45;
    color: var(--sg-text);
    transition: background 0.15s ease;
    word-break: normal;
    overflow-wrap: break-word;
    white-space: normal;
}

.sg-clue-item:hover {
    background: var(--sg-border);
}

.sg-clue-item.sg-clue-active {
    background: var(--sg-cell-word-hl);
    border-left: 3px solid var(--sg-primary);
    font-weight: 700;
}

.sg-clue-num {
    font-weight: 800;
    color: var(--sg-primary);
    min-width: 22px;
    flex-shrink: 0;
}

/* Victory Modal & Photo Banner Section */
.sg-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

#sg-confetti-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sg-modal-card {
    position: relative;
    background: var(--sg-bg);
    border-radius: 20px;
    padding: 28px;
    max-width: 580px;
    width: 100%;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
    text-align: center;
    animation: sgModalPop 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid var(--sg-border);
    max-height: 92vh;
    overflow-y: auto;
}

@keyframes sgModalPop {
    0% { transform: scale(0.85) translateY(20px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
}

.sg-modal-close-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--sg-text-muted);
    cursor: pointer;
    padding: 4px 8px;
}

.sg-victory-stars {
    font-size: 2rem;
    margin-bottom: 6px;
    animation: sgPop 0.5s ease;
}

.sg-modal-header h2 {
    margin: 0 0 6px 0;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--sg-text);
}

.sg-victory-subtitle {
    margin: 0 0 16px 0;
    color: var(--sg-text-muted);
    font-size: 0.95rem;
}

/* Player Avatar / Photo Picker */
.sg-player-avatar-section {
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 16px;
    text-align: left;
}

.sg-player-avatar-section h4 {
    margin: 0 0 10px 0;
    font-size: 0.9rem;
    font-weight: 700;
}

.sg-avatar-picker-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sg-current-avatar-wrap {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 3px solid #f59e0b;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 2rem;
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
    flex-shrink: 0;
}

.sg-current-avatar-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sg-avatar-controls {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sg-btn-upload {
    display: inline-flex;
    cursor: pointer;
    background: var(--sg-bg);
    border: 1px solid var(--sg-border);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--sg-primary);
    width: fit-content;
}

.sg-quick-emojis {
    display: flex;
    gap: 8px;
}

.sg-emoji-opt {
    font-size: 1.4rem;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 6px;
    transition: transform 0.15s;
}

.sg-emoji-opt:hover, .sg-emoji-opt.active {
    transform: scale(1.25);
    background: #e0f2fe;
}

/* Banner Canvas Preview */
.sg-banner-preview-box {
    margin-bottom: 16px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    background: #0f172a;
}

#sg-share-banner-canvas {
    width: 100%;
    height: auto;
    display: block;
}

/* Banner Actions */
.sg-banner-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.sg-btn-whatsapp-share {
    flex: 1 1 55%;
    background: var(--sg-wa-green) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 800 !important;
    font-size: 0.95rem !important;
    padding: 12px !important;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3) !important;
}

.sg-btn-download-banner {
    flex: 1 1 40%;
    background: var(--sg-primary) !important;
    color: #ffffff !important;
    border: none !important;
    font-weight: 700 !important;
    font-size: 0.85rem !important;
    padding: 12px !important;
}

/* Lead Section */
.sg-lead-section {
    background: var(--sg-surface);
    border: 1px solid var(--sg-border);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 18px;
}

.sg-lead-section h4 {
    margin: 0 0 10px 0;
    font-size: 0.95rem;
    font-weight: 700;
}

.sg-input-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

@media (max-width: 500px) {
    .sg-input-row {
        flex-direction: column;
    }
}

.sg-lead-section input {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid var(--sg-border);
    background: var(--sg-bg);
    color: var(--sg-text);
    font-size: 0.85rem;
}

.sg-btn-submit-score {
    width: 100%;
    background: var(--sg-primary);
    color: #ffffff;
    border: none;
    padding: 10px;
    font-size: 0.9rem;
    border-radius: 6px;
}

.sg-lead-msg {
    margin-top: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--sg-secondary);
}

/* SEO Guru Promotional Card */
.sg-brand-promo-card {
    background: linear-gradient(135deg, #eff6ff 0%, #e0e7ff 100%);
    border: 2px solid #93c5fd;
    border-radius: 14px;
    padding: 16px;
    text-align: left;
}

.sg-brand-promo-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.sg-promo-badge {
    background: #2563eb;
    color: #fff;
    font-weight: 800;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
}

.sg-brand-promo-header h5 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--sg-text);
}

.sg-brand-promo-card p {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--sg-text);
}

.sg-btn-brand-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #2563eb;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.85rem;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 8px;
}

/* Footer Watermark */
.sg-game-footer {
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px solid var(--sg-border);
    text-align: center;
    font-size: 0.8rem;
    color: var(--sg-text-muted);
}

.sg-game-footer a {
    color: var(--sg-primary);
    text-decoration: none;
    font-weight: 600;
}
