:root {
  color-scheme: light;
  --ink: #28312f;
  --muted: #66716f;
  --line: rgba(44, 54, 51, 0.14);
  --paper: #f7f2e9;
  --paper-2: #fffaf0;
  --mint: #95c9b6;
  --teal: #2e7f7a;
  --coral: #d86955;
  --gold: #d5a84d;
  --violet: #7b73a8;
  --blue: #5f8fb5;
  --shadow: 0 18px 45px rgba(38, 47, 44, 0.14);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(247, 242, 233, 0.84), rgba(247, 242, 233, 0.92)),
    url("./assets/paper-grain.svg"),
    #f7f2e9;
  letter-spacing: 0;
  touch-action: manipulation;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

#app {
  min-height: 100svh;
}

.app-shell {
  position: relative;
  isolation: isolate;
  width: min(100%, 1040px);
  min-height: 100svh;
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 28px) 92px;
}

.app-shell::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
}

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

.dictionary-note {
  margin: 0 0 16px;
  font-size: 0.78rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  grid-template-columns: repeat(2, 11px);
  grid-template-rows: repeat(2, 11px);
  gap: 4px;
  flex: 0 0 auto;
}

.brand-mark span {
  border-radius: 50%;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
}

.brand-mark span:nth-child(1) {
  background: var(--teal);
}

.brand-mark span:nth-child(2) {
  background: var(--gold);
}

.brand-mark span:nth-child(3) {
  background: var(--coral);
}

.brand-mark span:nth-child(4) {
  background: var(--violet);
}

.brand h1 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1;
}

.brand p,
.stat p,
.objective small,
.screen-title p,
.tile-note,
.dictionary-note,
.profile-row span,
.daily-copy,
.modal p {
  margin: 0;
  color: var(--muted);
}

.brand p {
  margin-top: 3px;
  font-size: 0.78rem;
}

.top-stats {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.stat {
  min-width: 68px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.72);
  text-align: center;
}

.stat strong {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}

.stat p {
  font-size: 0.68rem;
}

.nav {
  position: fixed;
  left: 50%;
  bottom: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: min(calc(100% - 24px), 520px);
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 250, 240, 0.94);
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(16px);
}

.nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 58px;
  color: var(--muted);
  background: transparent;
  font-size: 0.7rem;
}

.nav svg,
.icon-btn svg {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav button.active {
  color: var(--teal);
  background: rgba(149, 201, 182, 0.22);
}

.screen-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0 14px;
}

.screen-title h2 {
  margin: 0 0 4px;
  font-size: clamp(1.45rem, 5vw, 2.2rem);
  line-height: 1;
}

.action,
.secondary {
  min-height: 42px;
  padding: 0 16px;
  border-radius: var(--radius);
  font-weight: 760;
}

.action {
  color: white;
  background: var(--teal);
  box-shadow: 0 10px 20px rgba(46, 127, 122, 0.18);
}

.secondary {
  color: var(--ink);
  border: 1px solid var(--line);
  background: rgba(255, 250, 240, 0.8);
}

.level-btn {
  position: relative;
  min-height: 70px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: rgba(255, 250, 240, 0.82);
  box-shadow: 0 8px 18px rgba(38, 47, 44, 0.08);
}

.level-btn.current {
  border-color: rgba(46, 127, 122, 0.42);
  background: rgba(149, 201, 182, 0.28);
}

.level-btn.locked {
  opacity: 0.45;
  box-shadow: none;
}

.level-btn strong {
  display: block;
  font-size: 1.2rem;
}

.level-btn span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.15;
}

.roadmap-title {
  margin-bottom: 12px;
}

.journey-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
  padding: clamp(16px, 3vw, 24px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.88), rgba(255, 246, 228, 0.8)),
    rgba(255, 250, 240, 0.86);
  box-shadow: var(--shadow);
}

.journey-kicker,
.stage-copy span {
  display: block;
  color: var(--teal);
  font-size: 0.74rem;
  font-weight: 820;
}

.journey-hero h3,
.journey-hero p,
.stage-copy h3,
.stage-copy p {
  margin: 0;
}

