:root {
  --bg: #20140f;
  --panel: rgba(255, 244, 222, 0.88);
  --panel-2: #fff7e6;
  --text: #2d1b12;
  --muted: #775f48;
  --accent: #f4c76b;
  --accent-2: #b9782f;
  --purple: #6b4aa2;
  --green: #c78322;
  --blue: #152b55;
  --emerald: #2a7b61;
  --border: rgba(126, 84, 41, 0.22);
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--text);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% 8%, rgba(244,199,107,.22), transparent 22%),
    radial-gradient(circle at 16% 18%, rgba(67,45,94,.42), transparent 26%),
    radial-gradient(circle at 83% 22%, rgba(20,43,85,.55), transparent 30%),
    linear-gradient(180deg, #26170f 0%, #3a2617 45%, #1b1210 100%);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  z-index: 0;
  opacity: .52;
  background:
    linear-gradient(90deg, transparent 0 7%, rgba(114,72,38,.35) 7% 8%, transparent 8% 18%, rgba(111,47,43,.38) 18% 20%, transparent 20% 31%, rgba(29,55,91,.42) 31% 33%, transparent 33% 44%, rgba(122,84,34,.36) 44% 46%, transparent 46% 60%, rgba(71,42,91,.42) 60% 62%, transparent 62% 75%, rgba(38,85,68,.34) 75% 77%, transparent 77%),
    linear-gradient(180deg, transparent 0 18%, rgba(255,209,126,.15) 18% 19%, transparent 19% 42%, rgba(255,209,126,.12) 42% 43%, transparent 43% 66%, rgba(255,209,126,.10) 66% 67%, transparent 67%),
    radial-gradient(ellipse at 22% 17%, rgba(255,214,139,.22), transparent 20%),
    radial-gradient(ellipse at 78% 17%, rgba(255,214,139,.16), transparent 22%);
  background-size: 360px 100%, 100% 100%, 100% 100%, 100% 100%;
  filter: blur(2.5px);
}

body::after {
  z-index: 0;
  opacity: .5;
  background-image:
    radial-gradient(circle, rgba(255, 223, 149, .85) 0 1.2px, transparent 1.8px),
    radial-gradient(circle, rgba(151, 123, 255, .45) 0 .9px, transparent 1.6px),
    radial-gradient(circle, rgba(98, 220, 174, .38) 0 .9px, transparent 1.6px);
  background-size: 118px 118px, 173px 173px, 211px 211px;
  background-position: 18px 24px, 90px 72px, 120px 88px;
  animation: dustFloat 18s linear infinite;
}

