:root {
  --bg-a: #f7f2e7;
  --bg-b: #d8efe8;
  --ink: #1b2426;
  --muted: #56706d;
  --card: rgba(255, 252, 244, 0.9);
  --line: #c6d9d2;
  --accent: #0f766e;
  --accent-strong: #0a5f58;
  --accent-soft: #d8f3ef;
  --accent-warm: #ffb35c;
  --alert: #a02842;
  --ok: #166534;
  --shadow: 0 18px 40px rgba(27, 43, 41, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Century Gothic", "Trebuchet MS", sans-serif;
  color: var(--ink);
  background: linear-gradient(135deg, var(--bg-a), var(--bg-b));
  overflow-x: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 0.9rem;
  padding: 0.8rem 1rem;
  background: var(--accent);
  color: white;
  font-weight: 700;
  cursor: pointer;
  transition: transform 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

button:hover:not(:disabled),
button:focus-visible:not(:disabled) {
  transform: translateY(-1px);
  background: var(--accent-strong);
  box-shadow: 0 10px 18px rgba(15, 118, 110, 0.18);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.8rem;
  padding: 0.8rem 0.9rem;
  background: rgba(255, 255, 255, 0.72);
}

.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: none;
}

.ghost:hover:not(:disabled),
.ghost:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.8);
  box-shadow: none;
}

.bg-circle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.bg-circle-a {
  width: 36rem;
  height: 36rem;
  top: -12rem;
  left: -10rem;
  background: radial-gradient(circle, rgba(255, 186, 112, 0.45), transparent 68%);
}

.bg-circle-b {
  width: 30rem;
  height: 30rem;
  right: -8rem;
  bottom: -8rem;
  background: radial-gradient(circle, rgba(103, 209, 191, 0.4), transparent 70%);
}

.app-shell {
  width: min(76rem, 96vw);
  margin: 1.2rem auto 1.8rem;
  position: relative;
  z-index: 1;
}

.site-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 0 0 1.2rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.screen {
  display: none;
  animation: lift 220ms ease;
}

.screen.active {
  display: block;
}

@keyframes lift {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  background: var(--card);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(198, 217, 210, 0.9);
  border-radius: 1.4rem;
  box-shadow: var(--shadow);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.field-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 0.86rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 0.95;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.45rem;
  margin-bottom: 0.2rem;
}

h3 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.8rem;
}

.hero {
  padding: 1.6rem 1.8rem;
  margin-bottom: 1rem;
  background:
    radial-gradient(circle at top right, rgba(255, 179, 92, 0.18), transparent 30%),
    linear-gradient(135deg, rgba(255, 252, 244, 0.94), rgba(235, 250, 246, 0.92));
}

.home-layout {
  display: grid;
  grid-template-columns: 19rem 1fr;
  gap: 1rem;
}

.launch-layout {
  display: grid;
  gap: 1rem;
}

.launch-panel {
  padding: 1.2rem;
}

.home-select-btn {
  align-self: start;
  justify-self: start;
  margin-top: 0.25rem;
}

.launch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: 1rem;
}

.launch-card {
  display: grid;
  gap: 0.45rem;
  min-height: 13rem;
  padding: 1.3rem;
  text-align: left;
  border-radius: 1.4rem;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.28), transparent 30%),
    linear-gradient(145deg, #0f766e, #13958c);
  box-shadow: var(--shadow);
}

.launch-card strong {
  font-size: 1.55rem;
}

.launch-card span:last-child {
  font-weight: 500;
  line-height: 1.45;
}

