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

/* Light theme (default) */
:root {
    --primary-color: #234b8b;
    --primary-dark: #1b3a6a;
    --secondary-color: #2c3e50;
    --text-color: #222;
    --light-bg: #f8fafc;
    --panel-bg: #ffffff;
    --white: #ffffff;
    --border-color: #e2e8f0;
    --grid-border: #334155;
    --cell-empty: #ffffff;
    --cell-filled: #1f2937;
    --cell-marked: #ef4444;
    --clue-text: #1f2937;
    --muted-text: #64748b;
    --shadow: 0 2px 10px rgba(0,0,0,0.08);
}

/* Dark theme */
[data-theme="dark"] {
    --primary-color: #234b8b;
    --primary-dark: #1b3a6a;
    --secondary-color: #bcd2ff;
    --text-color: #e7eefc;
    --light-bg: #0e1b33;
    --panel-bg: #122347;
    --white: #122347;
    --border-color: #2b4475;
    --grid-border: #e7eefc;
    --cell-empty: #162a55;
    --cell-filled: #e7eefc;
    --cell-marked: #ff6b6b;
    --clue-text: #d7e5ff;
    --muted-text: #9eb3dc;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--light-bg);
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

/* Screen reader only - for SEO H2 without visual impact */
.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;
}

.ad-banner {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px;
}

.ad-banner.ad-top {
    border-bottom: 1px solid var(--border-color);
}

.ad-banner.ad-bottom {
    border-top: 1px solid var(--border-color);
}

.ad-placeholder {
    background: var(--light-bg);
    color: var(--muted-text);
    padding: 20px;
    border-radius: 4px;
    font-size: 0.875rem;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    max-width: 728px;
}

.ad-sidebar {
    display: none;
    min-width: 300px;
    width: 300px;
    padding: 20px;
    background: transparent;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    min-height: 250px;
}

/* Show sidebar on desktop, hide on mobile */
@media (min-width: 1024px) {
    .ad-sidebar {
        display: block;
    }
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 200px);
}

@media (max-width: 768px) {
    .container {
        padding: 10px;
        min-height: 100vh;
    }
}

