:root {
  --sky-top: #fef2d2;
  --sky-mid: #ffd8a8;
  --sky-bottom: #fff7ed;
  --ink: #2d3240;
  --ink-soft: #5d6576;
  --panel: rgba(255, 253, 248, 0.82);
  --panel-border: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 60px rgba(110, 76, 29, 0.14);
  --shadow-soft: 0 16px 36px rgba(110, 76, 29, 0.12);
  --accent: #ef8b32;
  --accent-strong: #d96e0f;
  --button-ink: #6b3b10;
  --focus-ring: rgba(239, 139, 50, 0.38);
}

* {
  box-sizing: border-box;
}

:where([hidden]) {
  display: none !important;
}

html {
  min-height: 100%;
  background:
    radial-gradient(circle at 20% 12%, rgba(255, 255, 255, 0.92), transparent 18%),
    radial-gradient(circle at 82% 8%, rgba(255, 245, 195, 0.88), transparent 18%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 42%, var(--sky-bottom) 100%);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: ui-rounded, "SF Pro Rounded", "Trebuchet MS", "Avenir Next Rounded",
    sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-full-mode {
  overflow: hidden;
}

body.is-full-mode .topbar,
body.is-full-mode .status-strip,
body.is-full-mode .level-nav,
body.is-full-mode .message-strip,
body.is-full-mode .install-hint,
body.is-full-mode .voice-disclosure {
  display: none;
}

body::before,
body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  filter: blur(8px);
}

body::before {
  top: 5vh;
  left: -7vw;
  width: 40vw;
  height: 26vw;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  animation: drift 18s ease-in-out infinite;
}

body::after {
  right: -6vw;
  bottom: 8vh;
  width: 32vw;
  height: 22vw;
  background: rgba(194, 236, 245, 0.3);
  border-radius: 999px;
  animation: drift 22s ease-in-out infinite reverse;
}

.page-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100vw - 24px));
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 0
    calc(env(safe-area-inset-bottom, 0px) + 28px);
}

.topbar,
.status-strip,
.level-nav,
.message-strip,
.board-view,
.install-hint,
.voice-disclosure {
  animation: float-in 720ms cubic-bezier(0.2, 1, 0.28, 1) both;
}

.topbar {
  display: grid;
  gap: 18px;
  align-items: start;
  padding: 20px;
  border: 1px solid var(--panel-border);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.brand-block h1,
.brand-block p,
.focus-header p,
.message-copy p,
.install-hint,
.voice-disclosure,
.category-header p {
  margin: 0;
}

.brand-kicker {
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 10px;
}

.brand-block h1 {
  font-size: clamp(2.1rem, 4vw, 3.6rem);
  line-height: 0.95;
}

.brand-subtitle {
  max-width: 42rem;
  margin-top: 12px;
  font-size: 1rem;
  line-height: 1.45;
  color: var(--ink-soft);
}

.topbar-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
  max-width: 100%;
}

.mode-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: inset 0 0 0 1px rgba(221, 183, 137, 0.42);
}

