/* The Boys Boys by Amanya - kid-friendly theme */

@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;700;800&family=Fredoka:wght@500;600;700&display=swap');

:root {
    --bg: #fdf6e9;
    --card: #ffffff;
    --ink: #33415c;
    --primary: #ff8c42;
    --primary-dark: #f76707;
    --blue: #4d96ff;
    --blue-dark: #2b7de9;
    --green: #38b000;
    --red: #e63946;
    --purple: #8e44ad;
    --yellow: #ffd93d;
    --radius: 18px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Baloo 2', 'Comic Sans MS', cursive, sans-serif;
    background: var(--bg);
    background-image: radial-gradient(#ffe3c0 2px, transparent 2px);
    background-size: 34px 34px;
    color: var(--ink);
    margin: 0;
    padding: 0;
    font-size: 20px;
}

.container {
    max-width: 950px;
    margin: 0 auto;
    padding: 20px;
}

/* ---------- Header ---------- */

header { text-align: center; margin-bottom: 22px; }

h1 {
    font-family: 'Fredoka', 'Baloo 2', sans-serif;
    font-size: 44px;
    margin: 10px 0 4px;
    color: var(--primary-dark);
    text-shadow: 2px 2px 0 #ffe3c0;
}

h1 .by {
    display: block;
    font-size: 20px;
    color: var(--purple);
    text-shadow: none;
}

h2 {
    font-family: 'Fredoka', 'Baloo 2', sans-serif;
    font-size: 30px;
    color: var(--blue-dark);
    margin-top: 0;
}

.welcome-message {
    font-size: 22px;
    color: var(--green);
    font-weight: 700;
    margin: 8px 0;
}

/* ---------- Navigation ---------- */

.main-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin: 14px 0;
}

.nav-btn {
    padding: 12px 20px;
    font-size: 19px;
    font-family: inherit;
    font-weight: 700;
    border: none;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 4px 0 var(--primary-dark);
    transition: transform .1s;
    display: inline-block;
}

.nav-btn:hover { transform: translateY(-2px); }
.nav-btn.active { background: var(--blue); box-shadow: 0 4px 0 var(--blue-dark); }
.nav-btn.logout { background: #adb5bd; box-shadow: 0 4px 0 #868e96; }

/* ---------- Cards & boxes ---------- */

.card {
    background: var(--card);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 22px;
    box-shadow: 0 6px 18px rgba(51, 65, 92, 0.12);
    border: 3px solid #ffe3c0;
}

.card.center { text-align: center; }

.question-box {
    background: #eef4ff;
    border: 3px dashed var(--blue);
    border-radius: var(--radius);
    padding: 22px;
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin: 16px 0;
}

.story-box {
    background: #fff8e1;
    border: 3px solid var(--yellow);
    border-radius: var(--radius);
    padding: 22px;
    font-size: 24px;
    line-height: 1.6;
    margin: 16px 0;
}

.answer-box {
    background: #f0fff4;
    border: 3px dashed var(--green);
    border-radius: var(--radius);
    padding: 18px;
    margin: 16px 0;
    text-align: center;
}

.answer-box label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 20px;
}

/* ---------- Inputs & buttons ---------- */

input[type="text"], input[type="number"], input[type="email"],
input[type="password"], input[type="date"], select {
    font-family: inherit;
    font-size: 22px;
    padding: 12px 16px;
    border: 3px solid #cfd8ea;
    border-radius: 12px;
    outline: none;
    max-width: 100%;
}

input:focus, select:focus { border-color: var(--blue); }

.btn {
    font-family: inherit;
    font-size: 21px;
    font-weight: 700;
    padding: 12px 26px;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    color: #fff;
    transition: transform .1s;
    text-decoration: none;
    display: inline-block;
}

