/* Grade 1: term map, lesson path and the lesson player (Brilliant-style: one card, check bar at the bottom). */
/* The host stays in the lesson player, docked in the top bar at every width (floating in the corner it covered the
   sticky check bar on large screens). */
body.g1-playing .topbar { padding-inline-end: 96px; min-height: 84px; }
body.g1-playing .mascot { width: 76px; top: 4px; bottom: auto; inset-inline-end: 10px; }
body.g1-playing .bubble { bottom: auto; top: calc(100% + 8px); inset-inline-end: 0; transform: translateY(-8px) scale(.95); }
body.g1-playing .bubble.show { transform: none; }
body.g1-playing .bubble::after { bottom: auto; top: -10px; inset-inline-end: 22px; border: 10px solid transparent;
  border-bottom-color: var(--ink); border-top: 0; }
@media (max-width: 680px) {
  body.g1-playing .topbar { padding-inline-end: 70px; min-height: 64px; }
  body.g1-playing .mascot { width: 58px; top: 3px; }
}
/* The home screen leaves 140px for the mascot; in the player that padding pushed the sticky footer up over the card. */
body.g1-playing .screen { padding-bottom: 0; }

.g1-loading { text-align: center; font-size: 40px; color: #fff; padding: 40px; }

/* Term map */
.g1-term { max-width: 900px; margin: 0 auto; }
.g1-weeks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.g1-week {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px;
  display: flex; flex-direction: column; gap: 4px; align-items: flex-start; text-align: start;
}
.g1-week-n { font-size: 15px; font-weight: 700; opacity: .7; }
.g1-week-t { font-family: var(--font-letter); font-size: 30px; font-weight: 700; color: var(--c5); }
.g1-week-u { font-size: 15px; font-weight: 700; color: var(--c3); }
.g1-week.locked { opacity: .55; box-shadow: none; }
.g1-week.locked .g1-week-t { color: inherit; }

/* Week path: zig-zag nodes like a learning path */
.g1-path { max-width: 520px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; align-items: center; padding-bottom: 40px; }
.g1-unit { background: rgba(255, 255, 255, .8); border-radius: 14px; padding: 6px 16px; font-weight: 800; }
.g1-node {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center;
  background: var(--card); border-radius: 26px; box-shadow: var(--shadow); padding: 12px 18px; width: 300px; text-align: start;
  transform: translateX(var(--x, 0)); animation: pop-in .4s both; animation-delay: calc(var(--i) * .08s);
}
.g1-node-dot {
  grid-row: 1 / 3; width: 64px; height: 64px; border-radius: 50%; background: var(--c4); color: #fff;
  display: grid; place-items: center; font-family: var(--font-letter); font-size: 34px; font-weight: 700; box-shadow: 0 5px 0 rgba(0, 0, 0, .15);
}
.g1-node.done .g1-node-dot { background: var(--c2); font-size: 30px; }
.g1-node-t { font-size: 22px; font-weight: 800; }
.g1-node-s { font-size: 14px; font-weight: 700; opacity: .7; }

/* Player */
.g1-player { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.g1-bar { display: flex; gap: 6px; }
.g1-bar i { flex: 1; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .55); transition: background .3s; }
.g1-bar i.on { background: var(--c3); }
.g1-stage-wrap { flex: 1; }
.g1-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px;
  display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center;
}
.g1-card.enter { animation: pop-in .3s both; }
.g1-q { margin: 0; font-size: clamp(20px, 3.4vw, 28px); font-weight: 800; }
.g1-stage { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.g1-pic { font-size: clamp(70px, 12vw, 100px); line-height: 1.1; }
.g1-pic.small { font-size: 46px; }
.g1-word { font-family: var(--font-letter); font-size: clamp(40px, 7vw, 56px); font-weight: 700; line-height: 1.5; }
.g1-word.big { font-size: clamp(56px, 10vw, 80px); }
.g1-word .hl, .g1-tile-word .hl { color: var(--c1); }
.g1-hidden-word { font-size: 44px; font-weight: 800; color: var(--c5); background: #f1ecff; border-radius: 14px; min-width: 120px; }
.g1-listen { background: var(--c4); color: #fff; border-radius: 16px; padding: 6px 16px; font-size: 18px; font-weight: 800; }
.g1-note { margin: 0; font-weight: 800; color: var(--c1); }

.g1-choices { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.g1-choice {
  min-width: 96px; padding: 8px 14px; border-radius: 18px; background: #fff; border: 4px solid #e6e1f2;
  display: flex; flex-direction: column; align-items: center; box-shadow: 0 5px 0 #e6e1f2;
}
.g1-choice .g1-glyph { font-family: var(--font-letter); font-size: 50px; font-weight: 700; line-height: 1.4; }
.g1-choice small { font-size: 14px; font-weight: 800; opacity: .7; }
.g1-choice.sel { border-color: var(--c4); box-shadow: 0 5px 0 var(--c4); }
.g1-choice.right, .g1-tile.right, .g1-slot.right { border-color: var(--c3) !important; box-shadow: 0 5px 0 var(--c3) !important; background: #e9fbf1; }
.g1-tile.wrong { border-color: var(--c1); box-shadow: 0 5px 0 var(--c1); }

.g1-big-letter { font-family: var(--font-letter); font-size: clamp(90px, 16vw, 130px); font-weight: 700; line-height: 1.1; color: var(--c5); cursor: pointer; }
.g1-forms { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.g1-form-card {
  background: #fff; border: 4px solid #e6e1f2; border-radius: 18px; padding: 8px 12px; min-width: 140px;
  display: flex; flex-direction: column; align-items: center; box-shadow: 0 5px 0 #e6e1f2;
}
.g1-form-glyph { font-family: var(--font-letter); font-size: 54px; font-weight: 700; line-height: 1.3; color: var(--c4); }
.g1-form-label { font-size: 14px; font-weight: 800; opacity: .7; }
.g1-form-card .g1-word { font-size: 30px; }

.g1-tiles { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); width: min(100%, 600px); }
.g1-tile {
  background: #fff; border: 4px solid #e6e1f2; border-radius: 18px; padding: 8px; box-shadow: 0 5px 0 #e6e1f2;
  display: flex; flex-direction: column; align-items: center;
}
.g1-tile.sel { border-color: var(--c4); box-shadow: 0 5px 0 var(--c4); background: #eef7ff; }
.g1-tile-word { font-family: var(--font-letter); font-size: 30px; font-weight: 700; line-height: 1.5; }

.g1-slots { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.g1-slot {
  width: 74px; height: 86px; border-radius: 16px; border: 4px dashed #c9bfe6; background: #faf8ff;
  font-family: var(--font-letter); font-size: 46px; font-weight: 700; line-height: 1;
}
.g1-slot:not(:empty) { border-style: solid; border-color: var(--c4); background: #fff; }
.g1-slot.locked { border-color: var(--c3); background: #e9fbf1; }
.g1-preview { font-family: var(--font-letter); font-size: 44px; font-weight: 700; min-height: 66px; color: var(--c5); }
.g1-bank { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.g1-letter-tile {
  width: 74px; height: 80px; border-radius: 16px; background: var(--c2); color: #fff; box-shadow: 0 5px 0 rgba(0, 0, 0, .15);
  font-family: var(--font-letter); font-size: 46px; font-weight: 700; line-height: 1;
}
.g1-slot.wide, .g1-letter-tile.wide { width: auto; min-width: 96px; padding: 0 14px; font-size: 38px; }
.g1-letter-tile.used { opacity: .2; pointer-events: none; }

.g1-footer { position: sticky; bottom: 0; display: flex; flex-direction: column; gap: 8px; padding: 10px 0 14px; }
.g1-feedback { display: none; border-radius: 16px; padding: 10px 16px; font-size: 20px; text-align: center; }
.g1-feedback.good { display: block; background: #e9fbf1; color: #1c7a4a; }
.g1-feedback.bad { display: block; background: #fff0eb; color: #b8401f; }
.g1-check {
  width: 100%; border-radius: 22px; padding: 14px; font-size: 26px; font-weight: 800; color: #fff;
  background: var(--c3); box-shadow: 0 6px 0 rgba(0, 0, 0, .18);
}
.g1-check:disabled { background: #bfb8d3; box-shadow: none; }
.g1-done .row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

@keyframes pop-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.g1-node { animation-name: g1-node-in; }
@keyframes g1-node-in { from { opacity: 0; } }

@media (max-width: 520px) {
  .g1-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g1-slot, .g1-letter-tile { width: 60px; height: 70px; font-size: 38px; }
  .g1-node { width: 260px; }
}
