:root {
  --ink: #1d2440;
  --muted: #5b647c;
  --paper: #fffdf7;
  --soft: #f4f8ff;
  --blue: #3266e3;
  --cyan: #1fb6c9;
  --green: #2ea86d;
  --yellow: #ffd36e;
  --orange: #ff9f43;
  --pink: #ff6f91;
  --purple: #7d5fff;
  --danger: #d94a4a;
  --shadow: 0 18px 45px rgba(32, 45, 74, 0.16);
  --radius: 26px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(255, 211, 110, 0.5), transparent 30rem),
    radial-gradient(circle at top right, rgba(31, 182, 201, 0.35), transparent 28rem),
    linear-gradient(180deg, #f8fbff 0%, #fffdf7 48%, #f7fbff 100%);
  min-height: 100vh;
}

button, input, select, textarea { font: inherit; }

button { cursor: pointer; }

a { color: inherit; }

.hero {
  padding: 22px clamp(16px, 4vw, 46px) 50px;
  position: relative;
  overflow: hidden;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  z-index: -1;
}

.hero::before {
  width: 220px;
  height: 220px;
  background: rgba(255, 111, 145, 0.2);
  left: -80px;
  top: 90px;
}

.hero::after {
  width: 180px;
  height: 180px;
  background: rgba(50, 102, 227, 0.16);
  right: -50px;
  top: 120px;
}

.topbar {
  max-width: 1180px;
  margin: 0 auto 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 900;
  font-size: clamp(1.08rem, 2vw, 1.35rem);
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background: white;
  box-shadow: 0 8px 20px rgba(32, 45, 74, 0.12);
}

.teacher-link,
.primary-btn,
.secondary-btn,
.close-btn,
.action-btn,
.filter-btn {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.teacher-link,
.secondary-btn,
.filter-btn {
  background: white;
  color: var(--ink);
  box-shadow: 0 8px 20px rgba(32, 45, 74, 0.1);
}

.primary-btn,
.action-btn {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  box-shadow: 0 10px 22px rgba(50, 102, 227, 0.28);
}

.teacher-link:hover,
.primary-btn:hover,
.secondary-btn:hover,
.close-btn:hover,
.action-btn:hover,
.filter-btn:hover,
.activity-card:hover {
  transform: translateY(-2px);
}

.hero-card {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(30px, 6vw, 70px);
  border-radius: 38px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255,255,255,0.78)),
    repeating-linear-gradient(45deg, rgba(50,102,227,0.06), rgba(50,102,227,0.06) 12px, transparent 12px, transparent 24px);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,0.75);
}

.hero-image-card {
  padding: 0;
  overflow: hidden;
}

.hero-banner {
  width: 100%;
  height: clamp(220px, 31.25vw, 380px);
  object-fit: cover;
  object-position: center;
  display: block;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  font-size: 0.78rem;
  font-weight: 900;
}

h1, h2, h3 { line-height: 1.06; margin: 0; }

h1 {
  max-width: 760px;
  font-size: clamp(2.45rem, 8vw, 5.6rem);
  letter-spacing: -0.06em;
}

h2 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -0.04em; }

h3 { font-size: 1.4rem; }

.hero-text {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.32rem);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px clamp(16px, 4vw, 46px) 18px;
}

.intro-section {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  align-items: end;
}

.intro-section p {
  color: var(--muted);
  max-width: 700px;
  line-height: 1.6;
}

.level-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.filter-btn.active {
  color: white;
  background: var(--ink);
}

.activity-grid {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px clamp(16px, 4vw, 46px) 50px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.activity-card {
  text-align: left;
  min-height: 230px;
  border: 0;
  border-radius: var(--radius);
  padding: 24px;
  background: white;
  color: var(--ink);
  box-shadow: 0 12px 28px rgba(32, 45, 74, 0.12);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.activity-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -55px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgba(255, 211, 110, 0.55);
}

.activity-card:nth-child(2n)::after { background: rgba(31, 182, 201, 0.26); }
.activity-card:nth-child(3n)::after { background: rgba(255, 111, 145, 0.25); }
.activity-card:nth-child(4n)::after { background: rgba(125, 95, 255, 0.18); }

.card-emoji { font-size: 2.8rem; margin-bottom: 14px; }

.card-level {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--soft);
  color: var(--blue);
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.76rem;
  font-weight: 900;
}

.activity-card p {
  color: var(--muted);
  line-height: 1.45;
  margin: 10px 0 0;
  position: relative;
  z-index: 1;
}

.lab-panel {
  max-width: 1180px;
  margin: 0 auto 60px;
  padding: clamp(16px, 4vw, 32px);
  border-radius: 34px;
  background: white;
  box-shadow: var(--shadow);
}

.lab-header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  border-bottom: 2px solid #eef3ff;
  padding-bottom: 22px;
  margin-bottom: 22px;
}

.lab-header p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 0;
}

.close-btn {
  background: #fff0f0;
  color: var(--danger);
}

.activity-stage {
  min-height: 320px;
}

.play-card {
  background: var(--soft);
  border-radius: 28px;
  padding: clamp(18px, 4vw, 32px);
  border: 2px solid #e7efff;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label {
  font-weight: 900;
}

input, select, textarea {
  width: 100%;
  border: 2px solid #dfe8fb;
  border-radius: 16px;
  padding: 13px 15px;
  color: var(--ink);
  background: white;
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(50, 102, 227, 0.12);
}

textarea { min-height: 110px; resize: vertical; }

/* Keep radio buttons and checkboxes compact.
   The general input rule above is for text fields, but it made
   multiple-choice radio buttons stretch across the whole answer card. */
input[type="radio"],
input[type="checkbox"] {
  width: auto;
  min-width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 0;
  accent-color: var(--blue);
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 18px;
}

.feedback {
  min-height: 30px;
  font-weight: 900;
}

.feedback.good { color: var(--green); }
.feedback.bad { color: var(--danger); }