.launch-card.warm {
  background: linear-gradient(145deg, #ff9c3f, #ffb85f);
  color: #36240c;
}

.launch-card.cool {
  background: linear-gradient(145deg, #2d6cdf, #58a6ff);
}

.launch-card.lilac {
  background: linear-gradient(145deg, #7b61c9, #a287eb);
}

.launch-card.rose {
  background: linear-gradient(145deg, #e56b6f, #ff9f7b);
}

.launch-card.sand {
  background: linear-gradient(145deg, #b98145, #e2b36e);
  color: #2d2214;
}

.launch-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.82rem;
  opacity: 0.88;
}

.control-card,
.concept-card,
.matching-header {
  padding: 1.2rem;
}

.quick-actions,
.cta-group {
  display: grid;
  gap: 0.65rem;
}

.quick-actions {
  grid-template-columns: 1fr 1fr;
}

.selection-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 179, 92, 0.16));
}

.selection-chip strong {
  font-size: 1.9rem;
  line-height: 1;
}

.cta-btn {
  padding: 1rem 1.1rem;
  font-size: 1.04rem;
}

.cta-btn.secondary {
  background: linear-gradient(135deg, #ff9f43, #ffbf69);
  color: #2d2214;
}

.cta-btn.secondary:hover:not(:disabled),
.cta-btn.secondary:focus-visible:not(:disabled) {
  background: linear-gradient(135deg, #f28b24, #ffb550);
}

.concept-card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  margin-bottom: 1rem;
}

.visible-count {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.concept-grid {
  display: grid;
  gap: 1rem;
  max-height: 68vh;
  overflow: auto;
  padding-right: 0.2rem;
}

.topic-group {
  display: grid;
  gap: 0.7rem;
}

.topic-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
  padding: 0.2rem 0.1rem 0;
}

.topic-title {
  margin: 0;
  font-size: 1.02rem;
  color: var(--accent-strong);
  letter-spacing: 0.06em;
}

.topic-count {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 0.85rem;
}

.concept-item {
  position: relative;
  padding: 1rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(198, 217, 210, 0.9);
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background-color 140ms ease;
}

.concept-item:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 118, 110, 0.45);
}

.concept-item.selected {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(255, 255, 255, 0.92));
  border-color: rgba(15, 118, 110, 0.6);
}

.concept-item input {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  width: 1.1rem;
  height: 1.1rem;
}

.concept-term {
  display: block;
  font-size: 1.08rem;
  font-weight: 800;
  padding-right: 1.8rem;
  margin-bottom: 0.55rem;
}

.concept-definition {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.message {
  min-height: 1.3rem;
  margin: 0.2rem 0 0;
  font-weight: 700;
}

.message.error {
  color: var(--alert);
}

.message.success {
  color: var(--ok);
}

#teacher-screen,
#pyramid-screen,
#matching-screen,
#hangman-screen,
#peripherals-screen {
  min-height: min(88vh, 760px);
  position: relative;
  padding-top: 4.4rem;
}

#fill-screen {
  min-height: min(88vh, 760px);
  position: relative;
  padding-top: 4.4rem;
}

#crossword-screen {
  min-height: min(88vh, 760px);
  position: relative;
  padding-top: 4.4rem;
}

.back-btn {
  position: absolute;
  top: 1rem;
  left: 0;
  z-index: 2;
}

.practice-top {
  display: flex;
  justify-content: center;
  min-height: 6rem;
}

.practice-center {
  min-height: min(72vh, 560px);
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
  gap: 1rem;
}

.start-btn,
.next-btn {
  min-width: 12rem;
  position: absolute;
  left: 50%;
  bottom: max(1rem, 8vh);
  transform: translateX(-50%);
}

.start-btn:hover:not(:disabled),
.start-btn:focus-visible:not(:disabled),
.next-btn:hover:not(:disabled),
.next-btn:focus-visible:not(:disabled) {
  transform: translateX(-50%) translateY(-1px);
}

#word-display {
  font-size: clamp(2.4rem, 11vw, 6rem);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0.03em;
  max-width: 92%;
  min-height: 1.25em;
}

.matching-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  margin-bottom: 1rem;
}

.matching-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.hangman-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 1rem;
}

.fill-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(16rem, 0.9fr);
  gap: 1rem;
  align-items: start;
}

.fill-list {
  display: grid;
  gap: 1rem;
}

.fill-item {
  padding: 1.3rem;
}

.fill-term {
  margin: 0 0 0.8rem;
  color: var(--accent-strong);
  font-size: 1.55rem;
  letter-spacing: 0.04em;
  text-transform: none;
}

.fill-definition {
  margin: 0;
  font-size: 1.48rem;
  line-height: 1.9;
}

.fill-blank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  margin: 0 0.18rem;
  min-width: calc(var(--blank-ch, 5) * 0.78ch + 1.6rem);
  min-height: 3.1rem;
  padding: 0.35rem 0.8rem;
  border-radius: 0.9rem;
  border: 2px dashed rgba(15, 118, 110, 0.42);
  background: rgba(216, 243, 239, 0.72);
  color: var(--ink);
  font-size: 1.22rem;
  font-weight: 800;
  box-shadow: none;
}

