/* ── Google Font ── */
/* Loaded via <link> in index.html */

/* ── Reset & Base ── */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Patrick Hand', cursive;
  background: #f5f5f3;
  min-height: 100vh;
}

.app {
  max-width: 780px;
  margin: 0 auto;
  padding: 1.5rem 1rem;
  background: #fff;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Screens ── */
.screen { display: none; }
.screen.active { display: block; }

/* ── Typography ── */
h1 {
  font-size: 22px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 4px;
}
p.sub {
  font-size: 14px;
  color: #666;
  margin-bottom: 1rem;
}

/* ── Set Header (home + title + sounds) ── */
.set-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.5rem;
  justify-content: space-between;
}

.set-header h1 {
  margin: 0;
}

.set-header .sub {
  margin: 0;
}



/* ── Progress bar ── */
.progress-bar {
  height: 4px;
  background: #e5e5e5;
  border-radius: 2px;
  margin-bottom: 1.5rem;
}
.progress-fill {
  height: 4px;
  background: #1D9E75;
  border-radius: 2px;
  transition: width 0.4s;
}

/* ── Card ── */
.card {
  background: #fff;
  border: 0.5px solid #e0e0e0;
  border-radius: 12px;
  padding: 1.25rem;
  margin-bottom: 1rem;
}