.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--primary); box-shadow: 0 4px 0 var(--primary-dark); }
.btn-blue    { background: var(--blue);    box-shadow: 0 4px 0 var(--blue-dark); }
.btn-green   { background: var(--green);   box-shadow: 0 4px 0 #2d8a00; }
.btn-danger  { background: var(--red);     box-shadow: 0 4px 0 #b02a34; }
.btn-small   { font-size: 17px; padding: 8px 18px; }

.mcq-btn {
    font-family: inherit;
    font-size: 22px;
    font-weight: 700;
    padding: 14px 24px;
    margin: 6px;
    border: 3px solid var(--blue);
    background: #fff;
    color: var(--blue-dark);
    border-radius: 14px;
    cursor: pointer;
    transition: transform .1s, background .1s;
}

.mcq-btn:hover { background: #eef4ff; transform: translateY(-2px); }

/* ---------- Feedback & rewards ---------- */

.feedback {
    margin-top: 14px;
    font-weight: 800;
    font-size: 24px;
    text-align: center;
    min-height: 32px;
}

.feedback.correct { color: var(--green); }
.feedback.incorrect { color: var(--red); }

.reward-message {
    margin-top: 10px;
    font-size: 20px;
    color: var(--purple);
    font-weight: 800;
    text-align: center;
}

.progress-line {
    font-size: 19px;
    text-align: center;
    color: #5c677d;
}

.pizza-badge {
    display: inline-block;
    background: var(--yellow);
    color: #7a5c00;
    border-radius: 999px;
    padding: 6px 16px;
    font-weight: 800;
    font-size: 19px;
    margin: 4px;
}

.level-badge {
    display: inline-block;
    background: var(--purple);
    color: #fff;
    border-radius: 999px;
    padding: 4px 14px;
    font-weight: 800;
    font-size: 17px;
}

.error-message { color: var(--red); font-weight: 700; text-align: center; min-height: 26px; }
.ok-message { color: var(--green); font-weight: 700; text-align: center; }

.hidden { display: none; }

/* ---------- Auth forms ---------- */

.auth-form { max-width: 460px; margin: 0 auto; }
.auth-form .field { margin-bottom: 16px; }
.auth-form label { display: block; font-weight: 700; margin-bottom: 6px; }
.auth-form input, .auth-form select { width: 100%; }
.auth-form .btn { width: 100%; margin-top: 8px; }
.auth-alt { text-align: center; margin-top: 14px; font-size: 18px; }

/* ---------- Home tiles ---------- */

.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.tile {
    display: block;
    text-decoration: none;
    color: var(--ink);
    background: var(--card);
    border-radius: var(--radius);
    border: 3px solid #ffe3c0;
    padding: 22px;
    text-align: center;
    box-shadow: 0 6px 18px rgba(51, 65, 92, .12);
    transition: transform .12s;
}

.tile:hover { transform: translateY(-4px); }
.tile .emoji { font-size: 46px; display: block; margin-bottom: 8px; }
.tile .tile-title { font-size: 23px; font-weight: 800; color: var(--blue-dark); }
.tile .tile-sub { font-size: 17px; color: #5c677d; }

/* ---------- History table ---------- */

table.history {
    width: 100%;
    border-collapse: collapse;
    font-size: 18px;
}

table.history th, table.history td {
    padding: 10px 12px;
    border-bottom: 2px solid #f0e6d6;
    text-align: left;
}

table.history th { color: var(--blue-dark); font-size: 19px; }
tr.row-correct td:last-child { color: var(--green); font-weight: 800; }
tr.row-wrong td:last-child { color: var(--red); font-weight: 800; }

.day-chip {
    display: inline-block;
    margin: 5px;
    padding: 10px 18px;
    border-radius: 999px;
    background: #eef4ff;
    border: 3px solid var(--blue);
    color: var(--blue-dark);
    font-weight: 800;
    cursor: pointer;
    font-size: 18px;
}

.day-chip:hover { background: var(--blue); color: #fff; }

/* ---------- Celebrations ---------- */

.burst-celebration {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--yellow);
    padding: 30px 50px;
    border-radius: 24px;
    font-size: 30px;
    color: #333;
    font-weight: 800;
    animation: burstPop 1.2s ease-out;
    z-index: 9999;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}

@keyframes burstPop {
    0% { transform: scale(.2) translateX(-50%); opacity: 0; }
    50% { transform: scale(1.35) translateX(-50%); opacity: 1; }
    100% { transform: scale(1) translateX(-50%); opacity: 1; }
}

.pizza-celebration {
    position: fixed;
    top: 22%;
    left: 50%;
    transform: translateX(-50%);
    background: #ffcc00;
    padding: 40px 60px;
    border-radius: 28px;
    color: #333;
    font-weight: 800;
    animation: burstPop 1.2s ease-out;
    z-index: 9999;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,.25);
}

.pizza-title { font-size: 38px; margin-bottom: 8px; }
.pizza-sub { font-size: 26px; margin-bottom: 14px; }
.pizza-emoji { font-size: 58px; }

/* ---------- Picture Words (vocabulary) ---------- */

/* Twemoji swaps emoji characters for images; size them like text */
img.emoji {
    height: 1em;
    width: 1em;
    margin: 0 .05em 0 .1em;
    vertical-align: -0.1em;
}

.vocab-image {
    font-size: 160px;
    line-height: 1.1;
    margin: 18px auto 6px;
    min-height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vocab-word {
    font-size: 52px;
    font-weight: 800;
    color: #4a3aff;
    margin-bottom: 18px;
    letter-spacing: 1px;
}

.vocab-controls {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.vocab-cat-icon { font-size: 44px; }

/* ---------- Manage Credits (parents) ---------- */

.table-scroll { overflow-x: auto; }

.parent-input {
    padding: 8px 10px;
    border: 2px solid #cfc7ff;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    max-width: 130px;
}

.redeem-count { max-width: 70px; }
.center-cell { text-align: center; }

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
    body { font-size: 18px; }
    h1 { font-size: 34px; }
    .question-box { font-size: 24px; }
    .story-box { font-size: 21px; }
    .card { padding: 16px; }
    .vocab-image { font-size: 110px; min-height: 130px; }
    .vocab-word { font-size: 38px; }
}

/* ---------- Fix the Sentence (scrambled word chips) ---------- */

.word-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    background: #fff7ec;
    border: 3px dashed var(--primary);
    border-radius: var(--radius);
    padding: 18px;
    margin: 16px 0;
}

.word-chip {
    display: inline-block;
    background: var(--yellow);
    color: var(--ink);
    font-weight: 700;
    font-size: 22px;
    padding: 6px 14px;
    border-radius: 12px;
    box-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.mcq-btn.sentence-choice {
    display: block;
    width: 100%;
    text-align: left;
    margin: 8px 0;
}