header {
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
    margin-bottom: 8px;
    background: var(--light-bg);
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

/* Dim header when modal is open to match page backdrop */
/* Backdrop will cover header; no filter necessary */

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo-mark {
    width: 32px;
    height: 32px;
    border-radius: 8px;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

.theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1; /* slate-300 */
    transition: background 0.2s ease;
    border-radius: 999px;
}

.slider:before {
    content: "";
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    top: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.switch input:checked + .slider {
    background: var(--primary-color);
}

.switch input:checked + .slider:before {
    transform: translateX(20px);
}

.switch-label {
    font-size: 0.9rem;
    color: var(--secondary-color);
}

.game-title {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin: 0;
}

.tagline {
    font-size: 1rem;
    color: #9eb3dc;
    font-style: italic;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    gap: 20px;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

.game-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
    width: 100%;
}

.game-controls.below {
    margin-top: 16px;
    justify-content: center;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 14px 16px;
    max-width: 900px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.control-group label.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.control-group label.checkbox-label span {
    font-weight: 500;
    font-size: 0.95rem;
}

select {
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    background: var(--panel-bg);
    color: var(--text-color);
    cursor: pointer;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

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

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: #264a86;
    color: #fff;
}

.btn-secondary:hover {
    background: #1a252f;
}

.game-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    width: 100%;
    max-width: 100%;
}

#game-container {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    overflow-x: auto;
    overflow-y: visible;
    max-width: 100%;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (min-width: 769px) {
    #game-container {
        justify-content: center;
        align-items: center;
    }
}

.nonogram-grid {
    display: grid;
    user-select: none;
    background: var(--panel-bg);
    padding: 20px;
    border-radius: 12px;
    box-shadow: var(--shadow);
    gap: 12px;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto 1fr;
    min-width: fit-content;
    width: fit-content;
    margin: 0 auto;
}

.nonogram-corner {
    width: 100%;
    height: 100%;
}

.nonogram-top-clues {
    display: grid;
    align-items: end;
    justify-items: center;
    gap: 0;
}

.nonogram-left-clues {
    display: grid;
    align-items: center;
    justify-items: end;
    gap: 0;
}

.nonogram-right-clues {
    display: grid;
    align-items: center;
    justify-items: start;
    gap: 0;
}

.nonogram-bottom-clues {
    display: grid;
    align-items: start;
    justify-items: center;
    gap: 0;
}

.nonogram-board {
    display: grid;
    gap: 0;
    background: var(--white);
    border: 1px solid var(--border-color);
}

.nonogram-cell {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: var(--cell-empty);
    cursor: pointer;
    position: relative;
    transition: background 0.1s ease;
}

.nonogram-cell:hover {
    background: #f1f5f9;
}

.nonogram-cell.thick-right {
    border-right: 2px solid var(--grid-border);
}

.nonogram-cell.thick-bottom {
    border-bottom: 2px solid var(--grid-border);
}

.nonogram-cell.filled {
    background: var(--cell-filled);
    color: #fff;
}

.nonogram-cell.marked {
    background: var(--cell-marked);
}

.nonogram-cell.marked::after {
    content: '✕';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 1rem;
}

.clue-cell {
    background: var(--light-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--clue-text);
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: background-color 0.2s ease;
    user-select: none;
    -webkit-user-select: none;
    pointer-events: auto;
}

.clue-cell:hover {
    background: var(--panel-bg);
}

.clue-cell.clue-in-progress {
    background: #fff3cd;
    border-color: #ffc107;
}

[data-theme="dark"] .clue-cell.clue-in-progress {
    background: #5a4a1a;
    border-color: #ffc107;
}

.clue-cell.clue-done {
    background: #d4edda;
    border-color: #28a745;
    text-decoration: line-through;
    opacity: 0.7;
}

[data-theme="dark"] .clue-cell.clue-done {
    background: #1e3a26;
    border-color: #28a745;
}

.clue-cell.empty {
    background: transparent;
    cursor: default;
}

.clue-cell.empty:hover {
    background: transparent;
}

.x-mark {
    color: #ef4444;
}

.game-status {
    display: flex;
    gap: 20px;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}
#game-container + .toolbar,
.toolbar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    justify-content: center;
}

.sizes {
    display: inline-flex;
    gap: 8px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    padding: 6px;
}

.size-pill {
    appearance: none;
    border: 0;
    background: transparent;
    color: var(--secondary-color);
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
}

.size-pill.active {
    background: var(--primary-color);
    color: #fff;
}

.custom-size-controls input {
    width: 90px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--panel-bg);
    color: var(--text-color);
}

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

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    display: none;
    z-index: 2000;
}

.modal.open { display: block; }

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 2000;
}

.modal-dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--panel-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    border-radius: 12px;
    width: min(640px, 92vw);
    padding: 20px 24px;
    z-index: 2001;
}

.modal-close {
    position: absolute;
    top: 6px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--secondary-color);
}

.modal-content ol { margin-left: 18px; }
.modal-content li { margin: 6px 0; }

/* Share modal specific styles */
.share-link-container {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    align-items: center;
}

.share-link-input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--light-bg);
    color: var(--text-color);
    font-size: 0.9rem;
    font-family: monospace;
    cursor: text;
}

.share-link-input:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-color: var(--primary-color);
}

.copy-success {
    color: #28a745;
    font-weight: 600;
    margin-top: 10px;
    text-align: center;
}

[data-theme="dark"] .copy-success {
    color: #4ade80;
}

/* Settings modal styles */
.setting-item {
    margin: 20px 0;
    padding: 15px;
    background: var(--light-bg);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.setting-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 8px;
}

.setting-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.setting-description {
    margin: 8px 0 0 28px;
    font-size: 0.875rem;
    color: var(--muted-text);
    line-height: 1.5;
}

[data-theme="dark"] .setting-description {
    color: #94a3b8;
}

@media (max-width: 768px) {
    .setting-item {
        padding: 12px;
    }
    
    .setting-label {
        font-size: 0.9rem;
    }
    
    .setting-description {
        font-size: 0.8rem;
        margin-left: 26px;
    }
}

#timer {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
}

#status-message {
    font-size: 1rem;
    font-weight: 500;
    color: var(--primary-color);
}

