/* ============================================================
   Kids Kingdom - Word Search Puzzle Stylesheet
   Self-contained (base hero/how-to-learn styles included)
   ============================================================ */

/* ================= BASE: hero ================= */
.hero {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 30px;
    padding: 40px 0;
}
.hero-image { flex: 1 1 320px; }
.hero-image img { width: 100%; height: auto; display: block; border-radius: 20px; }
.hero-content { flex: 1 1 380px; }
.hero-content h1 { font-size: 2.6rem; margin-bottom: 12px; }
.hero-content .subheading { font-size: 1.15rem; color: #555; margin-bottom: 14px; }
.hero-content .intro-paragraph { font-size: 1rem; color: #666; line-height: 1.7; }

/* ================= BASE: how-to-learn steps ================= */
.how-to-learn { padding: 50px 0; }
.how-to-learn h2 { text-align: center; font-size: 2rem; margin-bottom: 40px; }
.steps-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; }
.step-card { text-align: center; }
.step-number {
    display: inline-flex; align-items: center; justify-content: center;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--color-primary, #FF6B6B); color: #fff;
    font-weight: 700; font-size: 1.2rem; margin-bottom: 14px;
}
.step-card h3 { font-size: 1.1rem; margin-bottom: 8px; }
.step-card p { font-size: 1rem; color: #666; }

@media (max-width: 767px) {
    .steps-grid { grid-template-columns: repeat(2, 1fr); gap: 24px; }
}
@media (max-width: 420px) {
    .steps-grid { grid-template-columns: 1fr; }
}

/* ================= WORD SEARCH SECTION ================= */
.ws-section { padding: 40px 0 60px; }

.ws-card {
    max-width: 1000px;
    margin: 0 auto;
    background: #fff;
    border: 4px solid #6BCB77;
    border-radius: 28px;
    padding: 28px 26px 34px;
    box-shadow: 10px 10px 0 rgba(0,0,0,0.08);
}

/* ---- controls ---- */
.ws-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}

.ws-theme-select {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    padding: 10px 18px;
    border-radius: 999px;
    border: 2px solid #6BCB77;
    background: #fff;
    color: #2b2b2b;
    cursor: pointer;
}

.ws-levels { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

.ws-level-btn {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    border: 2px solid #ddd;
    background: #fff;
    color: #888;
    border-radius: 999px;
    padding: 9px 20px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ws-level-btn:hover { border-color: #6BCB77; color: #6BCB77; }
.ws-level-btn.active { color: #fff; box-shadow: 3px 3px 0 rgba(0,0,0,0.1); }
.ws-level-btn[data-level="easy"].active   { background: #6BCB77; border-color: #6BCB77; }
.ws-level-btn[data-level="medium"].active { background: #F7B32B; border-color: #F7B32B; }
.ws-level-btn[data-level="hard"].active   { background: #FF6B6B; border-color: #FF6B6B; }

.ws-theme-title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #2b2b2b;
    margin-bottom: 8px;
}

/* ---- stats ---- */
.ws-stats {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 0.95rem;
    font-weight: 700;
    color: #555;
    margin-bottom: 20px;
}
.ws-stats span { background: #F5F5F5; padding: 6px 14px; border-radius: 999px; }

/* ---- main layout: board + word list ---- */
.ws-body {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
}

.ws-board-wrap {
    overflow: auto;
    max-width: 100%;
    padding: 6px;
}

.ws-board {
    display: grid;
    grid-template-columns: repeat(var(--ws-size), 32px);
    grid-template-rows: repeat(var(--ws-size), 32px);
    gap: 1px;
    background: #E4F5D0;
    padding: 6px;
    border-radius: 12px;
    width: fit-content;
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
}

.ws-cell {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2b2b2b;
    border-radius: 3px;
    cursor: pointer;
}

.ws-cell.ws-selecting {
    background: #FFE9A8;
}

.ws-cell.ws-found {
    background: #6BCB77;
    color: #fff;
}

/* ---- word list ---- */
.ws-wordlist-wrap {
    min-width: 200px;
    flex: 1 1 220px;
}

.ws-wordlist-wrap h4 {
    font-size: 1.05rem;
    color: #6BCB77;
    margin-bottom: 10px;
    border-bottom: 2px solid #E4F5D0;
    padding-bottom: 6px;
}

.ws-word-list {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ws-word {
    font-size: 1rem;
    font-weight: 700;
    color: #2b2b2b;
    padding: 8px 14px;
    background: #F5F9FF;
    border-radius: 10px;
    letter-spacing: 0.5px;
}

.ws-word.ws-word-found {
    background: #DCFCE7;
    color: #16A34A;
    text-decoration: line-through;
    opacity: 0.75;
}

/* ---- status + buttons ---- */
.ws-status {
    text-align: center;
    min-height: 28px;
    font-size: 1.05rem;
    font-weight: 700;
    margin: 20px 0 16px;
}
.ws-status.ws-success { color: #2EC4B6; }
.ws-status.ws-warn     { color: #F7B32B; }

.ws-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;
}

.ws-btn {
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    padding: 12px 26px;
    cursor: pointer;
    color: #fff;
    box-shadow: 3px 3px 0 rgba(0,0,0,0.12);
    transition: transform 0.15s ease;
}
.ws-btn:active { transform: translateY(2px); box-shadow: 1px 1px 0 rgba(0,0,0,0.12); }
.ws-btn.check     { background: #6BCB77; }
.ws-btn.reveal    { background: #A78BFA; }
.ws-btn.reset     { background: #4D96FF; }
.ws-btn.newpuzzle { background: #FF6B6B; }

@media (max-width: 640px) {
    .ws-board {
        grid-template-columns: repeat(var(--ws-size), 24px);
        grid-template-rows: repeat(var(--ws-size), 24px);
    }
    .ws-cell { font-size: 0.75rem; }
    .ws-card { padding: 20px 14px 26px; }
    .ws-btn { padding: 10px 18px; font-size: 0.92rem; }
}