.level-select {
  flex: 0 0 auto;
  min-width: 112px;
  min-height: 56px;
  padding: 0 34px 0 16px;
  border: 0;
  border-radius: 999px;
  color: var(--button-ink);
  background:
    linear-gradient(135deg, #fff3d9, #ffe3bd),
    rgba(255, 255, 255, 0.88);
  box-shadow:
    0 10px 22px rgba(217, 110, 15, 0.14),
    inset 0 0 0 1px rgba(221, 183, 137, 0.42);
  font-weight: 900;
}

.mode-button,
.level-button,
.level-select,
.category-icon-button,
.install-button,
.secondary-action,
.focus-arrow,
.dot-button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.mode-button {
  min-width: 88px;
  padding: 12px 16px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: transparent;
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.mode-button.is-active {
  background: linear-gradient(135deg, #fff3d9, #ffe3bd);
  color: var(--button-ink);
  box-shadow: 0 10px 22px rgba(217, 110, 15, 0.16);
}

.install-button,
.secondary-action,
.focus-arrow {
  padding: 12px 18px;
  border-radius: 999px;
  background: linear-gradient(135deg, #f7b85d, #f39c46);
  color: #fffaf3;
  font-weight: 700;
  box-shadow: 0 14px 24px rgba(217, 110, 15, 0.22);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.install-button-inline {
  display: flex;
  width: fit-content;
  margin: 16px auto 0;
}

.status-strip,
.level-nav,
.message-strip,
.board-view,
.install-hint,
.voice-disclosure {
  margin-top: 16px;
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: rgba(255, 253, 248, 0.82);
  color: var(--ink-soft);
  box-shadow: var(--shadow-soft);
}

.level-nav {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: rgba(255, 253, 248, 0.72);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(14px);
}

.level-copy p {
  margin: 0;
}

.category-picker {
  display: flex;
  flex: 0 1 auto;
  min-width: 0;
  gap: 10px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px;
  border-radius: 999px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}

.category-picker::-webkit-scrollbar {
  display: none;
}

.level-kicker {
  color: var(--accent-strong);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.level-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 5px !important;
  font-size: 1.2rem;
  font-weight: 900;
}

.level-title-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: #fff5e7;
  box-shadow: inset 0 0 0 1px rgba(221, 183, 137, 0.34);
}

.level-title-symbol {
  color: var(--ink);
}

.level-caption {
  margin-top: 5px !important;
  color: var(--ink-soft);
  line-height: 1.35;
}

.level-buttons {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: thin;
}

.category-icon-button {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 60px;
  min-width: 60px;
  height: 60px;
  padding: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  font-size: 1.35rem;
  line-height: 1;
  box-shadow:
    0 12px 22px rgba(71, 54, 23, 0.1),
    inset 0 0 0 2px rgba(45, 50, 64, 0.12);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.category-icon-button.is-active {
  background: linear-gradient(135deg, #fff3d9, #ffe3bd);
  color: #171a22;
  box-shadow:
    0 14px 26px rgba(217, 110, 15, 0.2),
    inset 0 0 0 3px rgba(45, 50, 64, 0.16);
}

.category-icon-button.is-empty,
.full-section-dot.is-empty {
  opacity: 0.5;
}

.category-symbol {
  width: 32px;
  height: 32px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.level-button {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 0 15px;
  border-radius: 999px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.68);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px rgba(221, 183, 137, 0.34);
  transition: background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.level-button.is-active {
  color: var(--button-ink);
  background: linear-gradient(135deg, #fff3d9, #ffe3bd);
  box-shadow: 0 10px 22px rgba(217, 110, 15, 0.16);
}

.message-strip,
.board-view {
  padding: 18px;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.message-strip {
  display: grid;
  gap: 16px;
}

.message-label {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-strong);
}

.message-text {
  margin-top: 8px;
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  line-height: 1.25;
  font-weight: 700;
}

.message-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-action {
  background: #fff5e7;
  color: var(--button-ink);
  box-shadow: none;
}

.secondary-action[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.category-section + .category-section {
  margin-top: 18px;
}

.category-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.category-title {
  font-size: 1.25rem;
  font-weight: 800;
}

.category-caption {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.empty-state,
.full-empty-card {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  border-radius: 28px;
  text-align: center;
  background:
    radial-gradient(circle at 28% 18%, rgba(255, 255, 255, 0.92), transparent 24%),
    rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(221, 183, 137, 0.28);
}

.full-empty-card {
  min-height: 0;
  height: 100%;
}

.empty-state-icon,
.empty-state-title,
.empty-state-copy {
  margin: 0;
}

.empty-state-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  color: var(--ink);
  background: #fff5e7;
  box-shadow: inset 0 0 0 2px rgba(45, 50, 64, 0.1);
}

.empty-state-icon .category-symbol {
  width: 34px;
  height: 34px;
}

.empty-state-title {
  margin-top: 10px;
  font-size: 1.25rem;
  font-weight: 900;
}

.empty-state-copy {
  margin-top: 8px;
  max-width: 30rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.tile-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tile-card {
  position: relative;
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 28px;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(255, 249, 239, 0.84)),
    linear-gradient(135deg, var(--tile-shell), rgba(255, 255, 255, 0.76));
  box-shadow: 0 20px 32px rgba(71, 54, 23, 0.11);
  transition: transform 180ms ease, box-shadow 180ms ease, outline-color 180ms ease;
  outline: 2px solid transparent;
  animation: card-rise 520ms cubic-bezier(0.2, 1, 0.28, 1) both;
  animation-delay: var(--delay);
}

.tile-card.is-selected {
  outline-color: var(--focus-ring);
  box-shadow:
    0 26px 38px rgba(71, 54, 23, 0.14),
    0 0 0 5px rgba(255, 255, 255, 0.55);
}

.tile-art {
  display: grid;
  place-items: center;
  min-height: 132px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 255, 255, 0.72), transparent 22%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.76), rgba(255, 255, 255, 0.28)),
    linear-gradient(145deg, var(--tile-shell), var(--tile-accent));
}

.item-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  font-size: clamp(4.4rem, 15vw, 7rem);
  line-height: 1;
  max-width: 100%;
  white-space: nowrap;
  filter: drop-shadow(0 10px 10px rgba(71, 54, 23, 0.14));
  transform: translateY(2px);
}

.item-emoji-pair {
  gap: 0.06em;
  font-size: clamp(3rem, 8vw, 4.3rem);
}

.tile-word {
  display: block;
  font-size: 1.2rem;
  font-weight: 900;
}

.tile-phrase {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  line-height: 1.35;
  font-size: 0.96rem;
}

.focus-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.focus-label {
  color: var(--accent-strong);
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.focus-count {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.focus-surface {
  display: grid;
  gap: 14px;
  align-items: center;
}

.focus-card-row {
  display: grid;
  gap: 14px;
}

.focus-card {
  display: grid;
  gap: 14px;
  width: 100%;
  padding: 18px;
  border: 0;
  border-radius: 34px;
  text-align: left;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.9), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 239, 0.84)),
    linear-gradient(145deg, var(--tile-shell), var(--tile-accent));
  box-shadow: 0 26px 42px rgba(71, 54, 23, 0.14);
}

.card-category-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 13px 0 9px;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  font-size: 0.88rem;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(45, 50, 64, 0.1);
}

.card-category-badge .category-symbol {
  width: 24px;
  height: 24px;
}

.focus-card .tile-art {
  min-height: 270px;
  border-radius: 28px;
}

.focus-card .item-emoji {
  font-size: clamp(7rem, 18vw, 11rem);
}

.focus-card .item-emoji-pair {
  font-size: clamp(4.8rem, 11vw, 7.2rem);
}

.focus-card .tile-word {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.focus-card .tile-phrase {
  font-size: 1.08rem;
}

.focus-nav-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.focus-arrow {
  min-height: 56px;
  padding: 0 18px;
  border-radius: 18px;
  font-size: 1.8rem;
  line-height: 1;
}

.focus-dots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.full-view {
  position: fixed;
  inset: 0;
  z-index: 40;
  height: 100vh;
  height: 100dvh;
  padding: calc(env(safe-area-inset-top, 0px) + 8px) 8px
    calc(env(safe-area-inset-bottom, 0px) + 8px);
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 8%, rgba(255, 255, 255, 0.86), transparent 24%),
    linear-gradient(180deg, var(--sky-top), var(--sky-mid) 48%, var(--sky-bottom));
}

.full-screen-board {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(6px, 1.1dvh, 10px);
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.full-top-row,
.full-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.full-section-rail,
.full-section-dots,
.full-item-dots {
  display: flex;
  gap: 8px;
}

.full-section-rail {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.full-section-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.full-section-dots {
  width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 8px 7px 2px;
  scroll-padding-inline: 10px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  mask-image: linear-gradient(90deg, transparent, #000 10px, #000 calc(100% - 16px), transparent);
}

.full-section-dots::-webkit-scrollbar {
  display: none;
}

.full-section-dot {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  min-height: 52px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  font: inherit;
  font-weight: 900;
  scroll-snap-align: center;
  box-shadow:
    0 12px 22px rgba(71, 54, 23, 0.1),
    inset 0 0 0 2px rgba(45, 50, 64, 0.12);
  transition: background-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.full-section-dot.is-current {
  padding: 0;
  color: #171a22;
  background: linear-gradient(135deg, #f7b85d, #f39c46);
  box-shadow:
    0 0 0 5px rgba(255, 255, 255, 0.62),
    inset 0 0 0 3px rgba(45, 50, 64, 0.16);
}

.full-section-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: transparent;
}

.full-section-dot.is-current .full-section-mark {
  color: #171a22;
}

.full-exit-button,
.full-arrow {
  border: 0;
  color: #fffaf3;
  background: linear-gradient(135deg, #f7b85d, #f39c46);
  font: inherit;
  font-weight: 900;
  box-shadow: 0 14px 24px rgba(217, 110, 15, 0.22);
}

.full-exit-button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
}

.full-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: clamp(6px, 1.1dvh, 10px);
  min-height: 0;
  width: 100%;
  padding: clamp(10px, 2dvh, 16px);
  border: 0;
  border-radius: clamp(24px, 7vw, 34px);
  color: var(--ink);
  text-align: left;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.9), transparent 20%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(255, 250, 239, 0.84)),
    linear-gradient(145deg, var(--tile-shell), var(--tile-accent));
  box-shadow: 0 26px 42px rgba(71, 54, 23, 0.18);
}

.full-card .tile-art {
  min-height: 0;
  height: 100%;
  border-radius: clamp(20px, 6vw, 28px);
  overflow: hidden;
}

.full-card .item-emoji {
  font-size: clamp(8rem, 34vw, 16rem);
}

.full-card .item-emoji-pair {
  font-size: clamp(5rem, 19vw, 9rem);
}

.full-card .tile-word {
  font-size: clamp(2rem, 10.5vw, 3.8rem);
  line-height: 0.96;
}

.full-card .tile-phrase {
  margin-top: 3px;
  font-size: clamp(1rem, 4.4vw, 1.55rem);
  line-height: 1.14;
}

.full-arrow {
  flex: 0 0 clamp(46px, 13vw, 54px);
  min-height: clamp(46px, 6.4dvh, 54px);
  border-radius: 16px;
  font-size: 1.8rem;
}

.full-item-dots {
  flex: 1;
  min-width: 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 7px 0;
  scroll-padding-inline: 8px;
  scroll-snap-type: x proximity;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  mask-image: linear-gradient(90deg, transparent, #000 8px, #000 calc(100% - 8px), transparent);
}

.full-item-dots::-webkit-scrollbar {
  display: none;
}

.full-count {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(0.74rem, 3.2vw, 0.88rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.dot-button {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  padding: 0;
  border-radius: 999px;
  background: rgba(207, 162, 104, 0.32);
  scroll-snap-align: center;
  transition: transform 180ms ease, background-color 180ms ease;
}

.dot-button.is-current {
  background: var(--accent);
  transform: scale(1.16);
}

.focus-hint,
.install-hint {
  color: var(--ink-soft);
  text-align: center;
  line-height: 1.4;
}

.install-hint {
  min-height: 1.4em;
}

.voice-disclosure {
  color: var(--ink-soft);
  font-size: 0.84rem;
  line-height: 1.4;
  text-align: center;
}

.mode-button:hover,
.level-button:hover,
.level-select:hover,
.category-icon-button:hover,
.full-exit-button:hover,
.full-arrow:hover,
.full-section-dot:hover,
.install-button:hover,
.secondary-action:hover,
.focus-arrow:hover,
.tile-card:hover,
.focus-card:hover,
.full-card:hover,
.dot-button:hover {
  transform: translateY(-2px);
}

.mode-button:focus-visible,
.level-button:focus-visible,
.level-select:focus-visible,
.category-icon-button:focus-visible,
.full-exit-button:focus-visible,
.full-arrow:focus-visible,
.full-section-dot:focus-visible,
.install-button:focus-visible,
.secondary-action:focus-visible,
.focus-arrow:focus-visible,
.tile-card:focus-visible,
.focus-card:focus-visible,
.full-card:focus-visible,
.dot-button:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

@media (min-width: 760px) {
  .topbar,
  .message-strip {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .level-nav {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
  }

  .tile-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .board-view {
    padding: 22px;
  }
}

@media (max-width: 759px) {
  .page-shell {
    width: min(100vw - 14px, 100%);
    padding-top: calc(env(safe-area-inset-top, 0px) + 10px);
  }

  .topbar-actions {
    gap: 8px;
  }

  .level-select {
    min-width: 104px;
    min-height: 54px;
    padding-left: 14px;
  }

  .mode-button {
    min-width: 76px;
    padding: 12px 13px;
  }

  .topbar,
  .level-nav,
  .message-strip,
  .board-view {
    border-radius: 24px;
  }

  .focus-card-row {
    align-items: stretch;
  }

  .focus-arrow {
    width: 100%;
    min-height: 52px;
    justify-self: stretch;
  }

  .focus-card .tile-art {
    min-height: 220px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

@keyframes float-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes card-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(18px, -8px, 0);
  }
}