.journey-hero h3 {
  margin-top: 4px;
  font-size: clamp(1.45rem, 4vw, 2.2rem);
  line-height: 1;
}

.journey-hero p {
  max-width: 58ch;
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.journey-art {
  position: relative;
  display: grid;
  min-height: 210px;
  align-items: end;
  justify-self: end;
  width: min(100%, 390px);
}

.journey-art img {
  width: min(100%, 330px);
  justify-self: end;
  filter: drop-shadow(0 16px 20px rgba(38, 47, 44, 0.12));
}

.roadmap {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 10px 0 18px;
}

.roadmap::before {
  position: absolute;
  top: 22px;
  bottom: 22px;
  left: 52px;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(var(--coral), var(--teal), var(--gold), var(--violet));
  content: "";
}

.roadmap-stage {
  position: relative;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.stage-visual {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: 112px;
}

.stage-landmark {
  width: 96px;
  height: 96px;
  border: 4px solid rgba(255, 250, 240, 0.96);
  border-radius: 24px;
  background:
    rgba(255, 250, 240, 0.72)
    url("./assets/roadmap-landmarks.png") no-repeat var(--landmark-position);
  background-size: 500% 600%;
  box-shadow: 0 14px 28px rgba(38, 47, 44, 0.16);
}

.stage-card {
  display: grid;
  grid-template-columns: minmax(160px, 0.68fr) minmax(0, 1.32fr);
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.78);
  box-shadow: 0 8px 18px rgba(38, 47, 44, 0.08);
}

.stage-copy h3 {
  margin-top: 3px;
  font-size: 1.02rem;
}

.stage-copy p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.theme-score {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.theme-score div {
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.68);
}

.theme-score strong,
.theme-score span {
  display: block;
}

.theme-score strong {
  font-size: 1rem;
}

.theme-score span {
  color: var(--muted);
  font-size: 0.66rem;
}

.theme-meter {
  height: 6px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(40, 49, 47, 0.09);
}

.theme-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

.gate-note {
  margin-top: 7px;
  color: var(--coral);
  font-size: 0.74rem;
  font-weight: 740;
}

.stage-levels {
  display: grid;
  grid-template-columns: repeat(5, minmax(52px, 1fr));
  gap: 8px;
}

.roadmap-stage.locked {
  opacity: 0.62;
}

.level-btn.done {
  border-color: rgba(46, 127, 122, 0.34);
  background: rgba(149, 201, 182, 0.22);
}

.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(16px, 4vw, 32px);
  align-items: start;
}

.game-main {
  min-width: 0;
}

.level-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.level-head h2 {
  margin: 0;
  font-size: 1.45rem;
}

.mission-card {
  display: grid;
  grid-template-columns: minmax(130px, 0.55fr) minmax(0, 1.45fr);
  gap: 10px 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid rgba(46, 127, 122, 0.22);
  border-radius: var(--radius);
  background: rgba(149, 201, 182, 0.18);
}

.mission-card h3,
.mission-card p,
.mission-panel p,
.objective p,
.objective small {
  margin: 0;
}

.mission-card h3 {
  margin-top: 2px;
  font-size: 1.08rem;
}

.mission-card p,
.mission-panel p {
  color: var(--ink);
  font-weight: 680;
  line-height: 1.35;
}

.mission-kicker,
.mission-meta,
.objective small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.mission-meta {
  grid-column: 1 / -1;
}

.icon-row {
  display: flex;
  gap: 8px;
}

.icon-btn {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--ink);
  background: rgba(255, 250, 240, 0.8);
}

.hud {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.hud-item {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.74);
}

.hud-item span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}

.hud-item strong {
  display: block;
  margin-top: 2px;
  font-size: 1.08rem;
}

.hud-item.timer {
  border-color: rgba(216, 105, 85, 0.34);
}

.hud-item.timer.danger strong {
  color: var(--coral);
}

.board-wrap {
  position: relative;
  width: min(100%, 480px, calc(100svh - 310px));
  margin: 0 auto;
  padding: clamp(8px, 2vw, 14px);
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 250, 240, 0.88), rgba(238, 231, 216, 0.78)),
    rgba(255, 250, 240, 0.9);
  box-shadow: var(--shadow);
}

