/* Phonics Kids Adventure Web App Styles */
@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&family=Prompt:wght@400;500;600;700&display=swap');

:root {
    --primary-blue: #3b82f6;
    --primary-yellow: #f59e0b;
    --primary-pink: #ec4899;
    --primary-green: #10b981;
    --primary-purple: #8b5cf6;
    --bg-gradient: linear-gradient(135deg, #e0f2fe 0%, #fdf2f8 50%, #fef3c7 100%);
    --card-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
    --btn-shadow: 0 6px 0 rgba(0, 0, 0, 0.15);
    --btn-active-shadow: 0 2px 0 rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Fredoka', 'Prompt', system-ui, -apple-system, sans-serif;
    background: var(--bg-gradient);
    min-height: 100vh;
    color: #1e293b;
    overflow-x: hidden;
    touch-action: manipulation;
}

/* Big Kid-friendly Buttons */
.kid-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1.15rem;
    font-weight: 700;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    box-shadow: var(--btn-shadow);
    transition: all 0.15s ease;
    touch-action: manipulation;
}

.kid-btn:active {
    transform: translateY(4px);
    box-shadow: var(--btn-active-shadow);
}

.btn-primary {
    background: linear-gradient(180deg, #38bdf8 0%, #0284c7 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(180deg, #34d399 0%, #059669 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(180deg, #fbbf24 0%, #d97706 100%);
    color: #451a03;
}

.btn-pink {
    background: linear-gradient(180deg, #f472b6 0%, #db2777 100%);
    color: white;
}

.btn-purple {
    background: linear-gradient(180deg, #a78bfa 0%, #7c3aed 100%);
    color: white;
}

/* Tactile Card Styling */
.kid-card {
    background: white;
    border-radius: 24px;
    border: 3px solid #e2e8f0;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.kid-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px -8px rgba(0, 0, 0, 0.12);
}

/* Sound / Speaker Button */
.speaker-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #eff6ff;
    border: 2px solid #93c5fd;
    color: #2563eb;
    cursor: pointer;
    font-size: 1.3rem;
    transition: transform 0.15s ease, background 0.15s ease;
}

.speaker-btn:active {
    transform: scale(0.9);
    background: #dbeafe;
}

/* Red Cross-off Mark (กากบาท ❌) */
.cross-box {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 3px solid #94a3b8;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 900;
    color: #ef4444;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.choice-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 20px;
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 20px;
    cursor: pointer;
    font-size: 1.25rem;
    font-weight: 600;
    transition: all 0.15s ease;
}

.choice-item:active {
    transform: scale(0.98);
}

.choice-item.selected {
    border-color: #ef4444;
    background: #fef2f2;
}

.choice-item.selected .cross-box {
    border-color: #ef4444;
    background: #fee2e2;
}

/* Red underline style strictly matching teacher's slide */
.underlined-target {
    text-decoration: underline;
    text-decoration-color: #ef4444;
    text-decoration-thickness: 3.5px;
    text-underline-offset: 4px;
    font-weight: 800;
    color: #1e293b;
}

/* Blank Slot in Story Cloze */
.story-blank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    height: 40px;
    margin: 0 4px;
    padding: 0 12px;
    border-bottom: 3.5px dashed #3b82f6;
    background: #eff6ff;
    border-radius: 10px;
    font-weight: 800;
    color: #1d4ed8;
    font-size: 1.2rem;
    cursor: pointer;
    vertical-align: middle;
    transition: all 0.15s ease;
}

.story-blank.active {
    border-color: #ec4899;
    background: #fdf2f8;
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
}

.story-blank.filled {
    border-style: solid;
    border-color: #3b82f6;
    background: #dbeafe;
}

/* Word Bank Chips */
.word-chip {
    padding: 10px 18px;
    background: white;
    border: 3px solid #60a5fa;
    color: #1e40af;
    font-weight: 700;
    font-size: 1.2rem;
    border-radius: 9999px;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

.word-chip:active {
    transform: scale(0.95);
}

.word-chip.used {
    opacity: 0.4;
    pointer-events: none;
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #94a3b8;
}

/* Line Matching Canvas / SVG Area */
.matching-board {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    width: 100%;
    max-width: 850px;
    margin: 0 auto;
}

.matching-svg-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 10;
}

.match-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background: white;
    border: 3px solid #e2e8f0;
    border-radius: 18px;
    font-size: 1.25rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.match-node:active {
    transform: scale(0.97);
}

.match-node.selected {
    border-color: #ec4899;
    background: #fdf2f8;
    box-shadow: 0 0 0 4px rgba(236, 72, 153, 0.2);
}

.match-node.matched {
    border-color: #10b981;
    background: #f0fdf4;
}

/* Flashcard Styles */
.flashcard {
    background: white;
    border-radius: 20px;
    border: 3px solid #cbd5e1;
    overflow: hidden;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.flashcard:hover {
    border-color: #3b82f6;
    transform: translateY(-4px);
}

/* Certificate Styling */
.certificate-frame {
    background: #fff;
    border: 12px double #f59e0b;
    border-radius: 24px;
    padding: 36px 24px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.12);
    position: relative;
    background-image: radial-gradient(#fef3c7 10%, transparent 11%);
    background-size: 24px 24px;
}

@keyframes bounceSoft {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

.bounce-soft {
    animation: bounceSoft 2s infinite ease-in-out;
}
