/* ================================================
   Wend Answer Today - Matching thewordfinder.com
   ================================================ */

/* --- CSS Variables --- */
:root {
    --word-0: #E8572A;
    --word-1: #D4449A;
    --word-2: #4DBDBA;
    --word-3: #98C21F;
    --word-4: #5B8DD9;
    --word-5: #F5A623;
    --word-6: #9B59B6;
    --word-7: #26C0A6;

    --clr-bg: #f5f5f0;
    --clr-white: #ffffff;
    --clr-blocked: #b2b2b2;
    --clr-border: #333333;
    --clr-text: #1a1a1a;
    --clr-text-muted: #6b7280;
    --clr-card-border: #e5e5e0;
    --clr-primary-600: #017f70;
    --clr-primary-700: #016d60;
    --clr-grey-900: #1f2933;
    --clr-grey-700: #4b5563;
    --clr-grey-500: #6b7280;
    --clr-grey-300: #d1d5db;
    --clr-grey-200: #e5e7eb;
    --clr-grey-100: #f3f4f6;

    --font-family: 'Inter', ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
    --radius-md: 0.5rem;
    --radius-full: 9999px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --transition: 0.15s;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font-family);
    background: var(--clr-bg);
    color: var(--clr-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }

.container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

/* --- Page Wrapper --- */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header --- */
.site-header {
    background: var(--clr-white);
    border-bottom: 1px solid var(--clr-grey-200);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}
.site-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--clr-text);
}
.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #14b8a6, #22c55e);
    color: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
}
.logo-text { font-weight: 700; letter-spacing: -0.02em; }
.nav-links {
    display: flex;
    gap: 24px;
}
.nav-links a {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--clr-grey-700);
    padding: 4px 0;
    transition: color var(--transition);
}
.nav-links a:hover,
.nav-links a.active {
    color: var(--clr-text);
}
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--clr-text);
    padding: 8px;
}
.mobile-menu {
    display: none;
    flex-direction: column;
    background: var(--clr-white);
    border-top: 1px solid var(--clr-grey-200);
    padding: 8px 16px 16px;
}
.mobile-menu.active { display: flex; }
.mobile-menu a {
    padding: 10px 0;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--clr-grey-700);
    border-bottom: 1px solid var(--clr-grey-100);
}
.mobile-menu a.active { color: var(--clr-text); font-weight: 600; }

@media (max-width: 640px) {
    .nav-links { display: none; }
    .mobile-menu-btn { display: block; }
}

/* --- Page Title --- */
.page-title-section {
    padding: 20px 0 8px;
    text-align: center;
}
.page-title {
    font-size: clamp(1.25rem, 4vw, 1.75rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--clr-text);
    line-height: 1.2;
}
.page-subtitle {
    font-size: 0.9375rem;
    color: var(--clr-grey-700);
    margin-top: 4px;
}

/* --- Game Container --- */
.game-section {
    padding: 16px 0 24px;
}
.game-container {
    position: relative;
}