.drag-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.drag-pool,
.drop-zone,
.sort-zone {
  border: 3px dashed #c9d7f6;
  border-radius: 24px;
  padding: 18px;
  min-height: 220px;
  background: rgba(255,255,255,0.74);
}

.drop-zone.active,
.sort-zone.active { border-color: var(--blue); background: #f2f6ff; }

.drop-zone h3,
.sort-zone h3,
.drag-pool h3 { margin-bottom: 12px; }

.tile,
.word-tile,
.safety-card {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px;
  padding: 12px 15px;
  border-radius: 16px;
  background: white;
  border: 2px solid #e1e9fb;
  box-shadow: 0 8px 16px rgba(32, 45, 74, 0.08);
  font-weight: 900;
  user-select: none;
}

.tile { font-size: 1.1rem; }
.tile .big { font-size: 1.8rem; }

.tile[draggable="true"],
.word-tile[draggable="true"],
.safety-card[draggable="true"] { cursor: grab; }

.tile.used,
.word-tile.used,
.safety-card.used { opacity: 0.42; pointer-events: none; }

.match-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.device-card {
  background: white;
  border-radius: 24px;
  padding: 18px;
  border: 2px solid #e1e9fb;
  text-align: center;
}

.device-emoji { font-size: 4rem; display: block; }

.device-drop {
  margin-top: 14px;
  min-height: 58px;
  border: 3px dashed #c9d7f6;
  border-radius: 18px;
  padding: 8px;
}

.copy-box {
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 18px;
  padding: 18px;
  font-size: 1.35rem;
  font-weight: 900;
  line-height: 1.5;
}

.typing-target,
.search-query {
  background: var(--ink);
  color: white;
  border-radius: 20px;
  padding: 18px;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.5;
}

.live-typing {
  margin-top: 18px;
  font-size: 1.25rem;
  line-height: 1.7;
  background: white;
  padding: 16px;
  border-radius: 18px;
  border: 2px solid #e1e9fb;
}

.correct-char { color: var(--green); font-weight: 900; }
.wrong-char { color: var(--danger); font-weight: 900; text-decoration: underline; }
.pending-char { color: #9aa4bb; }

.sort-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.safe-zone { border-color: rgba(46,168,109,0.55); }
.unsafe-zone { border-color: rgba(217,74,74,0.55); }

.search-results {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.result-card {
  border: 2px solid #e1e9fb;
  border-radius: 20px;
  background: white;
  padding: 16px;
}

/* Multiple-choice search result cards need their radio buttons in a clear,
   predictable place. Without this, the radio sits awkwardly above the title
   because the title is a block element. */
label.result-card {
  cursor: pointer;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  column-gap: 12px;
  align-items: start;
}

label.result-card > input[type="radio"] {
  grid-row: 1 / span 2;
  margin-top: 6px;
}

.result-card h3 { color: var(--blue); margin-bottom: 6px; }
.result-card p { color: var(--muted); line-height: 1.45; }

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.shortcut-row {
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 18px;
  padding: 14px;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
}

kbd {
  background: var(--ink);
  color: white;
  border-radius: 10px;
  padding: 8px 10px;
  box-shadow: inset 0 -3px rgba(255,255,255,0.16);
  font-weight: 900;
}

.student-card-preview {
  margin-top: 18px;
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  color: white;
  box-shadow: 0 12px 26px rgba(31, 182, 201, 0.25);
  max-width: 460px;
}

.student-card-preview h3 { font-size: 1.9rem; margin-bottom: 8px; }
.student-card-preview p { margin: 7px 0; font-weight: 800; }

.slide-preview {
  margin-top: 18px;
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  background: white;
  border: 7px solid #dfe8fb;
  padding: clamp(18px, 4vw, 36px);
  box-shadow: 0 12px 26px rgba(32, 45, 74, 0.12);
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: center;
}

.slide-preview.theme-blue { border-color: #9bb7ff; }
.slide-preview.theme-green { border-color: #98e2bd; }
.slide-preview.theme-pink { border-color: #ffc1d0; }
.slide-preview.theme-yellow { border-color: #ffe19b; }

.slide-preview h3 { font-size: clamp(1.8rem, 5vw, 3.6rem); }
.slide-preview ul { font-size: clamp(1rem, 2.3vw, 1.5rem); line-height: 1.55; }
.slide-picture { font-size: clamp(4rem, 14vw, 10rem); text-align: center; }

.notice {
  background: #fff8df;
  border: 2px solid #ffe39b;
  border-radius: 20px;
  padding: 14px 16px;
  margin-bottom: 18px;
  line-height: 1.5;
  font-weight: 800;
}

/* Add a little breathing space below instruction banners before the activity content. */
.notice + * {
  margin-top: 0;
}

footer {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.hidden { display: none !important; }

@media (max-width: 1000px) {
  .activity-grid { grid-template-columns: repeat(2, 1fr); }
  .intro-section { align-items: start; flex-direction: column; }
  .level-filter { justify-content: flex-start; }
}

@media (max-width: 720px) {
  .activity-grid,
  .form-grid,
  .drag-layout,
  .sort-board,
  .match-board,
  .shortcut-grid,
  .slide-preview {
    grid-template-columns: 1fr;
  }

  .slide-preview { aspect-ratio: auto; }

  .topbar { align-items: flex-start; }
  .teacher-link { padding: 10px 13px; }
  .lab-header { flex-direction: column; }
  .close-btn { align-self: flex-start; }
  .shortcut-row { grid-template-columns: 1fr; }
}


.activity-card.upper {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.98), rgba(246, 249, 255, 0.9)),
    radial-gradient(circle at top right, rgba(125,95,255,0.12), transparent 10rem);
  border-color: #dfe7ff;
}

.choice-list,
.choice-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-pill,
.password-choice,
.url-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 16px;
  padding: 12px 14px;
  font-weight: 800;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.password-choice {
  justify-content: flex-start;
}

.password-choice kbd {
  margin-left: 2px;
}

.email-window,
.browser-mock,
.source-card,
.entry-card,
.total-box,
.shop-item {
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 22px;
  padding: 18px;
}

.email-window {
  display: grid;
  gap: 14px;
  box-shadow: 0 12px 26px rgba(32, 45, 74, 0.1);
}

.email-bar,
.browser-top {
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 2px solid #eef3ff;
  color: var(--muted);
  font-weight: 900;
}

.email-bar span,
.browser-top span {
  display: inline-block;
  width: 13px;
  height: 13px;
  border-radius: 99px;
  background: #dce6fb;
}

.browser-top div {
  margin-left: 8px;
}

.mini-rules {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.mini-rules div {
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 16px;
  padding: 12px;
  font-weight: 800;
}

.url-mission {
  padding: 16px 0;
  border-bottom: 2px solid #eef3ff;
}

.url-mission:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.url-option {
  margin-top: 10px;
  overflow-wrap: anywhere;
}

code {
  background: #f4f7ff;
  padding: 3px 6px;
  border-radius: 8px;
  color: #28365f;
}

.data-layout,
.source-grid,
.shop-grid,
.folder-board {
  display: grid;
  gap: 18px;
}

.data-layout {
  grid-template-columns: 0.8fr 1.2fr;
}

.source-grid,
.shop-grid,
.folder-board {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.source-card h3,
.entry-card h3,
.shop-item h3 {
  margin-bottom: 8px;
}

.source-card p,
.shop-item p {
  color: var(--muted);
  line-height: 1.5;
}

.total-box {
  margin-top: 18px;
  font-size: 1.35rem;
  font-weight: 900;
}

.shop-item label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.shop-item input[type="number"] {
  max-width: 90px;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  margin: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: white;
  border: 2px solid #e1e9fb;
  box-shadow: 0 8px 16px rgba(32, 45, 74, 0.08);
  font-weight: 900;
  user-select: none;
  cursor: grab;
}

.file-chip.used {
  opacity: 0.52;
  pointer-events: none;
}

.folder-zone {
  border: 3px dashed #c9d7f6;
  border-radius: 24px;
  padding: 18px;
  min-height: 180px;
  background: rgba(255,255,255,0.74);
}

.folder-zone.active {
  border-color: var(--blue);
  background: #f2f6ff;
}

@media (max-width: 1000px) {
  .source-grid,
  .shop-grid,
  .folder-board,
  .mini-rules {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .data-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .choice-grid,
  .source-grid,
  .shop-grid,
  .folder-board,
  .mini-rules {
    grid-template-columns: 1fr;
  }
}

.click-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.click-object {
  min-height: 130px;
  border: 2px solid #e1e9fb;
  border-radius: 22px;
  background: white;
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(32, 45, 74, 0.08);
}

.click-object span { font-size: 3.3rem; }
.click-object small { color: var(--muted); font-weight: 800; }
.click-object.found { border-color: rgba(46,168,109,0.7); background: #f0fff7; }
.click-object.wrong-flash { border-color: rgba(217,74,74,0.7); background: #fff1f1; }

.catch-arena {
  position: relative;
  min-height: 360px;
  border: 3px dashed #c9d7f6;
  border-radius: 28px;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,211,110,0.35), transparent 9rem),
    radial-gradient(circle at 80% 70%, rgba(31,182,201,0.22), transparent 10rem),
    rgba(255,255,255,0.78);
  overflow: hidden;
}

.moving-target {
  position: absolute;
  left: 16px;
  top: 16px;
  width: 68px;
  height: 68px;
  border: 0;
  border-radius: 999px;
  background: white;
  font-size: 2.1rem;
  box-shadow: 0 12px 26px rgba(32, 45, 74, 0.18);
}

.word-bank {
  min-height: auto;
  margin-bottom: 18px;
}

.sentence-slots,
.timetable-grid,
.picture-scene,
.popup-grid,
.robot-layout {
  display: grid;
  gap: 14px;
}

.sentence-slots {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.sentence-slot,
.label-drop,
.time-slot {
  border: 3px dashed #c9d7f6;
  border-radius: 18px;
  background: rgba(255,255,255,0.78);
  min-height: 64px;
  padding: 12px;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.sentence-slot.active,
.label-drop.active,
.time-slot.active { border-color: var(--blue); background: #f2f6ff; }

.picture-scene {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.scene-object {
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 24px;
  padding: 16px;
  text-align: center;
}

.scene-object > span {
  display: block;
  font-size: 3.8rem;
  margin-bottom: 10px;
}

.timetable-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.time-slot {
  min-height: 120px;
  align-content: start;
  place-items: stretch;
  text-align: center;
}

.time-slot strong { color: var(--ink); }
.time-slot .word-tile { justify-content: center; margin: 12px 0 0; }

.scroll-box {
  max-height: 210px;
  overflow-y: auto;
  border: 2px solid #e1e9fb;
  border-radius: 22px;
  background: white;
  padding: 18px;
  line-height: 1.65;
}

.key-target {
  background: var(--ink);
  color: white;
  border-radius: 24px;
  padding: 28px;
  text-align: center;
  font-size: clamp(2rem, 7vw, 4.5rem);
  font-weight: 900;
}

.key-catcher {
  margin-top: 18px;
  text-align: center;
  font-weight: 900;
}

.fix-list {
  display: grid;
  gap: 14px;
}

.popup-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fake-popup {
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 22px;
  padding: 16px;
  box-shadow: 0 12px 24px rgba(32, 45, 74, 0.09);
}

.popup-title {
  display: inline-block;
  background: #fff0f0;
  color: var(--danger);
  border-radius: 999px;
  padding: 6px 10px;
  font-weight: 900;
  margin-bottom: 10px;
}

.robot-layout {
  grid-template-columns: 1fr 0.9fr;
  align-items: start;
}

.robot-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 24px;
  padding: 12px;
}

.robot-cell {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: #f4f8ff;
  border: 1px solid #dfe8fb;
  font-size: clamp(1.2rem, 4vw, 2.1rem);
  font-weight: 900;
}

.robot-side {
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 24px;
  padding: 18px;
}

.robot-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
}

.command-list {
  min-height: 76px;
  border: 2px solid #e1e9fb;
  border-radius: 18px;
  padding: 14px;
  line-height: 1.5;
  color: var(--muted);
  font-weight: 800;
}

@media (max-width: 1000px) {
  .click-grid,
  .picture-scene,
  .timetable-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .sentence-slots { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .robot-layout { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .click-grid,
  .picture-scene,
  .timetable-grid,
  .popup-grid,
  .sentence-slots {
    grid-template-columns: 1fr;
  }
}

/* Extra upper-primary computer skills activities */
.edit-list {
  display: grid;
  gap: 14px;
}

.select-panel {
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 22px;
  padding: clamp(18px, 4vw, 30px);
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
  line-height: 1.6;
  user-select: text;
}

.important-note p {
  font-size: 1.12rem;
  line-height: 1.7;
}

.ad-card select {
  margin-top: 8px;
}

.upload-box {
  background: white;
  border: 3px dashed #c9d7f6;
  border-radius: 26px;
  padding: 24px;
  text-align: center;
  margin-bottom: 18px;
}

.upload-icon {
  font-size: 3.5rem;
  margin-bottom: 6px;
}

.file-choice-grid,
.filetype-grid,
.window-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.file-choice {
  display: flex;
  gap: 10px;
  align-items: center;
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 18px;
  padding: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.filetype-card {
  display: grid;
  gap: 12px;
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 20px;
  padding: 18px;
}

.filetype-card kbd {
  justify-self: start;
  font-size: 1.15rem;
}

.fake-window {
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 18px;
  overflow: hidden;
  min-height: 170px;
}

.fake-window.maximized {
  border-color: var(--blue);
  box-shadow: 0 12px 26px rgba(50,102,227,0.18);
}

.fake-window.minimized .fake-window-body {
  display: none;
}

.fake-window.minimized {
  min-height: auto;
}

.fake-window.closed-window {
  opacity: 0.45;
}

.fake-window.closed-window .fake-window-body {
  display: none;
}

.fake-titlebar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  background: #f4f7ff;
  border-bottom: 2px solid #e1e9fb;
  padding: 12px 14px;
}

.window-actions {
  display: flex;
  gap: 6px;
}

.window-actions button {
  width: 32px;
  height: 30px;
  border: 0;
  border-radius: 10px;
  background: white;
  box-shadow: 0 4px 12px rgba(32, 45, 74, 0.1);
  font-weight: 900;
}

.fake-window-body {
  padding: 14px;
  color: var(--muted);
  line-height: 1.5;
}

.spreadsheet-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

.fake-sheet {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(32, 45, 74, 0.08);
}

.fake-sheet th,
.fake-sheet td {
  border: 2px solid #e1e9fb;
  padding: 10px;
  text-align: left;
}

.fake-sheet th {
  background: #f4f7ff;
  font-weight: 900;
  color: var(--ink);
}

.fake-sheet td input {
  border-radius: 10px;
  padding: 10px;
}

@media (max-width: 1000px) {
  .file-choice-grid,
  .filetype-grid,
  .window-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .file-choice-grid,
  .filetype-grid,
  .window-grid {
    grid-template-columns: 1fr;
  }
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.language-switch {
  display: inline-flex;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255,255,255,0.82);
  box-shadow: 0 8px 20px rgba(32, 45, 74, 0.1);
}

.lang-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
}

.lang-btn.active {
  background: var(--ink);
  color: white;
}

html[lang="th"] body {
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
}

html[lang="th"] .hero-text,
html[lang="th"] .activity-card p,
html[lang="th"] .lab-header p:not(.eyebrow),
html[lang="th"] .notice {
  line-height: 1.75;
}

@media (max-width: 720px) {
  .topbar-actions {
    justify-content: flex-start;
  }
}


/* Extra Kindergarten picture-first activities */
.activity-card.kg-extra {
  background:
    linear-gradient(160deg, rgba(255,255,255,0.98), rgba(255, 250, 235, 0.92)),
    radial-gradient(circle at bottom right, rgba(255, 211, 110, 0.35), transparent 8rem);
}

.kg-visual-mission {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(10px, 2vw, 22px);
  background: white;
  border: 2px solid #e1e9fb;
  border-radius: 24px;
  padding: 14px;
  margin-bottom: 18px;
  box-shadow: 0 8px 18px rgba(32, 45, 74, 0.08);
}

.kg-icon,
.kg-number {
  display: inline-grid;
  place-items: center;
  min-width: 70px;
  min-height: 70px;
  border-radius: 24px;
  background: #f4f8ff;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 900;
}

.kg-number {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple));
}

.kg-arrow {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.kg-dots {
  color: var(--blue);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: 0.15em;
}

.kg-click-arena {
  position: relative;
  min-height: 320px;
  border: 3px dashed #c9d7f6;
  border-radius: 28px;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,211,110,0.35), transparent 9rem),
    radial-gradient(circle at 80% 75%, rgba(31,182,201,0.20), transparent 11rem),
    rgba(255,255,255,0.76);
}

.kg-big-target {
  position: absolute;
  left: 30%;
  top: 30%;
  width: 120px;
  height: 120px;
  border: 0;
  border-radius: 999px;
  background: white;
  font-size: 4rem;
  box-shadow: 0 16px 34px rgba(50, 102, 227, 0.24);
  transition: transform 0.12s ease, left 0.2s ease, top 0.2s ease;
}

.kg-big-target:hover {
  transform: scale(1.08);
}

.rocket-launch-pad {
  display: grid;
  place-items: center;
  gap: 16px;
  min-height: 330px;
  border-radius: 28px;
  background:
    linear-gradient(180deg, #dff5ff 0%, #f8fbff 70%),
    white;
  border: 2px solid #e1e9fb;
  overflow: hidden;
}

.rocket {
  font-size: 4rem;
  transition: transform 0.08s linear;
}

.power-bar {
  width: min(440px, 88%);
  height: 34px;
  border-radius: 999px;
  background: white;
  border: 2px solid #dfe8fb;
  overflow: hidden;
}

.power-bar span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--yellow), var(--orange), var(--pink));
  transition: width 0.06s linear;
}

.kg-hold-button {
  width: 130px;
  height: 90px;
  border: 0;
  border-radius: 28px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  font-size: 3rem;
  box-shadow: 0 14px 26px rgba(50, 102, 227, 0.28);
}

.door-grid,
.pair-grid,
.count-click-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.door-card,
.pair-card,
.count-object {
  min-height: 125px;
  border: 2px solid #e1e9fb;
  border-radius: 26px;
  background: white;
  font-size: 4rem;
  box-shadow: 0 10px 20px rgba(32, 45, 74, 0.1);
}

.door-card.open,
.pair-card.matched,
.count-object.picked {
  background: #ecfff5;
  border-color: rgba(46,168,109,0.55);
}

.pair-card:not(.revealed):not(.matched) {
  background: linear-gradient(135deg, #f4f8ff, white);
}

.kg-sorter {
  display: grid;
  gap: 18px;
}

.kg-item-pool {
  min-height: 120px;
  border: 3px dashed #c9d7f6;
  border-radius: 24px;
  background: rgba(255,255,255,0.72);
  padding: 12px;
}

.kg-zone-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.kg-sort-zone {
  min-height: 160px;
  border-style: dashed;
  cursor: pointer;
  font: inherit;
  color: inherit;
  border: 3px dashed #c9d7f6;
  border-radius: 24px;
  background: white;
  padding: 12px;
  text-align: center;
}

.kg-sort-zone.active {
  border-color: var(--blue);
  background: #f2f6ff;
}

.kg-zone-icon {
  display: grid;
  place-items: center;
  min-height: 60px;
  border-radius: 18px;
  background: #f4f8ff;
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.kg-shape-chip {
  min-width: 72px;
  min-height: 72px;
  margin: 8px;
  border: 0;
  border-radius: 22px;
  background: white;
  font-size: 2.8rem;
  box-shadow: 0 8px 16px rgba(32, 45, 74, 0.12);
}

.kg-shape-chip.used {
  opacity: 0.28;
  pointer-events: none;
}


.kg-sort-zone.ready {
  border-color: var(--yellow);
  box-shadow: 0 0 0 5px rgba(255, 211, 110, 0.22);
}

.kg-sort-zone.wrong {
  border-color: var(--danger);
  background: #fff3f3;
  animation: sorterShake 0.35s ease;
}

.kg-shape-chip.selected {
  outline: 5px solid var(--yellow);
  transform: translateY(-4px) scale(1.06);
  box-shadow: 0 14px 26px rgba(255, 159, 67, 0.28);
}

@keyframes sorterShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.kg-shape-chip.placed {
  opacity: 1;
  min-width: 54px;
  min-height: 54px;
  font-size: 2rem;
  box-shadow: none;
}

.train-path-board {
  position: relative;
  min-height: 300px;
  border-radius: 28px;
  border: 2px solid #e1e9fb;
  background:
    radial-gradient(circle at 18% 20%, rgba(255,211,110,0.36), transparent 8rem),
    radial-gradient(circle at 80% 65%, rgba(31,182,201,0.23), transparent 10rem),
    white;
  overflow: hidden;
}

.track-line {
  position: absolute;
  left: 14%;
  right: 16%;
  top: 50%;
  border-top: 12px dotted #9bb7ff;
}

.train-piece {
  position: absolute;
  left: 9%;
  top: calc(50% - 55px);
  width: 110px;
  height: 110px;
  border: 0;
  border-radius: 28px;
  background: white;
  font-size: 4rem;
  box-shadow: 0 12px 24px rgba(32, 45, 74, 0.15);
}

.station-drop {
  position: absolute;
  right: 8%;
  top: calc(50% - 62px);
  width: 126px;
  height: 126px;
  display: grid;
  place-items: center;
  border-radius: 30px;
  border: 4px dashed #c9d7f6;
  background: #fffdf7;
  font-size: 3.2rem;
}

.station-drop.active {
  border-color: var(--green);
  background: #ecfff5;
}

.sticker-layout {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
}

.sticker-tray {
  border: 3px dashed #c9d7f6;
  border-radius: 24px;
  background: rgba(255,255,255,0.76);
  padding: 14px;
}

.sticker-chip {
  width: 70px;
  height: 70px;
  margin: 8px;
  border: 0;
  border-radius: 22px;
  background: white;
  font-size: 2.4rem;
  box-shadow: 0 8px 16px rgba(32, 45, 74, 0.12);
}

.sticker-chip.active {
  outline: 4px solid rgba(50, 102, 227, 0.35);
}

.sticker-scene {
  position: relative;
  min-height: 320px;
  border-radius: 28px;
  overflow: hidden;
  border: 2px solid #e1e9fb;
  background:
    linear-gradient(180deg, #bdeeff 0 62%, #b4ec9b 62% 100%);
}

.scene-sun,
.scene-hill,
.placed-sticker {
  position: absolute;
  font-size: 3rem;
  user-select: none;
}

.scene-sun { right: 24px; top: 18px; }
.scene-hill { left: 24px; bottom: 20px; }

.placed-sticker {
  transform: translate(-50%, -50%);
  pointer-events: none;
}

@media (max-width: 900px) {
  .door-grid,
  .pair-grid,
  .count-click-grid,
  .kg-zone-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sticker-layout {
    grid-template-columns: 1fr;
  }

  .hero-banner {
    height: clamp(190px, 31.25vw, 300px);
  }
}

@media (max-width: 560px) {
  .door-grid,
  .pair-grid,
  .count-click-grid,
  .kg-zone-row {
    grid-template-columns: 1fr;
  }

  .kg-icon,
  .kg-number {
    min-width: 58px;
    min-height: 58px;
  }

  .hero {
    padding-left: 10px;
    padding-right: 10px;
  }

  .hero-image-card {
    border-radius: 22px;
  }

  .hero-banner {
    height: auto;
    object-fit: contain;
  }
}


/* Keyboard-control games */
.keyboard-play-area {
  outline: none;
  display: grid;
  gap: 16px;
  justify-items: center;
}

.keyboard-play-area:focus {
  box-shadow: 0 0 0 5px rgba(50, 102, 227, 0.14);
  border-radius: 24px;
}

.keyboard-play-area.bump .maze-board {
  animation: bumpMaze 0.16s ease;
}

@keyframes bumpMaze {
  0%, 100% { transform: translateX(0); }
  35% { transform: translateX(-5px); }
  70% { transform: translateX(5px); }
}

.keyboard-status {
  display: flex;
  justify-content: center;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-radius: 999px;
  background: white;
  border: 2px solid #e1e9fb;
  font-weight: 900;
}

.maze-board {
  display: grid;
  gap: 7px;
  justify-content: center;
  max-width: 100%;
  overflow-x: auto;
  padding: 10px;
  border-radius: 26px;
  background: rgba(255,255,255,0.72);
  border: 2px solid #e1e9fb;
}

.maze-cell {
  width: clamp(34px, 8vw, 54px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: white;
  border: 2px solid #dfe8fb;
  font-size: clamp(1.35rem, 5vw, 2rem);
  box-shadow: 0 5px 12px rgba(32, 45, 74, 0.08);
}

.maze-cell.wall,
.maze-cell.obstacle {
  background: #eef3ff;
}

.maze-cell.goal {
  background: #fff8df;
  border-color: #ffe39b;
}

.maze-cell.player-cell {
  background: #eaf7ff;
  border-color: #8bd6ff;
  transform: scale(1.05);
}

.arrow-pad {
  display: grid;
  grid-template-columns: repeat(3, 64px);
  grid-template-rows: repeat(2, 54px);
  gap: 8px;
  justify-content: center;
}

.arrow-pad button {
  border: 0;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  font-size: 1.6rem;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(50, 102, 227, 0.23);
}

.arrow-pad button[data-dir="up"] { grid-column: 2; grid-row: 1; }
.arrow-pad button[data-dir="left"] { grid-column: 1; grid-row: 2; }
.arrow-pad button[data-dir="down"] { grid-column: 2; grid-row: 2; }
.arrow-pad button[data-dir="right"] { grid-column: 3; grid-row: 2; }

.big-arrow-display {
  width: min(280px, 70vw);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 42px;
  background: white;
  border: 4px solid #dfe8fb;
  font-size: clamp(6rem, 30vw, 12rem);
  box-shadow: 0 18px 38px rgba(32, 45, 74, 0.14);
}

@media (max-width: 560px) {
  .maze-board {
    gap: 5px;
    padding: 7px;
  }

  .arrow-pad {
    grid-template-columns: repeat(3, 56px);
    grid-template-rows: repeat(2, 50px);
  }
}


/* Lesson code and lesson builder */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.lesson-code-section {
  padding-top: 8px;
  padding-bottom: 4px;
}

.lesson-code-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  background: white;
  border: 2px solid #e7efff;
  border-radius: 30px;
  box-shadow: 0 12px 28px rgba(32, 45, 74, 0.1);
  padding: clamp(18px, 3vw, 28px);
}

.lesson-code-copy h2 {
  font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.lesson-code-copy p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.lesson-code-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.lesson-code-form input {
  width: min(220px, 48vw);
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 0.16em;
  font-size: 1.35rem;
  font-weight: 900;
}

.lesson-feedback {
  grid-column: 1 / -1;
  margin: 0;
  min-height: 24px;
  font-weight: 900;
}

.lesson-feedback.good { color: var(--green); }
.lesson-feedback.bad { color: var(--danger); }

.builder-small-link {
  grid-column: 1 / -1;
  color: var(--blue);
  font-weight: 900;
  text-decoration: none;
}

body.lesson-active .level-filter {
  display: none;
}

body.lesson-active .intro-section h2::after {
  content: " for today";
}

.builder-page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 10px clamp(16px, 4vw, 46px) 60px;
}

.builder-hero {
  background: white;
  border: 2px solid #e7efff;
  border-radius: 34px;
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 46px);
  margin-bottom: 22px;
}

.builder-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.6;
}

.builder-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 22px;
  align-items: start;
}

.builder-panel {
  background: white;
  border: 2px solid #e7efff;
  border-radius: 28px;
  box-shadow: 0 12px 28px rgba(32, 45, 74, 0.1);
  padding: clamp(18px, 3vw, 26px);
}

.builder-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0;
}

.builder-tools .filter-btn {
  box-shadow: none;
  border: 2px solid #e7efff;
}

.builder-activity-list,
.selected-list {
  display: grid;
  gap: 10px;
}

.builder-activity-item,
.selected-activity-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  background: #f7faff;
  border: 2px solid #e1e9fb;
  border-radius: 18px;
  padding: 12px;
}

.builder-activity-item.selected {
  border-color: rgba(46, 168, 109, 0.6);
  background: #f1fff7;
}

.builder-activity-title,
.selected-activity-title {
  font-weight: 900;
}

.builder-activity-desc,
.selected-activity-meta {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
  margin-top: 3px;
}

.tiny-btn {
  border: 0;
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 900;
  background: white;
  color: var(--ink);
  box-shadow: 0 6px 14px rgba(32, 45, 74, 0.1);
}

.selected-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.code-output-box {
  margin-top: 16px;
  padding: 18px;
  border-radius: 22px;
  background: var(--ink);
  color: white;
}

.lesson-code-display {
  display: inline-block;
  margin: 8px 0;
  font-size: clamp(2rem, 7vw, 4rem);
  line-height: 1;
  letter-spacing: 0.1em;
  font-weight: 900;
}

.lesson-link-output {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  border: 0;
  background: rgba(255,255,255,0.13);
  color: white;
  font-weight: 800;
}

.code-help {
  background: #fff8df;
  border: 2px solid #ffe39b;
  border-radius: 18px;
  padding: 14px 16px;
  color: var(--ink);
  line-height: 1.55;
  font-weight: 800;
}

.empty-lesson {
  padding: 18px;
  border-radius: 18px;
  background: #f7faff;
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .lesson-code-card,
  .builder-layout {
    grid-template-columns: 1fr;
  }

  .lesson-code-form {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .lesson-code-form input {
    width: 100%;
  }

  .lesson-code-form .primary-btn,
  .lesson-code-form .secondary-btn {
    flex: 1;
  }

  .builder-activity-item,
  .selected-activity-item {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .builder-activity-item .tiny-btn,
  .selected-controls {
    grid-column: 1 / -1;
  }
}

.quick-code-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: #fff8df;
  color: #7a4d00;
  border: 1px solid #ffe39b;
  font-size: 0.72rem;
  font-weight: 900;
  vertical-align: middle;
}

#lesson-code-input {
  letter-spacing: 0.12em;
  font-weight: 900;
  text-align: center;
}

/* Game rounds */
.round-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  margin-bottom: 14px;
  padding: 8px 13px;
  border-radius: 999px;
  background: #fff6d8;
  border: 2px solid #ffe08a;
  color: #6a4a00;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(32,45,74,0.08);
}

.next-round-btn.done,
.next-round-btn:disabled {
  opacity: 0.72;
  cursor: default;
  transform: none;
}

.keyboard-action-row {
  justify-content: center;
  margin-top: 14px;
}

/* Clear visual success feedback for young learners */
.play-card {
  position: relative;
}

.round-complete-card,
.game-complete-card {
  border-color: rgba(46,168,109,0.55);
  box-shadow: 0 18px 42px rgba(46,168,109,0.18);
}

.round-celebration {
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 150px;
  margin: 0 0 18px;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 211, 110, 0.75), transparent 8rem),
    radial-gradient(circle at 80% 45%, rgba(46, 168, 109, 0.35), transparent 9rem),
    linear-gradient(135deg, #ecfff5, #ffffff);
  border: 4px solid rgba(46,168,109,0.5);
  animation: celebration-pop 0.38s ease-out both;
}

.final-celebration {
  min-height: 230px;
  border: 5px solid #ffd36e;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 211, 110, 0.95), transparent 9rem),
    radial-gradient(circle at 75% 35%, rgba(255, 111, 145, 0.38), transparent 9rem),
    radial-gradient(circle at 50% 80%, rgba(31, 182, 201, 0.32), transparent 10rem),
    linear-gradient(135deg, #fff8df, #ffffff);
}

.celebration-icon {
  font-size: clamp(4.2rem, 12vw, 7.5rem);
  line-height: 1;
  filter: drop-shadow(0 10px 16px rgba(32,45,74,0.14));
  animation: celebration-bounce 0.8s ease-in-out infinite alternate;
}

.celebration-text {
  font-size: clamp(1.7rem, 6vw, 3.3rem);
  line-height: 1;
  font-weight: 1000;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.celebration-stars {
  font-size: clamp(1.6rem, 5vw, 3rem);
  line-height: 1;
}

.confetti-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.confetti-sparks span {
  position: absolute;
  font-size: clamp(1.4rem, 4vw, 2.4rem);
  animation: confetti-float 1.8s ease-in-out infinite;
}

.confetti-sparks span:nth-child(1) { left: 8%; top: 18%; animation-delay: 0s; }
.confetti-sparks span:nth-child(2) { left: 22%; top: 72%; animation-delay: 0.18s; }
.confetti-sparks span:nth-child(3) { left: 44%; top: 12%; animation-delay: 0.32s; }
.confetti-sparks span:nth-child(4) { right: 28%; top: 68%; animation-delay: 0.46s; }
.confetti-sparks span:nth-child(5) { right: 12%; top: 20%; animation-delay: 0.6s; }
.confetti-sparks span:nth-child(6) { right: 8%; bottom: 12%; animation-delay: 0.76s; }

.feedback.good {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: #ecfff5;
  border: 2px solid rgba(46,168,109,0.45);
  font-size: clamp(1.05rem, 3vw, 1.35rem);
}

.feedback.good::before {
  content: "✅";
  font-size: 1.4em;
}

.activity-card.activity-complete {
  outline: 6px solid rgba(46,168,109,0.38);
  border: 3px solid rgba(46,168,109,0.75);
  background:
    linear-gradient(160deg, rgba(236,255,245,0.98), rgba(255,255,255,0.95)),
    radial-gradient(circle at bottom right, rgba(46,168,109,0.28), transparent 8rem);
}

.activity-card.activity-complete::before {
  content: "🏆 DONE";
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #ecfff5;
  color: #146d43;
  border: 2px solid rgba(46,168,109,0.6);
  font-size: 0.9rem;
  font-weight: 1000;
  box-shadow: 0 8px 16px rgba(32,45,74,0.12);
}

.zone-size-icon {
  display: inline-grid;
  place-items: center;
  line-height: 1;
}

.zone-size-icon.zone-big {
  font-size: 2.9rem;
  transform: scale(1.15);
}

.zone-size-icon.zone-small {
  font-size: 1.7rem;
  transform: translateY(6px);
}

@keyframes celebration-pop {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes celebration-bounce {
  from { transform: translateY(0) rotate(-2deg); }
  to { transform: translateY(-8px) rotate(2deg); }
}

@keyframes confetti-float {
  0%, 100% { transform: translateY(0) rotate(0deg) scale(1); }
  50% { transform: translateY(-12px) rotate(12deg) scale(1.12); }
}

@media (max-width: 720px) {
  .round-celebration { min-height: 130px; }
  .final-celebration { min-height: 190px; }
  .activity-card.activity-complete::before {
    left: 14px;
    bottom: 14px;
  }
}

.kg-shape-chip[data-kind="big"]:not(.placed) {
  min-width: 92px;
  min-height: 92px;
  font-size: 3.6rem;
}

.kg-shape-chip[data-kind="small"]:not(.placed) {
  min-width: 58px;
  min-height: 58px;
  font-size: 2rem;
}

.feedback.bad {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: #fff0f0;
  border: 2px solid rgba(217,74,74,0.42);
  font-size: clamp(1.05rem, 3vw, 1.25rem);
}

.feedback.bad::before {
  content: "↩️";
  font-size: 1.3em;
}

/* Put success messages in the activity/instruction box, not squeezed under the round badge. */
.success-celebration-target {
  min-height: clamp(240px, 34vw, 390px) !important;
  display: grid !important;
  place-items: center !important;
  padding: clamp(12px, 2vw, 22px) !important;
  border: 4px solid rgba(46,168,109,0.55) !important;
  border-radius: 30px !important;
  background:
    radial-gradient(circle at 18% 30%, rgba(255, 211, 110, 0.45), transparent 10rem),
    radial-gradient(circle at 78% 58%, rgba(31, 182, 201, 0.22), transparent 11rem),
    linear-gradient(135deg, #f2fff8, #ffffff) !important;
  box-shadow: 0 18px 38px rgba(46,168,109,0.18) !important;
  margin-bottom: 18px !important;
  width: 100%;
}

.final-success-celebration-target {
  min-height: clamp(300px, 40vw, 480px) !important;
  border-color: #ffd36e !important;
  background:
    radial-gradient(circle at 20% 25%, rgba(255, 211, 110, 0.72), transparent 10rem),
    radial-gradient(circle at 72% 35%, rgba(255, 111, 145, 0.32), transparent 12rem),
    radial-gradient(circle at 50% 80%, rgba(31, 182, 201, 0.26), transparent 12rem),
    linear-gradient(135deg, #fff8df, #ffffff) !important;
  box-shadow: 0 22px 48px rgba(255, 159, 67, 0.22) !important;
}

.success-celebration-target .round-celebration {
  width: 100%;
  min-height: 100%;
  margin: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.success-celebration-target .celebration-icon {
  font-size: clamp(5.5rem, 16vw, 10rem);
}

.success-celebration-target .celebration-text {
  font-size: clamp(2.6rem, 9vw, 5.6rem);
}

.success-celebration-target .celebration-stars {
  font-size: clamp(2rem, 6vw, 4.2rem);
}

.keyboard-celebration-area .action-row {
  margin-top: 8px;
}

@media (max-width: 720px) {
  .success-celebration-target {
    min-height: 230px !important;
  }

  .final-success-celebration-target {
    min-height: 280px !important;
  }
}


/* Shared-computer and Kindergarten-friendly round feedback updates */
.round-feedback-zone {
  margin: 14px 0 10px;
  width: 100%;
}

.round-feedback-zone .round-celebration {
  min-height: 96px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 22px;
  border-width: 3px;
  gap: 3px;
}

.round-feedback-zone.final-feedback-zone .round-celebration {
  min-height: 118px;
  border-width: 4px;
}

.round-feedback-zone .celebration-icon {
  font-size: clamp(2.4rem, 6vw, 4.1rem);
}

.round-feedback-zone .celebration-text {
  font-size: clamp(1.5rem, 4.2vw, 2.7rem);
}

.round-feedback-zone .celebration-stars {
  font-size: clamp(1.1rem, 3vw, 1.85rem);
}

.round-feedback-zone .confetti-sparks span {
  font-size: clamp(1rem, 2.6vw, 1.75rem);
}

.next-round-btn {
  font-size: clamp(1.05rem, 3vw, 1.45rem);
  padding: 14px 22px;
  box-shadow: 0 10px 22px rgba(32,45,74,0.14);
}

.rocket-launch-pad {
  min-height: 260px;
}

.rocket-launch-pad .rocket {
  justify-self: start;
  margin-left: clamp(18px, 7vw, 90px);
}

@media (max-width: 720px) {
  .round-feedback-zone .round-celebration {
    min-height: 82px;
    padding: 8px 10px;
  }
  .round-feedback-zone.final-feedback-zone .round-celebration {
    min-height: 96px;
  }
  .rocket-launch-pad {
    min-height: 230px;
  }
}


/* CSS-drawn shapes for Shape Sorter Jr. Avoid emoji squares/triangles that display badly on older school computers. */
.shape-mission-row {
  display: inline-flex;
  align-items: center;
  gap: 16px;
}

.shape-symbol {
  --shape-colour: #3266e3;
  display: inline-block;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  filter: drop-shadow(0 2px 0 rgba(0,0,0,0.95));
}

.shape-circle {
  border-radius: 999px;
  background: var(--shape-colour);
  border: 4px solid #071128;
}

.shape-square {
  background: var(--shape-colour);
  border: 4px solid #071128;
}

.shape-triangle {
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 56px solid var(--shape-colour);
  background: transparent;
  filter: drop-shadow(0 4px 0 #071128) drop-shadow(3px 0 0 #071128) drop-shadow(-3px 0 0 #071128);
}

.shape-red { --shape-colour: #ff3333; }
.shape-blue { --shape-colour: #168be0; }
.shape-green { --shape-colour: #16ce1b; }
.shape-yellow { --shape-colour: #ffe326; }
.shape-orange { --shape-colour: #ff6b2c; }
.shape-purple { --shape-colour: #8a5cff; }
.shape-pink { --shape-colour: #ff9ebe; }

.kg-shape-chip .shape-symbol,
.kg-zone-icon .shape-symbol {
  pointer-events: none;
}

.kg-zone-icon .shape-symbol {
  width: 42px;
  height: 42px;
}

.kg-zone-icon .shape-triangle {
  width: 0;
  height: 0;
  border-left-width: 25px;
  border-right-width: 25px;
  border-bottom-width: 46px;
}
