/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --green-light: #e8f5e9;
    --green: #81c784;
    --green-dark: #388e3c;
    --yellow-light: #fffde7;
    --yellow: #fff176;
    --yellow-dark: #f9a825;
    --pink: #f8bbd0;
    --pink-dark: #e91e63;
    --purple-light: #e1bee7;
    --white: #ffffff;
    --text: #2e3d2e;
    --text-light: #5a6e5a;
    --shadow: rgba(0, 0, 0, 0.08);
    --radius: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(180deg, var(--green-light) 0%, var(--yellow-light) 100%);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

/* ===== Layout ===== */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 24px 16px 32px;
}

/* ===== Header ===== */
header {
    text-align: center;
    margin-bottom: 32px;
}

.hero-emoji {
    font-size: 3rem;
    margin-bottom: 8px;
}

h1 {
    font-size: 1.75rem;
    color: var(--green-dark);
    margin-bottom: 8px;
    line-height: 1.3;
}

.subtitle {
    color: var(--text-light);
    font-size: 1rem;
}

.stats {
    display: inline-block;
    margin-top: 12px;
    background: var(--yellow);
    color: var(--text);
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== Error ===== */
.error {
    background: #ffebee;
    color: #c62828;
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    font-size: 0.95rem;
    border-left: 4px solid #c62828;
}

/* ===== Form ===== */
.hunt-form {
    background: var(--white);
    border-radius: var(--radius);
    padding: 24px 20px;
    box-shadow: 0 4px 20px var(--shadow);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--green-dark);
    font-size: 0.95rem;
}

.form-group small {
    display: block;
    margin-top: 4px;
    color: var(--text-light);
    font-size: 0.8rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--green);
    border-radius: 12px;
    font-size: 1rem;
    background: var(--green-light);
    color: var(--text);
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(129, 199, 132, 0.3);
}

.form-group input::placeholder {
    color: #a5c9a5;
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

/* ===== Buttons ===== */
.btn-generate {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--yellow-dark), var(--yellow));
    color: var(--text);
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    box-shadow: 0 4px 12px rgba(249, 168, 37, 0.3);
}

.btn-generate:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(249, 168, 37, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-generate:disabled {
    opacity: 0.7;
    cursor: wait;
}

/* ===== Clue Cards ===== */
.clues-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 28px;
}

.clue-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 3px 16px var(--shadow);
    border-left: 5px solid var(--green);
    position: relative;
}

.clue-card:nth-child(even) {
    border-left-color: var(--yellow-dark);
}

.clue-card:last-child {
    border-left-color: var(--pink-dark);
    background: linear-gradient(135deg, var(--white), #fce4ec);
}

.clue-number {
    font-weight: 700;
    color: var(--green-dark);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.clue-card:last-child .clue-number {
    color: var(--pink-dark);
}

.clue-spot {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 10px;
    padding: 6px 10px;
    background: var(--green-light);
    border-radius: 8px;
    display: inline-block;
}

.clue-card:last-child .clue-spot {
    background: #fce4ec;
}

.spot-label {
    font-weight: 600;
}

.clue-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text);
    font-style: italic;
    padding: 8px 0;
}

/* ===== Hint Toggle ===== */
.hint-toggle {
    margin-top: 8px;
}

.hint-toggle summary {
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-light);
    padding: 4px 0;
    user-select: none;
}

.hint-toggle summary:hover {
    color: var(--green-dark);
}

.hint-text {
    margin-top: 6px;
    padding: 8px 12px;
    background: var(--yellow-light);
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== Action Buttons ===== */
.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.btn-action {
    display: block;
    text-align: center;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn-action:hover {
    transform: translateY(-1px);
}

.btn-print {
    background: var(--white);
    color: var(--text);
    border: 2px solid var(--green);
}

.btn-whatsapp {
    background: #25d366;
    color: white;
}

.btn-new {
    background: linear-gradient(135deg, var(--yellow-dark), var(--yellow));
    color: var(--text);
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 24px 16px 32px;
    color: var(--text-light);
    font-size: 0.9rem;
}

footer a {
    color: var(--green-dark);
    text-decoration: none;
    font-weight: 600;
}

footer a:hover {
    text-decoration: underline;
}

/* ===== Print Styles ===== */
@media print {
    body {
        background: white;
    }

    .actions,
    footer,
    .stats {
        display: none !important;
    }

    .clue-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }

    .hint-toggle {
        display: none;
    }

    .container {
        max-width: 100%;
    }
}

/* ===== Tablet+ ===== */
@media (min-width: 640px) {
    .container {
        padding: 40px 24px 48px;
    }

    h1 {
        font-size: 2.25rem;
    }

    .hero-emoji {
        font-size: 4rem;
    }

    .hunt-form {
        padding: 32px 28px;
    }

    .actions {
        flex-direction: row;
    }

    .btn-action {
        flex: 1;
    }
}

/* Parent's guide */
.parents-guide {
    background: #fffde7;
    border: 2px dashed #f9a825;
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 1.5rem;
}
.parents-guide h2 { margin-top: 0; font-size: 1.1rem; color: #e65100; }
.parents-guide p { font-size: 0.9rem; color: #555; margin-bottom: 0.8rem; }
.answer-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.answer-table th { background: #f9a825; color: white; padding: 0.4rem 0.6rem; text-align: left; }
.answer-table td { padding: 0.4rem 0.6rem; border-bottom: 1px solid #ffe082; }
.answer-table tr:last-child td { border-bottom: none; }

/* Cut here divider */
.print-divider { border: none; border-top: 2px dashed #ccc; margin: 1.5rem 0 0.5rem; }
.cut-here { text-align: center; color: #aaa; font-size: 0.85rem; margin: 0 0 1.5rem; }

/* Print: hide actions + stats, keep guide + clues */
@media print {
    .actions, .stats, footer { display: none; }
    .parents-guide { border: 2px dashed #999; }
}