/* Hidden checkbox for CSS-only reveal */
.reveal-checkbox,
.archive-reveal-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* --- Two-Column Layout (matches thewordfinder.com) --- */
.game-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}
@media (min-width: 768px) {
    .game-layout {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

/* --- Board Column --- */
.game-board-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* --- Wend Board Grid (matching thewordfinder.com exactly) --- */
.wend-board-wrapper {
    display: grid;
    width: 100%;
    max-width: 480px;
    aspect-ratio: 1;
    border: 3px solid #333;
    border-radius: 14px;
    overflow: hidden;
    gap: 0;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* --- Grid Cells --- */
.wend-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    position: relative;
    overflow: visible;
}
.wend-cell--blocked {
    background: #b2b2b2;
    cursor: default;
    box-sizing: border-box;
}
.wend-cell--letter {
    background: #fff !important;
    appearance: none;
    border: none;
    padding: 0;
    outline: none;
    cursor: pointer;
    font-family: inherit;
    box-sizing: border-box;
    box-shadow: inset 1px 0 #e4e4e4, inset -1px 0 #e4e4e4, inset 0 1px #e4e4e4, inset 0 -1px #e4e4e4;
    transition: background 0.15s ease;
}
.wend-cell--revealed {
    background: color-mix(in srgb, var(--word-color) 22%, white) !important;
    box-shadow: none;
}
.wend-cell--revealed:hover {
    filter: brightness(1.04);
}

/* Cell pop animation (exact match) */
@keyframes cellPop {
    0% { transform: scale(0.82); opacity: 0.6; }
    55% { transform: scale(1.06); }
    100% { transform: scale(1); opacity: 1; }
}
.wend-cell--pulse {
    animation: cellPop 0.28s ease forwards;
}

/* Cell letter styling */
.cell-letter {
    font-size: clamp(14px, 4.5vw, 28px);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.03em;
    user-select: none;
    pointer-events: none;
    position: relative;
    z-index: 4;
}
.cell-letter--hidden {
    color: #1a1a1a;
}

/* --- Tube connectors (matching thewordfinder.com) --- */
.cell-tube {
    position: absolute;
    z-index: 1;
    pointer-events: none;
}
.cell-tube-h {
    top: 22.5%;
    bottom: 22.5%;
}
.cell-tube-v {
    left: 22.5%;
    right: 22.5%;
}

/* --- Cell circle (first letter indicator) --- */
.cell-circle {
    position: absolute;
    width: 55%;
    height: 55%;
    border-radius: 50%;
    z-index: 2;
    pointer-events: none;
    outline: 5px solid color-mix(in srgb, var(--word-color) 22%, white);
    border: 3px solid var(--word-color);
}

/* --- Check badge on first cell --- */
.cell-check-badge {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 5;
    pointer-events: none;
    font-size: 9px;
    font-weight: 700;
}

/* --- Direction arrows (matching thewordfinder.com) --- */
.cell-arrow {
    position: absolute;
    width: clamp(10px, 3vw, 16px);
    height: clamp(10px, 3vw, 16px);
    color: rgba(0,0,0,0.6);
    z-index: 999;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.cell-arrow svg {
    width: 100%;
    height: 100%;
    display: block;
}
.cell-arrow--down {
    top: 0;
    left: 50%;
    transform: translate(-50%) translateY(-50%) rotate(0);
}
.cell-arrow--up {
    bottom: 0;
    left: 50%;
    transform: translate(-50%) translateY(50%) rotate(180deg);
}
.cell-arrow--right {
    left: 0;
    top: 50%;
    transform: translate(-50%) translateY(-50%) rotate(-90deg);
}
.cell-arrow--left {
    right: 0;
    top: 50%;
    transform: translate(50%) translateY(-50%) rotate(90deg);
}

/* --- Board instruction text --- */
.board-instruction {
    font-size: 0.875rem;
    color: #6b7280;
    text-align: center;
    margin-top: 0.75rem;
}
.board-instruction b { color: var(--clr-text); }
.revealed-text { display: none; }

/* --- Reveal / Clear Buttons (matching thewordfinder.com pill style) --- */
.reveal-buttons {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    justify-content: center;
    flex-wrap: wrap;
}
.reveal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.55em 1.4em;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition), transform 0.12s ease;
    box-shadow: var(--shadow-sm);
    user-select: none;
}
.reveal-btn--primary {
    background: var(--clr-primary-600);
    color: #fff;
}
.reveal-btn--primary:hover {
    background: var(--clr-primary-700);
}
.reveal-btn--secondary {
    background: #fff;
    border-color: var(--clr-grey-900);
    color: var(--clr-grey-900);
}
.reveal-btn--secondary:hover {
    background: var(--clr-grey-100);
}

/* Toggle text on reveal */
.reveal-text-hide { display: none; }
.reveal-checkbox:checked ~ .game-layout .reveal-text-show { display: none; }
.reveal-checkbox:checked ~ .game-layout .reveal-text-hide { display: inline; }
.reveal-checkbox:checked ~ .game-layout .reveal-btn--primary {
    background: #fff;
    border-color: var(--clr-grey-900);
    color: var(--clr-grey-900);
}
.reveal-checkbox:checked ~ .game-layout .reveal-btn--secondary {
    background: var(--clr-primary-600);
    border-color: transparent;
    color: #fff;
}

/* --- Words Column --- */
.game-words-col {
    width: 100%;
}

/* --- Progress Bar (matching thewordfinder.com) --- */
.progress-section {
    margin-top: 0.5rem;
}
.progress-label {
    font-size: 0.875rem;
    color: #374151;
    margin-bottom: 0.35rem;
}
.progress-label b { font-weight: 700; }
.progress-bar {
    height: 10px;
    background: #e5e7eb;
    border-radius: 5px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    border-radius: 5px;
    background: linear-gradient(90deg, #14b8a6, #22c55e);
    transition: width 0.4s ease;
    width: 0%;
}

/* --- Word Cards List --- */
.words-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 16px;
}

/* --- Word Blank Card (matching thewordfinder.com exactly) --- */
.word-blank {
    background: #fff;
    border: 2px solid #e5e5e0;
    border-radius: 16px;
    padding: 12px 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.word-blank--revealed {
    border-color: var(--word-color, #22c55e);
    background: color-mix(in srgb, var(--word-color, #22c55e) 5%, white);
    box-shadow: 0 2px 16px color-mix(in srgb, var(--word-color, #22c55e) 18%, transparent);
    animation: wordSlideDown 0.4s ease backwards;
    animation-delay: calc(var(--card-delay, 0) * 0.12s);
}

@keyframes wordSlideDown {
    0% { opacity: 0; transform: translateY(-12px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* --- Letter Row --- */
.letter-row {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

/* --- Letter Bubbles (matching thewordfinder.com exactly) --- */
.letter-bubble {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
    transition: background 0.28s ease, transform 0.2s ease;
}
.letter-bubble--hidden {
    background: #deded8;
}
.letter-bubble--revealed {
    color: #1a1a1a;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    animation: bubbleBounce 0.3s ease backwards;
    animation-delay: calc(var(--bubble-delay, 0) * 0.08s);
}
.bubble-letter {
    font-size: 16px;
    font-weight: 800;
    color: #1a1a1a;
    text-shadow: none;
    line-height: 1;
    letter-spacing: -0.02em;
}

@keyframes bubbleBounce {
    0% { transform: scale(0.6); opacity: 0.5; }
    60% { transform: scale(1.1); }
    100% { transform: scale(1.05); opacity: 1; }
}

/* --- Revealed label under word --- */
.revealed-label {
    font-size: 0.9rem;
    color: #3a3a38;
}
.revealed-label strong {
    color: var(--word-color, #374151);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: 0.04em;
}

/* --- Wend #N Words label (shown after reveal) --- */
.wend-words-label {
    display: none;
    margin-top: 20px;
    padding: 16px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--clr-grey-200);
}
.wend-words-label h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--clr-text);
}
.wend-words-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* --- Word Chips --- */
.word-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 5px 12px;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    opacity: 0;
    animation: chipFadeIn 0.3s ease forwards;
    animation-delay: var(--chip-delay, 0s);
}
.chip-check {
    display: flex;
    width: 12px;
    height: 12px;
}
.chip-check svg {
    width: 100%;
    height: 100%;
}

@keyframes chipFadeIn {
    0% { opacity: 0; transform: scale(0.8); }
    100% { opacity: 1; transform: scale(1); }
}

/* ================================================
   CSS-ONLY REVEAL MECHANISM
   Checkbox ~ sibling combinator
   ================================================ */

/* Default: show before-state, hide after-state */
.grid-view-revealed { display: none; }
.grid-view:not(.grid-view-revealed) { display: block; }
.words-list-revealed { display: none; }
.wend-words-label { display: none; }
.progress-fill { width: 0%; }

/* When checkbox checked: swap visibility */
.reveal-checkbox:checked ~ .game-layout .grid-view:not(.grid-view-revealed) { display: none; }
.reveal-checkbox:checked ~ .game-layout .grid-view-revealed {
    display: block;
    animation: revealPuzzle 0.6s ease-out;
}
.reveal-checkbox:checked ~ .game-layout .words-list:not(.words-list-revealed) { display: none; }
.reveal-checkbox:checked ~ .game-layout .words-list-revealed { display: flex; }
.reveal-checkbox:checked ~ .game-layout .wend-words-label { display: block; }
.reveal-checkbox:checked ~ .game-layout .progress-fill { width: 100% !important; }
.reveal-checkbox:checked ~ .game-layout .board-instruction:not(.revealed-text) { display: none; }
.reveal-checkbox:checked ~ .game-layout .revealed-text { display: block; }

/* Staggered cell pop animation on reveal */
.reveal-checkbox:checked ~ .game-layout .wend-cell--revealed {
    animation: cellPop 0.28s ease backwards;
    animation-delay: calc(var(--cell-delay, 0) * 0.06s);
}
/* Staggered word card animation */
.reveal-checkbox:checked ~ .game-layout .word-blank--revealed {
    animation: wordSlideDown 0.4s ease backwards;
    animation-delay: calc(var(--card-delay, 0) * 0.12s);
}
/* Staggered letter bubble animation */
.reveal-checkbox:checked ~ .game-layout .letter-bubble--revealed {
    animation: bubbleBounce 0.3s ease backwards;
    animation-delay: calc(var(--bubble-delay, 0) * 0.08s);
}

@keyframes revealPuzzle {
    0% { opacity: 0; transform: scale(0.96); }
    100% { opacity: 1; transform: scale(1); }
}

/* ================================================
   Hints Section
   ================================================ */
.hints-section {
    padding: 32px 0;
}
.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}
.hints-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}
@media (min-width: 640px) {
    .hints-grid { grid-template-columns: 1fr 1fr; }
}
.hint-card {
    display: flex;
    gap: 12px;
    padding: 16px;
    background: var(--clr-white);
    border-radius: 12px;
    border: 1px solid var(--clr-grey-200);
}
.hint-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #14b8a6, #22c55e);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.875rem;
    flex-shrink: 0;
}
.hint-card h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.hint-card p {
    font-size: 0.8125rem;
    color: var(--clr-grey-700);
    line-height: 1.5;
}

/* ================================================
   Recent Puzzles
   ================================================ */
.recent-section {
    padding: 24px 0 32px;
}
.recent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.recent-card {
    display: block;
    padding: 16px;
    background: var(--clr-white);
    border-radius: 12px;
    border: 1px solid var(--clr-grey-200);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.recent-card:hover {
    border-color: var(--clr-grey-300);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.card-number {
    font-weight: 700;
    font-size: 0.875rem;
}
.card-date {
    font-size: 0.8125rem;
    color: var(--clr-grey-500);
}
.card-words {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.card-word {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: var(--clr-grey-100);
    border-radius: var(--radius-full);
    color: var(--clr-grey-700);
}

/* ================================================
   FAQ Section
   ================================================ */
.faq-section {
    padding: 24px 0 48px;
}
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.faq-item {
    background: var(--clr-white);
    border-radius: 12px;
    border: 1px solid var(--clr-grey-200);
    padding: 16px 20px;
}
.faq-question {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.faq-answer {
    font-size: 0.875rem;
    color: var(--clr-grey-700);
    line-height: 1.6;
}

/* ================================================
   Footer
   ================================================ */
.site-footer {
    margin-top: auto;
    background: var(--clr-white);
    border-top: 1px solid var(--clr-grey-200);
    padding: 24px 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}
@media (max-width: 640px) {
    .footer-grid { grid-template-columns: 1fr; gap: 16px; }
}
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.footer-brand .logo-icon { width: 28px; height: 28px; font-size: 0.8rem; }
.footer-brand p {
    font-size: 0.8125rem;
    color: var(--clr-grey-500);
    max-width: 280px;
}
.footer-links h4,
.footer-legal h4 {
    font-size: 0.8125rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--clr-grey-500);
}
.footer-links a {
    display: block;
    font-size: 0.875rem;
    color: var(--clr-grey-700);
    padding: 3px 0;
}
.footer-links a:hover { color: var(--clr-text); }
.footer-legal p {
    font-size: 0.75rem;
    color: var(--clr-grey-500);
    line-height: 1.5;
}
.footer-bottom {
    border-top: 1px solid var(--clr-grey-200);
    padding-top: 16px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--clr-grey-500);
}

/* ================================================
   Archive Page
   ================================================ */
.archive-header {
    padding: 24px 0 16px;
    text-align: center;
}
.archive-header h1 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}
.archive-header p {
    font-size: 0.9375rem;
    color: var(--clr-grey-700);
    margin-top: 4px;
}

/* Calendar */
.calendar-section {
    padding: 16px 0;
}
.calendar-wrapper {
    background: var(--clr-white);
    border-radius: 16px;
    border: 1px solid var(--clr-grey-200);
    padding: 20px;
    max-width: 400px;
    margin: 0 auto;
}
.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.calendar-nav button {
    background: none;
    border: 1px solid var(--clr-grey-200);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--clr-grey-700);
    transition: all 0.2s;
}
.calendar-nav button:hover {
    background: var(--clr-grey-100);
    border-color: var(--clr-grey-300);
}
.calendar-month-title {
    font-size: 1rem;
    font-weight: 700;
}
.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 8px;
}
.calendar-weekdays span {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--clr-grey-500);
    padding: 4px;
}
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.calendar-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    border-radius: 50%;
    color: var(--clr-grey-700);
}
.calendar-day--empty { visibility: hidden; }
.calendar-day--today {
    background: var(--clr-grey-100);
    font-weight: 700;
    color: var(--clr-text);
}
.calendar-day--has-puzzle {
    background: linear-gradient(135deg, #14b8a6, #22c55e);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.calendar-day--has-puzzle:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(20,184,166,0.3);
}
.calendar-day--has-puzzle.calendar-day--today {
    box-shadow: 0 0 0 2px var(--clr-text);
}

/* Archive puzzle section */
.archive-puzzle-section {
    padding: 16px 0 32px;
}
.archive-puzzle-section:not(.active) { display: none; }
.archive-puzzle-section.active { display: block; }
.back-to-calendar {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--clr-primary-600);
    cursor: pointer;
    margin-bottom: 16px;
    transition: color 0.2s;
}
.back-to-calendar:hover { color: var(--clr-primary-700); }

/* Archive puzzle item */
.archive-puzzle-item {
    background: var(--clr-white);
    border-radius: 16px;
    border: 1px solid var(--clr-grey-200);
    padding: 20px;
}
.archive-puzzle-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.archive-puzzle-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
}
.puzzle-date {
    font-size: 0.875rem;
    color: var(--clr-grey-500);
}

/* Archive layout - same two-column as main */
.archive-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: start;
}
@media (min-width: 768px) {
    .archive-layout {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
}

/* Archive grid before/after */
.archive-grid-before { display: block; }
.archive-grid-after { display: none; }
.archive-words-before { display: block; }
.archive-words-after { display: none; }

/* Archive reveal button */
.archive-reveal-container {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}
.archive-reveal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0.55em 1.4em;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    cursor: pointer;
    background: var(--clr-primary-600);
    color: #fff;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}
.archive-reveal-btn:hover {
    background: var(--clr-primary-700);
}
.archive-reveal-hide { display: none; }

/* ================================================
   How to Play Page
   ================================================ */
.steps-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 20px;
}
@media (min-width: 640px) {
    .steps-grid { grid-template-columns: 1fr 1fr; }
}
.step-card {
    background: var(--clr-white);
    border-radius: 12px;
    border: 1px solid var(--clr-grey-200);
    padding: 20px;
}
.step-num {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #14b8a6, #22c55e);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 10px;
}
.step-card h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 6px;
}
.step-card p {
    font-size: 0.875rem;
    color: var(--clr-grey-700);
    line-height: 1.6;
}