button, a { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.ambient { position: fixed; z-index: 0; border-radius: 50%; filter: blur(2px); pointer-events: none; opacity: .75; }
.ambient-one { width: 330px; height: 330px; left: -190px; top: 20%; background: radial-gradient(circle, rgba(107,74,162,.24), transparent 70%); }
.ambient-two { width: 420px; height: 420px; right: -230px; bottom: -80px; background: radial-gradient(circle, rgba(244,199,107,.32), transparent 70%); }

.app-shell { width: min(1060px, calc(100% - 32px)); margin: 0 auto; padding: 28px 0 36px; position: relative; z-index: 1; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.back-button {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid rgba(255,226,163,.2);
  border-radius: 12px;
  color: #fff3d5;
  background: rgba(35,22,15,.48);
  box-shadow: 0 12px 30px rgba(0,0,0,.18);
  display: grid;
  place-items: center;
  transition: .2s ease;
  backdrop-filter: blur(12px);
}
.back-button:hover {
  background: rgba(68,42,26,.68);
  transform: translateY(-2px);
}
.back-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform: translateX(-1px);
}
.brand { color: #fff3d5; display: flex; align-items: center; gap: 12px; text-decoration: none; font-size: 18px; font-weight: 800; letter-spacing: .15em; text-shadow: 0 2px 18px rgba(244,199,107,.25); }
.brand-site-logo { width: 58px; height: 46px; object-fit: contain; filter: drop-shadow(0 7px 16px rgba(244,199,107,.24)); }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: linear-gradient(145deg, #ffd464, #ff9c21); color: #1e1008; font-family: "Cormorant Garamond", serif; font-size: 26px; box-shadow: 0 8px 25px rgba(255,153,33,.2); }
.brand-name { font-family: "Cormorant Garamond", serif; font-size: 31px; font-weight: 700; letter-spacing: -.02em; }
.brand-divider { width: 1px; height: 20px; background: var(--border); }
.game-name { color: #bca991; font-size: 11px; letter-spacing: .19em; }
.header-actions { display: flex; gap: 10px; }
.language-switch { display: flex; align-items: center; gap: 3px; padding: 4px; border: 1px solid rgba(255,226,163,.2); border-radius: 12px; background: rgba(35,22,15,.48); box-shadow: 0 12px 30px rgba(0,0,0,.18); backdrop-filter: blur(12px); }
.language-button { min-width: 38px; height: 32px; padding: 0 9px; border: 0; border-radius: 8px; color: rgba(255,243,213,.68); background: transparent; font-size: 11px; font-weight: 800; letter-spacing: .08em; cursor: pointer; transition: .18s ease; }
.language-button:hover { color: #fff3d5; }
.language-button.active { color: #1e1008; background: linear-gradient(135deg, #ffd464, #ff9c21); box-shadow: 0 4px 14px rgba(255,156,33,.18); }
.teacher-button { height: 42px; display: flex; align-items: center; gap: 8px; padding: 0 14px; border: 1px solid rgba(255,226,163,.2); border-radius: 12px; color: #fff3d5; background: rgba(35,22,15,.48); box-shadow: 0 12px 30px rgba(0,0,0,.18); font-size: 11px; font-weight: 800; cursor: pointer; transition: .2s ease; backdrop-filter: blur(12px); }
.teacher-button { display: flex !important; }
.edit-words-button { display: none !important; }
.teacher-button:hover { background: rgba(68,42,26,.68); transform: translateY(-2px); }
.teacher-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.icon-button { width: 42px; height: 42px; border: 1px solid rgba(255,226,163,.2); border-radius: 12px; color: #fff3d5; background: rgba(35,22,15,.48); box-shadow: 0 12px 30px rgba(0,0,0,.18); display: grid; place-items: center; font-weight: 800; font-size: 18px; cursor: pointer; transition: .2s ease; backdrop-filter: blur(12px); }
.icon-button:hover { background: rgba(68,42,26,.68); transform: translateY(-2px); }
.icon-button svg { width: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sound-off { display: none; }
.muted .sound-on { display: none; }
.muted .sound-off { display: block; }

.game-card { border: 1px solid rgba(255,226,163,.28); background: linear-gradient(135deg, rgba(255,248,226,.9), rgba(231,203,151,.84)); border-radius: 32px; overflow: hidden; box-shadow: 0 34px 90px rgba(0,0,0,.34), 0 0 80px rgba(244,199,107,.14); backdrop-filter: blur(18px); }
.game-head, .progress-row, .streak-row, .keyboard-tip { display: none !important; }
.game-head { display: flex; align-items: center; justify-content: space-between; gap: 28px; padding: 20px 40px 14px; }
.game-head h1, .game-head .subtitle { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.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; }
.game-head .eyebrow { margin: 0; }
.eyebrow { margin: 0 0 10px; color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .16em; }
.dot { color: #625e80; padding: 0 5px; }
h1 { font-family: "Cormorant Garamond", serif; font-size: clamp(42px, 6vw, 58px); font-weight: 600; line-height: .95; letter-spacing: -.035em; margin: 0; }
.subtitle { color: var(--muted); margin: 12px 0 0; font-size: 14px; }
.score-box { min-width: 110px; border-left: 1px solid var(--border); padding-left: 28px; text-align: right; }
.score-box span { color: var(--muted); display: block; font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.score-box strong { font-size: 30px; letter-spacing: -.03em; }
.progress-row { display: flex; gap: 16px; align-items: center; padding: 0 40px 18px; color: var(--muted); font-size: 12px; font-weight: 700; }
.progress-track { flex: 1; height: 5px; background: rgba(255,255,255,.07); border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; width: 10%; border-radius: inherit; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .5s ease; }

.play-area { position: relative; min-height: 540px; display: flex; flex-direction: column; justify-content: center; background:
    linear-gradient(90deg, rgba(122,78,39,.13), transparent 12%, transparent 88%, rgba(122,78,39,.13)),
    radial-gradient(ellipse at 50% 16%, rgba(255,255,255,.52), transparent 28%),
    radial-gradient(circle at 18% 24%, rgba(244,199,107,.28), transparent 19%),
    radial-gradient(circle at 78% 20%, rgba(107,74,162,.13), transparent 24%),
    linear-gradient(145deg, rgba(255,247,224,.97), rgba(232,203,151,.88) 54%, rgba(255,241,203,.94));
  text-align: center; padding: 82px 80px 56px; overflow: hidden; }
.play-area::before {
  content: "";
  position: absolute;
  inset: 26px 50% 26px auto;
  width: 1px;
  border-radius: 999px;
  background: linear-gradient(180deg, transparent, rgba(111,72,35,.18), transparent);
  box-shadow: -10px 0 28px rgba(111,72,35,.06), 10px 0 28px rgba(255,255,255,.24);
  transform: translateX(-50%);
  pointer-events: none;
}
.play-area::after {
  content: "";
  position: absolute;
  inset: 18px 18px 18px 18px;
  height: auto;
  border-radius: 999px;
  border: 1px solid rgba(151,103,44,.16);
  background:
    radial-gradient(circle at 10% 10%, rgba(255,255,255,.35), transparent 15%),
    radial-gradient(circle at 90% 14%, rgba(244,199,107,.22), transparent 16%);
  pointer-events: none;
}
.play-area > * { position: relative; z-index: 1; }
.lumi-decor,
.theme-decor { display: none; }
.decor-cloud { position: absolute; display: block; width: 112px; height: 38px; border-radius: 999px; background: rgba(255,236,184,.34); box-shadow: 28px -10px 0 rgba(255,236,184,.24), 52px 2px 0 rgba(255,236,184,.2); filter: blur(.1px); }
.decor-cloud-one { top: 35px; left: 17%; transform: rotate(-4deg); }
.decor-cloud-two { top: 54px; right: 18%; transform: scale(.82) rotate(5deg); opacity: .75; }
.decor-item { position: absolute; color: rgba(74,142,183,.16); font-weight: 800; line-height: 1; user-select: none; }
.decor-star { top: 30px; left: 45%; color: rgba(184,129,39,.32); font-size: 28px; animation: softTwinkle 3.8s ease-in-out infinite; }
.lumi-progress { position: absolute; top: 18px; left: 50%; z-index: 4; display: flex; align-items: center; gap: 8px; max-width: min(58vw, 520px); padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; transform: translateX(-50%); backdrop-filter: none; pointer-events: none; }
.progress-feathers { display: flex; align-items: center; justify-content: center; gap: clamp(5px, .8vw, 12px); min-width: 0; }
.progress-feather { position: relative; flex: 0 0 auto; width: clamp(13px, 1.8vw, 20px); height: clamp(13px, 1.8vw, 20px); display: block; color: transparent; font-size: 0; line-height: 0; opacity: .26; transform: scale(.96); border: 0; border-radius: 0; background: url("./кристалл.PNG") center / contain no-repeat; box-shadow: none; filter: grayscale(.72) brightness(.68) saturate(.58); transition: opacity .35s ease, transform .35s ease, filter .35s ease; }
.progress-feather img { display: none; }
.progress-feather.current { opacity: 1; transform: scale(1); filter: none; }
.progress-feather.filled { opacity: 1; transform: scale(1.12); filter: brightness(1.12) saturate(1.16) drop-shadow(0 0 9px rgba(230,171,70,.68)) drop-shadow(0 0 18px rgba(255,212,119,.34)); }
.progress-feather.just-filled { animation: featherGlowIn .72s ease both; }
.progress-feather.just-filled::before,
.progress-feather.just-filled::after { content: "◆"; position: absolute; pointer-events: none; color: rgba(255,214,126,.95); font-size: 12px; line-height: 1; text-shadow: 0 0 10px rgba(255,196,75,.86); opacity: 0; animation: featherSpark .78s ease-out both; }
.progress-feather.just-filled::before { top: -7px; left: -5px; font-size: 10px; }
.progress-feather.just-filled::after { right: -6px; bottom: -4px; font-size: 8px; animation-delay: .08s; }
.lumi-progress strong { margin-left: 4px; color: rgba(74,50,24,.72); font-size: 12px; font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.theme-picker { position: absolute; z-index: 6; top: 18px; left: 18px; text-align: left; }
.theme-picker summary { list-style: none; }
.theme-picker summary::-webkit-details-marker { display: none; }
.theme-summary { min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 7px 11px; border: 1px solid rgba(143,95,40,.24); border-radius: 10px 16px 16px 10px; color: #3a2414; background: linear-gradient(90deg, #7b3f28 0 10px, rgba(255,244,219,.9) 10px, rgba(245,221,174,.88)); box-shadow: 0 10px 24px rgba(92,52,20,.14), inset 0 0 0 1px rgba(255,255,255,.34); font-size: 11px; font-weight: 900; cursor: pointer; }
.theme-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: inline-grid;
  place-items: center;
  color: #5a3a7d;
  filter: drop-shadow(0 3px 8px rgba(116, 69, 25, .18));
}

.theme-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.theme-icon .theme-icon-fill {
  fill: rgba(221, 154, 48, .24);
  stroke: #b87527;
}
.theme-chevron {
  margin-left: 2px;
  color: #b9792f;
  font-size: 15px;
  line-height: 1;
  text-shadow: 0 0 8px rgba(246,200,102,.45);
  transform: translateY(1px);
  transition: transform .18s ease, color .18s ease, filter .18s ease;
}
.theme-picker[open] .theme-chevron {
  color: #d49335;
  filter: drop-shadow(0 0 7px rgba(244,199,107,.48));
  transform: translateY(1px) rotate(180deg);
}
.theme-menu { width: 190px; position: absolute; top: calc(100% + 7px); left: 0; display: grid; gap: 6px; padding: 9px; border: 1px solid rgba(143,95,40,.26); border-radius: 16px; background: rgba(255,244,219,.97); box-shadow: 0 22px 55px rgba(47,26,13,.26); }
.theme-menu button { min-height: 42px; display: flex; align-items: center; gap: 10px; border: 1px solid rgba(143,95,40,.08); border-radius: 8px 14px 14px 8px; color: #4c301b; background: linear-gradient(90deg, rgba(42,43,85,.82) 0 9px, rgba(255,250,236,.74) 9px); padding: 0 10px 0 13px; text-align: left; cursor: pointer; box-shadow: 0 6px 16px rgba(92,52,20,.08); }
.theme-menu button:hover, .theme-menu button.active { color: #24140a; background: linear-gradient(90deg, #6b4aa2 0 9px, #ffd776 9px, #ffb84a); }
.theme-menu button .theme-icon {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
}
.theme-menu button strong { font-size: 11px; }
.play-tools { width: 48px; position: absolute; z-index: 3; top: 18px; right: 18px; display: flex; flex-direction: column; gap: 7px; text-align: left; }
.font-picker { position: relative; }
.font-picker summary { list-style: none; }
.font-picker summary::-webkit-details-marker { display: none; }
.tool-button { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid rgba(143,95,40,.22); border-radius: 14px; color: #3a2414; background: rgba(255,244,219,.82); box-shadow: 0 10px 24px rgba(92,52,20,.12); padding: 7px; cursor: pointer; transition: .18s ease; }
.tool-button:hover { background: rgba(255,249,234,.96); transform: translateY(-2px); }
.tool-button small { display: block; color: #7192a4; font-size: 8px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tool-button strong { display: block; max-width: 78px; overflow: hidden; text-overflow: ellipsis; font-size: 11px; white-space: nowrap; }
.tool-icon { width: 30px; text-align: center; color: var(--accent); font-family: "Manrope", sans-serif; font-size: 21px; font-weight: 800; }
.font-menu-button > span:nth-child(2), .font-menu-button .chevron { display: none; }
.chevron { margin-left: auto; color: #a99580; transition: transform .18s; }
.font-picker[open] .chevron { transform: rotate(180deg); }
.font-options { width: 250px; max-height: 380px; position: absolute; z-index: 5; top: calc(100% + 6px); right: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 9px; border: 1px solid rgba(127,188,222,.28); border-radius: 14px; background: rgba(255,255,255,.96); box-shadow: 0 18px 45px rgba(87,151,189,.22); overflow-y: auto; scrollbar-color: #98c8e3 transparent; }
.font-options::-webkit-scrollbar { display: none; }
.font-option { min-height: 70px; display: grid; place-items: center; align-content: center; gap: 2px; border: 1px solid transparent; border-radius: 10px; color: #4a3218; background: rgba(237,248,255,.78); cursor: pointer; transition: .18s ease; }
.font-option .font-sample { font-size: 27px; line-height: 1; }
.font-option small { max-width: 120px; overflow: hidden; color: #7192a4; font: 700 9px "Manrope", sans-serif; letter-spacing: .03em; text-overflow: ellipsis; white-space: nowrap; }
.font-option.active small { color: rgba(36,20,10,.72); }
.font-option:hover { background: rgba(255,246,213,.9); }
.font-option.active { color: #24140a; border-color: #ffd464; background: linear-gradient(135deg, #ffd464, #ff9c21); }
.font-propisi { font-family: "PropisiWeb", cursive; }
.font-sassoon { font-family: "SassoonJoined", "Edu NSW ACT Cursive", cursive; }
.font-cormorant { font-family: "Cormorant Garamond", Georgia, serif; }
.case-switch { display: grid; grid-template-columns: 1fr; gap: 3px; padding: 4px; border: 1px solid rgba(143,95,40,.22); border-radius: 12px; background: rgba(255,244,219,.78); box-shadow: 0 10px 24px rgba(92,52,20,.12); }
.case-button { width: 38px; height: 32px; border: 0; border-radius: 8px; color: #7192a4; background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.case-button.active { color: #24140a; background: linear-gradient(135deg, #ffd464, #ff9c21); }
.edit-words-button { justify-content: center; min-height: 42px; color: #2a1809; background: linear-gradient(135deg, #ffd464, #ff9c21); font-size: 10px; font-weight: 800; }
.edit-words-button:hover { background: linear-gradient(135deg, #ffdc78, #ffad3f); }
.edit-words-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.word-nav { display: none; }
.word-nav-button { border: 0; cursor: pointer; }
.clue { width: fit-content; max-width: min(980px, calc(100vw - 260px)); margin: 0 auto 34px; padding: 11px 18px; border: 1px solid rgba(143,95,40,.18); border-radius: 999px; color: #4d301a; background: rgba(255,247,229,.64); box-shadow: 0 12px 28px rgba(92,52,20,.08); font-size: 21px; line-height: 1.28; font-weight: 800; white-space: normal; overflow: visible; text-overflow: clip; text-wrap: normal; }
.clue.is-long { font-size: 21px; }
.clue.is-very-long { font-size: 21px; max-width: min(1040px, calc(100vw - 220px)); }
.clue::before { content: "✦"; color: #6b4aa2; padding-right: 9px; }
.points-pop { height: 0; position: relative; z-index: 4; color: #e2a43a; font-family: "Cormorant Garamond", serif; font-size: 27px; font-weight: 800; letter-spacing: .015em; opacity: 0; pointer-events: none; text-shadow: 0 0 10px rgba(255,237,179,.62), 0 0 22px rgba(216,145,38,.34); transform: translateY(18px) scale(.88); }
.points-pop.show { animation: pointsPop 1.05s cubic-bezier(.18,.78,.2,1) forwards; }
.academy-mascot { position: absolute; right: 34px; bottom: 34px; z-index: 3; width: 92px; height: 92px; display: grid; place-items: center; pointer-events: none; animation: mascotIdle 4.8s ease-in-out infinite; }
.mascot-orb { position: absolute; inset: 12px; border-radius: 50%; background:
  radial-gradient(circle at 35% 28%, rgba(255,255,255,.72), transparent 20%),
  radial-gradient(circle at 50% 58%, rgba(107,74,162,.28), transparent 58%),
  rgba(255,244,219,.54);
  border: 1px solid rgba(244,199,107,.36);
  box-shadow: 0 18px 34px rgba(72,38,18,.2), 0 0 30px rgba(244,199,107,.2), inset 0 0 0 1px rgba(255,255,255,.34);
  backdrop-filter: blur(8px);
}
.mascot-face { position: relative; z-index: 1; font-size: 42px; line-height: 1; filter: drop-shadow(0 8px 12px rgba(35,20,10,.28)); transform-origin: 50% 85%; }
.mascot-spark { position: absolute; z-index: 2; top: 9px; right: 12px; color: #ffd464; font-size: 19px; filter: drop-shadow(0 0 9px rgba(244,199,107,.8)); animation: softTwinkle 2.6s ease-in-out infinite; }
.academy-mascot.is-happy .mascot-face { animation: mascotHappy .72s ease; }
.academy-mascot.is-happy .mascot-orb { box-shadow: 0 18px 34px rgba(72,38,18,.2), 0 0 42px rgba(244,199,107,.38), inset 0 0 0 1px rgba(255,255,255,.48); }
.academy-mascot.is-error .mascot-face { animation: mascotError .45s ease; }
.academy-mascot.is-error .mascot-orb { box-shadow: 0 18px 34px rgba(72,38,18,.2), 0 0 32px rgba(107,74,162,.34), inset 0 0 0 1px rgba(255,255,255,.4); }
.academy-mascot.is-hint .mascot-spark { animation: mascotHint .72s ease; }
.letters { min-height: 88px; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 11px; margin: 0 auto; }
.letter-tile { width: clamp(58px, 7.5vw, 78px); height: clamp(70px, 8.5vw, 88px); position: relative; overflow: visible; padding: 0; border: 1px solid rgba(143,95,40,.32); border-bottom: 5px solid rgba(92,52,20,.28); border-radius: 18px; background:
  linear-gradient(135deg, rgba(255,255,255,.45), transparent 36%),
  radial-gradient(circle at 50% 0, rgba(244,199,107,.28), transparent 42%),
  linear-gradient(145deg, #fff5d7 0%, #eacb8f 58%, #bd7d35 100%);
  color: #2f1c12; font-size: clamp(27px, 3.6vw, 36px); font-weight: 800; cursor: grab; box-shadow: 0 18px 30px rgba(72,38,18,.28), 0 5px 0 rgba(92,52,20,.2), inset 0 0 0 1px rgba(255,255,255,.45); transition: transform .18s ease, border-color .18s, background .18s, opacity .18s, box-shadow .18s; touch-action: manipulation; }
.letter-tile { animation: tileIntro .42s cubic-bezier(.18,.84,.2,1.16) both; animation-delay: var(--tile-delay, 0ms); }
.letters.no-tile-intro .letter-tile { animation: none; }
.letter-tile * { pointer-events: none; }
body[data-letter-font="propisi"] .letter-tile { font-family: "PropisiWeb", cursive; font-size: clamp(44px, 5.6vw, 61px); font-weight: 400; -webkit-text-stroke: .28px currentColor; text-shadow: .35px 0 currentColor; }
body.lang-en[data-letter-font="propisi"] .letter-tile { font-family: "Edu NSW ACT Cursive", cursive; font-size: clamp(38px, 5vw, 54px); font-weight: 600; -webkit-text-stroke: 0; text-shadow: none; }
body[data-letter-font="manrope"] .letter-tile { font-family: "Manrope", sans-serif; font-size: clamp(25px, 3.4vw, 34px); font-weight: 800; }
.letter-tile:hover { transform: translateY(-6px); border-color: rgba(244,199,107,.78); box-shadow: none; filter: drop-shadow(0 26px 20px rgba(31,17,8,.38)) drop-shadow(0 0 18px rgba(244,199,107,.2)); }
.letter-tile.selected { transform: translateY(-9px) scale(1.03); border-color: var(--accent); box-shadow: none; filter: drop-shadow(0 26px 22px rgba(31,17,8,.42)) drop-shadow(0 0 26px rgba(244,199,107,.34)); }
.letter-tile.dragging { opacity: .35; transform: scale(.92); }
.letter-tile.fixed { border-color: #d99a31; box-shadow: none; filter: drop-shadow(0 18px 16px rgba(190,117,28,.24)) drop-shadow(0 0 24px rgba(255,207,105,.22)); animation: pop .35s ease; }
.letter-tile.placed { opacity: .42; cursor: default; transform: translateY(8px) scale(.9); filter: saturate(.72); box-shadow: none; pointer-events: none; }
.letter-tile.feedback-correct { box-shadow: none; filter: drop-shadow(0 18px 18px rgba(205,133,35,.28)) drop-shadow(0 0 24px rgba(255,214,118,.3)); border-color: rgba(222,158,54,.7); }
.letter-tile.feedback-error { box-shadow: none; filter: drop-shadow(0 18px 18px rgba(184,112,26,.22)) drop-shadow(0 0 18px rgba(255,207,105,.24)); border-color: rgba(219,157,58,.5); }
.tile-feedback { position: absolute; top: -11px; right: -9px; z-index: 6; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; color: #fff; font: 900 18px "Manrope", sans-serif; pointer-events: none; }
.tile-feedback.correct { background: linear-gradient(145deg, #ffe19a, #d49125); color: #3a210c; box-shadow: 0 8px 20px rgba(205,133,35,.34), 0 0 18px rgba(255,225,154,.42); animation: feedbackDrop .72s ease forwards; }
.failed-magic-particle {
  position: absolute;
  z-index: 7;
  color: rgba(255, 226, 139, .72);
  font-size: 17px;
  line-height: 1;
  pointer-events: none;
  text-shadow: 0 0 9px rgba(255,242,190,.5), 0 0 18px rgba(222,148,37,.32);
  filter: drop-shadow(0 0 9px rgba(255,207,105,.36));
  transform: translate(-50%, -50%);
  animation: failedMagic .86s ease-out forwards;
}
.failed-magic-particle.question {
  font-size: 24px;
  color: rgba(255, 233, 176, .58);
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
}
.answer-slots { display: flex; justify-content: center; flex-wrap: wrap; gap: 11px; min-height: 15px; margin: 14px auto 0; }
.answer-slot { width: clamp(58px, 7.5vw, 78px); min-height: clamp(46px, 5vw, 58px); display: grid; place-items: center; border-bottom: 2px solid rgba(214, 153, 55, .74); border-radius: 2px; color: #2f1c12; font-size: clamp(28px, 4vw, 42px); font-weight: 800; transition: border-color .2s, transform .2s, background .2s, box-shadow .2s; box-shadow: 0 8px 18px rgba(244,199,107,.08), 0 0 10px rgba(255,214,122,.18); }
.answer-slot { animation: slotIntro .36s ease both; animation-delay: var(--slot-delay, 0ms); }
.answer-slots.no-slot-intro .answer-slot { animation: none; }
body[data-letter-font="propisi"] .answer-slot { font-family: "PropisiWeb", cursive; font-size: clamp(40px, 5vw, 56px); -webkit-text-stroke: .24px currentColor; text-shadow: .32px 0 currentColor; }
body.lang-en[data-letter-font="propisi"] .answer-slot { font-family: "Edu NSW ACT Cursive", cursive; font-size: clamp(36px, 4.6vw, 50px); font-weight: 600; -webkit-text-stroke: 0; text-shadow: none; }
.answer-slot.correct { border-color: #d79a32; transform: translateY(-2px); }
.answer-slot.filled { background: rgba(255,244,219,.72); border-radius: 14px 14px 4px 4px; box-shadow: 0 10px 24px rgba(244,199,107,.18), 0 0 20px rgba(244,199,107,.18); animation: slotFill .28s ease; }
.letters.is-celebrating .letter-tile {
  filter: drop-shadow(0 24px 22px rgba(31,17,8,.36)) drop-shadow(0 0 24px rgba(234,176,77,.36));
  animation: bookGoldGlow 1.1s ease both;
}
.answer-slots.is-celebrating {
  filter: drop-shadow(0 0 16px rgba(244,199,107,.22));
}
.answer-slots.is-celebrating .answer-slot.filled {
  border-color: rgba(232,169,64,.96);
  box-shadow: 0 12px 28px rgba(122,75,31,.16), 0 0 22px rgba(255,217,126,.28);
  animation: wordGoldShimmer .95s ease both;
}
.controls.is-dimmed {
  opacity: .58;
  filter: saturate(.72) brightness(.88);
  transition: opacity .24s ease, filter .24s ease;
}
.status { display: none !important; height: 0 !important; margin: 0 !important; overflow: hidden !important; font-size: 0 !important; }
.status.error { color: #9b651f; text-shadow: 0 0 12px rgba(255,207,105,.16); }
.status.success { color: #a96515; animation: successText .65s ease; text-shadow: 0 0 16px rgba(255,207,105,.24); }
.controls { display: flex; align-items: center; justify-content: center; gap: 12px; }
.primary-button, .secondary-button { min-height: 48px; border-radius: 13px; border: 0; padding: 0 22px; font-weight: 800; font-size: 13px; cursor: pointer; transition: transform .18s ease, filter .18s, background .18s, box-shadow .18s; }
.primary-button { color: #231d2f; background: linear-gradient(135deg, var(--accent), #ff9f43); box-shadow: 0 10px 28px rgba(255,169,63,.2); }
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.06); }
#check-button { min-height: 55px; padding: 0 28px; background: linear-gradient(135deg, #ffd96e, #ff9f43); box-shadow: 0 15px 34px rgba(255,169,63,.32), 0 0 22px rgba(255,198,82,.24); font-size: 15px; }
#check-button:hover { transform: translateY(-3px); box-shadow: 0 19px 42px rgba(255,169,63,.38), 0 0 30px rgba(255,198,82,.32); }
.secondary-button { display: flex; align-items: center; gap: 8px; color: #4a3218; border: 1px solid var(--border); background: rgba(255,255,255,.7); box-shadow: 0 9px 22px rgba(92,52,20,.08); }
.secondary-button:hover { background: rgba(255,255,255,.94); transform: translateY(-2px); }
.secondary-button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.secondary-button svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.result-actions { display: grid; gap: 12px; margin-top: 14px; }
.result-actions .primary-button,
.result-actions .secondary-button { width: 100%; margin-top: 0; justify-content: center; }
.result-exit-button { display: grid; place-items: center; text-decoration: none; opacity: .82; }
.hint-button span { background: rgba(255,255,255,.1); border-radius: 99px; min-width: 20px; padding: 2px 6px; }
#shuffle-button svg { stroke: #6b4aa2; filter: drop-shadow(0 0 6px rgba(107,74,162,.18)); }
#hint-button svg { stroke: #2a7b61; filter: drop-shadow(0 0 6px rgba(42,123,97,.16)); }
.streak-row { display: flex; align-items: center; padding: 18px 40px; color: var(--muted); font-size: 12px; }
.streak-row strong { color: var(--text); }
.flame { color: var(--accent-2); margin-right: 8px; font-size: 11px; }
.best { margin-left: auto; }
.keyboard-tip { text-align: center; color: #75728f; font-size: 11px; margin: 22px 0 0; }
.keyboard-tip span { padding: 0 8px; }
kbd { min-width: 22px; display: inline-block; padding: 3px 6px; margin: 0 2px; color: #aaa7c2; background: rgba(255,255,255,.05); border: 1px solid var(--border); border-radius: 5px; box-shadow: 0 2px 0 rgba(0,0,0,.2); }
.seo-keywords {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.modal { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(9,8,23,.78); backdrop-filter: blur(8px); animation: fade .25s ease; }
.modal.hidden { display: none; }
.modal-card { width: min(430px, 100%); position: relative; padding: 38px; text-align: center; border: 1px solid var(--border); border-radius: 24px; background: #24160d; box-shadow: 0 30px 80px rgba(0,0,0,.4); animation: modalIn .35s cubic-bezier(.2,.8,.2,1); }
.modal-card h2 { font-family: "Cormorant Garamond", serif; font-size: 38px; font-weight: 600; margin: 10px 0 14px; }
.modal-card p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.modal-card .primary-button { width: 100%; margin-top: 14px; }
.modal-close { position: absolute; top: 15px; right: 16px; width: 34px; height: 34px; border: 0; border-radius: 9px; color: var(--muted); background: rgba(255,255,255,.06); font-size: 22px; cursor: pointer; }
.modal-icon { display: grid; place-items: center; width: 62px; height: 62px; margin: 0 auto; border-radius: 18px; color: #2b2240; background: linear-gradient(145deg, var(--accent), var(--accent-2)); font-size: 22px; font-weight: 800; }
.result-card { overflow: hidden; }
.result-word {
  margin: 0;
  color: var(--accent);
  font: 700 clamp(44px, 6vw, 72px) "Cormorant Garamond", serif;
  letter-spacing: .01em;
  text-shadow: 0 0 24px rgba(244,199,107,.22);
}
.result-details {
  margin: 10px 0 18px;
  color: rgba(255,246,224,.76);
  font-size: 15px;
  font-weight: 700;
}
.result-crystals {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 2px auto 22px;
}
.result-crystals .progress-feather {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 76px;
  background-image: url("./crystal-progress.png");
  background-size: contain;
}
.result-crystals.is-many { gap: 5px; }
.result-crystals.is-many .progress-feather {
  flex-basis: 26px;
  width: 26px;
  height: 58px;
}
.result-crystals.is-ten { gap: 3px; }
.result-crystals.is-ten .progress-feather {
  flex-basis: 23px;
  width: 23px;
  height: 52px;
}
.teacher-card {
  width: min(920px, 100%);
  max-height: min(90vh, 820px);
  display: flex;
  flex-direction: column;
  padding: 32px;
  text-align: left;
  overflow: hidden;
  color: #2d1b12;
  background:
    linear-gradient(180deg, rgba(255,248,232,.96), rgba(246,224,188,.96)),
    #fff4dd;
  border-color: rgba(160,108,52,.26);
  box-shadow: 0 30px 80px rgba(24,13,8,.42), inset 0 0 0 1px rgba(255,255,255,.55);
  font-family: "Manrope", system-ui, sans-serif;
}
.teacher-card * {
  font-family: inherit;
}
.teacher-heading { display: flex; align-items: center; gap: 18px; padding-right: 38px; }
.teacher-heading .modal-icon { flex: 0 0 auto; margin: 0; }
.teacher-heading .eyebrow { display: none; }
.teacher-heading h2 { margin: 0; color: #2d1b12; font-size: 34px; font-weight: 800; letter-spacing: -.03em; }
.teacher-heading p:last-child { margin: 4px 0 0; color: #775f48; line-height: 1.4; }
.teacher-icon { font-family: "Manrope", sans-serif; }
.clue-toggle { width: fit-content; display: flex; align-items: center; gap: 10px; margin: 22px 0 16px; color: #2d1b12; font-size: 13px; font-weight: 700; cursor: pointer; }
.clue-toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track { width: 40px; height: 23px; position: relative; border-radius: 99px; background: rgba(255,255,255,.12); transition: .2s; }
.toggle-track::after { content: ""; width: 17px; height: 17px; position: absolute; top: 3px; left: 3px; border-radius: 50%; background: #c8baa9; transition: .2s; }
.clue-toggle input:checked + .toggle-track { background: linear-gradient(135deg, #ffc652, #ff9d21); }
.clue-toggle input:checked + .toggle-track::after { transform: translateX(17px); background: #261508; }
.word-editor-head { display: grid; grid-template-columns: minmax(180px, .85fr) minmax(220px, 1.35fr) 94px; gap: 10px; padding: 0 10px 8px 38px; color: #806146; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.word-editor-head strong { text-align: right; color: #a96515; }
.word-list { min-height: 100px; overflow-y: auto; padding: 2px 8px 2px 0; scrollbar-color: #6e4c2b transparent; }
.word-row { display: grid; grid-template-columns: 28px minmax(180px, .85fr) minmax(220px, 1.35fr) 94px; gap: 10px; align-items: center; margin-bottom: 9px; }
.word-index { color: #7f644a; font-size: 12px; font-weight: 800; text-align: right; }
.word-input, .clue-input {
  width: 100%;
  height: 44px;
  border: 1px solid rgba(126,84,41,.28);
  border-radius: 10px;
  outline: none;
  color: #24160d;
  background: rgba(255,255,255,.82);
  padding: 0 13px;
  font-size: 15px;
  font-weight: 700;
  transition: .18s;
}
.word-input::placeholder, .clue-input::placeholder { color: rgba(88,62,38,.55); }
.word-input:focus, .clue-input:focus {
  border-color: rgba(184,116,35,.72);
  background: #fffaf0;
  box-shadow: 0 0 0 3px rgba(244,199,107,.2);
}
.clue-input.is-disabled { display: none; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.row-action { width: 27px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 7px; color: #846243; background: rgba(92,54,22,.08); cursor: pointer; font-size: 15px; }
.row-action:hover { color: #2d1b12; background: rgba(184,116,35,.16); }
.row-action:disabled { opacity: .25; cursor: not-allowed; }
.teacher-footer { display: flex; gap: 10px; align-items: center; margin-top: 18px; }
.teacher-footer .primary-button { width: auto; margin: 0 0 0 auto; }
.ghost-button { min-height: 44px; border: 0; color: #7f644a; background: transparent; font-size: 12px; font-weight: 800; cursor: pointer; }
.ghost-button:hover { color: #2d1b12; }
.editor-status { min-height: 18px; margin: 8px 0 -12px !important; color: #ff9b86 !important; font-size: 11px !important; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 20; overflow: hidden; }
.magic-spark {
  position: absolute;
  width: var(--spark-size, 7px);
  height: var(--spark-size, 7px);
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(var(--start-x) - 50%), calc(var(--start-y) - 50%));
  animation: premiumSparkRise 1s cubic-bezier(.2,.66,.26,1) forwards;
  will-change: transform, opacity;
}
.magic-spark::before,
.magic-spark::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 224, 145, .72);
  box-shadow: 0 0 8px rgba(255, 228, 158, .55), 0 0 18px rgba(203, 133, 34, .22);
}
.magic-spark-dot { border-radius: 50%; }
.magic-spark-dust {
  border-radius: 50%;
  filter: blur(.35px);
}
.magic-spark-dust::before { opacity: .62; }
.magic-spark-star::before {
  border-radius: 1px;
  transform: scaleX(.28);
}
.magic-spark-star::after {
  border-radius: 1px;
  transform: scaleY(.28);
}
.magic-spark-rune::before,
.magic-spark-rune::after {
  content: "ᚱ";
  inset: auto;
  color: rgba(255, 229, 163, .95);
  background: none;
  box-shadow: none;
  font: 700 calc(var(--spark-size, 7px) * 1.75) "Cormorant Garamond", serif;
  text-shadow: 0 0 10px rgba(255, 224, 145, .74), 0 0 24px rgba(203, 133, 34, .32);
}
.magic-spark-rune::after {
  content: "✶";
  font-size: calc(var(--spark-size, 7px) * 1.1);
  opacity: .78;
  transform: translate(9px, -8px);
}
.magic-feather-trail,
.magic-crystal-trail {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  animation: featherTrailRise 1.28s cubic-bezier(.2,.66,.26,1) forwards;
  transform: translate(-50%, -50%);
  will-change: transform, opacity;
}

.magic-feather-trail {
  width: 26px;
  height: 34px;
  background: center / contain no-repeat url("./перо copy.PNG");
  filter: sepia(.78) saturate(1.8) hue-rotate(344deg) brightness(1.14) drop-shadow(0 0 14px rgba(255, 208, 105, .54));
}

.magic-crystal-trail {
  width: 34px;
  height: 78px;
  background: center / contain no-repeat url("./crystal-progress.png");
  filter: brightness(1.12) saturate(1.14) drop-shadow(0 0 12px rgba(255, 214, 118, .72)) drop-shadow(0 0 22px rgba(218, 147, 37, .38));
}
.screen-glimmer {
  position: fixed;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 48%, rgba(255, 224, 145, .16), transparent 34%),
    radial-gradient(circle at 22% 24%, rgba(255, 237, 184, .10), transparent 22%),
    radial-gradient(circle at 78% 68%, rgba(236, 172, 62, .12), transparent 26%);
  animation: screenGlimmer 1.65s ease-out forwards;
}
.screen-star {
  position: absolute;
  width: var(--screen-star-size, 20px);
  height: var(--screen-star-size, 20px);
  left: var(--screen-star-x, 50%);
  top: var(--screen-star-y, 50%);
  opacity: 0;
  pointer-events: none;
  filter: drop-shadow(0 0 9px rgba(255, 225, 137, .52)) drop-shadow(0 0 20px rgba(218, 143, 32, .24));
  transform: translate(-50%, -50%) scale(.45) rotate(var(--screen-star-rotate, 0deg));
  animation: screenStarTwinkle 2.1s ease-out forwards;
  will-change: transform, opacity;
}
.screen-star::before,
.screen-star::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  border-radius: 999px;
  background: rgba(255, 227, 154, .88);
  box-shadow: 0 0 10px rgba(255, 233, 176, .62), 0 0 22px rgba(215, 144, 35, .26);
}
.screen-star::before {
  width: 100%;
  height: 18%;
}
.screen-star::after {
  width: 18%;
  height: 100%;
}
.screen-star-1 {
  opacity: 0;
  filter: blur(.1px) drop-shadow(0 0 8px rgba(255, 226, 158, .42));
}
.screen-star-1::before { height: 26%; }
.screen-star-1::after { width: 26%; }
.screen-star-2::before {
  transform: rotate(45deg);
}
.screen-star-2::after {
  transform: rotate(45deg);
}

/* Magic academy composition inspired by the reference mockup */
body {
  background:
    linear-gradient(180deg, rgba(15,9,7,.16), rgba(15,9,7,.22)),
    url("./фон.PNG") center / cover no-repeat fixed,
    linear-gradient(180deg, #130d0c 0%, #2c1a12 52%, #120c0a 100%);
}

body::before {
  opacity: .62;
  background:
    radial-gradient(circle at 50% 52%, transparent 0 42%, rgba(14,8,6,.45) 78%),
    linear-gradient(90deg, rgba(10,7,6,.34), transparent 24%, transparent 76%, rgba(10,7,6,.34)),
    linear-gradient(180deg, rgba(10,7,6,.22), transparent 24%, transparent 74%, rgba(10,7,6,.34));
  filter: none;
}

.app-shell {
  width: min(1480px, calc(100% - 46px));
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 30px 0 26px;
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: fixed;
  z-index: 1;
  pointer-events: none;
  display: none;
}

.app-shell::before {
  left: 30px;
  bottom: 110px;
  width: 150px;
  height: 250px;
  border-radius: 18px 18px 8px 8px;
  background:
    linear-gradient(180deg, rgba(255,226,145,.85), rgba(255,151,58,.16) 22%, transparent 42%),
    radial-gradient(ellipse at 50% 18%, rgba(255,226,145,.8), transparent 22%),
    linear-gradient(90deg, #5a2c17 0 20%, #9d5730 20% 28%, #342117 28% 48%, #315038 48% 70%, #6a331e 70% 100%);
  box-shadow: 0 22px 45px rgba(0,0,0,.34), inset 0 0 0 1px rgba(255,214,138,.18);
  clip-path: polygon(0 24%, 38% 24%, 38% 0, 62% 0, 62% 24%, 100% 24%, 100% 100%, 0 100%);
  opacity: .88;
}

.app-shell::after {
  right: 58px;
  bottom: 96px;
  width: 165px;
  height: 230px;
  border-radius: 24px 24px 12px 12px;
  background:
    radial-gradient(circle at 50% 18%, rgba(255,219,128,.62), transparent 18%),
    linear-gradient(90deg, #20365d 0 22%, #5e321e 22% 42%, #2c1a13 42% 62%, #7a4a28 62% 82%, #20365d 82% 100%);
  box-shadow: 0 20px 45px rgba(0,0,0,.32), inset 0 0 0 1px rgba(255,214,138,.16);
  opacity: .82;
}

.topbar {
  position: relative;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: -56px;
  padding: 8px 4px 0;
}

.topbar .brand {
  margin-right: auto;
}

.brand-name {
  color: #ffe2a5;
  font-size: 42px;
  text-shadow: 0 4px 24px rgba(255,198,82,.34);
}

.brand-site-logo {
  width: 90px;
  height: 78px;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,.35)) drop-shadow(0 0 16px rgba(255,198,82,.2));
}

.language-switch,
.teacher-button,
.icon-button {
  min-height: 62px;
  border-color: rgba(255,222,150,.24);
  border-radius: 18px;
  color: #ffe7b2;
  background:
    linear-gradient(135deg, rgba(139,84,42,.7), rgba(66,39,25,.78));
  box-shadow: 0 18px 38px rgba(0,0,0,.28), inset 0 0 0 1px rgba(255,255,255,.1);
}

.language-button { height: 48px; min-width: 54px; font-size: 14px; }
.teacher-button { padding: 0 24px; font-size: 16px; }
.icon-button { width: 62px; height: 62px; font-size: 25px; }
.teacher-button svg, .icon-button svg { width: 24px; height: 24px; }

.game-card {
  position: relative;
  z-index: 3;
  width: min(1050px, calc(100% - 320px));
  min-width: 760px;
  margin: 126px auto 0;
  overflow: visible;
  border: 0;
  border-radius: 34px;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.game-card::before {
  content: "";
  position: absolute;
  z-index: 0;
  left: 8%;
  top: -108px;
  width: 115px;
  height: 115px;
  background: url("./сова.png") center / contain no-repeat;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.42));
  pointer-events: none;
}

.game-card::after {
  content: "";
  position: absolute;
  inset: -18px -22px -24px;
  z-index: 1;
  border-radius: 42px;
  background: url("./copy_7C873C04-C2D4-4430-9854-A78EE7E8687B.PNG") center / 100% 100% no-repeat;
  filter: drop-shadow(0 35px 54px rgba(0,0,0,.36)) drop-shadow(0 0 16px rgba(244,199,107,.22));
  pointer-events: none;
}

.play-area {
  z-index: 2;
  min-height: 640px;
  padding: 104px 96px 70px;
  border-radius: 34px;
  overflow: visible;
  background:
    radial-gradient(circle at 50% 53%, rgba(255,255,255,.26), transparent 34%),
    radial-gradient(circle at 12% 16%, rgba(255,255,255,.32), transparent 20%),
    radial-gradient(circle at 88% 15%, rgba(255,226,162,.28), transparent 20%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
}

.play-area::before {
  inset: 28px auto 28px 50%;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(112,70,35,.22), rgba(255,255,255,.34), rgba(112,70,35,.18), transparent);
}

.play-area::after {
  inset: 16px;
  border-radius: 28px;
  border-color: rgba(143,95,40,.18);
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(103,64,32,.08) 49%, transparent 52%),
    radial-gradient(circle at 8% 10%, rgba(255,255,255,.42), transparent 13%),
    radial-gradient(circle at 92% 12%, rgba(180,124,49,.16), transparent 12%);
}

.lumi-progress {
  top: -82px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.progress-feathers {
  gap: 10px;
}

.progress-feather {
  flex-basis: 108px;
  width: 108px;
  height: 108px;
  background-size: 145% auto;
}

.lumi-progress strong {
  display: none;
}

.theme-picker { top: 54px; left: 26px; }
.theme-summary {
  min-width: 141px;
  min-height: 58px;
  padding: 0 14px;
  border-radius: 16px;
  background: rgba(255,239,207,.88);
  color: #321f13;
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  box-shadow: 0 14px 29px rgba(65,35,17,.22), inset 0 0 0 1px rgba(255,255,255,.48);
}

.theme-summary .theme-icon {
  width: 27px;
  height: 27px;
  flex-basis: 27px;
}
.theme-menu { width: 215px; background: rgba(255,239,207,.96); }

.play-tools {
  top: 58px;
  right: -76px;
  width: 72px;
  gap: 14px;
}

.tool-button,
.case-switch {
  border-radius: 18px;
  background: rgba(255,239,207,.9);
  box-shadow: 0 16px 34px rgba(65,35,17,.2), inset 0 0 0 1px rgba(255,255,255,.42);
}

.tool-button { min-height: 72px; }
.tool-icon { color: #b9792f; font-family: "Cormorant Garamond", serif; font-size: 32px; }
.case-switch { padding: 8px; gap: 8px; }
.case-button { width: 54px; height: 48px; border-radius: 12px; font-size: 17px; color: #5a3a21; }
.case-button.active { background: linear-gradient(135deg, #f6c866, #d4861c); box-shadow: 0 10px 22px rgba(212,134,28,.32); }

  .clue {
    margin: 66px auto 48px;
    max-width: min(1120px, calc(100vw - 260px));
    padding: 0;
  border: 0;
  border-radius: 0;
  color: #2f2118;
  background: transparent;
  box-shadow: none;
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(38px, 3.75vw, 52px);
  font-weight: 700;
    line-height: 1.08;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    text-wrap: normal;
  }

  .clue.is-long {
    font-size: clamp(38px, 3.75vw, 52px);
  }

  .clue.is-very-long {
    font-size: clamp(38px, 3.75vw, 52px);
    max-width: min(1180px, calc(100vw - 220px));
  }

.clue::before,
.clue::after {
  display: inline-block;
  padding: 0 24px;
  color: #d39a3c;
  font-size: .82em;
  vertical-align: .08em;
}

.clue::before {
  content: "✦\00a0";
}

.clue::after {
  content: "\00a0✦";
}

.connected-word {
  display: none;
  position: relative;
  width: min(940px, calc(100vw - 470px));
  margin: -20px auto 18px;
  padding: 4px 26px 10px;
  color: #6f3f12;
  font-family: "PropisiWeb", cursive;
  font-size: clamp(70px, 6.8vw, 112px);
  font-weight: 400;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 2px 0 rgba(255,238,190,.45), 0 0 18px rgba(225,153,42,.22);
  filter: drop-shadow(0 10px 18px rgba(96,52,18,.12));
  pointer-events: none;
  overflow: hidden;
}

.connected-word.show {
  display: block;
  animation: connectedWordIn 1.05s cubic-bezier(.2,.78,.2,1) both;
}

.connected-word.show::after {
  content: "";
  position: absolute;
  top: 14%;
  bottom: 10%;
  left: 0;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 231, 151, .78), transparent);
  filter: blur(10px);
  opacity: 0;
  transform: translateX(-110%);
  animation: connectedWordShimmer 1.05s ease both;
}

.connected-word.is-long {
  font-size: clamp(58px, 5.6vw, 92px);
}

.connected-word.is-very-long {
  font-size: clamp(46px, 4.5vw, 74px);
}

.letters {
  min-height: 315px;
  gap: 0;
}

.letter-tile {
  width: clamp(268px, 23.65vw, 367px);
  height: clamp(303px, 27.5vw, 408px);
  display: block;
  border: 0;
  border-radius: 18px;
  background: url("./book1.PNG") center / contain no-repeat;
  color: #f6c969;
  filter: drop-shadow(0 22px 18px rgba(31,17,8,.34));
  box-shadow: none;
  margin-inline: -72px;
}

.letter-symbol {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  line-height: 1;
  pointer-events: none;
  text-align: center;
}

body.lang-en .letter-symbol {
  left: 50%;
  top: 50%;
}

.letter-tile::before {
  display: none;
}

.letter-tile::after {
  display: none;
}

body[data-letter-font="propisi"] .letter-tile {
  font-size: clamp(88px, 8.45vw, 122px);
  -webkit-text-stroke: .22px currentColor;
}

body.lang-en[data-letter-font="propisi"] .letter-tile {
  font-size: clamp(82px, 7.9vw, 113px);
  font-weight: 700;
}

body[data-letter-font="manrope"] .letter-tile {
  font-family: "Cormorant Garamond", serif;
  font-size: clamp(74px, 6.85vw, 101px);
  font-weight: 700;
}

.answer-slots {
  gap: 18px;
  margin-top: 24px;
}

.answer-slot {
  position: relative;
  width: clamp(92px, 8.2vw, 126px);
  min-height: 58px;
  border-bottom: 1px solid rgba(214,153,55,.72);
  box-shadow: 0 8px 16px rgba(116,69,25,.04), 0 0 16px rgba(255,214,122,.28), 0 0 28px rgba(215,143,35,.12);
}

.answer-slot::after {
  content: "";
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: -2px;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(255,231,160,.95), transparent);
  box-shadow: 0 0 10px rgba(255,210,102,.58), 0 0 24px rgba(215,143,35,.28), 0 0 38px rgba(255,236,176,.12);
  opacity: .86;
}

.answer-slot.filled {
  color: #3f220d;
  background: rgba(255,239,207,.58);
  border-radius: 14px;
  box-shadow: 0 12px 25px rgba(122,75,31,.16), 0 0 18px rgba(255,215,114,.22);
  text-shadow: 0 1px 0 rgba(255,236,187,.42), 0 0 8px rgba(92,47,16,.16);
}

.status {
  margin: 34px 0 42px;
  color: #4c3828;
  font-family: "Cormorant Garamond", serif;
  font-size: 23px;
  font-weight: 600;
}
.status:empty {
  height: 0;
  margin: 18px 0 24px;
  overflow: hidden;
}

.controls { gap: 36px; }
.primary-button,
.secondary-button {
  min-height: 72px;
  border-radius: 20px;
  padding: 0 34px;
  font-size: 20px;
  font-family: "Cormorant Garamond", serif;
  font-weight: 700;
}

#check-button {
  min-width: 330px;
  min-height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  white-space: nowrap;
  font-size: 25px;
  color: #2b1708;
  background: linear-gradient(135deg, #ffd26e, #cc7e12);
  box-shadow: 0 20px 40px rgba(155,83,19,.34), 0 0 0 1px rgba(255,255,255,.32), 0 0 26px rgba(255,198,82,.45);
}

#check-button::before,
#check-button::after {
  content: "✦";
  flex: 0 0 auto;
  color: rgba(255, 244, 198, .82);
  font-size: .9em;
  line-height: 1;
  text-shadow: 0 0 10px rgba(255,255,255,.72), 0 0 22px rgba(255,205,91,.48);
  animation: sparklePulse 2.4s ease-in-out infinite;
}

#check-button::after { animation-delay: .8s; }

.secondary-button {
  min-width: 175px;
  color: #3b2818;
  background: rgba(255,239,207,.72);
  box-shadow: 0 14px 28px rgba(65,35,17,.14), inset 0 0 0 1px rgba(255,255,255,.4);
}

.academy-mascot {
  left: -150px;
  right: auto;
  bottom: -58px;
  z-index: 6;
  width: 350px;
  height: 330px;
  animation: mascotIdle 5.6s ease-in-out infinite;
}

.mascot-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 24px 24px rgba(0,0,0,.42));
}

.academy-feather {
  position: absolute;
  right: -128px;
  bottom: -42px;
  z-index: 6;
  width: 285px;
  height: 360px;
  display: grid;
  place-items: end center;
  pointer-events: none;
  animation: featherIdle 6.4s ease-in-out infinite;
}

.feather-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 24px 24px rgba(0,0,0,.38)) drop-shadow(0 0 20px rgba(147,87,211,.16));
}

.mascot-orb {
  display: none;
  inset: auto 18px 0;
  height: 84px;
  border-radius: 34px 34px 20px 20px;
  background: linear-gradient(135deg, rgba(38,28,53,.95), rgba(18,14,13,.98));
  border-color: rgba(255,198,82,.28);
}

.mascot-face {
  display: none;
  position: absolute;
  left: 9px;
  bottom: 36px;
  font-size: 132px;
  filter: drop-shadow(0 18px 18px rgba(0,0,0,.44));
}

.mascot-spark {
  display: none;
  top: 42px;
  right: 22px;
  font-size: 30px;
}


@keyframes pop { 50% { transform: scale(1.12); } }
@keyframes dustFloat { to { background-position: 136px 142px, 16px 218px, 286px 304px; } }
@keyframes featherGlowIn {
  0% { opacity: .45; transform: scale(.86) rotate(-14deg); filter: drop-shadow(0 0 0 rgba(230,171,70,0)); }
  46% { opacity: 1; transform: scale(1.18) rotate(2deg); filter: drop-shadow(0 0 16px rgba(255,211,112,.9)) drop-shadow(0 0 28px rgba(255,231,161,.46)); }
  100% { opacity: 1; transform: scale(1) rotate(-5deg); filter: drop-shadow(0 0 10px rgba(230,171,70,.72)) drop-shadow(0 0 18px rgba(255,212,119,.32)); }
}
@keyframes featherSpark {
  0% { opacity: 0; transform: translate(0, 4px) scale(.4) rotate(-10deg); }
  35% { opacity: 1; }
  100% { opacity: 0; transform: translate(8px, -10px) scale(1.15) rotate(22deg); }
}
@keyframes softTwinkle { 50% { opacity: .42; transform: scale(1.08) rotate(8deg); } }
@keyframes sparklePulse { 0%, 100% { opacity: .48; transform: scale(.86) rotate(-6deg); } 50% { opacity: .86; transform: scale(1.08) rotate(6deg); } }
@keyframes slotFill { 0% { opacity: 0; transform: translateY(8px) scale(.88); } 100% { opacity: 1; transform: translateY(-2px) scale(1); } }
@keyframes successText { 0% { opacity: .35; transform: translateY(5px) scale(.95); } 45% { opacity: 1; transform: translateY(-2px) scale(1.04); } 100% { transform: translateY(0) scale(1); } }
@keyframes tileIntro { 0% { opacity: 0; transform: translateY(-22px) scale(.86) rotate(-3deg); } 65% { opacity: 1; transform: translateY(4px) scale(1.03) rotate(1deg); } 100% { opacity: 1; transform: translateY(0) scale(1) rotate(0); } }
@keyframes slotIntro { from { opacity: 0; transform: translateY(10px) scaleX(.7); } to { opacity: 1; transform: translateY(0) scaleX(1); } }
@keyframes feedbackDrop { 0% { opacity: 0; transform: translateY(-14px) scale(.6) rotate(-12deg); } 22% { opacity: 1; transform: translateY(0) scale(1.12) rotate(4deg); } 68% { opacity: 1; transform: translateY(0) scale(1); } 100% { opacity: 0; transform: translateY(-10px) scale(.82); } }
@keyframes failedMagic {
  0% {
    opacity: 0;
    transform: translate(-50%, 10px) scale(.35) rotate(0deg);
  }
  28% {
    opacity: .78;
  }
  62% {
    opacity: .5;
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--x) - 50%), calc(var(--y) - 50%)) scale(.72) rotate(var(--rot));
  }
}

@keyframes pointsPop { 0% { opacity: 0; transform: translateY(14px) scale(.9); filter: blur(.2px); } 22%, 70% { opacity: 1; transform: translateY(-18px) scale(1); filter: blur(0); } 100% { opacity: 0; transform: translateY(-42px) scale(.98); filter: blur(.35px); } }
@keyframes bookGoldGlow {
  0% { filter: drop-shadow(0 22px 18px rgba(31,17,8,.34)); }
  36% { filter: drop-shadow(0 24px 22px rgba(31,17,8,.34)) drop-shadow(0 0 34px rgba(255,216,126,.44)); }
  100% { filter: drop-shadow(0 22px 18px rgba(31,17,8,.34)) drop-shadow(0 0 16px rgba(230,171,70,.18)); }
}
@keyframes wordGoldShimmer {
  0% { color: #3f220d; text-shadow: 0 1px 0 rgba(255,236,187,.42), 0 0 8px rgba(92,47,16,.16); transform: translateY(-2px); }
  42% { color: #4a280f; text-shadow: 0 0 9px rgba(255,228,158,.5), 0 1px 0 rgba(255,246,219,.44); transform: translateY(-4px); }
  100% { color: #3f220d; text-shadow: 0 1px 0 rgba(255,236,187,.42), 0 0 8px rgba(92,47,16,.16); transform: translateY(-2px); }
}
@keyframes premiumSparkRise {
  0% {
    opacity: 0;
    transform: translate(calc(var(--start-x) - 50%), calc(var(--start-y) - 50%)) scale(.45) rotate(0deg);
  }
  18% {
    opacity: .82;
  }
  58% {
    opacity: .68;
    transform: translate(calc(var(--mid-x) - 50%), calc(var(--mid-y) - 50%)) scale(1) rotate(calc(var(--spin) * 46deg));
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--end-x) - 50%), calc(var(--end-y) - 50%)) scale(.35) rotate(calc(var(--spin) * 92deg));
  }
}
@keyframes screenGlimmer {
  0% { opacity: 0; }
  24% { opacity: .75; }
  58% { opacity: .34; }
  100% { opacity: 0; }
}
@keyframes screenStarTwinkle {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.35) rotate(var(--screen-star-rotate, 0deg));
  }
  22% {
    opacity: .78;
  }
  48% {
    opacity: .36;
    transform:
      translate(calc(var(--screen-star-fly-x, 0px) * .42 - 50%), calc(var(--screen-star-fly-y, -60px) * .42 - 50%))
      scale(1.16)
      rotate(calc(var(--screen-star-rotate, 0deg) + 9deg));
  }
  68% {
    opacity: .82;
  }
  100% {
    opacity: 0;
    transform:
      translate(calc(var(--screen-star-fly-x, 0px) - 50%), calc(var(--screen-star-fly-y, -90px) - 50%))
      scale(.48)
      rotate(calc(var(--screen-star-rotate, 0deg) + 18deg));
  }
}
@keyframes featherTrailRise {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(.48) rotate(-18deg);
  }
  18% {
    opacity: .88;
  }
  58% {
    opacity: .86;
    transform: translate(calc(var(--feather-x, 24px) - 50%), calc(var(--feather-y, -110px) * .56 - 50%)) scale(1) rotate(6deg);
  }
  100% {
    opacity: 0;
    transform: translate(calc(var(--feather-x, 24px) * 1.15 - 50%), calc(var(--feather-y, -110px) - 50%)) scale(.7) rotate(18deg);
  }
}
@keyframes connectedWordIn {
  0% {
    opacity: 0;
    clip-path: inset(0 100% 0 0);
    transform: translateY(8px) scale(.98);
    filter: blur(.4px) drop-shadow(0 10px 18px rgba(96,52,18,.08));
  }
  64% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(-2px) scale(1.02);
    filter: blur(0) drop-shadow(0 0 20px rgba(225,153,42,.28));
  }
  100% {
    opacity: 1;
    clip-path: inset(0 0 0 0);
    transform: translateY(0) scale(1);
    filter: drop-shadow(0 10px 18px rgba(96,52,18,.12));
  }
}
@keyframes connectedWordShimmer {
  0% { opacity: 0; transform: translateX(-115%); }
  28% { opacity: .82; }
  100% { opacity: 0; transform: translateX(320%); }
}
@keyframes mascotIdle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
@keyframes featherIdle { 0%, 100% { transform: translateY(0) rotate(-1deg); } 50% { transform: translateY(-7px) rotate(1.5deg); } }
@keyframes mascotHappy { 0%, 100% { transform: translateY(0) rotate(0) scale(1); } 35% { transform: translateY(-10px) rotate(-8deg) scale(1.08); } 68% { transform: translateY(2px) rotate(5deg) scale(1.02); } }
@keyframes mascotError { 20%, 60% { transform: translateX(-5px) rotate(-6deg); } 40%, 80% { transform: translateX(5px) rotate(6deg); } }
@keyframes mascotHint { 0% { opacity: .25; transform: scale(.7) rotate(-12deg); } 45% { opacity: 1; transform: scale(1.42) rotate(12deg); } 100% { opacity: .8; transform: scale(1) rotate(0); } }
@keyframes shake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
@keyframes fade { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(.96); } }

@media (max-width: 680px) {
  .app-shell { width: min(100% - 20px, 520px); padding-top: 18px; }
  .topbar { margin-bottom: 16px; }
  .brand { gap: 6px; }
  .brand-site-logo { width: 42px; height: 35px; }
  .brand-name { font-size: 19px; white-space: nowrap; }
  .brand-divider, .game-name, .teacher-button span { display: none; }
  .header-actions { gap: 6px; }
  .teacher-button { width: 36px; height: 36px; padding: 0; justify-content: center; }
  .icon-button { width: 36px; height: 36px; }
  .language-switch { height: 36px; padding: 3px; }
  .language-button { min-width: 31px; height: 28px; padding: 0 6px; }
  .game-card { border-radius: 22px; }
  .game-head { padding: 16px 22px 12px; align-items: center; }
  .score-box { min-width: 72px; padding-left: 16px; }
  .score-box strong { font-size: 24px; }
  .progress-row { padding: 0 22px 14px; }
  .play-area { min-height: calc(100vh - 108px); padding: 92px 14px 48px; }
  .lumi-progress { top: 58px; gap: 4px; padding: 6px 9px; }
  .progress-feather { flex-basis: 18px; width: 18px; height: 23px; }
  .lumi-progress strong { font-size: 11px; }
  .decor-cloud-one { top: 26px; left: 10%; transform: scale(.72) rotate(-4deg); }
  .decor-cloud-two { top: 36px; right: 13%; transform: scale(.62) rotate(5deg); }
  .decor-star { top: 23px; left: 48%; font-size: 21px; }
  .play-tools { width: 48px; position: absolute; top: 14px; right: 14px; display: flex; margin: 0; }
  .theme-picker { top: 14px; left: 14px; }
  .theme-summary { width: 48px; justify-content: center; padding: 6px; }
  .theme-summary span:nth-child(2), .theme-summary span:last-child { display: none; }
  .font-options { right: 0; left: auto; }
  .font-options { width: min(310px, calc(100vw - 40px)); max-height: 420px; }
  .edit-words-button { min-height: 48px; }
  .clue { padding-inline: 42px; margin-bottom: 26px; font-size: 16px; }
  .academy-mascot { right: 8px; bottom: 8px; width: 66px; height: 66px; opacity: .82; }
  .mascot-face { font-size: 31px; }
  .mascot-spark { top: 4px; right: 5px; font-size: 15px; }
  .letters { gap: 8px; }
  .letter-tile { width: 52px; height: 66px; border-radius: 14px; font-size: 26px; }
  body[data-letter-font="propisi"] .letter-tile { font-size: 45px; }
  .answer-slots { gap: 8px; }
  .answer-slot { width: 52px; min-height: 45px; }
  body[data-letter-font="propisi"] .answer-slot { font-size: 42px; }
  .controls { flex-wrap: wrap; gap: 9px; }
  .primary-button { order: -1; width: 100%; }
  #check-button { min-height: 58px; }
  .secondary-button { flex: 1; justify-content: center; padding: 0 12px; }
  .streak-row { padding: 17px 22px; }
  .keyboard-tip { display: none; }
  .modal-card { padding: 34px 24px 28px; }
  .teacher-card { padding: 28px 15px 20px; }
  .teacher-heading { gap: 12px; }
  .teacher-heading .modal-icon { width: 48px; height: 48px; }
  .teacher-heading h2 { font-size: 30px; }
  .word-editor-head { display: none; }
  .word-row { grid-template-columns: 25px minmax(0, 1fr) 88px; gap: 7px; padding-bottom: 9px; border-bottom: 1px solid var(--border); }
  .word-row .clue-input { grid-column: 2 / 4; grid-row: 2; }
  .row-actions { gap: 2px; }
  .teacher-footer { flex-wrap: wrap; }
  .teacher-footer .primary-button { width: 100%; order: -1; margin: 0; }
  .teacher-footer .secondary-button { flex: 1; }
}

@media (max-width: 390px) {
  .letters, .answer-slots { gap: 6px; }
  .letter-tile { width: 43px; height: 58px; }
  body[data-letter-font="propisi"] .letter-tile { font-size: 39px; }
  .answer-slot { width: 43px; min-height: 40px; }
  body[data-letter-font="propisi"] .answer-slot { font-size: 36px; }
  .brand { font-size: 16px; }
  .brand-name { font-size: 20px; }
  .edit-words-button span { display: none; }
  .subtitle { max-width: 220px; }
}

@media (max-width: 1180px) {
  .app-shell { width: min(100% - 26px, 980px); }
  .game-card {
    width: min(100%, 860px);
    min-width: 0;
  }
  .game-card::before { left: 42%; top: -78px; width: 98px; height: 98px; }
  .theme-picker { left: 18px; }
  .play-tools { right: 18px; }
  .academy-mascot {
    left: -58px;
    width: 132px;
    height: 170px;
    opacity: .92;
  }
  .mascot-face { font-size: 92px; }
}

@media (max-width: 680px) {
  body::before { background-size: 260px 100%, 240px 100%, 100% 100%, 100% 100%, 100% 100%; }
  .app-shell {
    width: min(100% - 18px, 520px);
    min-height: 100vh;
    padding: 14px 0 18px;
  }
  .topbar {
    margin-bottom: 12px;
    padding-top: 0;
  }
  .brand-name { font-size: 24px; }
  .brand-site-logo { width: 42px; height: 36px; }
  .language-switch,
  .teacher-button,
  .icon-button {
    min-height: 38px;
    border-radius: 12px;
  }
  .language-button { min-width: 31px; height: 30px; font-size: 11px; }
  .teacher-button { width: 38px; height: 38px; padding: 0; }
  .icon-button { width: 38px; height: 38px; font-size: 18px; }
  .game-card {
    width: 100%;
    min-width: 0;
    margin-top: 0;
  }
  .game-card::before {
    left: 50%;
    top: -49px;
    width: 68px;
    height: 68px;
  }
  .game-card::after {
    inset: -8px;
    border-radius: 28px;
  }
  .play-area {
    min-height: calc(100vh - 166px);
    padding: 108px 14px 46px;
    border-radius: 22px;
  }
  .lumi-progress {
    top: 56px;
    padding: 6px 10px;
  }
  .progress-feather { flex-basis: 17px; width: 17px; height: 22px; }
  .lumi-progress strong { margin-left: 4px; font-size: 11px; }
  .theme-picker { top: 12px; left: 12px; }
  .theme-summary {
    min-width: 0;
    width: 50px;
    min-height: 50px;
    padding: 0;
  }
  .theme-summary .theme-icon {
    width: 28px;
    height: 28px;
    flex-basis: 28px;
  }
  .theme-summary span:nth-child(2),
  .theme-summary span:last-child { display: none; }
  .play-tools {
    top: 12px;
    right: 12px;
    width: 50px;
    gap: 7px;
  }
  .tool-button { min-height: 50px; }
  .tool-icon { font-size: 22px; }
  .case-button { width: 36px; height: 31px; font-size: 11px; }
  .clue {
    margin: 30px auto 28px;
    max-width: min(560px, calc(100vw - 250px));
    padding: 0 24px;
    font-size: 23px;
  }
  .clue.is-long {
    font-size: 18px;
  }
  .clue.is-very-long {
    font-size: 16px;
    max-width: min(600px, calc(100vw - 230px));
  }
  .clue::before,
  .clue::after { padding: 0 8px; }
  .letters { gap: 10px; min-height: 78px; }
  .letter-tile {
    width: 56px;
    height: 68px;
    border-bottom-width: 5px;
    border-radius: 12px;
  }
  .letter-tile::before { inset: 6px 5px 6px 11px; }
  .letter-tile::after {
    left: 13px;
    bottom: -14px;
    width: 9px;
    height: 18px;
  }
  body[data-letter-font="propisi"] .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letter-tile { font-size: 44px; }
  body[data-letter-font="manrope"] .letter-tile { font-size: 34px; }
  .answer-slots { gap: 10px; margin-top: 32px; }
  .answer-slot {
    width: 56px;
    min-height: 42px;
  }
  .answer-slot::after {
    width: 8px;
    height: 8px;
    margin-top: 32px;
  }
  body[data-letter-font="propisi"] .answer-slot,
  body.lang-en[data-letter-font="propisi"] .answer-slot { font-size: 38px; }
  .status {
    margin: 24px 0 24px;
    font-size: 16px;
  }
  .controls { gap: 9px; }
  .primary-button,
  .secondary-button {
    min-height: 50px;
    border-radius: 14px;
    padding: 0 14px;
    font-size: 16px;
  }
  #check-button {
    min-width: 0;
    min-height: 58px;
    font-size: 20px;
    white-space: nowrap;
  }
  .academy-mascot {
    left: -12px;
    bottom: -8px;
    width: 68px;
    height: 84px;
    opacity: .62;
  }
  .mascot-face {
    left: 0;
    bottom: 12px;
    font-size: 54px;
  }
  .mascot-orb { height: 38px; }
  .mascot-spark { top: 10px; right: 8px; font-size: 14px; }
  }
}

@media (max-width: 390px) {
  .letter-tile {
    width: 46px;
    height: 60px;
  }
  body[data-letter-font="propisi"] .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letter-tile { font-size: 38px; }
  body[data-letter-font="manrope"] .letter-tile { font-size: 30px; }
  .answer-slot {
    width: 46px;
    min-height: 38px;
  }
  body[data-letter-font="propisi"] .answer-slot,
  body.lang-en[data-letter-font="propisi"] .answer-slot { font-size: 34px; }
  .clue { max-width: min(520px, calc(100vw - 220px)); font-size: 21px; }
  .clue.is-long { font-size: 17px; }
  .clue.is-very-long { font-size: 15px; }
  #check-button { font-size: 18px; }
}

@media (min-width: 681px) {
  html,
  body {
    min-height: 100%;
  }

  body {
    overflow: hidden;
  }

  .app-shell {
    height: 100vh;
    min-height: 0;
    padding: 20px 0 16px;
    justify-content: flex-start;
  }

  .topbar {
    flex: 0 0 auto;
    margin-bottom: -50px;
  }

.brand-site-logo {
    width: 72px;
    height: 62px;
  }

  .brand-name {
    font-size: 35px;
  }

  .language-switch,
  .teacher-button,
  .icon-button {
    min-height: 52px;
  }

  .language-button {
    height: 40px;
    min-width: 46px;
  }

  .teacher-button {
    padding: 0 18px;
    font-size: 15px;
  }

  .icon-button {
    width: 52px;
    height: 52px;
  }

  .game-card {
    flex: 0 1 auto;
    margin-top: 94px;
  }

.game-card::before {
    top: -73px;
    width: 90px;
    height: 90px;
  }

  .game-card::after {
    inset: -14px -18px -18px;
  }

  .play-area {
    min-height: clamp(455px, calc(100vh - 282px), 560px);
    padding: 80px 86px 42px;
  }

  .lumi-progress {
    top: -62px;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .progress-feather {
    flex-basis: 22px;
    width: 22px;
    height: 28px;
  }

  .lumi-progress strong {
    font-size: 15px;
  }

  .theme-picker {
    top: 38px;
  }

  .theme-summary {
    min-height: 58px;
    font-size: 22px;
  }

  .theme-summary .theme-icon {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }

  .play-tools {
    top: 42px;
    gap: 10px;
  }

  .tool-button {
    min-height: 58px;
  }

  .tool-icon {
    font-size: 28px;
  }

  .case-switch {
    padding: 6px;
    gap: 6px;
  }

  .case-button {
    height: 39px;
  }

  .clue {
    margin: 48px auto 30px;
    max-width: min(640px, calc(100vw - 500px));
    font-size: clamp(25px, 2.65vw, 32px);
  }

  .clue.is-long {
    font-size: clamp(25px, 2.65vw, 32px);
  }

  .clue.is-very-long {
    font-size: clamp(25px, 2.65vw, 32px);
    max-width: min(700px, calc(100vw - 460px));
  }

  body.is-long-word .clue {
    margin: 34px auto 18px;
  }

  .letters {
    min-height: 270px;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .letter-tile {
    width: clamp(202px, 17.9vw, 276px);
    height: clamp(228px, 20.5vw, 307px);
    border-bottom-width: 8px;
    margin-inline: -62px;
  }

  .letter-tile::before {
    inset: 8px 7px 8px 15px;
  }

  .letter-tile::after {
    bottom: -18px;
    width: 12px;
    height: 23px;
  }

  body[data-letter-font="propisi"] .letter-tile {
    font-size: clamp(84px, 8vw, 121px);
  }

  body.lang-en[data-letter-font="propisi"] .letter-tile {
    font-size: clamp(79px, 7.45vw, 112px);
  }

  body[data-letter-font="manrope"] .letter-tile {
    font-size: clamp(67px, 6.8vw, 98px);
  }

  .answer-slots {
    gap: 10px;
    margin-top: 10px;
  }

  .letters.word-long {
    min-height: 271px;
  }

  .letters.word-long .letter-tile {
    width: clamp(177px, 14.8vw, 230px);
    height: clamp(202px, 16.9vw, 256px);
    margin-inline: -50px;
  }

  .letters.word-very-long {
    min-height: 202px;
  }

  .letters.word-very-long .letter-tile {
    width: clamp(119px, 9.8vw, 156px);
    height: clamp(135px, 11.2vw, 174px);
    margin-inline: -18px;
  }

  body[data-letter-font="propisi"] .letters.word-long .letter-tile {
    font-size: clamp(68px, 6.1vw, 92px);
  }

  body.lang-en[data-letter-font="propisi"] .letters.word-long .letter-tile {
    font-size: clamp(64px, 5.75vw, 86px);
  }

  body[data-letter-font="manrope"] .letters.word-long .letter-tile {
    font-size: clamp(56px, 5.2vw, 76px);
  }

  body[data-letter-font="propisi"] .letters.word-very-long .letter-tile {
    font-size: clamp(58px, 4.95vw, 77px);
  }

  body.lang-en[data-letter-font="propisi"] .letters.word-very-long .letter-tile {
    font-size: clamp(54px, 4.65vw, 72px);
  }

  body[data-letter-font="manrope"] .letters.word-very-long .letter-tile {
    font-size: clamp(47px, 4.3vw, 63px);
  }

  .answer-slots.word-long {
    gap: 6px;
    margin-top: 0;
  }

  .answer-slots.word-long .answer-slot {
    width: clamp(58px, 5.3vw, 78px);
  }

  .answer-slots.word-very-long {
    gap: 4px;
    margin-top: 0;
  }

  .answer-slots.word-very-long .answer-slot {
    width: clamp(48px, 4.4vw, 64px);
  }

  .answer-slot {
    width: clamp(76px, 6.8vw, 104px);
    min-height: 46px;
  }

  .answer-slot::after {
    width: 10px;
    height: 10px;
    margin-top: 36px;
  }

  body[data-letter-font="propisi"] .answer-slot {
    font-size: clamp(42px, 4.5vw, 54px);
  }

  body.lang-en[data-letter-font="propisi"] .answer-slot {
    font-size: clamp(38px, 4.2vw, 50px);
  }

  .status {
    margin: 24px 0 26px;
    font-size: 20px;
  }

  body.is-long-word .status {
    margin: 14px 0 18px;
  }

  .controls {
    gap: 24px;
  }

  body.is-long-word .controls {
    gap: 18px;
  }

  .primary-button,
  .secondary-button {
    min-height: 58px;
    padding: 0 26px;
    font-size: 18px;
  }

  #check-button {
    min-width: 310px;
    min-height: 64px;
    font-size: 23px;
    white-space: nowrap;
  }

  .academy-mascot {
    width: 150px;
    height: 185px;
    bottom: -18px;
  }

  .mascot-face {
    font-size: 104px;
    bottom: 30px;
  }

  .mascot-orb {
    height: 68px;
  }

}

@media (min-width: 681px) and (max-height: 820px) {
  .app-shell {
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .topbar {
    margin-bottom: -46px;
  }

  .brand-site-logo {
    width: 62px;
    height: 54px;
  }

  .brand-name {
    font-size: 30px;
  }

  .language-switch,
  .teacher-button,
  .icon-button {
    min-height: 46px;
  }

  .language-button {
    height: 35px;
  }

  .icon-button {
    width: 46px;
    height: 46px;
  }

  .game-card {
    margin-top: 78px;
  }

  .game-card::before {
    left: 9%;
    top: -60px;
    width: 75px;
    height: 75px;
  }

  .play-area {
    min-height: calc(100vh - 236px);
    padding-top: 66px;
    padding-bottom: 32px;
  }

  .lumi-progress {
    top: -62px;
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .theme-picker,
  .play-tools {
    top: 28px;
  }

  .theme-summary,
  .tool-button {
    min-height: 50px;
  }

  .clue {
    margin: 38px auto 22px;
    max-width: min(600px, calc(100vw - 460px));
    font-size: clamp(23px, 2.35vw, 29px);
  }

  .clue.is-long {
    font-size: clamp(18px, 1.85vw, 23px);
  }

  .clue.is-very-long {
    font-size: clamp(16px, 1.6vw, 20px);
    max-width: min(660px, calc(100vw - 430px));
  }

  .letters {
    min-height: 214px;
    gap: 5px;
    flex-wrap: nowrap;
  }

  .letter-tile {
    width: clamp(199px, 17.8vw, 268px);
    height: clamp(229px, 20.4vw, 297px);
    margin-inline: -60px;
  }

  .letters.word-long {
    min-height: 235px;
  }

  .letters.word-long .letter-tile {
    width: clamp(153px, 12.9vw, 199px);
    height: clamp(176px, 14.75vw, 222px);
    margin-inline: -46px;
  }

  .letters.word-very-long {
    min-height: 172px;
  }

  .letters.word-very-long .letter-tile {
    width: clamp(106px, 8.65vw, 139px);
    height: clamp(120px, 9.95vw, 154px);
    margin-inline: -16px;
  }

  body[data-letter-font="propisi"] .letter-tile {
    font-size: clamp(74px, 7.15vw, 102px);
  }

  body.lang-en[data-letter-font="propisi"] .letter-tile {
    font-size: clamp(70px, 6.8vw, 96px);
  }

  body[data-letter-font="manrope"] .letter-tile {
    font-size: clamp(61px, 6vw, 86px);
  }

  body[data-letter-font="propisi"] .letters.word-long .letter-tile {
    font-size: clamp(60px, 5.3vw, 80px);
  }

  body.lang-en[data-letter-font="propisi"] .letters.word-long .letter-tile {
    font-size: clamp(57px, 5vw, 75px);
  }

  body[data-letter-font="manrope"] .letters.word-long .letter-tile {
    font-size: clamp(49px, 4.75vw, 66px);
  }

  body[data-letter-font="propisi"] .letters.word-very-long .letter-tile {
    font-size: clamp(50px, 4.35vw, 66px);
  }

  body.lang-en[data-letter-font="propisi"] .letters.word-very-long .letter-tile {
    font-size: clamp(47px, 4.1vw, 62px);
  }

  body[data-letter-font="manrope"] .letters.word-very-long .letter-tile {
    font-size: clamp(42px, 3.85vw, 55px);
  }

  .answer-slots {
    margin-top: 8px;
  }

  .answer-slots.word-long,
  .answer-slots.word-very-long {
    margin-top: 0;
  }

  .answer-slot {
    width: clamp(68px, 6.1vw, 92px);
    min-height: 40px;
  }

  .answer-slot::after {
    margin-top: 31px;
  }

  .status {
    margin: 18px 0 20px;
    font-size: 18px;
  }

  .primary-button,
  .secondary-button {
    min-height: 50px;
  }

  #check-button {
    min-width: 286px;
    min-height: 56px;
    font-size: 21px;
    white-space: nowrap;
  }

}

@media (min-width: 681px) and (max-height: 700px) {
  .play-area {
    min-height: calc(100vh - 150px);
  }
}

@media (max-width: 1180px) {
  .academy-feather {
    right: -64px;
    bottom: -28px;
    width: 190px;
    height: 245px;
    opacity: .9;
  }
}

@media (min-width: 681px) and (max-height: 820px) {
  .academy-feather {
    right: -54px;
    bottom: -24px;
    width: 155px;
    height: 205px;
    opacity: .82;
  }
}

@media (max-width: 680px) {
  .academy-feather {
    right: -18px;
    bottom: -10px;
    width: 82px;
    height: 110px;
    opacity: .46;
  }
}

body[data-letter-font="propisi"] .letter-tile,
body[data-letter-font="propisi"] .answer-slot {
  font-family: "PropisiWeb", cursive;
}

body[data-letter-font="sassoon"] .letter-tile,
body[data-letter-font="sassoon"] .answer-slot {
  font-family: "SassoonJoined", "Edu NSW ACT Cursive", cursive;
  font-weight: 400;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

body[data-letter-font="cormorant"] .letter-tile,
body[data-letter-font="cormorant"] .answer-slot {
  font-family: "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  -webkit-text-stroke: 0;
  text-shadow: none;
}

body[data-letter-kind="cursive"] .letter-tile {
  font-size: clamp(88px, 8.45vw, 122px);
}

body.lang-en[data-letter-kind="cursive"] .letter-tile {
  font-size: clamp(82px, 7.9vw, 113px);
}

body[data-letter-kind="print"] .letter-tile {
  font-size: clamp(74px, 6.85vw, 101px);
}

body[data-letter-kind="cursive"] .answer-slot {
  font-size: clamp(42px, 4.5vw, 54px);
}

body.lang-en[data-letter-kind="cursive"] .answer-slot {
  font-size: clamp(38px, 4.2vw, 50px);
}

body[data-letter-kind="print"] .answer-slot {
  font-size: clamp(34px, 3.7vw, 46px);
}

body[data-letter-kind="cursive"] .letters.word-long .letter-tile {
  font-size: clamp(68px, 6.1vw, 92px);
}

body.lang-en[data-letter-kind="cursive"] .letters.word-long .letter-tile {
  font-size: clamp(64px, 5.75vw, 86px);
}

body[data-letter-kind="print"] .letters.word-long .letter-tile {
  font-size: clamp(56px, 5.2vw, 76px);
}

body[data-letter-kind="cursive"] .letters.word-very-long .letter-tile {
  font-size: clamp(58px, 4.95vw, 77px);
}

body.lang-en[data-letter-kind="cursive"] .letters.word-very-long .letter-tile {
  font-size: clamp(54px, 4.65vw, 72px);
}

body[data-letter-kind="print"] .letters.word-very-long .letter-tile {
  font-size: clamp(47px, 4.3vw, 63px);
}

@media (min-width: 681px) and (max-height: 820px) {
  body[data-letter-kind="cursive"] .letter-tile { font-size: clamp(74px, 7.15vw, 102px); }
  body.lang-en[data-letter-kind="cursive"] .letter-tile { font-size: clamp(70px, 6.8vw, 96px); }
  body[data-letter-kind="print"] .letter-tile { font-size: clamp(61px, 6vw, 86px); }
  body[data-letter-kind="cursive"] .letters.word-long .letter-tile { font-size: clamp(60px, 5.3vw, 80px); }
  body.lang-en[data-letter-kind="cursive"] .letters.word-long .letter-tile { font-size: clamp(57px, 5vw, 75px); }
  body[data-letter-kind="print"] .letters.word-long .letter-tile { font-size: clamp(49px, 4.75vw, 66px); }
  body[data-letter-kind="cursive"] .letters.word-very-long .letter-tile { font-size: clamp(50px, 4.35vw, 66px); }
  body.lang-en[data-letter-kind="cursive"] .letters.word-very-long .letter-tile { font-size: clamp(47px, 4.1vw, 62px); }
  body[data-letter-kind="print"] .letters.word-very-long .letter-tile { font-size: clamp(42px, 3.85vw, 55px); }
}

@media (max-width: 680px) {
  body[data-letter-kind="cursive"] .letter-tile,
  body.lang-en[data-letter-kind="cursive"] .letter-tile { font-size: 44px; }
  body[data-letter-kind="print"] .letter-tile { font-size: 34px; }
  body[data-letter-kind="cursive"] .answer-slot,
  body.lang-en[data-letter-kind="cursive"] .answer-slot { font-size: 38px; }
  body[data-letter-kind="print"] .answer-slot { font-size: 30px; }
  .connected-word {
    width: min(420px, calc(100vw - 52px));
    margin: -10px auto 10px;
    font-size: 44px;
  }
  .connected-word.is-long { font-size: 36px; }
  .connected-word.is-very-long { font-size: 30px; }
}

@media (max-width: 390px) {
  body[data-letter-kind="cursive"] .letter-tile,
  body.lang-en[data-letter-kind="cursive"] .letter-tile { font-size: 38px; }
  body[data-letter-kind="print"] .letter-tile { font-size: 30px; }
  body[data-letter-kind="cursive"] .answer-slot,
  body.lang-en[data-letter-kind="cursive"] .answer-slot { font-size: 34px; }
  body[data-letter-kind="print"] .answer-slot { font-size: 28px; }
  .connected-word { font-size: 38px; }
  .connected-word.is-long { font-size: 31px; }
  .connected-word.is-very-long { font-size: 25px; }
}

@media (min-width: 681px) {
  .answer-slots {
    margin-top: 10px;
  }

  .answer-slots.word-long,
  .answer-slots.word-very-long {
    margin-top: 4px;
  }
}

@media (max-width: 680px) {
  .answer-slots,
  .answer-slots.word-long,
  .answer-slots.word-very-long {
    margin-top: 12px;
  }
}

@media (min-width: 681px) {
  .letters {
    min-height: clamp(218px, 23vw, 292px);
    align-items: flex-end;
    margin-bottom: -16px;
  }

  .letter-tile {
    width: clamp(210px, 18.4vw, 292px);
    height: clamp(238px, 21vw, 324px);
    margin-inline: -58px;
  }

  .answer-slots {
    margin-top: -2px;
    margin-bottom: 22px;
  }

  .answer-slot {
    min-height: 30px;
  }

  .answer-slot::after {
    margin-top: 16px;
  }

  .letters.word-long {
    min-height: clamp(192px, 18.6vw, 236px);
    margin-bottom: -12px;
  }

  .letters.word-long .letter-tile {
    width: clamp(150px, 12.8vw, 196px);
    height: clamp(172px, 14.8vw, 220px);
    margin-inline: -42px;
  }

  .letters.word-very-long {
    min-height: clamp(132px, 13.4vw, 166px);
    margin-bottom: -6px;
  }

  .letters.word-very-long .letter-tile {
    width: clamp(104px, 8.5vw, 136px);
    height: clamp(118px, 9.8vw, 151px);
    margin-inline: -15px;
  }

  .answer-slots.word-long,
  .answer-slots.word-very-long {
    margin-top: 0;
    margin-bottom: 20px;
  }
}

@media (min-width: 681px) and (max-height: 820px) {
  .letters {
    min-height: clamp(188px, 20.5vw, 236px);
    margin-bottom: -12px;
  }

  .letter-tile {
    width: clamp(184px, 16vw, 240px);
    height: clamp(210px, 18.3vw, 266px);
    margin-inline: -54px;
  }

  .answer-slots {
    margin-top: -4px;
    margin-bottom: 18px;
  }

  .answer-slot {
    min-height: 28px;
  }
}

@media (min-width: 681px) {
  .connected-word.show {
    margin-bottom: -8px;
  }

  .connected-word.show + .letters,
  .connected-word.show + .letters.word-long,
  .connected-word.show + .letters.word-very-long {
    min-height: 0;
    align-items: flex-start;
    margin-top: 0;
    margin-bottom: -8px;
  }

  .connected-word.show + .letters + .answer-slots,
  .connected-word.show + .letters + .answer-slots.word-long,
  .connected-word.show + .letters + .answer-slots.word-very-long {
    margin-top: -8px;
    margin-bottom: 16px;
  }
}

@media (max-width: 680px) {
  .connected-word.show {
    margin-bottom: 2px;
  }

  .connected-word.show + .letters,
  .connected-word.show + .letters.word-long,
  .connected-word.show + .letters.word-very-long {
    min-height: 0;
    align-items: flex-start;
    margin-bottom: 0;
  }
}

.academy-mascot {
  width: 210px;
  height: 198px;
}

.academy-feather {
  width: 342px;
  height: 432px;
}

@media (max-width: 1180px) {
  .academy-mascot {
    width: 90px;
    height: 111px;
  }

  .academy-feather {
    width: 228px;
    height: 294px;
  }
}

@media (min-width: 681px) and (max-height: 820px) {
  .academy-feather {
    width: 186px;
    height: 246px;
  }
}

@media (min-width: 681px) {
  body.word-complete .letters,
  body.word-complete .letters.word-long,
  body.word-complete .letters.word-very-long {
    transform: translateY(-14px);
  }

  body.word-complete .answer-slots,
  body.word-complete .answer-slots.word-long,
  body.word-complete .answer-slots.word-very-long {
    transform: translateY(-36px);
    margin-bottom: 18px;
  }

  .connected-word.show {
    margin-bottom: -18px;
  }

  .connected-word.show + .letters,
  .connected-word.show + .letters.word-long,
  .connected-word.show + .letters.word-very-long {
    transform: translateY(-28px);
    margin-bottom: -34px;
  }

  .connected-word.show + .letters + .answer-slots,
  .connected-word.show + .letters + .answer-slots.word-long,
  .connected-word.show + .letters + .answer-slots.word-very-long {
    transform: translateY(-28px);
    margin-bottom: 20px;
  }
}

@media (max-width: 680px) {
  body.word-complete .letters,
  body.word-complete .letters.word-long,
  body.word-complete .letters.word-very-long {
    transform: translateY(-8px);
  }

  body.word-complete .answer-slots,
  body.word-complete .answer-slots.word-long,
  body.word-complete .answer-slots.word-very-long {
    transform: translateY(-20px);
    margin-bottom: 12px;
  }

  .academy-mascot {
    width: 41px;
    height: 50px;
  }

  .academy-feather {
    width: 98px;
    height: 132px;
  }

  .connected-word.show + .letters,
  .connected-word.show + .letters.word-long,
  .connected-word.show + .letters.word-very-long,
  .connected-word.show + .letters + .answer-slots,
  .connected-word.show + .letters + .answer-slots.word-long,
  .connected-word.show + .letters + .answer-slots.word-very-long {
    transform: translateY(-14px);
  }
}

@media (max-width: 680px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100dvh;
  }

  .app-shell {
    width: min(100% - 18px, 520px);
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding-top: 12px;
    padding-bottom: 12px;
    overflow: hidden;
  }

  .game-card {
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    border-radius: 0;
    overflow: visible;
  }

  .game-card::before,
  .game-card::after,
  .play-area::before {
    display: none;
  }

  .topbar {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 8px;
  }

  .back-button {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    border-radius: 10px;
  }

  .back-button svg {
    width: 16px;
    height: 16px;
  }

  .brand {
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
  }

  .brand-site-logo {
    width: 67px;
    height: 53px;
  }

  .brand-name {
    font-size: 15px;
    letter-spacing: .02em;
  }

  .header-actions {
    gap: 5px;
    flex: 0 0 auto;
  }

  .language-switch {
    height: 32px;
    padding: 2px;
  }

  .language-button {
    min-width: 28px;
    height: 26px;
    padding: 0 5px;
    font-size: 10px;
  }

  .teacher-button,
  .icon-button {
    width: 32px;
    height: 32px;
  }

  .play-area {
    min-height: 0;
    height: calc(100dvh - 110px);
    padding: 56px 10px 10px;
    justify-content: flex-start;
    overflow: visible;
    transform: translateY(-36px);
    transform-origin: top center;
    background: url("./фон.PNG") center top / cover no-repeat;
  }

  .play-area::after {
    inset: -26px 8px 24px;
    border: 0;
    border-radius: 0;
    background: url("./copy_7C873C04-C2D4-4430-9854-A78EE7E8687B.PNG") center / 100% 100% no-repeat;
    box-shadow: none;
  }

  .theme-picker {
    top: 32px;
    left: 38px;
    right: auto;
    transform: none;
    z-index: 7;
  }

  .play-tools {
    width: auto;
    top: 32px;
    right: 38px;
    left: auto;
    transform: none;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
  }

  .font-picker {
    flex: 0 0 auto;
  }

  .theme-summary,
  .tool-button {
    min-height: 34px;
    padding: 0 7px;
    border-radius: 12px;
    color: #321f13;
    font-family: "Cormorant Garamond", serif;
    font-size: 13px;
    background: rgba(255,239,207,.88);
    box-shadow: 0 12px 24px rgba(65,35,17,.18), inset 0 0 0 1px rgba(255,255,255,.42);
  }

  .theme-summary {
    width: auto;
    max-width: 108px;
    gap: 4px;
  }

  .theme-summary .theme-icon,
  .tool-icon {
    width: 18px;
    height: 18px;
    flex-basis: 18px;
    font-size: 16px;
  }

  .font-menu-button {
    width: auto;
    min-width: 34px;
    padding: 3px 6px;
  }

  .font-menu-button > span:nth-child(2) {
    display: none;
  }

  .case-switch {
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    padding: 3px;
    border-radius: 12px;
    background: rgba(255,239,207,.9);
    box-shadow: 0 12px 24px rgba(65,35,17,.18), inset 0 0 0 1px rgba(255,255,255,.42);
  }

  .case-button {
    width: 28px;
    height: 26px;
    border-radius: 8px;
    font-size: 10px;
    color: #5a3a21;
  }

  .case-button.active {
    background: linear-gradient(135deg, #f6c866, #d4861c);
    box-shadow: 0 8px 18px rgba(212,134,28,.28);
  }

  .font-options {
    right: 50%;
    left: auto;
    transform: translateX(50%);
    width: min(210px, calc(100vw - 64px));
  }

  .clue,
  .clue.is-long,
  .clue.is-very-long {
    width: calc(100% - 48px);
    max-width: calc(100% - 48px);
    margin: 28px auto 8px;
    padding: 0 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    color: #442813;
    font-family: "Cormorant Garamond", serif;
    font-size: 23px;
    line-height: 1.18;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
  }

  .clue.is-long {
    font-size: 18px;
  }

  .clue.is-very-long {
    font-size: 16px;
  }

  .clue::before,
  .clue::after {
    display: none;
  }

  .letters {
    width: calc(100% - 70px);
    max-width: calc(100% - 70px);
    min-height: 124px;
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    align-items: center;
    justify-content: center;
    margin: -8px auto 22px;
    filter: drop-shadow(0 13px 15px rgba(36, 20, 10, .2));
  }

  .letter-tile {
    width: clamp(56px, 15.4vw, 64px);
    flex: 0 0 clamp(56px, 15.4vw, 64px);
    max-width: none;
    min-width: 0;
    height: clamp(96px, 27.6vw, 118px);
    margin-inline: auto;
    border-bottom-width: 5px;
    border-radius: 0;
    background-size: 204% auto;
    background-position: center;
    box-shadow: none;
    filter: drop-shadow(0 9px 9px rgba(50, 28, 13, .24)) drop-shadow(0 3px 2px rgba(96, 57, 22, .18));
  }

  .letter-symbol {
    left: 50%;
    top: 50%;
    width: 100%;
    height: 100%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    text-align: center;
    line-height: 1;
  }

  body.lang-en .letter-symbol,
  body[data-letter-font="propisi"] .letter-symbol,
  body[data-letter-font="manrope"] .letter-symbol,
  body[data-letter-kind="cursive"] .letter-symbol,
  body[data-letter-kind="print"] .letter-symbol {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  body[data-letter-font="propisi"] .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letter-tile {
    font-size: 55px;
  }

  body[data-letter-font="manrope"] .letter-tile {
    font-size: 36px;
  }

  .letters.word-long {
    min-height: 108px;
    gap: 3px;
  }

  .letters.word-long .letter-tile {
    width: clamp(45px, 12.4vw, 53px);
    flex-basis: clamp(45px, 12.4vw, 53px);
    max-width: none;
    min-width: 0;
    height: clamp(78px, 22.5vw, 101px);
    margin-inline: auto;
    background-size: 204% auto;
  }

  body[data-letter-font="propisi"] .letters.word-long .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letters.word-long .letter-tile {
    font-size: 44px;
  }

  body[data-letter-font="manrope"] .letters.word-long .letter-tile {
    font-size: 29px;
  }

  .letters.word-very-long {
    min-height: 92px;
    gap: 2px;
  }

  .letters.word-very-long .letter-tile {
    width: clamp(34px, 9.5vw, 44px);
    flex-basis: clamp(34px, 9.5vw, 44px);
    max-width: none;
    min-width: 0;
    height: clamp(64px, 18.5vw, 84px);
    margin-inline: auto;
    background-size: 204% auto;
  }

  body[data-letter-font="propisi"] .letters.word-very-long .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letters.word-very-long .letter-tile {
    font-size: 35px;
  }

  body[data-letter-font="manrope"] .letters.word-very-long .letter-tile {
    font-size: 24px;
  }

  .answer-slots,
  .answer-slots.word-long,
  .answer-slots.word-very-long {
    position: relative;
    width: calc(100% - 48px);
    max-width: calc(100% - 48px);
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    margin-top: 12px;
    margin-bottom: 10px;
    gap: 3px;
    transform: none;
  }

  .answer-slots::before,
  .answer-slots::after {
    display: none;
  }

  .answer-slot {
    width: 100%;
    max-width: 54px;
    min-width: 0;
    min-height: 38px;
    display: grid;
    place-items: center;
    margin-inline: auto;
    border-bottom-width: 1px;
    border-bottom-color: rgba(128, 75, 29, .72);
    border-radius: 0;
    background: transparent;
    box-shadow: 0 0 11px rgba(129, 77, 28, .26), 0 0 20px rgba(204, 137, 45, .12);
    line-height: 1;
    text-align: center;
  }

  body[data-letter-font="propisi"] .answer-slot,
  body.lang-en[data-letter-font="propisi"] .answer-slot {
    font-size: 38px;
  }

  body[data-letter-font="manrope"] .answer-slot {
    font-size: 29px;
  }

  .answer-slot::after {
    content: "";
    position: absolute;
    left: 9%;
    right: 9%;
    bottom: -2px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(143, 84, 30, .88), transparent);
    box-shadow: 0 0 8px rgba(130, 78, 30, .44), 0 0 18px rgba(204, 137, 45, .2);
    opacity: .86;
  }

  .answer-slot.filled {
    background: rgba(255,239,207,.58);
    border-radius: 10px;
    box-shadow: 0 12px 25px rgba(122,75,31,.16), 0 0 18px rgba(255,215,114,.22);
  }

  .controls {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: calc(100% - 68px);
    margin: 0 auto;
  }

  .primary-button {
    order: 1;
    width: 100%;
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
  }

  #check-button {
    min-width: 0;
    width: 100%;
    min-height: 38px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    font-size: 18px;
    color: #2b1708;
    background: linear-gradient(135deg, #ffd26e, #cc7e12);
    box-shadow: 0 16px 30px rgba(155,83,19,.28), 0 0 0 1px rgba(255,255,255,.28), 0 0 20px rgba(255,198,82,.34);
  }

  #check-button::before,
  #check-button::after {
    content: "✦";
    flex: 0 0 auto;
    color: rgba(255, 244, 198, .82);
    font-size: .86em;
    line-height: 1;
    text-shadow: 0 0 8px rgba(255,255,255,.66), 0 0 18px rgba(255,205,91,.38);
    animation: sparklePulse 2.4s ease-in-out infinite;
  }

  #check-button::after {
    animation-delay: .8s;
  }

  .secondary-button {
    width: 100%;
    min-height: 34px;
    justify-content: center;
    padding: 0 12px;
    font-size: 18px;
    color: #3b2818;
    font-family: "Cormorant Garamond", serif;
    font-weight: 700;
    background: rgba(255,239,207,.72);
    box-shadow: 0 10px 22px rgba(65,35,17,.12), inset 0 0 0 1px rgba(255,255,255,.38);
  }

  #hint-button {
    order: 2;
  }

  #shuffle-button {
    order: 3;
  }

  .academy-feather {
    right: 8px;
    bottom: 46px;
    left: auto;
    width: 82px;
    height: 110px;
    transform: none;
    opacity: 1;
  }

  .academy-mascot {
    right: 14px;
    bottom: 46px;
    width: 91px;
    height: 91px;
    opacity: 1;
  }

  .lumi-progress {
    top: -52px;
    left: 50%;
    gap: 0;
    max-width: calc(100% - 40px);
    padding: 0;
    background: transparent;
    box-shadow: none;
  }

  .progress-feathers {
    gap: 6px;
  }

  .progress-feather {
    width: min(96px, calc((100vw - 56px) / 5));
    height: min(96px, calc((100vw - 56px) / 5));
    background-size: 145% auto;
  }

  .lumi-progress strong {
    display: none;
  }
}

@media (max-width: 390px) {
  .app-shell {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .brand-name {
    font-size: 14px;
  }

  .theme-summary {
    max-width: 98px;
  }

  .clue,
  .clue.is-long,
  .clue.is-very-long {
    font-size: 18px;
  }

  .letter-tile {
    width: clamp(54px, 15vw, 60px);
    flex: 0 0 clamp(54px, 15vw, 60px);
    height: clamp(92px, 26.5vw, 110px);
    background-size: 204% auto;
  }

  body[data-letter-font="propisi"] .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letter-tile {
    font-size: 53px;
  }

  body[data-letter-font="manrope"] .letter-tile {
    font-size: 34px;
  }

  .letters.word-six,
  .letters[data-count="6"] {
    width: calc(100% - 80px);
    max-width: calc(100% - 80px);
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
    gap: 0;
  }

  .letters.word-six .letter-tile,
  .letters[data-count="6"] .letter-tile {
    width: clamp(44px, 12.1vw, 48px);
    flex: 0 0 clamp(44px, 12.1vw, 48px);
    height: clamp(76px, 21.7vw, 90px);
    margin-left: -1px;
    margin-right: -1px;
    background-size: 204% auto;
  }

  body[data-letter-font="propisi"] .letters.word-six .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letters.word-six .letter-tile,
  body[data-letter-font="propisi"] .letters[data-count="6"] .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letters[data-count="6"] .letter-tile {
    font-size: 49px;
  }

  body[data-letter-font="manrope"] .letters.word-six .letter-tile,
  body[data-letter-font="manrope"] .letters[data-count="6"] .letter-tile {
    font-size: 31px;
  }

  .letters.word-long .letter-tile {
    width: clamp(43px, 12vw, 50px);
    flex-basis: clamp(43px, 12vw, 50px);
    height: clamp(74px, 21.5vw, 96px);
    background-size: 204% auto;
  }

  .letters.word-very-long .letter-tile {
    width: clamp(32px, 9vw, 41px);
    flex-basis: clamp(32px, 9vw, 41px);
    height: clamp(60px, 17.5vw, 78px);
    background-size: 204% auto;
  }

  .answer-slot {
    max-width: 50px;
    min-height: 36px;
    border-bottom-width: 2px;
  }

  body[data-letter-font="propisi"] .answer-slot,
  body.lang-en[data-letter-font="propisi"] .answer-slot {
    font-size: 36px;
  }

  body[data-letter-font="manrope"] .answer-slot {
    font-size: 27px;
  }

  #check-button {
    font-size: 17px;
  }

  .secondary-button {
    font-size: 17px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* Final adaptive book sizing: tie tiles to the parchment/play-area width, not the browser window. */
.play-area {
  container-type: inline-size;
}

@supports (width: 1cqw) {
  @media (min-width: 681px) {
    .letters,
    .letters.word-long,
    .letters.word-very-long,
    .letters[data-count="9"] {
      --book-w: clamp(210px, 18.4cqw, 292px);
      --book-h: calc(var(--book-w) * 1.13);
      --book-overlap: clamp(-62px, calc(var(--book-w) * -0.22), -34px);
      width: min(1500px, calc(100cqw - 260px));
      max-width: min(1500px, calc(100cqw - 260px));
      justify-content: center;
      align-items: flex-end;
      flex-wrap: nowrap;
      gap: 0;
    }

    .letter-tile,
    .letters.word-long .letter-tile,
    .letters.word-very-long .letter-tile,
    .letters[data-count="9"] .letter-tile {
      width: var(--book-w);
      flex: 0 0 var(--book-w);
      height: var(--book-h);
      margin-left: var(--book-overlap);
      margin-right: var(--book-overlap);
      margin-inline: var(--book-overlap);
    }

    body[data-letter-font="propisi"] .letter-tile,
    body[data-letter-font="propisi"] .letters.word-long .letter-tile,
    body[data-letter-font="propisi"] .letters.word-very-long .letter-tile,
    body[data-letter-font="propisi"] .letters[data-count="9"] .letter-tile {
      font-size: clamp(88px, calc(var(--book-w) * .42), 122px);
    }

    body.lang-en[data-letter-font="propisi"] .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters.word-long .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters.word-very-long .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters[data-count="9"] .letter-tile {
      font-size: clamp(82px, calc(var(--book-w) * .39), 113px);
    }

    body[data-letter-font="manrope"] .letter-tile,
    body[data-letter-font="manrope"] .letters.word-long .letter-tile,
    body[data-letter-font="manrope"] .letters.word-very-long .letter-tile,
    body[data-letter-font="manrope"] .letters[data-count="9"] .letter-tile {
      font-size: clamp(74px, calc(var(--book-w) * .35), 101px);
    }
  }

  @media (max-width: 680px) {
    .letters {
      --book-w: clamp(52px, 15.2cqw, 66px);
      --book-h: calc(var(--book-w) * 1.75);
      width: calc(100cqw - 70px);
      max-width: calc(100cqw - 70px);
      justify-content: center;
      gap: clamp(2px, .9cqw, 5px);
    }

    .letters.word-six,
    .letters[data-count="6"] {
      --book-w: clamp(44px, 12.4cqw, 54px);
      width: calc(100cqw - 80px);
      max-width: calc(100cqw - 80px);
      gap: clamp(1px, .55cqw, 3px);
    }

    .letters.word-long {
      --book-w: clamp(43px, 12.2cqw, 52px);
      width: calc(100cqw - 70px);
      max-width: calc(100cqw - 70px);
      gap: clamp(1px, .55cqw, 3px);
    }

    .letters.word-very-long {
      --book-w: clamp(34px, 9.6cqw, 45px);
      width: calc(100cqw - 70px);
      max-width: calc(100cqw - 70px);
      gap: clamp(1px, .45cqw, 2px);
    }

    .letter-tile,
    .letters.word-six .letter-tile,
    .letters[data-count="6"] .letter-tile,
    .letters.word-long .letter-tile,
    .letters.word-very-long .letter-tile {
      width: var(--book-w) !important;
      flex: 0 0 var(--book-w) !important;
      height: var(--book-h) !important;
      margin-left: 0 !important;
      margin-right: 0 !important;
      margin-inline: 0 !important;
    }

    body[data-letter-font="propisi"] .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letter-tile,
    body[data-letter-font="propisi"] .letters.word-six .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters.word-six .letter-tile,
    body[data-letter-font="propisi"] .letters[data-count="6"] .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters[data-count="6"] .letter-tile,
    body[data-letter-font="propisi"] .letters.word-long .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters.word-long .letter-tile,
    body[data-letter-font="propisi"] .letters.word-very-long .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters.word-very-long .letter-tile {
      font-size: clamp(34px, calc(var(--book-w) * .92), 56px);
    }

    body[data-letter-font="manrope"] .letter-tile,
    body[data-letter-font="manrope"] .letters.word-six .letter-tile,
    body[data-letter-font="manrope"] .letters[data-count="6"] .letter-tile,
    body[data-letter-font="manrope"] .letters.word-long .letter-tile,
    body[data-letter-font="manrope"] .letters.word-very-long .letter-tile {
      font-size: clamp(24px, calc(var(--book-w) * .62), 36px);
    }
  }
}

@media (max-width: 680px) {
  .academy-mascot {
    width: 100px;
    height: 100px;
  }

  .letters.word-long,
  .letters.word-very-long {
    flex-wrap: wrap;
    align-content: center;
    justify-content: center;
    width: calc(100% - 70px);
    max-width: calc(100% - 70px);
    margin-left: auto;
    margin-right: auto;
  }

  .letters.word-long {
    min-height: clamp(112px, 30vw, 134px);
    row-gap: 0;
    column-gap: 1px;
  }

  .letters.word-very-long {
    min-height: clamp(100px, 27vw, 122px);
    row-gap: 0;
    column-gap: 1px;
  }

  .letters.word-long .letter-tile,
  .letters.word-very-long .letter-tile {
    margin-top: -10px;
    margin-bottom: -10px;
  }

  .answer-slot.filled {
    width: clamp(56px, 15.4vw, 64px);
    max-width: clamp(56px, 15.4vw, 64px);
    height: clamp(66px, 18.4vw, 76px);
    min-height: 0;
    box-sizing: border-box;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: rgba(255,239,207,.58);
    box-shadow: 0 12px 25px rgba(122,75,31,.16), 0 0 18px rgba(255,215,114,.22);
  }

  body[data-letter-font="propisi"] .answer-slot.filled,
  body.lang-en[data-letter-font="propisi"] .answer-slot.filled {
    font-size: 55px;
  }

  body[data-letter-font="manrope"] .answer-slot.filled {
    font-size: 36px;
  }

  .answer-slots.word-six .answer-slot.filled,
  .answer-slots[data-count="6"] .answer-slot.filled {
    width: clamp(46px, 12.8vw, 54px);
    max-width: clamp(46px, 12.8vw, 54px);
    height: clamp(62px, 17.2vw, 72px);
    background: rgba(255,239,207,.42);
    box-shadow: 0 10px 20px rgba(122,75,31,.12), 0 0 14px rgba(255,215,114,.16);
  }

  body[data-letter-font="propisi"] .answer-slots.word-six .answer-slot.filled,
  body.lang-en[data-letter-font="propisi"] .answer-slots.word-six .answer-slot.filled,
  body[data-letter-font="propisi"] .answer-slots[data-count="6"] .answer-slot.filled,
  body.lang-en[data-letter-font="propisi"] .answer-slots[data-count="6"] .answer-slot.filled {
    font-size: 50px;
  }

  body[data-letter-font="manrope"] .answer-slots.word-six .answer-slot.filled,
  body[data-letter-font="manrope"] .answer-slots[data-count="6"] .answer-slot.filled {
    font-size: 32px;
  }

  .answer-slots.word-long .answer-slot.filled {
    width: clamp(36px, 9.9vw, 42px);
    max-width: clamp(36px, 9.9vw, 42px);
    height: clamp(54px, 15vw, 64px);
    min-height: 0;
  }

  body[data-letter-font="propisi"] .answer-slots.word-long .answer-slot.filled,
  body.lang-en[data-letter-font="propisi"] .answer-slots.word-long .answer-slot.filled {
    font-size: 44px;
  }

  body[data-letter-font="manrope"] .answer-slots.word-long .answer-slot.filled {
    font-size: 29px;
  }

  .answer-slots.word-very-long .answer-slot.filled {
    width: clamp(27px, 7.6vw, 35px);
    max-width: clamp(27px, 7.6vw, 35px);
    height: clamp(42px, 12vw, 52px);
    min-height: 0;
  }

  body[data-letter-font="propisi"] .answer-slots.word-very-long .answer-slot.filled,
  body.lang-en[data-letter-font="propisi"] .answer-slots.word-very-long .answer-slot.filled {
    font-size: 35px;
  }

  body[data-letter-font="manrope"] .answer-slots.word-very-long .answer-slot.filled {
    font-size: 24px;
  }
}

/* Final lock: keep every letter visually centered inside the book on all layouts. */
.letter-tile .letter-symbol,
body.lang-en .letter-tile .letter-symbol,
body[data-letter-font="propisi"] .letter-tile .letter-symbol,
body[data-letter-font="manrope"] .letter-tile .letter-symbol,
body[data-letter-font="sassoon"] .letter-tile .letter-symbol,
body[data-letter-font="cormorant"] .letter-tile .letter-symbol,
body[data-letter-kind="cursive"] .letter-tile .letter-symbol,
body[data-letter-kind="print"] .letter-tile .letter-symbol {
  position: absolute;
  inset: 0;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  line-height: .78;
  transform: translate(-50%, -56%);
}

/* Final progress crystal sizing: use the cropped crystal so it reads clearly. */
.progress-feather {
  flex: 0 0 clamp(42px, 3.2vw, 58px);
  width: clamp(42px, 3.2vw, 58px);
  height: clamp(90px, 7vw, 128px);
  background-image: url("./crystal-progress.png");
  background-size: contain;
}

.progress-feathers {
  gap: clamp(10px, 1vw, 18px);
}

@media (min-width: 681px) {
  .lumi-progress {
    top: -118px;
  }
}

@media (min-width: 681px) and (max-height: 820px) {
  .lumi-progress {
    top: -92px;
  }
}

@media (max-width: 680px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
    touch-action: manipulation;
  }

  .app-shell {
    width: 100vw;
    max-width: 100vw;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden !important;
    overscroll-behavior: none;
  }

  .game-card,
  .play-area {
    overflow: visible;
  }

  .academy-mascot,
  .academy-mascot::before,
  .academy-mascot::after {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .academy-mascot .mascot-image {
    filter: none !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  .progress-feathers {
    gap: 8px;
  }

  .progress-feather {
    flex-basis: clamp(38px, 10vw, 52px);
    width: clamp(38px, 10vw, 52px);
    height: clamp(82px, 22vw, 112px);
    background-image: url("./crystal-progress.png");
    background-size: contain;
  }

  .progress-feathers.is-many {
    gap: 4px;
  }

  .progress-feathers.is-many .progress-feather {
    flex-basis: clamp(24px, 6.4vw, 34px);
    width: clamp(24px, 6.4vw, 34px);
    height: clamp(52px, 14vw, 74px);
  }

  .progress-feathers.is-ten {
    gap: 2px;
  }

  .progress-feathers.is-ten .progress-feather {
    flex-basis: clamp(20px, 5.5vw, 28px);
    width: clamp(20px, 5.5vw, 28px);
    height: clamp(44px, 12vw, 62px);
  }

  .letters.word-long .letter-tile,
  .letters.word-very-long .letter-tile {
    margin-left: 0;
    margin-right: 0;
    margin-inline: 0;
  }

  .letters.word-six .letter-tile,
  .letters[data-count="6"] .letter-tile {
    width: clamp(49px, 13.5vw, 54px) !important;
    flex: 0 0 clamp(49px, 13.5vw, 54px) !important;
    height: clamp(83px, 23.8vw, 99px) !important;
    margin-left: 1px !important;
    margin-right: 1px !important;
    margin-inline: 1px !important;
  }
}

@media (min-width: 681px) {
  .letters,
  .letters.word-long,
  .letters.word-very-long {
    width: min(1500px, calc(100% - 260px));
    max-width: min(1500px, calc(100% - 260px));
    justify-content: center;
    align-items: flex-end;
    flex-wrap: nowrap;
    gap: 0;
    margin-left: auto;
    margin-right: auto;
  }

  .letter-tile,
  .letters.word-long .letter-tile,
  .letters.word-very-long .letter-tile {
    margin-left: 0;
    margin-right: 0;
    margin-inline: 0;
  }

  .letter-tile,
  .letters.word-long .letter-tile,
  .letters.word-very-long .letter-tile {
    width: clamp(210px, 18.4vw, 292px);
    flex: 0 0 clamp(210px, 18.4vw, 292px);
    height: clamp(238px, 21vw, 324px);
  }

  .letters[data-count="9"] .letter-tile {
    width: clamp(210px, 18.4vw, 292px);
    flex: 0 0 clamp(210px, 18.4vw, 292px);
    height: clamp(238px, 21vw, 324px);
    margin-left: 0;
    margin-right: 0;
    margin-inline: 0;
  }

  body[data-letter-font="propisi"] .letter-tile,
  body[data-letter-font="propisi"] .letters.word-long .letter-tile,
  body[data-letter-font="propisi"] .letters.word-very-long .letter-tile,
  body[data-letter-font="propisi"] .letters[data-count="9"] .letter-tile {
    font-size: clamp(88px, 8.45vw, 122px);
  }

  body.lang-en[data-letter-font="propisi"] .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letters.word-long .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letters.word-very-long .letter-tile,
  body.lang-en[data-letter-font="propisi"] .letters[data-count="9"] .letter-tile {
    font-size: clamp(82px, 7.9vw, 113px);
  }

  body[data-letter-font="manrope"] .letter-tile,
  body[data-letter-font="manrope"] .letters.word-long .letter-tile,
  body[data-letter-font="manrope"] .letters.word-very-long .letter-tile,
  body[data-letter-font="manrope"] .letters[data-count="9"] .letter-tile {
    font-size: clamp(74px, 6.85vw, 101px);
  }

  .word-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 14px;
    margin: 18px auto 4px;
  }

  .word-nav-button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 999px;
    color: rgba(69, 42, 20, .68);
    background: rgba(255, 246, 225, .38);
    box-shadow: inset 0 0 0 1px rgba(143, 95, 40, .14), 0 8px 18px rgba(92, 52, 20, .08);
    font-family: "Cormorant Garamond", serif;
    font-size: 28px;
    line-height: 1;
    transition: transform .18s ease, opacity .18s ease, background .18s ease;
  }

  .word-nav-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: rgba(255, 246, 225, .6);
  }

  .word-nav-button:disabled {
    opacity: .24;
    cursor: default;
  }

  .word-nav + .clue {
    margin-top: 0;
  }

  .result-actions {
    grid-template-columns: minmax(180px, 1fr) minmax(112px, .55fr);
  }

  .clue,
  .clue.is-long,
  .clue.is-very-long {
    max-width: min(1420px, calc(100vw - 560px));
    margin-bottom: 28px;
    font-size: clamp(32px, 3.2vw, 44px);
  }

  .clue::after {
    display: inline;
    padding-left: .34em;
    padding-right: 0;
    white-space: nowrap;
  }

  .connected-word.show {
    margin-top: -28px;
    margin-bottom: -18px;
  }

  .connected-word.show + .letters,
  .connected-word.show + .letters.word-long,
  .connected-word.show + .letters.word-very-long {
    transform: translateY(-44px);
    margin-bottom: -40px;
  }

  .connected-word.show + .letters + .answer-slots,
  .connected-word.show + .letters + .answer-slots.word-long,
  .connected-word.show + .letters + .answer-slots.word-very-long {
    transform: translateY(-42px);
    margin-bottom: 8px;
  }
}

@media (min-width: 681px) and (max-height: 820px) {
  .clue,
  .clue.is-long,
  .clue.is-very-long {
    max-width: min(1320px, calc(100vw - 500px));
    margin-bottom: 22px;
    font-size: clamp(32px, 3.2vw, 44px);
  }

  .clue::after {
    display: inline;
    padding-left: .34em;
    padding-right: 0;
    white-space: nowrap;
  }

  .connected-word.show {
    margin-top: -34px;
    margin-bottom: -22px;
  }
}

/* Final safety: books scale inside the parchment/play-area on every screen. */
.play-area {
  container-type: inline-size;
}

@supports (width: 1cqw) {
  @media (min-width: 681px) {
    .letters,
    .letters.word-long,
    .letters.word-very-long,
    .letters[data-count="9"] {
      --book-w: clamp(120px, 8.6cqw, 180px);
      --book-gap: 7px;
      width: fit-content;
      max-width: calc(100cqw - 120px);
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      gap: var(--book-gap);
      row-gap: 9px;
      margin-left: auto;
      margin-right: auto;
      margin-bottom: 0;
      min-height: 168px;
      transform: none;
      overflow: visible;
    }

    .letters[data-count="3"],
    .letters[data-count="4"],
    .letters[data-count="5"] {
      --book-w: clamp(170px, 9.7cqw, 180px);
      --book-gap: 8px;
      flex-wrap: nowrap;
    }

    .letters[data-count="6"],
    .letters[data-count="7"] {
      --book-w: clamp(145px, 8.6cqw, 160px);
      --book-gap: 7px;
      flex-wrap: nowrap;
    }

    .letters[data-count="8"],
    .letters[data-count="9"],
    .letters[data-count="10"],
    .letters.word-long {
      --book-w: clamp(120px, 7.4cqw, 140px);
      --book-gap: 6px;
      flex-wrap: nowrap;
      max-width: calc(100cqw - 100px);
    }

    .letters[data-count="11"],
    .letters[data-count="12"],
    .letters.word-very-long {
      --book-w: clamp(96px, 6.4cqw, 118px);
      --book-gap: 6px;
      max-width: calc(100cqw - 88px);
      flex-wrap: wrap;
    }

    .letters[data-count="8"],
    .letters[data-count="9"],
    .letters[data-count="10"] {
      --book-w: clamp(120px, 7.4cqw, 140px);
      --book-gap: 6px;
      flex-wrap: nowrap;
      max-width: calc(100cqw - 100px);
    }

    .letter-tile,
    .letters.word-long .letter-tile,
    .letters.word-very-long .letter-tile,
    .letters[data-count="9"] .letter-tile {
      width: var(--book-w);
      max-width: var(--book-w);
      flex: 0 1 var(--book-w);
      aspect-ratio: 210 / 238;
      height: auto;
      margin-left: 0;
      margin-right: 0;
      margin-inline: 0;
    }

    .letter-symbol {
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      transform: none;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: .82;
      text-align: center;
    }

    body[data-letter-font="propisi"] .letter-tile,
    body[data-letter-font="propisi"] .letters.word-long .letter-tile,
    body[data-letter-font="propisi"] .letters.word-very-long .letter-tile,
    body[data-letter-font="propisi"] .letters[data-count="9"] .letter-tile {
      font-size: clamp(58px, calc(var(--book-w) * .66), 112px);
    }

    body.lang-en[data-letter-font="propisi"] .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters.word-long .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters.word-very-long .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters[data-count="9"] .letter-tile {
      font-size: clamp(54px, calc(var(--book-w) * .60), 102px);
    }

    body[data-letter-font="manrope"] .letter-tile,
    body[data-letter-font="manrope"] .letters.word-long .letter-tile,
    body[data-letter-font="manrope"] .letters.word-very-long .letter-tile,
    body[data-letter-font="manrope"] .letters[data-count="9"] .letter-tile {
      font-size: clamp(44px, calc(var(--book-w) * .50), 82px);
    }

    @media (max-width: 1024px) {
      .letters,
      .letters.word-long,
      .letters.word-very-long,
      .letters[data-count="9"] {
        --book-w: clamp(106px, 10.8cqw, 128px);
        max-width: calc(100cqw - 90px);
        gap: var(--book-gap);
        row-gap: 8px;
      }

      .letters[data-count="3"],
      .letters[data-count="4"],
      .letters[data-count="5"] {
        --book-w: clamp(136px, 13.4cqw, 154px);
        --book-gap: 7px;
      }

      .letters[data-count="6"],
      .letters[data-count="7"] {
        --book-w: clamp(112px, 11.3cqw, 128px);
        --book-gap: 6px;
      }

      .letters.word-long {
        --book-w: clamp(98px, 9.9cqw, 116px);
      }

      .letters.word-very-long {
        --book-w: clamp(82px, 8.6cqw, 100px);
      }

      .letters[data-count="8"],
      .letters[data-count="9"],
      .letters[data-count="10"] {
        --book-w: clamp(98px, 9.9cqw, 116px);
        --book-gap: 6px;
        flex-wrap: nowrap;
      }
    }
  }

  @media (max-width: 680px) {
    .letters,
    .letters.word-six,
    .letters[data-count="6"],
    .letters.word-long,
    .letters.word-very-long {
      --book-w: clamp(88px, 21.2cqw, 108px);
      width: calc(100cqw - 46px);
      max-width: calc(100cqw - 46px);
      display: flex;
      justify-content: center;
      align-items: center;
      flex-wrap: wrap;
      gap: 6px;
      row-gap: 8px;
      margin-left: auto;
      margin-right: auto;
      margin-bottom: 0;
      min-height: 118px;
      transform: none;
      overflow: visible;
    }

    .letters.word-six,
    .letters[data-count="6"] {
      --book-w: clamp(82px, 18.4cqw, 98px);
      width: calc(100cqw - 40px);
      max-width: calc(100cqw - 40px);
      gap: 5px;
    }

    .letters.word-long {
      --book-w: clamp(78px, 17.2cqw, 92px);
      row-gap: 7px;
    }

    .letters.word-very-long {
      --book-w: clamp(68px, 15.2cqw, 82px);
      row-gap: 7px;
    }

    .letter-tile,
    .letters.word-six .letter-tile,
    .letters[data-count="6"] .letter-tile,
    .letters.word-long .letter-tile,
    .letters.word-very-long .letter-tile {
      width: var(--book-w) !important;
      max-width: var(--book-w) !important;
      flex: 0 1 var(--book-w) !important;
      aspect-ratio: 210 / 238;
      height: auto !important;
      margin-left: 0 !important;
      margin-right: 0 !important;
      margin-inline: 0 !important;
    }

    .letter-symbol {
      left: 0;
      top: 0;
      width: 100%;
      height: 100%;
      transform: none;
      display: flex;
      align-items: center;
      justify-content: center;
      line-height: .82;
      text-align: center;
    }

    body[data-letter-font="propisi"] .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letter-tile,
    body[data-letter-font="propisi"] .letters.word-six .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters.word-six .letter-tile,
    body[data-letter-font="propisi"] .letters[data-count="6"] .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters[data-count="6"] .letter-tile,
    body[data-letter-font="propisi"] .letters.word-long .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters.word-long .letter-tile,
    body[data-letter-font="propisi"] .letters.word-very-long .letter-tile,
    body.lang-en[data-letter-font="propisi"] .letters.word-very-long .letter-tile {
      font-size: clamp(44px, calc(var(--book-w) * .60), 78px);
    }

    body[data-letter-font="manrope"] .letter-tile,
    body[data-letter-font="manrope"] .letters.word-six .letter-tile,
    body[data-letter-font="manrope"] .letters[data-count="6"] .letter-tile,
    body[data-letter-font="manrope"] .letters.word-long .letter-tile,
    body[data-letter-font="manrope"] .letters.word-very-long .letter-tile {
      font-size: clamp(34px, calc(var(--book-w) * .46), 56px);
    }
  }
}