#status-message.success {
    color: #27ae60;
    font-size: 1.2rem;
}

footer {
    text-align: center;
    padding: 30px 20px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: #9eb3dc;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.footer-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.footer-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.footer-nav a:hover {
    opacity: 0.8;
    text-decoration: underline;
}

/* More Games Section */
.more-games {
    max-width: 800px;
    margin: 40px auto 20px;
    padding: 20px;
    text-align: center;
    border-top: 2px solid var(--border-color);
    padding-top: 30px;
}

.more-games h3 {
    color: var(--secondary-color);
    font-size: 1.25rem;
    margin-bottom: 15px;
    font-weight: 600;
}

.games-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 15px;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.games-grid::-webkit-scrollbar {
    width: 6px;
}

.games-grid::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 3px;
}

.games-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.games-grid::-webkit-scrollbar-thumb:hover {
    background: var(--muted-text);
}

.game-card-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.game-card-link:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(35, 75, 139, 0.1);
    transform: translateY(-2px);
}

.game-card-icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.game-card-info {
    flex: 1;
    text-align: left;
    min-width: 0;
}

.game-card-info h4 {
    color: var(--secondary-color);
    font-size: 0.95rem;
    margin: 0 0 3px 0;
    font-weight: 600;
}

.game-card-info p {
    color: var(--muted-text);
    font-size: 0.8rem;
    margin: 0;
    line-height: 1.3;
}

.game-status-badge {
    display: inline-block;
    padding: 2px 6px;
    background: var(--light-bg);
    color: var(--muted-text);
    border-radius: 8px;
    font-size: 0.65rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-top: 4px;
}

.game-status-badge.coming-soon {
    background: rgba(35, 75, 139, 0.1);
    color: var(--primary-color);
}

.more-games-cta {
    margin-top: 12px;
    color: var(--muted-text);
    font-size: 0.85rem;
}

.more-games-cta a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.more-games-cta a:hover {
    text-decoration: underline;
}