.board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: clamp(6px, 1.5vw, 10px);
  aspect-ratio: 1;
  user-select: none;
  touch-action: none;
}

.board.animating {
  pointer-events: none;
}

.tile {
  position: relative;
  display: grid;
  place-items: center;
  min-width: 0;
  border: 1px solid rgba(40, 49, 47, 0.11);
  border-radius: 14px;
  color: var(--ink);
  background: var(--paper-2);
  box-shadow:
    inset 0 -5px 0 rgba(40, 49, 47, 0.06),
    0 6px 13px rgba(38, 47, 44, 0.1);
  font-size: clamp(1.05rem, 7vw, 2.1rem);
  font-weight: 850;
  transition:
    transform 150ms ease,
    background 150ms ease,
    box-shadow 150ms ease;
}

.tile.breaking {
  animation: tile-break 320ms ease-in forwards;
}

.tile.falling {
  animation: tile-drop 360ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tile.entering {
  animation: tile-drop 420ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tile.selected {
  color: white;
  background: var(--teal);
  transform: translateY(-3px) scale(1.03);
  box-shadow:
    inset 0 -5px 0 rgba(0, 0, 0, 0.12),
    0 12px 22px rgba(46, 127, 122, 0.24);
}

.tile.multiplier {
  border-color: rgba(213, 168, 77, 0.52);
  background: #fff4d1;
}

.tile.wildcard {
  border-color: rgba(123, 115, 168, 0.45);
  background: #eeeafe;
}

.tile.frozen {
  border-color: rgba(95, 143, 181, 0.5);
  background: #e9f6fb;
}

.tile .badge {
  position: absolute;
  right: 5px;
  bottom: 4px;
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: rgba(40, 49, 47, 0.55);
  font-size: 0.62rem;
}

.tile-letter {
  line-height: 1;
}

.tile-value {
  position: absolute;
  left: 6px;
  bottom: 4px;
  display: grid;
  min-width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  color: var(--muted);
  background: rgba(40, 49, 47, 0.06);
  font-size: 0.58rem;
  font-weight: 850;
}

.tile.selected .tile-value {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.16);
}

@keyframes tile-break {
  0% {
    opacity: 1;
    transform: translate3d(0, -3px, 0) scale(1.03) rotate(0deg);
  }

  12% {
    opacity: 1;
    transform: translate3d(-7px, -5px, 0) scale(1.08) rotate(-7deg);
    filter: brightness(1.08);
  }

  24% {
    transform: translate3d(8px, -2px, 0) scale(1.12) rotate(8deg);
  }

  36% {
    transform: translate3d(-6px, 3px, 0) scale(1.06) rotate(-6deg);
  }

  52% {
    opacity: 1;
    transform: translate3d(5px, 0, 0) scale(1.15) rotate(5deg);
    filter: brightness(1.18);
  }

  100% {
    opacity: 0;
    transform: translate3d(12px, 18px, 0) scale(0.38) rotate(18deg);
    filter: brightness(1.18);
  }
}

@keyframes tile-drop {
  0% {
    opacity: 1;
    transform: translateY(calc((var(--drop-distance) * -100%) - (var(--drop-distance) * 8px)));
  }

  78% {
    transform: translateY(3px);
  }

  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

.selection-bar {
  display: grid;
  grid-template-columns: 1fr minmax(112px, auto) auto;
  gap: 10px;
  align-items: center;
  margin: 14px 0 0;
}

.word-preview,
.score-preview {
  min-height: 54px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.74);
}

.word-preview span,
.score-preview span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}

.word-preview strong,
.score-preview strong {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: 1.28rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-preview small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.score-preview {
  background: rgba(213, 168, 77, 0.14);
}

.scoring-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.4;
}

.message {
  min-height: 24px;
  margin: 10px 2px 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.message.good {
  color: var(--teal);
}

.message.bad {
  color: var(--coral);
}

.side-panel {
  display: grid;
  gap: 12px;
}

.panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.76);
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 1rem;
}

.objective {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.objective:first-of-type {
  margin-top: 0;
}

.objective-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-weight: 760;
}

.objective p {
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.35;
}