/* ── Buttons ── */
.btn {
  padding: 10px 20px;
  border: 0.5px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
  font-size: 14px;
  font-family: 'Patrick Hand', cursive;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.btn:hover { background: #f5f5f5; }
.btn.primary {
  background: #1D9E75;
  color: #E1F5EE;
  border-color: #0F6E56;
}
.btn.primary:hover { background: #0F6E56; }

.nav-back {
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
  display: flex;
  align-items: center;
  padding: 0;
}
.nav-back:hover { 
  color: #1a1a1a; 
}

.nav-back svg {
  width: 28px;
  height: 28px;
  display: block;   /* removes inline baseline offset */
}

.icon-btn-round {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
  flex-shrink: 0;
}
.icon-btn-round:hover { background: #E6F1FB; }

.icon-only-btn {
  background: none;
  border: 0.5px solid #ccc;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  color: #1a1a1a;
}
.icon-only-btn:hover { background: #f5f5f5; }
.icon-only-btn:disabled {
  opacity: 0.25;
  cursor: default;
}
.icon-only-btn:disabled:hover { background: none; }

/* ── Nav row (back + next) ── */
.nav-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
}


/* ── Home screen ── */
.set-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 1.5rem;
}
 
.set-card {
  background: #fff;
  border: 0.5px solid #e0e0e0;
  border-radius: 10px;
  padding: 14px 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  min-height: 64px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}
 
/* Unselected hover (keep subtle / neutral) */
.set-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}
}
 
.set-card.locked-card {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}
 
.set-card.locked-card:hover {
  background: #fff;
  border-color: #e0e0e0;
}
 
.set-card-placeholder {
  border-radius: 10px;
  min-height: 64px;
  background: transparent;
}
 
.set-number {
  font-size: 15px;
  font-weight: 700;
  color: #1a1a1a;
  font-family: 'Patrick Hand', cursive;
}
 
.set-sounds {
  font-size: 12px;
  color: #555;
  margin-top: 3px;
  font-family: 'Patrick Hand', cursive;
}

.set-card.is-selected[data-set="1"]       { background: #EBF4FF; border-color: #BADAF7; }
.set-card.is-selected[data-set="1"]:hover { background: #D0E9FB; border-color: #7DC0EF; }

.set-card.is-selected[data-set="2"]       { background: #E6F7F4; border-color: #A8DDD5; }
.set-card.is-selected[data-set="2"]:hover { background: #CCF0EA; border-color: #5DCAA5; }

.set-card.is-selected[data-set="3"]       { background: #EDF7E6; border-color: #B5DFA0; }
.set-card.is-selected[data-set="3"]:hover { background: #D8F0C8; border-color: #7EC257; }

.set-card.is-selected[data-set="4"]       { background: #FDF6E3; border-color: #F0D98A; }
.set-card.is-selected[data-set="4"]:hover { background: #FAF0C0; border-color: #D4B030; }

.set-card.is-selected[data-set="5"]       { background: #FEF0E6; border-color: #F5C49A; }
.set-card.is-selected[data-set="5"]:hover { background: #FDDFC8; border-color: #E8965A; }

.set-card.is-selected[data-set="6"]       { background: #FDF0F3; border-color: #F4B8C8; }
.set-card.is-selected[data-set="6"]:hover { background: #FAE0E8; border-color: #E07898; }

.set-card.is-selected[data-set="7"]       { background: #F3F0FB; border-color: #C8BAEE; }
.set-card.is-selected[data-set="7"]:hover { background: #E6E0F8; border-color: #9880D8; }

.set-card.is-selected[data-set="8"]       { background: #EEF0FB; border-color: #B8C0EE; }
.set-card.is-selected[data-set="8"]:hover { background: #DDE0F8; border-color: #7888D8; }

.set-card.is-selected[data-set="9"]       { background: #E6F6FB; border-color: #9DD5EA; }
.set-card.is-selected[data-set="9"]:hover { background: #CCEDF8; border-color: #55B8D8; }

.set-card.is-selected[data-set="10"]      { background: #EEF3EE; border-color: #AECAAE; }
.set-card.is-selected[data-set="10"]:hover{ background: #DCEADC; border-color: #6EA86E; }

.set-card.locked-card,
.set-card.locked-card:hover   { background: #f5f5f5 !important; border-color: #ddd !important; opacity: 0.6; cursor: default; }

.set-card-placeholder         { background: transparent !important; border: none !important; }







/* ── Step indicator ── */
.step-indicator {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  padding: 12px 0 8px;
  margin-top: 0;
  z-index: 100;
  max-width: 780px;
  margin-left: auto;
  margin-right: auto;
}

#activity-container {
  flex: 1;
}
.step-pill {
  font-size: 13px;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
  border: 0.5px solid #ccc;
  color: #888;
  background: #f5f5f5;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Patrick Hand', cursive;
}
.step-pill:hover { border-color: #5DCAA5; }
.step-pill.active {
  background: #E1F5EE;
  color: #0F6E56;
  border-color: #5DCAA5;
  font-weight: 600;
}
.step-pill.done {
  background: #E1F5EE;
  color: #0F6E56;
  border-color: #5DCAA5;
  opacity: 0.55;
}
.step-pill.locked { opacity: 0.3; cursor: default; }
.step-pill.locked:hover { border-color: #ccc; }

/* ── Activity 1: Listen ── */
.sound-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 1.25rem;
}
.sound-btn {
  padding: 10px 6px;
  font-size: 32px;
  line-height: 1;
  font-weight: 400;
  border: 0.5px solid #ccc;
  border-radius: 12px;
  background: #f5f5f5;
  cursor: default;
  color: #1a1a1a;
  
  transition: all 0.15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: 'Patrick Hand', cursive;
}

/* ── Activity 2: Say ── */
.blend-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.blend-table th {
  font-size: 18px;
  font-weight: 600;
  padding: 0 8px 10px;
  text-align: centre;
  border-bottom: 0.5px solid #e0e0e0;
  font-family: 'Patrick Hand', cursive;
}
.blend-table th.listen-h {
  text-align: center;
}
.blend-table th.say-h {
  text-align: center;
}
.blend-table th.listen-h { color: #185FA5; }
.blend-table th.say-h { color: #0F6E56; }
.blend-table td {
  padding: 9px 6px;
  text-align: center;
  border-bottom: 0.5px solid #e0e0e0;
  vertical-align: middle;
}
.blend-table tr:last-child td { border-bottom: none; }
.blend-listen-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 0 4px;
}
.blend-say-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}
.col-divider { border-left: 0.5px solid #e0e0e0; }
.phoneme-text {
  font-size: 17px;
  font-weight: 600;
  color: #185FA5;
  letter-spacing: 2px;
  font-family: 'Patrick Hand', cursive;
  flex: 1;
  text-align: left;
}
.word-text {
  font-size: 32px;
  font-weight: 400;
  color: #1a1a1a;
  font-family: 'Patrick Hand', cursive;
  flex: 1;
  text-align: left;
}

/* ── Activity 3: Spell ── */
.spell-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.spell-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #f5f5f5;
  border-radius: 8px;
  border: 0.5px solid #e0e0e0;
}
.spell-pic {
  width: 70px;
  height: 70px;
  background: #fff;
  border: 0.5px solid #e0e0e0;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  flex-shrink: 0;
  overflow: hidden;
}
.spell-pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 6px;
}
.spell-input {
  flex: 1;
  padding: 9px 12px;
  font-size: 28px;
  border: 0.5px solid #ccc;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
  min-width: 0;
  font-family: 'Patrick Hand', cursive;
}
.spell-input:focus {
  outline: none;
  box-shadow: 0 0 0 2px #5DCAA5;
  border-color: #5DCAA5;
}
.spell-input.correct-input { border-color: #1D9E75; background: #E1F5EE; }
.spell-input.wrong-input { border-color: #D85A30; background: #FAECE7; }
.result-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Activity 4: Match (drag & drop) ── */
.dnd-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.dnd-drag-col,
.dnd-drop-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drag-chip {
  height: 80px;
  background: #f5f5f5;
  border: 0.5px solid #ccc;
  border-radius: 8px;
  cursor: grab;
  font-size: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  transition: all 0.15s;
  overflow: hidden;
}
.drag-chip img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  pointer-events: none;
}
.drag-chip:hover { background: #E6F1FB; border-color: #85B7EB; }
.drag-chip.dragging { opacity: 0.4; }
.drag-chip.used { opacity: 0.2; pointer-events: none; }
.drop-slot {
  height: 80px;
  padding: 0 14px;
  border: 1.5px dashed #ccc;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.15s;
}
.drop-slot.over { background: #E6F1FB; border-color: #378ADD; }
.drop-slot.correct-slot { background: #E1F5EE; border-color: #1D9E75; border-style: solid; }
.drop-slot.wrong-slot { background: #FAECE7; border-color: #D85A30; border-style: solid; }
.slot-word {
  font-size: 32px;
  font-weight: 400;
  color: #1a1a1a;
  min-width: 50px;
  font-family: 'Patrick Hand', cursive;
}
.slot-img {
  font-size: 24px;
  margin-left: auto;
  display: flex;
  align-items: center;
}
.slot-img img {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 4px;
}
.slot-result {
  width: 24px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.dnd-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
}

/* ── Review / Summary page ── */

.review-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 0.5rem;
}
 
.flip-card {
  width: 88px;
  height: 88px;
  cursor: pointer;
  position: relative;
}
 
.flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: transform 0.4s ease;
}
 
.flip-card.is-flipped .flip-inner {
  transform: rotateY(180deg);
}
 
.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  border-radius: 10px;
  border: 0.5px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
 
.flip-front {
  background: #f9f9f9;
}
 
.flip-back {
  background: #E1F5EE;
  border-color: #5DCAA5;
  transform: rotateY(180deg);
}
 
.review-word {
  font-family: 'Patrick Hand', cursive;
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  text-align: center;
  line-height: 1.1;
}


/* ── Fireworks ── */
#fw-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
}
#fw-overlay.active { display: block; }
#fw-canvas { width: 100%; height: 100%; display: block; }

#fw-message {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 0.5px solid #e0e0e0;
  border-radius: 12px;
  padding: 2rem 2.5rem;
  text-align: center;
  z-index: 1000;
  pointer-events: all;
  min-width: 260px;
  display: none;
  box-shadow: 0 4px 32px rgba(0,0,0,0.10);
}
#fw-message.active { display: block; }
#fw-message h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
  font-family: 'Patrick Hand', cursive;
}
#fw-message p {
  font-size: 15px;
  color: #666;
  margin-bottom: 1.5rem;
  font-family: 'Patrick Hand', cursive;
}

#screen-set {
  flex-direction: column;
  min-height: 100vh;
}

#screen-set.active {
  display: flex;
  padding-bottom: 70px;
}

/* ── Responsive ── */
@media (max-width: 480px) {
  .sound-grid { grid-template-columns: repeat(2, 1fr); }
  .dnd-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .slot-word { font-size: 22px; min-width: 36px; }
  .blend-table th, .blend-table td { padding: 7px 4px; }
  .phoneme-text, .word-text { font-size: 32px; }
}

.grid-placeholder {
  visibility: hidden;
}

@media (max-width: 480px) {
  .grid-placeholder {
    display: none;
  }
}

/* Reading cards white until selected */
.reading-card {
  background: #fff;
  border-color: #e0e0e0;
}
.reading-card:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

/* Once clicked (selected), give them the reading tint */
.reading-card.is-selected {
  border-color: #BDD8F5;
  background: #F0F7FF;
}
.reading-card.is-selected:hover {
  border-color: #185FA5;
  background: #E6F1FB;
}
.reading-input {
  width: 100%;
}


.review-match-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 8px;
  margin-bottom: 0.75rem;
}
 
.rm-tile {
  border-radius: 10px;
  border: 2px solid #e0e0e0;
  background: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  cursor: pointer;
  transition: all 0.15s;
  padding: 6px;
  text-align: center;
}
 
.rm-tile.rm-selected {
  border-color: #185FA5;
  background: #E6F1FB;
}
 
.rm-tile.rm-matched {
  border-color: #ccc;
  background: #f0f0f0;
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}
 
.sb-chip {
  touch-action: manipulation;
}
