/* ============================================================
   Kids Kingdom - Tic Tac Toe 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; }
}

/* ================= TIC TAC TOE SECTION ================= */
.ttt-section { padding: 40px 0 60px; }

.ttt-card {
    max-width: 560px;
    margin: 0 auto;
    background: #fff;
    border: 4px solid #FF6B9D;
    border-radius: 28px;
    padding: 28px 26px 34px;
    box-shadow: 10px 10px 0 rgba(0,0,0,0.08);
    text-align: center;
}

/* ---- mode + theme controls ---- */
.ttt-controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.ttt-mode-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;
}
.ttt-mode-btn:hover { border-color: #FF6B9D; color: #FF6B9D; }
.ttt-mode-btn.active { background: #FF6B9D; border-color: #FF6B9D; color: #fff; box-shadow: 3px 3px 0 rgba(0,0,0,0.1); }

.ttt-theme-select {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    padding: 9px 16px;
    border-radius: 999px;
    border: 2px solid #FF6B9D;
    background: #fff;
    color: #2b2b2b;
    cursor: pointer;
}

/* ---- difficulty (only shown in vs-computer mode) ---- */
.ttt-difficulty-wrap {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}
.ttt-diff-btn {
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 700;
    border: 2px solid #ddd;
    background: #fff;
    color: #888;
    border-radius: 999px;
    padding: 7px 16px;
    cursor: pointer;
    transition: all 0.15s ease;
}
.ttt-diff-btn.active { color: #fff; }
.ttt-diff-btn[data-diff="easy"].active   { background: #6BCB77; border-color: #6BCB77; }
.ttt-diff-btn[data-diff="medium"].active { background: #F7B32B; border-color: #F7B32B; }
.ttt-diff-btn[data-diff="hard"].active   { background: #FF6B6B; border-color: #FF6B6B; }

/* ---- score + turn ---- */
.ttt-score {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 10px;
}
.ttt-score span { background: #F5F5F5; padding: 6px 14px; border-radius: 999px; }
.ttt-score-p1 { color: #4D96FF; }
.ttt-score-p2 { color: #FF6B6B; }
.ttt-score-draw { color: #888; }

.ttt-turn {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2b2b2b;
    margin-bottom: 18px;
    min-height: 26px;
}

/* ---- board ---- */
.ttt-board {
    display: grid;
    grid-template-columns: repeat(3, 90px);
    grid-template-rows: repeat(3, 90px);
    gap: 8px;
    background: #FFD9E8;
    padding: 10px;
    border-radius: 18px;
    width: fit-content;
    margin: 0 auto 20px;
}

.ttt-cell {
    width: 90px;
    height: 90px;
    background: #fff;
    border: none;
    border-radius: 12px;
    font-size: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s ease, transform 0.1s ease;
}
.ttt-cell:hover:not(.ttt-filled) { background: #FFF0F5; transform: scale(1.03); }
.ttt-cell.ttt-filled { cursor: default; }
.ttt-cell.ttt-winning { background: #DCFCE7; animation: ttt-pop 0.4s ease; }

@keyframes ttt-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ---- status + buttons ---- */
.ttt-status {
    min-height: 28px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 18px;
}
.ttt-status.ttt-success { color: #2EC4B6; }
.ttt-status.ttt-error   { color: #FF6B6B; }
.ttt-status.ttt-warn     { color: #F7B32B; }

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

.ttt-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;
}
.ttt-btn:active { transform: translateY(2px); box-shadow: 1px 1px 0 rgba(0,0,0,0.12); }
.ttt-btn.newround   { background: #6BCB77; }
.ttt-btn.resetscore { background: #4D96FF; }

@media (max-width: 480px) {
    .ttt-board {
        grid-template-columns: repeat(3, 76px);
        grid-template-rows: repeat(3, 76px);
    }
    .ttt-cell { width: 76px; height: 76px; font-size: 2.1rem; }
    .ttt-card { padding: 20px 14px 26px; }
    .ttt-btn { padding: 10px 18px; font-size: 0.92rem; }
}
