/* CSS Variables for Light/Dark Mode */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #fafafa;
    --text-primary: #000000;
    --text-secondary: #666666;
    --border-color: #e0e0e0;
    --accent: #000000;
    --header-bg: rgba(255, 255, 255, 0.95);
    --modal-bg: #ffffff;
    --toggle-bg: #f5f5f5;
    --toggle-active-bg: #ffffff;
}

[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1a1a1a;
    --text-primary: #ffffff;
    --text-secondary: #999999;
    --border-color: #333333;
    --accent: #ffffff;
    --header-bg: rgba(0, 0, 0, 0.95);
    --modal-bg: #000000;
    --toggle-bg: #1a1a1a;
    --toggle-active-bg: #000000;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 4rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.logo {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.8rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: var(--text-primary);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    gap: 0.3rem;
    background: var(--toggle-bg);
    padding: 0.3rem;
    border-radius: 50px;
    border: 1px solid var(--border-color);
}

.theme-btn {
    background: transparent;
    border: none;
    padding: 0.5rem 0.8rem;
    cursor: pointer;
    border-radius: 50px;
    transition: all 0.3s ease;
    opacity: 0.5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
}

.theme-btn i {
    width: 16px;
    height: 16px;
    display: block;
}

.theme-btn:hover {
    opacity: 0.8;
}

.theme-btn.active {
    background: var(--toggle-active-bg);
    opacity: 1;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.nav-btn {
    background: none;
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 0.6rem 1.8rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.nav-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Hero Section */
.hero {
    margin-top: 100px;
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
}

.hero h1 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 4.5rem;
    font-weight: 300;
    margin-bottom: 1.5rem;
    letter-spacing: 2px;
    color: var(--text-primary);
}

.hero .tagline {
    font-size: 1.2rem;
    font-weight: 300;
    margin-bottom: 3rem;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.cta-btn {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 1rem 3rem;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.cta-btn:hover {
    opacity: 0.8;
}

/* How It Works */
.how-it-works {
    padding: 6rem 4rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 4rem;
    font-weight: 400;
    letter-spacing: 1px;
    color: var(--text-primary);
}

.steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

.step {
    text-align: center;
    padding: 2rem;
}

.step-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 3rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.step h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 400;
    color: var(--text-primary);
}

.step p {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Generator Section */
.generator {
    padding: 6rem 4rem;
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 2rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
    text-align: center;
    color: var(--text-primary);
}

.form-group input[type="text"] {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    text-align: center;
    color: var(--text-primary);
}

.form-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
}

.placeholder-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    text-align: center;
}

/* Pill Toggle Buttons */
.pill-group {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
    flex-wrap: wrap;
}

.pill {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.7rem 1.8rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
}

.pill:hover {
    border-color: var(--accent);
}

.pill.active {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.8rem;
}

.checkbox-group input[type="checkbox"] {
    cursor: pointer;
}

.checkbox-group label {
    text-transform: none;
    font-weight: 400;
    cursor: pointer;
    color: var(--text-primary);
}

.generate-btn {
    width: 100%;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 1px;
    margin-top: 2rem;
    transition: all 0.3s ease;
}

.generate-btn:hover {
    opacity: 0.8;
}

/* Pricing Section */
.pricing {
    padding: 6rem 4rem;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
    max-width: 900px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 3rem 2rem;
    text-align: center;
    display: flex;
    flex-direction: column;
}

.pricing-card.featured {
    border: 2px solid var(--accent);
}

.pricing-card h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 400;
    color: var(--text-primary);
}

.price {
    font-size: 3rem;
    font-weight: 300;
    margin: 1.5rem 0;
    color: var(--text-primary);
}

.price-period {
    font-size: 1rem;
    color: var(--text-secondary);
}

.features {
    list-style: none;
    margin: 2rem 0;
    text-align: left;
    flex-grow: 1;
}