.fill-blank::before {
  content: "";
  display: block;
  width: 100%;
  border-bottom: 3px solid rgba(15, 118, 110, 0.35);
}

.fill-blank.filled::before {
  display: none;
}

.fill-blank.filled {
  border-style: solid;
  background: rgba(255, 255, 255, 0.98);
}

.fill-blank.correct {
  background: linear-gradient(135deg, rgba(42, 157, 143, 0.22), rgba(226, 255, 245, 0.92));
  border-color: rgba(22, 101, 52, 0.65);
  color: #1b2426;
}

.fill-blank.wrong {
  background: linear-gradient(135deg, rgba(255, 224, 214, 0.96), rgba(255, 245, 242, 0.96));
  border-color: rgba(160, 40, 66, 0.45);
  color: #7a2031;
}

.fill-blank.drag-over {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(15, 118, 110, 0.8);
}

.fill-bank-panel {
  padding: 1.25rem;
  position: sticky;
  top: 4.8rem;
}

.fill-word-bank {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.7rem;
  margin-top: 1rem;
  min-height: 4rem;
}

.fill-word {
  background: linear-gradient(135deg, #f8fffe, #e7f5f2);
  color: var(--ink);
  border: 1px solid rgba(15, 118, 110, 0.22);
  box-shadow: 0 12px 20px rgba(21, 46, 44, 0.08);
  padding: 0.9rem 1.1rem;
  font-size: 1.18rem;
  width: 100%;
  text-align: left;
}

.fill-word:hover:not(:disabled),
.fill-word:focus-visible:not(:disabled) {
  background: linear-gradient(135deg, #14907f, #0f766e);
  color: #ffffff;
}

.fill-word.selected {
  background: linear-gradient(135deg, #14907f, #0f766e);
  color: #ffffff;
  transform: translateY(-1px);
}

.crossword-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
  align-items: start;
}

.crossword-board-panel {
  padding: 0.9rem;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
}

.crossword-board {
  display: grid;
  gap: 0.18rem;
  justify-content: start;
}

.crossword-board-row {
  display: grid;
  grid-template-columns: repeat(var(--crossword-cols, 8), 2.35rem);
  gap: 0.18rem;
}

.crossword-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.8rem;
}

.crossword-clue-card {
  padding: 0.75rem 0.85rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(198, 217, 210, 0.9);
  display: grid;
  gap: 0.45rem;
}

.crossword-clue-card.correct {
  border-color: rgba(15, 118, 110, 0.45);
  background: linear-gradient(135deg, rgba(216, 243, 239, 0.72), rgba(255, 252, 244, 0.95));
}

.crossword-row-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
}

.crossword-row-number {
  font-size: 1.02rem;
  color: var(--accent-strong);
}

.crossword-clue {
  margin: 0;
  font-size: 0.98rem;
  line-height: 1.35;
}

.crossword-input {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.65rem 0.75rem;
}

.crossword-answer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.crossword-help-btn {
  white-space: nowrap;
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
}

.crossword-cell {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.2rem;
  border: 1px solid #293133;
  background: #ffffff;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08rem;
  font-weight: 800;
  text-transform: uppercase;
}

.crossword-cell.block {
  background: #1b2426;
  border-color: #1b2426;
}

.crossword-cell.solution-cell {
  background: #fff1d6;
}

.crossword-cell.filled {
  color: var(--ink);
}

.crossword-cell.correct {
  background: #d9f3ee;
  border-color: #0f766e;
  color: #1b2426;
}

.crossword-cell-number {
  position: absolute;
  top: 0.08rem;
  left: 0.14rem;
  font-size: 0.5rem;
  font-weight: 900;
  line-height: 1;
  color: #1b2426;
}

.crossword-cell-letter {
  display: block;
  line-height: 1;
  margin-top: 0.12rem;
}

.crossword-cell.correct .crossword-cell-number {
  color: #ffffff;
}

.crossword-side {
  padding: 0.95rem;
  display: grid;
  gap: 0.7rem;
}

.crossword-solution {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(2.25rem, 2.25rem));
  gap: 0.35rem;
  margin-top: 0.1rem;
  justify-content: start;
}