.meter {
  height: 7px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(40, 49, 47, 0.1);
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.word-log {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.word-chip {
  padding: 5px 8px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(149, 201, 182, 0.2);
  font-size: 0.74rem;
  font-weight: 740;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.highscore-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(213, 168, 77, 0.16);
}

.highscore-row span,
.highscore-meta {
  color: var(--muted);
}

.highscore-row strong {
  font-size: 1.45rem;
}

.highscore-meta {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  font-size: 0.78rem;
}

.analysis-grid div {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.68);
}

.analysis-grid span {
  display: block;
  color: var(--muted);
  font-size: 0.68rem;
}

.analysis-grid strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-panel,
.profile-panel,
.premium-panel,
.result-panel {
  display: grid;
  gap: 16px;
  padding: clamp(18px, 4vw, 28px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 250, 240, 0.78);
  box-shadow: var(--shadow);
}

.daily-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
}

.daily-word {
  display: inline-grid;
  width: fit-content;
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--teal);
  background: rgba(149, 201, 182, 0.22);
  font-weight: 800;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}

.language-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.language-field {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.68);
}

.language-field span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 740;
}

.language-field select {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  background: var(--paper-2);
  font: inherit;
}

.score-note {
  margin: 0;
  color: var(--teal);
  font-weight: 720;
}

.profile-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.68);
}

.profile-row strong {
  display: block;
  margin-top: 4px;
  font-size: 1.3rem;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.badge-pill {
  padding: 7px 10px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(213, 168, 77, 0.25);
  font-size: 0.8rem;
  font-weight: 760;
}

.premium-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.premium-list li {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 250, 240, 0.68);
}

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(40, 49, 47, 0.3);
  backdrop-filter: blur(8px);
}

.modal {
  width: min(100%, 430px);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-2);
  box-shadow: var(--shadow);
}