/* ================================================
   Mobile Optimizations
   ================================================ */
@media (max-width: 767px) {
    .game-layout,
    .archive-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .game-board-col {
        align-items: center;
    }
    .wend-board-wrapper {
        max-width: 100%;
        width: 100%;
    }
    .page-title-section {
        padding: 12px 0 4px;
    }
    .page-title {
        font-size: 1.15rem;
    }
    .game-section {
        padding: 8px 0 16px;
    }
    .word-blank {
        padding: 10px 12px;
    }
    .letter-bubble {
        width: 34px;
        height: 34px;
        font-size: 14px;
    }
    .bubble-letter {
        font-size: 14px;
    }
    .letter-row {
        gap: 4px;
    }
    .reveal-btn {
        font-size: 0.875rem;
        padding: 0.5em 1.2em;
    }
    .progress-section {
        margin-top: 0.25rem;
    }
    .words-list {
        margin-top: 12px;
        gap: 8px;
    }
    .hints-section,
    .recent-section,
    .faq-section {
        padding: 20px 0;
    }
    .footer-grid {
        gap: 16px;
    }
}

/* Extra small screens */
@media (max-width: 380px) {
    .container {
        padding: 0 10px;
    }
    .letter-bubble {
        width: 30px;
        height: 30px;
        font-size: 13px;
    }
    .bubble-letter {
        font-size: 13px;
    }
    .word-blank {
        padding: 8px 10px;
        gap: 8px;
    }
    .letter-row {
        gap: 3px;
    }
    .wend-board-wrapper {
        border-width: 2px;
        border-radius: 10px;
    }
    .cell-letter {
        font-size: clamp(12px, 4vw, 22px);
    }
}

/* ================================================
   Puzzle Picker (removed from main but kept for archive)
   ================================================ */
.puzzle-picker-section { display: none; }

/* ================================================
   Shimmer loading animation (for skeleton states)
   ================================================ */
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
.shimmer {
    animation: shimmer 1.5s infinite;
    background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6, #e5e7eb 75%);
    background-size: 200% 100%;
    border-radius: 12px;
}
