.crossword-wrapper {
    max-width: 1500px;
    width: 95%;
    margin: auto;
    padding: 2rem;
}

/* =============================================
   TOPBAR - Centered Title + Buttons
   ============================================= */

.crossword-topbar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-bottom: 40px;
    text-align: center;
}

.crossword-topbar > div:first-child {      /* Title + Date + Streak */
    margin-bottom: 20px;
}

#puzzleTitle {
    font-size: 2.4rem;
    margin: 0 0 8px 0;
    line-height: 1.05;
    color: white;
}

.crossword-date {
    font-size: 1.15rem;
    color: #8ea4ba;
    margin-bottom: 6px;
}

.crossword-streak {
    font-size: 1rem;
    color: #12d6a0;
    font-weight: 600;
}

/* Buttons row */
.crossword-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

/* Mobile adjustments */
@media (max-width: 900px) {
    #puzzleTitle {
        font-size: 2.1rem;
    }
    
    .crossword-buttons {
        gap: 10px;
    }
}
.crossword-buttons button,
.archive-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 18px;
    border: 1px solid rgba(255,255,255,0.08);
    background: #08121f;
    color: white;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.18);
}

.crossword-buttons button:hover,
.archive-link:hover {
    background: #102338;
    border-color: #12d6a0;
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.28);
}

.crossword-layout {
    display: grid;
    grid-template-columns: minmax(760px, 900px) minmax(320px, 1fr);
    gap: 40px;
    align-items: start;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 10px 35px rgba(0,0,0,0.25);
}

.crossword-grid {
    display: grid;
    width: 100%;
    max-width: 900px;
    border: 2px solid #000;
    background: #000;
    overflow: hidden;
    border-radius: 10px;
}

.crossword-cell {
    aspect-ratio: 1/1;
    background: white;
    position: relative;
    border: 1px solid #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 22px;
    color: #111;
}

.crossword-cell.black {
    background: #000;
}

.crossword-cell:not(.black):hover {
    background: #eefaf5;
}

.crossword-number {
    position: absolute;
    top: 2px;
    left: 4px;
    font-size: 10px;
    font-weight: 600;
    color: #555;
    line-height: 1;
}

.crossword-input {
    width: 100%;
    height: 100%;
    border: none;
    outline: none;
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    background: transparent;
    color: #111;
    text-transform: uppercase;
    cursor: pointer;
}

.crossword-input:focus {
    background: rgba(18, 214, 160, 0.15);
}

/* =============================================
   STATES & HIGHLIGHTS
   ============================================= */