.modal h2 {
  margin: 0 0 8px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

.app-shell[data-layout="confetti"] {
  --ink: #242338;
  --muted: #625f72;
  --line: rgba(36, 35, 56, 0.13);
  --paper: #fff7ee;
  --paper-2: #fffdf8;
  --mint: #73d4b3;
  --teal: #117f72;
  --coral: #ee5f66;
  --gold: #f0b936;
  --violet: #875de6;
  --blue: #3d94d8;
  --shadow: 0 20px 48px rgba(36, 35, 56, 0.15);
}

.app-shell[data-layout="confetti"]::before {
  background:
    radial-gradient(circle at 10% 12%, rgba(238, 95, 102, 0.18), transparent 24%),
    radial-gradient(circle at 88% 16%, rgba(61, 148, 216, 0.18), transparent 22%),
    radial-gradient(circle at 74% 88%, rgba(240, 185, 54, 0.2), transparent 25%),
    linear-gradient(135deg, rgba(255, 247, 238, 0.7), rgba(239, 251, 244, 0.72));
}

.app-shell[data-layout="confetti"] .brand-mark span,
.app-shell[data-layout="confetti"] .tile {
  border-radius: 10px;
}

.app-shell[data-layout="confetti"] .topbar,
.app-shell[data-layout="confetti"] .screen-title,
.app-shell[data-layout="confetti"] .stage-card,
.app-shell[data-layout="confetti"] .daily-panel,
.app-shell[data-layout="confetti"] .profile-panel,
.app-shell[data-layout="confetti"] .premium-panel,
.app-shell[data-layout="confetti"] .panel,
.app-shell[data-layout="confetti"] .mission-card,
.app-shell[data-layout="confetti"] .word-preview,
.app-shell[data-layout="confetti"] .score-preview,
.app-shell[data-layout="confetti"] .hud-item,
.app-shell[data-layout="confetti"] .stat {
  background: rgba(255, 253, 248, 0.76);
}

.app-shell[data-layout="confetti"] .screen-title {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.app-shell[data-layout="confetti"] .level-btn:nth-child(4n + 1),
.app-shell[data-layout="confetti"] .tile:nth-child(4n + 1) {
  background: #fff0c4;
}

.app-shell[data-layout="confetti"] .level-btn:nth-child(4n + 2),
.app-shell[data-layout="confetti"] .tile:nth-child(4n + 2) {
  background: #e4f8ef;
}

.app-shell[data-layout="confetti"] .level-btn:nth-child(4n + 3),
.app-shell[data-layout="confetti"] .tile:nth-child(4n + 3) {
  background: #f1ebff;
}

.app-shell[data-layout="confetti"] .level-btn:nth-child(4n + 4),
.app-shell[data-layout="confetti"] .tile:nth-child(4n + 4) {
  background: #ffe9e7;
}

.app-shell[data-layout="confetti"] .tile.selected {
  color: white;
  background: linear-gradient(135deg, var(--teal), var(--violet));
}

.app-shell[data-layout="compact"] {
  --ink: #202625;
  --muted: #5d6764;
  --line: rgba(32, 38, 37, 0.12);
  --paper: #f4f7f2;
  --paper-2: #ffffff;
  --mint: #8fcfb7;
  --teal: #246b66;
  --coral: #cf5c4d;
  --gold: #cfa645;
  --violet: #6f6aa8;
  --blue: #4e87ad;
  --shadow: 0 12px 28px rgba(32, 38, 37, 0.11);
  --radius: 6px;
}

.app-shell[data-layout="compact"]::before {
  background:
    linear-gradient(rgba(244, 247, 242, 0.9), rgba(244, 247, 242, 0.95)),
    url("./assets/paper-grain.svg");
}

.app-shell[data-layout="compact"] {
  width: min(100%, 1180px);
}

.app-shell[data-layout="compact"] .game-layout {
  grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr);
  gap: 18px;
}

.app-shell[data-layout="compact"] .hud {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.app-shell[data-layout="compact"] .hud-item,
.app-shell[data-layout="compact"] .panel,
.app-shell[data-layout="compact"] .mission-card,
.app-shell[data-layout="compact"] .stage-card,
.app-shell[data-layout="compact"] .stat,
.app-shell[data-layout="compact"] .word-preview,
.app-shell[data-layout="compact"] .score-preview {
  padding: 8px;
}

.app-shell[data-layout="compact"] .board-wrap {
  width: min(100%, 430px, calc(100svh - 280px));
  padding: 8px;
  border-radius: 10px;
}

.app-shell[data-layout="compact"] .board {
  gap: 5px;
}

.app-shell[data-layout="compact"] .tile {
  border-radius: 7px;
  box-shadow:
    inset 0 -3px 0 rgba(40, 49, 47, 0.06),
    0 4px 8px rgba(38, 47, 44, 0.08);
}

.app-shell[data-layout="compact"] .side-panel {
  gap: 8px;
}

@media (max-width: 760px) {
  .app-shell {
    padding-top: 14px;
  }

  .topbar {
    align-items: flex-start;
  }

  .top-stats .stat:nth-child(2) {
    display: none;
  }

  .screen-title {
    align-items: flex-start;
    flex-direction: column;
  }

  .journey-hero {
    grid-template-columns: 1fr;
  }

  .journey-art {
    min-height: 190px;
    justify-self: center;
    width: min(100%, 320px);
  }

  .journey-art img {
    width: min(100%, 280px);
    justify-self: center;
  }

  .roadmap::before {
    left: 32px;
  }

  .roadmap-stage {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .stage-visual {
    min-height: 74px;
  }

  .stage-landmark {
    width: 62px;
    height: 62px;
    border-radius: 17px;
  }

  .stage-card {
    grid-template-columns: 1fr;
  }

  .stage-levels {
    grid-template-columns: repeat(5, minmax(42px, 1fr));
  }

  .stage-levels .level-btn {
    min-height: 58px;
    padding: 7px 5px;
  }

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

  .side-panel {
    grid-template-columns: 1fr;
  }

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

  .mission-card {
    grid-template-columns: 1fr;
  }

  .hud-item {
    padding: 8px;
  }

  .daily-hero {
    grid-template-columns: 1fr;
  }

  .selection-bar {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 761px) {
  .app-shell {
    padding-bottom: 28px;
  }

  .nav {
    top: 14px;
    bottom: auto;
    width: min(40vw, 420px);
  }
}