.crossword-solution-cell {
  min-height: 2.45rem;
  border-radius: 0.7rem;
  border: 2px solid rgba(185, 129, 69, 0.35);
  background: linear-gradient(135deg, rgba(255, 244, 224, 0.95), rgba(255, 255, 255, 0.96));
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 900;
}

.peripheral-board {
  min-height: min(72vh, 640px);
  padding: 1.5rem;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at top right, rgba(162, 135, 235, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(255, 252, 244, 0.95), rgba(240, 242, 255, 0.95));
}

.peripheral-image {
  display: block;
  max-width: min(100%, 52rem);
  max-height: min(62vh, 34rem);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 1.25rem;
  box-shadow: 0 20px 34px rgba(37, 43, 81, 0.14);
  background: rgba(255, 255, 255, 0.9);
  padding: 1rem;
}

.matching-column {
  padding: 1.1rem;
  border-radius: 1.4rem;
  background: rgba(255, 252, 244, 0.82);
  border: 1px solid rgba(198, 217, 210, 0.9);
  box-shadow: var(--shadow);
}

.matching-column-grid {
  display: grid;
  gap: 0.8rem;
}

.match-card {
  position: relative;
  min-height: 5.5rem;
  padding: 1rem 1rem 1rem 1.1rem;
  border-radius: 1.15rem;
  border: 1px solid transparent;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(242, 249, 247, 0.92));
  color: var(--ink);
  text-align: left;
  font-size: 1.56rem;
  line-height: 1.56;
  box-shadow: 0 12px 24px rgba(21, 46, 44, 0.08);
}