.crossword-cell.correct   { background: #d7ffe8; }
.crossword-cell.incorrect { background: #ffd7d7; }
.crossword-cell.active    { background: #cceee6; }

.active-word {
    background: #dff7ef !important;
    outline: 2px solid #12d6a0;
}

.show-answer {
    background: #e6f7ff !important;
}

.active-clue {
    color: #12d6a0 !important;
    font-weight: bold;
    background: #f0fdf9;
    padding: 4px 8px;
    border-radius: 4px;
}

.clickable-clue {
    cursor: pointer;
    padding: 6px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.clickable-clue:hover {
    background: #f8fafc;
}

/* =============================================
   CLUES
   ============================================= */

.crossword-clues {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-content: start;
}

.clue-column h3 {
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.08);
    font-size: 1.25rem;
    color: #12d6a0;
    letter-spacing: 0.5px;
}

.clue {
    margin-bottom: 18px;
    line-height: 1.6;
    font-size: 1.02rem;
    color: #d7e2ec;
}

.clue strong {
    color: #12d6a0;
    margin-right: 4px;
}

/* =============================================
   HEADER / META
   ============================================= */

#puzzleTitle {
    font-size: 2.15rem;
    margin-bottom: 6px;
    line-height: 1.05;
    text-align: center;
}

.crossword-date {
    color: #8ea4ba;
    font-size: 1.05rem;
    letter-spacing: 0.4px;
    text-align: center;
}

.crossword-streak {
    margin-top: 8px;
    font-size: 0.98rem;
    color: #12d6a0;
    font-weight: 600;
    text-align: center;
}

/* =============================================
   MOBILE & TOUCH OPTIMIZATIONS
   ============================================= */

.crossword-grid {
    max-width: 100% !important;
    touch-action: manipulation;
    border: 2px solid #111;
}

.crossword-input {
    font-size: clamp(18px, 4.5vw, 22px) !important;
    -webkit-text-size-adjust: 100%;
    touch-action: manipulation;
}

@media (max-width: 768px) {
    .crossword-cell {
        font-size: clamp(16px, 4vw, 20px);
    }
    
    .crossword-number {
        font-size: 9px;
        top: 1px;
        left: 3px;
    }

    .crossword-layout {
        padding: 1rem;
        gap: 1.5rem;
    }

    .clue {
        font-size: 1.05rem;
        line-height: 1.55;
    }

    .active-word {
        outline: 3px solid #12d6a0;
        background: #d0f4e8 !important;
    }
}

@media (max-width: 480px) {
    .crossword-grid {
        border-width: 1.5px;
    }
    .crossword-cell {
        border-width: 0.5px;
    }
}

/* =============================================
   PRINT STYLES — SINGLE PAGE VERSION
   ============================================= */

@media print {

    html,
    body {
        width: 100%;
        height: auto;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        background: #fff !important;
    }

    body * {
        visibility: hidden !important;
    }

    .crossword-wrapper,
    .crossword-wrapper * {
        visibility: visible !important;
    }

    .crossword-wrapper {
        position: absolute;
        left: 0;
        top: 0;

        width: 100% !important;
        max-width: 100% !important;

        margin: 0 !important;
        padding: 8px !important;

        background: #fff !important;
        box-shadow: none !important;
    }

    .crossword-topbar {
        margin-bottom: 8px !important;
        text-align: center;
    }

    .crossword-topbar h1 {
        font-size: 28px !important;
        margin-bottom: 2px !important;
    }

    .crossword-topbar p {
        font-size: 14px !important;
        margin: 0 !important;
    }

.crossword-layout {
    display: grid !important;
    grid-template-columns: 330px 1fr !important;
    gap: 18px !important;
    align-items: start !important;

        padding: 0 !important;
        margin: 0 !important;

        background: white !important;
    }

/* =================================
   PRINT GRID FIX
   ================================= */

.crossword-grid {

    display: grid !important;

width: 312px !important;
height: 312px !important;

    min-width: 312px !important;
    min-height: 312px !important;

    max-width: 312px !important;
    max-height: 312px !important;

grid-template-columns: repeat(13, 24px) !important;
grid-template-rows: repeat(13, 24px) !important;

    gap: 0 !important;

    border: 2px solid #000 !important;
    background: #000 !important;

    overflow: hidden !important;

    box-sizing: content-box !important;

    margin: 0 auto !important;

    aspect-ratio: unset !important;
}

.crossword-cell {

width: 24px !important;
height: 24px !important;

    min-width: 26px !important;
    min-height: 26px !important;

    max-width: 26px !important;
    max-height: 26px !important;

    margin: 0 !important;
    padding: 0 !important;

    border: 1px solid #555 !important;

    box-sizing: border-box !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background: #fff !important;
    color: #000 !important;

    position: relative !important;

    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

.crossword-cell.black {
    background: #000 !important;
}

.crossword-number {
    position: absolute !important;
    top: 1px !important;
    left: 2px !important;

    font-size: 7px !important;
    line-height: 1 !important;
}

.crossword-input {
    font-size: 13px !important;
    font-weight: bold !important;
}

    /* =================================
       CLUES
       ================================= */

    .crossword-clues {
        font-size: 10.5px !important;
        line-height: 1.2 !important;
        color: #000 !important;
    }

    .clues-columns {
        gap: 12px !important;
    }

    .clue-column h3 {
        font-size: 12px !important;
        margin: 0 0 5px 0 !important;

        border-bottom: 1px solid #000 !important;
        padding-bottom: 2px !important;
    }

    .clue {
        margin-bottom: 3px !important;
        break-inside: avoid !important;
    }

    /* =================================
       HIDE UI
       ================================= */

    .crossword-buttons,
    .page-hero,
    .crossword-seo-text,
    header,
    footer,
    .archive-link,
    .crossword-streak,
    .hero-tag,
    button,
    nav {
        display: none !important;
    }

    /* =================================
       PAGE SETUP
       ================================= */

    @page {
        size: letter portrait;
        margin: 0.25in;
    }
}



/* =============================================
   PAGE HERO + SEO TEXT (Top Section)
   ============================================= */

.page-hero {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 0 1rem;
}

.page-hero h1 {
    font-size: 2.8rem;
    line-height: 1.1;
    margin-bottom: 1rem;
    color: #fff;
}

.hero-tag {
    font-size: 1.25rem;
    color: #12d6a0;
    font-weight: 500;
    max-width: 700px;
    margin: 0 auto;
}

/* SEO Text Box */
.crossword-seo-text {
    max-width: 820px;
    margin: 0 auto 3rem auto;
    padding: 2rem 2.5rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 16px;
    color: #c9d6e2;
    line-height: 1.75;
    font-size: 1.05rem;
    text-align: center;
}

.crossword-seo-text p {
    margin-bottom: 1.25rem;
}

.crossword-seo-text p:last-child {
    margin-bottom: 0;
}

.crossword-seo-text a {
    color: #12d6a0;
    font-weight: 600;
    text-decoration: none;
}

.crossword-seo-text a:hover {
    color: #5ff0cb;
    text-decoration: underline;
}

/* Make the second puzzle title (inside wrapper) consistent */
.crossword-topbar #puzzleTitle {
    font-size: 2.35rem;
}