.features li {
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.features li:before {
    content: "—";
    margin-right: 0.5rem;
}

.pricing-btn {
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 1rem 2.5rem;
    font-size: 0.95rem;
    cursor: pointer;
    letter-spacing: 1px;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.pricing-btn:hover {
    opacity: 0.8;
}

.pricing-btn.outline {
    background: var(--bg-primary);
    color: var(--accent);
    border: 1px solid var(--accent);
}

.pricing-btn.outline:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

/* Footer */
footer {
    padding: 3rem 4rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

footer p {
    margin: 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--modal-bg);
    padding: 3rem;
    max-width: 450px;
    width: 90%;
    position: relative;
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
}

.modal h2 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    margin-bottom: 2rem;
    font-weight: 400;
    color: var(--text-primary);
}

.modal input {
    width: 100%;
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    font-family: 'Inter', sans-serif;
    color: var(--text-primary);
}

.modal input:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-primary);
}

.modal-btn {
    width: 100%;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    padding: 1rem;
    font-size: 1rem;
    cursor: pointer;
    letter-spacing: 1px;
    margin-top: 1rem;
}

.modal-btn:hover {
    opacity: 0.8;
}

.modal-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.modal-switch button {
    background: none;
    border: none;
    text-decoration: underline;
    cursor: pointer;
    color: var(--accent);
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 1.5rem 2rem;
    }

    .hero h1 {
        font-size: 3rem;
    }

    .hero .tagline {
        font-size: 1rem;
    }

    .how-it-works, .generator, .pricing {
        padding: 4rem 2rem;
    }

    .pill-group {
        flex-direction: column;
        align-items: stretch;
    }

    .pill {
        text-align: center;
    }
}

/* Range Slider Styling */
input[type="range"] {
    width: 100%;
    max-width: 400px;
    height: 6px;
    border-radius: 3px;
    background: var(--border-color);
    outline: none;
    opacity: 0.9;
    transition: opacity 0.2s;
    -webkit-appearance: none;
    appearance: none;
    margin: 1rem auto;
    display: block;
}

input[type="range"]:hover {
    opacity: 1;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

input[type="range"]::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}

input[type="range"]::-moz-range-track {
    height: 6px;
    border-radius: 3px;
    background: transparent;
}

/* Word count label */
.form-group label[for="wordCount"] {
    display: block;
    text-align: center;
}

#wordCountValue {
    font-weight: 600;
    color: var(--accent);
    font-size: 1.2em;
}