/* Content Pages (FAQ, Tips, Blog) */
.content-page {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.content-page h2 {
    color: var(--secondary-color);
    margin-bottom: 20px;
    font-size: 2rem;
}

.content-page h3 {
    color: var(--secondary-color);
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.content-page p {
    line-height: 1.8;
    margin-bottom: 15px;
}

.content-page ul, .content-page ol {
    margin-left: 25px;
    margin-bottom: 20px;
    line-height: 1.8;
}

.content-page li {
    margin-bottom: 8px;
}

/* FAQ Sections */
.faq-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

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

/* Tips Sections */
.tips-section {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
}

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

.tips-cta {
    margin-top: 40px;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Blog Styles */
.blog-list {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.blog-post-preview {
    padding: 25px;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.blog-post-preview h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.blog-post-preview h3 a {
    color: var(--secondary-color);
    text-decoration: none;
}

.blog-post-preview h3 a:hover {
    text-decoration: underline;
}

.blog-meta {
    color: var(--muted-text);
    font-size: 0.9rem;
    margin-bottom: 15px;
}

.read-more {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-top: 10px;
}

.read-more:hover {
    text-decoration: underline;
}

.blog-post {
    line-height: 1.8;
}

.breadcrumb {
    color: var(--muted-text);
    font-size: 0.9rem;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.blog-cta {
    margin: 40px 0;
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.blog-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.blog-nav a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.blog-nav a:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .more-games {
        margin: 30px auto 15px;
        padding: 20px 15px;
        padding-top: 25px;
    }
    
    .more-games h3 {
        font-size: 1.1rem;
        margin-bottom: 12px;
    }
    
    .games-grid {
        grid-template-columns: 1fr;
        max-height: 400px;
        gap: 8px;
    }
    
    .game-card-link {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
    
    .game-card-icon {
        font-size: 1.25rem;
    }
    
    .footer-nav {
        gap: 10px;
        font-size: 0.9rem;
    }
    
    .content-page {
        padding: 15px;
    }
    
    .content-page h2 {
        font-size: 1.5rem;
    }
    
    .content-page h3 {
        font-size: 1.25rem;
    }
    
    .blog-post-preview {
        padding: 15px;
    }
    
    .tips-cta, .blog-cta {
        flex-direction: column;
    }
    
    .blog-nav {
        flex-direction: column;
        gap: 10px;
    }
}

/* Responsive Design */
@media (min-width: 769px) {
    .container {
        padding: 20px;
        min-height: auto;
        height: auto;
        overflow: visible;
    }

    main {
        flex-direction: column;
        width: 100%;
        align-items: center;
    }

    .game-area {
        width: 100%;
        max-width: 100%;
        flex: 1;
        overflow: visible;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #game-container {
        flex: none;
        overflow: visible;
        justify-content: center;
    }

    .toolbar {
        position: static;
        max-height: none;
        overflow: visible;
    }

    footer {
        display: block;
    }
}

@media (min-width: 1024px) {
    /* Sidebar layout for desktop with ads */
    main {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        justify-content: center;
        max-width: 1400px;
        margin: 0 auto;
        gap: 20px;
    }

    .game-area {
        flex: 1;
        max-width: calc(100% - 340px);
        width: auto;
    }
}

@media (max-width: 768px) {
    .logo {
        font-size: 2rem;
    }

    header h2 {
        font-size: 1.5rem;
    }

    .site-header {
        position: sticky;
        top: 0;
        background: var(--light-bg);
        z-index: 100;
        padding: 10px 0;
    }

    .game-title {
        display: none;
    }

    .header-right {
        justify-content: flex-end;
    }

    .container {
        padding: 0;
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }

    main {
        flex-direction: column;
        display: flex;
        flex: 1;
    }

    .game-area {
        display: flex;
        flex-direction: column;
        padding: 0 10px;
        min-height: calc(100vh - 200px);
    }

    #game-container {
        flex-shrink: 0;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
        display: flex;
        justify-content: center;
        align-items: flex-start;
        padding: 10px 0;
        max-height: calc(100vh - 300px);
    }

    .nonogram-grid {
        gap: 0;
        padding: 10px;
        width: max-content;
        margin: 0 auto;
    }

    .nonogram-cell {
        width: 28px;
        height: 28px;
        border: 1px solid var(--border-color);
    }

    .clue-cell {
        width: 28px;
        height: 28px;
        min-width: 28px;
        min-height: 28px;
        font-size: 0.75rem;
        border: 1px solid var(--border-color);
    }

    /* Ensure 10x10 fits without scrolling - adjust cell size in render if needed */
    @media (max-width: 768px) and (max-height: 900px) {
        .nonogram-cell {
            width: 26px;
            height: 26px;
        }
        .clue-cell {
            width: 26px;
            height: 26px;
            min-width: 26px;
            min-height: 26px;
        }
    }

    .nonogram-board {
        gap: 0;
    }

    .game-status {
        flex-shrink: 0;
        padding: 10px 0;
    }

    .toolbar {
        position: static;
        background: var(--light-bg);
        padding: 10px;
        margin: 10px 0 0 0;
        justify-content: center;
        gap: 6px;
        flex-wrap: wrap;
        border-top: 1px solid var(--border-color);
    }

    .control-group {
        display: flex;
        align-items: center;
        gap: 8px;
        flex-wrap: nowrap;
    }

    .control-group label {
        white-space: nowrap;
    }

    .custom-size-controls {
        display: flex;
        align-items: center;
        gap: 8px;
        justify-content: center;
        flex-wrap: wrap;
        width: 100%;
    }

    .custom-size-controls select {
        flex: 0 0 auto;
        min-width: 80px;
    }

    .actions {
        justify-content: center;
        width: 100%;
        gap: 6px;
        flex-wrap: wrap;
    }

    .btn {
        flex: 0 1 auto;
        min-width: 80px;
        padding: 8px 16px;
    }

    footer {
        display: block;
        padding: 20px 15px;
        margin-top: 20px;
    }
    
    .footer-nav {
        gap: 8px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .nonogram-cell {
        width: 20px;
        height: 20px;
        border: 1px solid var(--border-color);
    }

    .clue-cell {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        font-size: 0.7rem;
        border: 1px solid var(--border-color);
    }

    .nonogram-grid {
        gap: 0;
        padding: 8px;
    }

    #game-container {
        padding: 0;
    }
}