.match-card:hover:not(:disabled),
.match-card:focus-visible:not(:disabled) {
  background: linear-gradient(135deg, #14907f, #0f766e);
  color: #ffffff;
  box-shadow: 0 14px 24px rgba(21, 46, 44, 0.14);
}

.match-card.term-card {
  border-color: rgba(15, 118, 110, 0.18);
}

.match-card.definition-card {
  border-color: rgba(255, 179, 92, 0.28);
}

.match-card.selected {
  outline: 3px solid rgba(15, 118, 110, 0.28);
  background: linear-gradient(135deg, #14907f, #0f766e);
  color: #ffffff;
  transform: translateY(-2px);
}

.match-card.matched {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(185, 247, 219, 0.48));
  border-color: rgba(15, 118, 110, 0.45);
  color: #10413c;
}

.match-card.wrong {
  background: linear-gradient(135deg, rgba(255, 221, 226, 0.95), rgba(255, 246, 246, 0.92));
  border-color: rgba(160, 40, 66, 0.4);
}

.matching-result {
  min-height: 1.5rem;
  margin-top: 1rem;
  text-align: center;
  font-size: 1.04rem;
  font-weight: 800;
  color: var(--accent-strong);
}

.hangman-board,
.hangman-controls {
  padding: 1.25rem;
}

.hangman-board {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.hangman-stage {
  min-height: 16rem;
  display: grid;
  place-items: center;
  border-radius: 1.2rem;
  background: linear-gradient(145deg, rgba(225, 244, 240, 0.95), rgba(255, 248, 235, 0.95));
}

.flower-stage {
  width: min(18rem, 90%);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

.flower-wrap {
  position: relative;
  width: 12rem;
  height: 12rem;
}

.flower-petal {
  position: absolute;
  width: 3.25rem;
  height: 4.8rem;
  left: 50%;
  top: 50%;
  margin-left: -1.625rem;
  margin-top: -5.3rem;
  border-radius: 1.8rem 1.8rem 1.1rem 1.1rem;
  background: linear-gradient(180deg, #ff9dc1, #ff6fa3);
  transform-origin: center 5.3rem;
  box-shadow: inset 0 0.35rem 0.6rem rgba(255, 255, 255, 0.35);
  transition: opacity 160ms ease, transform 160ms ease, filter 160ms ease;
}

.flower-petal.lost {
  opacity: 0.18;
  filter: grayscale(0.7);
}

.petal-1 { transform: rotate(0deg); }
.petal-2 { transform: rotate(45deg); }
.petal-3 { transform: rotate(90deg); }
.petal-4 { transform: rotate(135deg); }
.petal-5 { transform: rotate(180deg); }
.petal-6 { transform: rotate(225deg); }
.petal-7 { transform: rotate(270deg); }
.petal-8 { transform: rotate(315deg); }

.flower-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3.2rem;
  height: 3.2rem;
  margin-left: -1.6rem;
  margin-top: -1.6rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #ffe999, #ffca3a 70%);
  border: 0.22rem solid rgba(223, 156, 30, 0.55);
  z-index: 2;
}

.flower-stem {
  position: absolute;
  left: 50%;
  top: calc(50% + 1.4rem);
  width: 0.5rem;
  height: 7rem;
  margin-left: -0.25rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #4baf66, #2f8f47);
  z-index: 0;
}

.flower-leaf {
  position: absolute;
  top: calc(50% + 4.5rem);
  width: 2.8rem;
  height: 1.6rem;
  background: linear-gradient(180deg, #67c77c, #3c9f55);
  border-radius: 100% 0 100% 0;
  z-index: 1;
}

.leaf-left {
  left: 50%;
  margin-left: -2.8rem;
  transform: rotate(-30deg);
}

.leaf-right {
  left: 50%;
  margin-left: 0.1rem;
  transform: rotate(30deg) scaleX(-1);
}

.hangman-word {
  display: grid;
  gap: 0.7rem;
  justify-items: center;
}

.hangman-line {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  justify-content: center;
  max-width: 100%;
}

.hangman-line.small .hangman-char {
  min-width: 2.2rem;
  font-size: 1.6rem;
}

.hangman-line.compact .hangman-char {
  min-width: 1.75rem;
  font-size: 1.3rem;
}

.hangman-char {
  min-width: 2.7rem;
  padding-bottom: 0.3rem;
  border-bottom: 3px solid rgba(15, 118, 110, 0.5);
  text-align: center;
  font-size: 2.2rem;
  font-weight: 800;
}

.hangman-char.fixed {
  border-bottom-color: transparent;
}

.hangman-char.empty {
  color: rgba(27, 36, 38, 0.45);
}

.hangman-keyboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(3.2rem, 1fr));
  gap: 0.55rem;
}

.hangman-key {
  padding: 1.1rem 0.45rem;
  border-radius: 0.8rem;
  min-height: 3.6rem;
  font-size: 1.5rem;
  font-weight: 800;
}

.hangman-key.correct {
  background: linear-gradient(145deg, #1e8f6c, #20aa7d);
}

.hangman-key.wrong {
  background: linear-gradient(145deg, #d2566c, #ee7f8f);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 27, 31, 0.45);
  backdrop-filter: blur(4px);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(52rem, 94vw);
  max-height: 86vh;
  padding: 1.2rem;
  display: grid;
  gap: 1rem;
}

.modal-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: start;
}

.modal-list {
  max-height: 60vh;
  overflow: auto;
  display: grid;
  gap: 1rem;
  padding-right: 0.15rem;
}

.modal-pick-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.65rem;
}

.modal-pick {
  text-align: left;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.88);
  color: var(--ink);
  border: 1px solid rgba(198, 217, 210, 0.9);
  box-shadow: none;
}

.modal-pick:hover:not(:disabled),
.modal-pick:focus-visible:not(:disabled) {
  background: rgba(216, 243, 239, 0.95);
  color: var(--ink);
}

@media (max-width: 980px) {
  .home-layout,
  .matching-layout,
  .hangman-layout,
  .crossword-layout,
  .fill-layout,
  .launch-grid {
    grid-template-columns: 1fr;
  }

  .concept-grid {
    max-height: none;
  }

  .crossword-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(96vw, 40rem);
  }

  .hero,
  .control-card,
  .concept-card,
  .matching-header,
  .matching-column,
  .fill-item,
  .fill-bank-panel,
  .crossword-board-panel,
  .crossword-clue-card,
  .crossword-side {
    padding: 1rem;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .concept-grid {
    grid-template-columns: 1fr;
  }

  .concept-card-head,
  .matching-header,
  .modal-head {
    align-items: start;
    flex-direction: column;
  }

  .fill-definition {
    font-size: 1.2rem;
    line-height: 1.75;
  }

  .fill-blank {
    min-height: 2.7rem;
    font-size: 1.02rem;
  }

  .fill-bank-panel {
    position: static;
  }

  .crossword-board-row {
    grid-template-columns: repeat(var(--crossword-cols, 8), 2.2rem);
  }

  .crossword-cell {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.05rem;
  }

  .back-btn {
    top: 0.4rem;
  }

  .start-btn,
  .next-btn {
    bottom: 1rem;
  }
}