/* Crossword Result Section */
.crossword-result {
    max-width: 1200px;
    margin: 60px auto;
    padding: 40px 20px;
    background: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.crossword-stats {
    display: flex;
    gap: 30px;
    justify-content: center;
    margin: 20px 0 40px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.stat {
    text-align: center;
    color: var(--text-secondary);
}

.stat strong {
    display: block;
    color: var(--text-primary);
    font-size: 1.1em;
    margin-bottom: 5px;
}

/* Grid Container */
.crossword-grid-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.grid-container {
    display: inline-block;
    background: #ffffff;
    padding: 20px;
    border: 2px solid #333333;
    border-radius: 4px;
}

.grid-row {
    display: flex;
}

.grid-cell {
    width: 35px;
    height: 35px;
    border: 1px solid #999999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    position: relative;
    font-family: Arial, sans-serif;
    font-size: 18px;
    color: #000000;
    background: #ffffff;
}

.grid-cell.filled {
    background: #ffffff;
}

.grid-cell.empty {
    background: #000000;
}

.cell-number {
    position: absolute;
    top: 2px;
    left: 3px;
    font-size: 10px;
    color: #666666;
    font-weight: normal;
}

/* Tabbed Clues Interface */
.clues-container {
    margin: 40px 0;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.clue-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 0;
}

.clue-tab {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-bottom: none;
    padding: 1rem 2rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 500;
    color: var(--text-secondary);
}

.clue-tab:first-child {
    border-right: none;
}

.clue-tab:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.clue-tab.active {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-bottom: 2px solid var(--bg-primary);
    position: relative;
    z-index: 1;
}

.clue-content {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-top: none;
    padding: 2rem;
    min-height: 400px;
    max-height: 600px;
    overflow-y: auto;
}

.clue-panel {
    display: none;
}

.clue-panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.clue-item {
    margin: 15px 0;
    padding: 12px;
    background: var(--bg-secondary);
    border-left: 3px solid var(--accent);
    border-radius: 0;
    line-height: 1.6;
    transition: all 0.2s ease;
    color: var(--text-primary);
}

.clue-item:hover {
    background: var(--bg-secondary);
    opacity: 0.8;
    padding-left: 16px;
}

.clue-item strong {
    color: var(--accent);
    margin-right: 8px;
    font-weight: 600;
}

/* Custom scrollbar for clue content */
.clue-content::-webkit-scrollbar {
    width: 8px;
}

.clue-content::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.clue-content::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

.clue-content::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Action Buttons */
.crossword-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 40px 0;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    border: 2px solid var(--accent);
    background: transparent;
    color: var(--accent);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.action-btn.primary {
    background: var(--accent);
    color: var(--bg-primary);
}

.action-btn.primary:hover {
    opacity: 0.8;
}

/* Answer Key */
.answer-key {
    margin-top: 40px;
    padding: 20px;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.answer-key summary {
    font-size: 1.2em;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    padding: 10px;
    list-style: none;
    user-select: none;
}

.answer-key summary:hover {
    color: var(--accent);
}

.answer-key summary::-webkit-details-marker {
    display: none;
}

.answer-key[open] summary {
    margin-bottom: 20px;
}

.answer-key .grid-container {
    margin: 20px auto;
}

/* Error Display */
.crossword-error {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
}

.error-content {
    background: #fee;
    border: 2px solid #fcc;
    border-left: 4px solid #c33;
    border-radius: 8px;
    padding: 20px;
}

.error-content strong {
    display: block;
    color: #c33;
    font-size: 1.2em;
    margin-bottom: 10px;
}

.error-content p {
    color: #933;
    margin: 10px 0;
}

.error-help {
    font-size: 0.9em;
    color: #666 !important;
    margin-top: 15px;
}

/* Responsive Design for Crossword */
@media (max-width: 768px) {
    .clue-tab {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
    }
    
    .clue-content {
        padding: 1.5rem;
        max-height: 500px;
    }
    
    .crossword-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .grid-cell {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
    
    .crossword-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Print Styles */
@media print {
    /* Hide everything except crossword */
    header, footer, .hero, .how-it-works, .generator, .pricing {
        display: none !important;
    }
    
    /* Hide action buttons */
    .crossword-actions {
        display: none !important;
    }
    
    /* Show only the crossword */
    .crossword-result {
        margin: 0;
        padding: 20px;
        box-shadow: none;
        page-break-after: avoid;
    }
    
    /* Hide stats */
    .crossword-stats {
        display: none !important;
    }
    
    /* Make sure grid is visible and properly formatted */
    .crossword-grid-container {
        display: flex;
        justify-content: center;
        margin: 40px 0;
    }
    
    .grid-container {
        display: inline-block;
        background: #ffffff;
        padding: 20px;
        border: 3px solid #000000 !important;
        border-radius: 0;
    }
    
    .grid-row {
        display: flex;
    }
    
    .grid-cell {
        width: 30px;
        height: 30px;
        border: 1px solid #000000 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        background: #ffffff !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .grid-cell.filled {
        background: #ffffff !important;
    }
    
    .grid-cell.empty {
        background: #000000 !important;
    }
    
    .cell-number {
        position: absolute;
        top: 2px;
        left: 3px;
        font-size: 8px;
        color: #000000;
        font-weight: normal;
    }
    
    /* Hide tab buttons, show all clues */
    .clue-tabs {
        display: none !important;
    }
    
    .clues-container {
        margin: 40px 0;
        max-width: 100%;
    }
    
    .clue-content {
        border: none !important;
        padding: 0 !important;
        max-height: none !important;
        overflow: visible !important;
        background: transparent !important;
    }
    
    .clue-panel {
        display: block !important;
        page-break-inside: avoid;
    }
    
    .clue-item {
        margin: 8px 0;
        padding: 8px;
        background: transparent !important;
        border-left: none !important;
        line-height: 1.4;
    }
    
    /* Add headers for clues */
    #across-panel::before {
        content: "Across";
        display: block;
        font-size: 18px;
        font-weight: bold;
        margin-bottom: 10px;
        border-bottom: 2px solid #000;
        padding-bottom: 5px;
    }
    
    #down-panel::before {
        content: "Down";
        display: block;
        font-size: 18px;
        font-weight: bold;
        margin-top: 30px;
        margin-bottom: 10px;
        border-bottom: 2px solid #000;
        padding-bottom: 5px;
    }
    
    /* Print answer key upside down if shown */
    .answer-key[open] {
        margin-top: 60px;
        padding-top: 20px;
        border-top: 1px solid #000;
        page-break-before: avoid;
        background: transparent !important;
    }
    
    .answer-key[open] summary {
        display: none;
    }
    
    .answer-key[open] .grid-container {
        transform: rotate(180deg);
        font-size: 8px;
        margin: 20px auto;
    }
    
    .answer-key:not([open]) {
        display: none !important;
    }
}
/* ============================================
   PRINT STYLES - Applied only when printing
   ============================================ */
@media print {
    /* Hide elements that shouldn't print */
    header,
    footer,
    .hero,
    .how-it-works,
    .pricing,
    .generator,
    .crossword-actions,
    .theme-toggle {
        display: none !important;
    }
    
    /* Make crossword result take full page */
    .crossword-result {
        margin: 0;
        padding: 20px;
        max-width: 100%;
    }
    
    /* Page setup */
    @page {
        margin: 1cm;
        size: A4 portrait;
    }
    
    body {
        background: white;
        color: black;
    }
    
    /* Title styling for print */
    .section-title {
        font-size: 24pt;
        margin-bottom: 10pt;
        text-align: center;
    }
    
    /* Stats */
    .crossword-stats {
        display: flex;
        justify-content: center;
        gap: 30px;
        margin-bottom: 15pt;
        font-size: 10pt;
    }
    
    /* Grid styling */
    .crossword-grid-container {
        margin-bottom: 20pt;
    }
    
    .grid-container {
        display: inline-block;
    }
    
    /* CLUES - Side by Side for Print */
    .clues-container {
        display: block !important;
        page-break-inside: avoid;
    }
    
    /* Hide the tab buttons when printing */
    .clue-tabs {
        display: none !important;
    }
    
    /* Show both clue panels side by side */
    .clue-content {
        display: flex !important;
        gap: 20pt;
        justify-content: space-between;
    }
    
    .clue-panel {
        display: block !important; /* Override the hidden state */
        width: 48% !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    
    /* Add headers for Across and Down in print */
    .clue-panel#across-panel::before {
        content: "Across";
        display: block;
        font-weight: bold;
        font-size: 14pt;
        margin-bottom: 8pt;
        border-bottom: 2px solid #333;
        padding-bottom: 4pt;
    }
    
    .clue-panel#down-panel::before {
        content: "Down";
        display: block;
        font-weight: bold;
        font-size: 14pt;
        margin-bottom: 8pt;
        border-bottom: 2px solid #333;
        padding-bottom: 4pt;
    }
    
    /* Clue items */
    .clue-item {
        margin-bottom: 6pt;
        font-size: 10pt;
        line-height: 1.4;
        page-break-inside: avoid;
    }
    
    /* Answer key - Hide the full grid version */
    .answer-key {
        display: none !important;
    }
    
    /* Compact upside-down answer footnote */
    .answer-footnote {
        margin-top: 30pt;
        padding-top: 10pt;
        border-top: 1pt solid #999;
        font-size: 7pt;
        line-height: 1.3;
        color: #333;
        transform: rotate(180deg);
        page-break-inside: avoid;
    }
    
    .answer-footnote-title {
        font-weight: bold;
        font-size: 8pt;
        margin-bottom: 4pt;
        text-align: center;
    }
    
    .answer-footnote-section {
        margin-bottom: 3pt;
    }
    
    .answer-footnote-label {
        font-weight: bold;
    }
    
    /* Grid cells for print */
    .grid-cell {
        border: 1pt solid #000;
        width: 25pt;
        height: 25pt;
    }
    
    .grid-cell.empty {
        background: #000 !important;
    }
    
    .grid-cell.filled {
        background: #fff !important;
    }
    
    /* Cell numbers */
    .cell-number {
        font-size: 6pt;
    }
}

/* Hide answer footnote on website (only show when printing) */
.answer-footnote {
    display: none;
}