:root {
  --bg: #f7f4ff;
  --panel: #ffffff;
  --panel-soft: #f2ecff;
  --text: #2d2350;
  --muted: #6d6490;
  --primary: #7c5cff;
  --primary-dark: #5c3ef0;
  --success: #2bb673;
  --danger: #ff6b7a;
  --warm: #ffb84d;
  --shadow: 0 20px 45px rgba(91, 64, 201, 0.12);
  --radius-lg: 28px;
  --radius-md: 20px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Nunito", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #fff5d9 0, transparent 30%),
    radial-gradient(circle at top right, #e5f7ff 0, transparent 28%),
    linear-gradient(180deg, #f8f6ff 0%, #f3efff 100%);
}

button,
textarea {
  font: inherit;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  background: #f3efff;
  padding: 2px 6px;
  border-radius: 8px;
}

.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.hero-card,
.card {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(124, 92, 255, 0.1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.hero-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 28px;
  margin-bottom: 22px;
}

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

h1,
h2 {
  margin: 0;
  font-family: "Baloo 2", cursive;
  line-height: 1;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4rem);
}

h2 {
  font-size: 1.75rem;
}

.subtitle,
.status-text,
.missed-box,
.card-header span,
.meta-label,
.helper-strip span,
.progress-box span,
.parent-copy,
.mascot-copy,
.tiny-note,
.lives-panel span {
  color: var(--muted);
}

.subtitle {
  max-width: 560px;
  margin: 10px 0 0;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-end;
}


.primary-btn,
.segment-btn {
  border: 0;
  border-radius: 999px;
  padding: 14px 22px;
  font-weight: 800;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(180deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  box-shadow: 0 10px 25px rgba(92, 62, 240, 0.28);
}

.segment-btn {
  background: #fff7e7;
  color: #9a6500;
}

.primary-btn:hover,
.segment-btn:hover {
  transform: translateY(-1px);
}

.segment-btn.active {
  background: var(--primary);
  color: #fff;
}


.game-grid,
.progress-grid,
.three-col-grid,
.two-col-grid {
  display: grid;
  gap: 22px;
}

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

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

.three-col-grid {
  grid-template-columns: 1.1fr 1.2fr 1fr;
  margin-top: 22px;
}

.two-col-grid {
  grid-template-columns: 1.2fr 1fr;
  margin-top: 22px;
}

.card {
  padding: 24px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
}

.drawing-wrap {
  position: relative;
  background: linear-gradient(180deg, #fcfbff 0%, #f6f0ff 100%);
  border-radius: 24px;
  padding: 12px;
  overflow: hidden;
}

.sky-decor {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.cloud,
.sun {
  position: absolute;
  border-radius: 999px;
}

.cloud {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 18px 6px 0 rgba(255, 255, 255, 0.95), 36px 0 0 rgba(255, 255, 255, 0.95);
  width: 34px;
  height: 20px;
}

.cloud-one {
  top: 24px;
  left: 24px;
}

.cloud-two {
  top: 54px;
  right: 82px;
}

.sun {
  width: 42px;
  height: 42px;
  background: #ffe27a;
  top: 24px;
  right: 24px;
  box-shadow: 0 0 0 10px rgba(255, 226, 122, 0.2);
}

.hangman-svg {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
}

.gallows,
.body-part {
  stroke: #3f316f;
  stroke-width: 7;
  stroke-linecap: round;
}

.body-part {
  transition: opacity 180ms ease;
}

.hidden {
  opacity: 0;
}

.status-text {
  text-align: center;
  font-weight: 700;
  margin: 16px 0 0;
}

.helper-strip,
.meta-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.meta-chip-wide {
  grid-column: 1 / -1;
}

.helper-strip {
  margin-top: 16px;
}

.helper-strip div,
.meta-chip,
.progress-box,
.lives-panel,
.mascot-wrap,
.segment-control,
.sticker-shelf {
  background: #f8f5ff;
  border-radius: 18px;
  padding: 14px 16px;
}

.helper-strip strong,
.meta-chip strong,
.progress-box strong,
.mascot-wrap strong {
  display: block;
  font-size: 1.15rem;
}

.lives-panel {
  margin-top: 14px;
}

.lives-display {
  margin-top: 8px;
  font-size: 1.5rem;
  letter-spacing: 0.18em;
}

.word-display {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 74px;
  align-items: center;
  margin: 18px 0;
}

.letter-slot {
  width: 54px;
  height: 64px;
  border-radius: 18px;
  background: #f8f5ff;
  border: 3px solid #e7dcff;
  display: grid;
  place-items: center;
  font-size: 2rem;
  font-weight: 800;
  text-transform: uppercase;
}


.missed-box {
  background: #fff7f8;
  border: 2px dashed #ffc3ca;
  border-radius: 20px;
  padding: 16px;
  font-weight: 700;
}

.wrong-letters {
  margin-top: 8px;
  color: var(--danger);
  font-size: 1.1rem;
  letter-spacing: 0.08em;
}

.segment-control {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mascot-wrap {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.mascot-face {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, #fff0b0 0%, #ffd977 100%);
  font-size: 2rem;
}

.sticker-shelf {
  min-height: 88px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-content: flex-start;
}

.sticker {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #fff;
  font-size: 1.5rem;
  box-shadow: 0 8px 18px rgba(91, 64, 201, 0.12);
}


.key-btn {
  min-height: 52px;
  border-radius: 16px;
  border: 0;
  background: #f4f0ff;
  color: var(--text);
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 120ms ease, background 120ms ease, opacity 120ms ease;
}

.key-btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.key-btn.correct {
  background: rgba(43, 182, 115, 0.18);
  color: #17794b;
}

.key-btn.wrong {
  background: rgba(255, 107, 122, 0.2);
  color: #c24155;
}

.key-btn:disabled {
  cursor: default;
  opacity: 0.8;
}

.custom-words-input {
  width: 100%;
  min-height: 180px;
  border: 2px solid #e5dcff;
  border-radius: 20px;
  background: #fbfaff;
  padding: 16px;
  resize: vertical;
}

.parent-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

.result-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(26, 18, 54, 0.45);
  padding: 24px;
}

.result-panel {
  width: min(420px, 100%);
  background: white;
  border-radius: 30px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 24px 50px rgba(36, 23, 88, 0.28);
}

.result-emoji {
  font-size: 3.5rem;
  margin: 0 0 10px;
}

.result-panel h2 {
  margin-bottom: 10px;
}

.result-panel p {
  color: var(--muted);
  margin-bottom: 20px;
}

@media (max-width: 980px) {
  .three-col-grid,
  .two-col-grid,
  .game-grid,
  .progress-grid,
  .helper-strip,
  .meta-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .hero-card {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero-actions
}

.compact-keyboard {
  margin-top: 18px;
}
