:root {
  --font-ui: Inter, system-ui, "Segoe UI", sans-serif;
  --ink: #1a242e;
  --muted: #5c5348;
  --bg: #f5f0e8;
  --panel: #faf6ef;
  --tile: #fffdf8;
  --tile-ink: #1a242e;
  --tile-edge: #d8d4ca;
  --selected: oklch(0.45 0.13 25);
  --selected-edge: oklch(0.34 0.12 25);
  --soft: #ece4d6;
  --soft-ink: #5c5348;
  --yellow: #f2c94c;
  --accent: #006770;
  --accent-strong: #00545c;
  --accent-text: #ffffff;
  --danger: #b24a3e;
  --glass: color-mix(in srgb, #faf6ef 90%, transparent);
  --glass-edge: #d8d4ca;
  --shadow: color-mix(in srgb, #1a242e 18%, transparent);
  --c0: oklch(0.55 0.13 255);
  --c0b: oklch(0.44 0.12 255);
  --c1: oklch(0.74 0.14 85);
  --c1b: oklch(0.62 0.13 78);
  --c2: oklch(0.62 0.1 185);
  --c2b: oklch(0.5 0.09 185);
  --c3: oklch(0.55 0.14 300);
  --c3b: oklch(0.44 0.13 300);
  --press: 140ms cubic-bezier(0.2, 0, 0, 1);
  --shift: 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { margin: 0; }

body {
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-ui);
  background: var(--bg);
}

.grain {
  display: none;
}

#fx {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

main {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 16px max(12px, env(safe-area-inset-right)) 28px max(12px, env(safe-area-inset-left));
  overflow-x: clip;
}

h1 {
  margin: 0 0 8px;
  font-size: 2.125rem;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

h1 .mark {
  background-image: linear-gradient(var(--yellow), var(--yellow));
  background-repeat: no-repeat;
  background-position: 0 88%;
  background-size: 100% 0.3em;
  padding: 0 0.04em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

h1.loss {
  color: var(--muted);
}

h1 .caret {
  display: inline-block;
  width: 0.08em;
  height: 0.8em;
  margin-left: 0.08em;
  background: var(--accent);
  vertical-align: -0.05em;
  animation: caret-blink 0.9s steps(1, end) infinite;
}

@keyframes caret-blink {
  50% { opacity: 0; }
}

#pick-lead {
  margin: 2px 0 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--muted);
}

#notice {
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 1rem;
}

.toolbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 12px;
}

.toolbar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

#mistakes {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-height: 32px;
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#mistakes .heart {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
}

button {
  touch-action: manipulation;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}

.tool {
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  padding: 8px 14px;
  box-shadow:
    0 4px 0 var(--accent-strong),
    0 8px 12px var(--shadow);
  transform: translateY(-2px);
  transition: transform var(--press), box-shadow var(--press);
}

.chooser {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-height: 56px;
  padding: 8px 12px 10px;
  text-align: left;
}

.chooser-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: color-mix(in srgb, var(--accent-text) 78%, transparent);
}

.chooser-value {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

#numbers-open,
#levels-open,
#sheet-close {
  border: 0;
}

#pick {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.level-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  min-height: 96px;
  padding: 16px 20px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background: var(--panel);
  box-shadow:
    0 10px 0 var(--tile-edge),
    0 18px 28px var(--shadow);
  color: var(--ink);
  text-align: left;
  transform: translateY(-4px);
  transition: transform var(--press), box-shadow var(--press);
}

.level-card.medium {
  background: linear-gradient(180deg, #f8de82, var(--yellow));
  color: var(--ink);
  box-shadow:
    0 10px 0 #e5b93b,
    0 18px 28px var(--shadow);
}

.level-card.hard {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fffdf8;
  box-shadow:
    0 10px 0 var(--accent-strong),
    0 18px 28px var(--shadow);
}

.mine-wrap {
  position: relative;
}

.level-card.mine {
  padding-right: 88px;
  background: linear-gradient(180deg, #a48ae6, #7a5ad8);
  color: #fffdf8;
  box-shadow:
    0 10px 0 #5f43b8,
    0 18px 28px var(--shadow);
}

.add-game {
  position: absolute;
  top: 50%;
  right: 18px;
  width: 60px;
  height: 60px;
  margin-top: -34px;
  border: 2px solid oklch(1 0.01 70 / 0.8);
  border-radius: 50%;
  background: oklch(1 0.01 70 / 0.18);
  color: #fffdf8;
  font: inherit;
  font-size: 2.25rem;
  font-weight: 700;
  line-height: 1;
  padding: 0 0 4px;
}

.add-game:active {
  background: oklch(1 0.01 70 / 0.34);
}

.wide.share {
  margin-top: 16px;
  background: var(--panel);
  color: var(--accent);
  border: 2px solid var(--accent);
  box-shadow: 0 4px 0 var(--tile-edge);
}

.wide {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 1.0625rem;
  font-weight: 800;
  padding: 14px 22px;
  box-shadow:
    0 6px 0 var(--accent-strong),
    0 12px 18px var(--shadow);
  transform: translateY(-3px);
  transition: transform var(--press), box-shadow var(--press);
}

.wide:disabled {
  background: var(--soft);
  color: var(--soft-ink);
  box-shadow: 0 4px 0 oklch(0.78 0.03 50);
}

.level-name {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.level-lead {
  font-size: 1rem;
  font-weight: 600;
  opacity: 0.78;
}

.level-count {
  margin-top: 4px;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

#cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  position: relative;
  margin: 0;
  padding: 14px 16px 13px;
  border-radius: 22px;
  color: oklch(0.99 0.01 90);
  border: 1px solid oklch(1 0.01 70 / 0.28);
  box-shadow:
    inset 0 1px 0 oklch(1 0.01 70 / 0.4),
    0 8px 0 oklch(0.35 0.08 40 / 0.22),
    0 14px 22px var(--shadow);
  animation: card-in var(--shift);
}

.card-0 { background: linear-gradient(180deg, var(--c0), var(--c0b)); }
.card-1 { background: linear-gradient(180deg, var(--c1), var(--c1b)); }
.card-2 { background: linear-gradient(180deg, var(--c2), var(--c2b)); }
.card-3 { background: linear-gradient(180deg, var(--c3), var(--c3b)); }

.card h2 {
  margin: 0 0 3px;
  font-size: 1.125rem;
  line-height: 1.25;
  font-weight: 800;
}

.card p {
  margin: 0;
  font-size: 0.9375rem;
  line-height: 1.35;
  font-weight: 600;
}

#grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  width: 100%;
}

.word {
  aspect-ratio: 1.36;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 6px 4px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--tile), var(--panel));
  color: var(--tile-ink);
  font: inherit;
  font-size: clamp(1rem, 4.5vw, 1.25rem);
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
  overflow-wrap: normal;
  word-break: keep-all;
  hyphens: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow:
    inset 0 1px 0 oklch(1 0.01 80 / 0.85),
    0 6px 0 var(--tile-edge),
    0 10px 14px var(--shadow);
  transform: translateY(-3px);
  transition: transform var(--press), box-shadow var(--press), background var(--press), color var(--press);
}

.word[aria-pressed="true"] {
  background: linear-gradient(180deg, oklch(0.58 0.16 28), var(--selected));
  color: oklch(0.99 0.01 80);
  border-color: oklch(0.7 0.1 32 / 0.5);
  box-shadow:
    inset 0 1px 0 oklch(0.8 0.08 40 / 0.45),
    0 8px 0 var(--selected-edge),
    0 14px 18px var(--shadow);
}

.word.near {
  box-shadow:
    inset 0 0 0 3px var(--yellow),
    0 8px 0 var(--selected-edge),
    0 14px 18px var(--shadow);
}

.word.hint {
  background: linear-gradient(180deg, #f8de82, var(--yellow));
  color: var(--ink);
  border-color: #e6c15a;
  box-shadow:
    inset 0 1px 0 oklch(1 0.02 95 / 0.85),
    0 6px 0 #e0b43a,
    0 10px 14px var(--shadow);
}

.word.shake {
  animation: miss-shake 380ms cubic-bezier(0.2, 0, 0, 1);
}

.word.spent {
  background: var(--soft);
  color: var(--muted);
  border-color: var(--tile-edge);
  box-shadow:
    0 3px 0 var(--tile-edge),
    0 6px 10px var(--shadow);
  transform: translateY(0);
  opacity: 0.72;
  cursor: default;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  margin-top: 20px;
}

#check,
#hint,
#clear,
#next,
#again,
#jump-form button {
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.15;
  padding: 12px 8px;
  box-shadow:
    0 4px 0 var(--accent-strong),
    0 8px 12px var(--shadow);
  transform: translateY(-2px);
  transition: transform var(--press), box-shadow var(--press);
}

#check,
#hint,
#clear {
  width: 100%;
  min-height: 52px;
}

#next,
#again,
#jump-form button {
  border-radius: 999px;
  font-size: 1.0625rem;
  padding: 14px 24px;
  box-shadow:
    0 6px 0 var(--accent-strong),
    0 12px 18px var(--shadow);
  transform: translateY(-3px);
}

#check:disabled,
#hint:disabled,
#clear:disabled {
  background: var(--soft);
  color: var(--soft-ink);
  box-shadow:
    inset 0 1px 0 oklch(1 0.01 70 / 0.35),
    0 4px 0 oklch(0.78 0.03 50),
    0 8px 12px oklch(0.4 0.05 40 / 0.12);
}

#next,
#again {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 16px 22px;
}

#again {
  animation: again-wait 1.6s cubic-bezier(0.22, 1, 0.36, 1) infinite;
}

#end-note {
  margin: 16px 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
}

#streak {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  justify-items: center;
  width: 100%;
  margin: 16px 0 8px;
  min-height: 48px;
}

.heart {
  width: 48px;
  height: 48px;
  display: block;
}

.heart.empty {
  color: color-mix(in srgb, var(--ink) 22%, transparent);
}

.heart.win {
  color: var(--accent);
}

.heart.intact,
.heart.loss {
  color: var(--danger);
}

#sheet,
#maker,
#player-sheet,
#board {
  position: fixed;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding:
    max(18px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    0
    max(16px, env(safe-area-inset-left));
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(22px) saturate(1.3);
}

.sheet-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 430px;
  margin: 0 auto;
}

.sheet-head {
  flex: none;
  background: var(--bg);
}

.sheet-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sheet-top h2 {
  margin: 0;
  font-size: 1.625rem;
  font-weight: 800;
}

#collected {
  margin: 14px 0 0;
  font-size: 1.125rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

#jump-form {
  display: flex;
  gap: 8px;
  margin: 12px 0 8px;
}

#jump-form button {
  flex: none;
  padding: 12px 16px;
}

#jump {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background: var(--glass);
  padding: 0 14px;
  font: inherit;
  font-size: 1.125rem;
  box-shadow: inset 0 1px 0 oklch(1 0.01 70 / 0.6);
}

#maker,
#player-sheet,
#board {
  overflow: auto;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.maker-inner,
.panel-inner,
.panel {
  flex: none;
  gap: 12px;
}

.panel {
  display: flex;
  flex-direction: column;
}

.panel[hidden] {
  display: none;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card .info {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1.5px solid oklch(1 0.01 70 / 0.75);
  border-radius: 50%;
  background: oklch(1 0.01 70 / 0.16);
  color: inherit;
  font: inherit;
  font-size: 1rem;
  font-weight: 800;
  font-style: italic;
  line-height: 1;
}

.card .info[aria-expanded="true"] {
  background: oklch(1 0.01 70 / 0.38);
}

.card h2 {
  padding-right: 40px;
}

.why {
  margin: 10px 0 2px;
  padding-left: 18px;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
}

.why li + li {
  margin-top: 6px;
}

#hint-count {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#hint-count[hidden] {
  display: none;
}

.star {
  font-size: 1.375rem;
  line-height: 1;
  color: color-mix(in srgb, var(--ink) 22%, transparent);
}

.star.lit {
  color: #e3a01b;
}

#points-line {
  margin: 16px 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--accent);
}

#offer {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--glass-edge);
  border-radius: 16px;
  background: var(--panel);
}

.offer-text {
  margin: 0 0 12px;
  font-size: 1.125rem;
  font-weight: 800;
}

.offer-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.offer-actions .wide {
  flex: 1;
}

.wide.compete {
  background: linear-gradient(180deg, #e3a01b, #c98a0f);
  color: #1a242e;
  box-shadow:
    0 6px 0 #a87207,
    0 12px 18px var(--shadow);
}

.name-big {
  margin: 8px 0 0;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.2;
}

.code-words {
  margin: 0;
  padding: 16px;
  border: 2px dashed var(--accent);
  border-radius: 16px;
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  -webkit-user-select: text;
  user-select: text;
}

.link {
  align-self: flex-start;
  border: 0;
  background: none;
  padding: 6px 0;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: underline;
}

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

.field-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--glass-edge);
  border-radius: 14px;
  background: var(--glass);
  padding: 0 12px;
  font: inherit;
  font-size: 1rem;
}

.field-row .tool {
  flex: none;
  font-size: 0.9375rem;
}

.form-label {
  margin: 12px 0 0;
  font-size: 0.9375rem;
  font-weight: 800;
}

.me-line {
  margin: 4px 0 0;
  font-size: 1.0625rem;
  font-weight: 800;
}

.tabs,
.period {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  padding: 8px 14px;
}

.pill.on {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
}

#board-rows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#board-rows li {
  display: grid;
  grid-template-columns: 2.2em 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--panel);
  font-weight: 700;
}

#board-rows li.me {
  background: color-mix(in srgb, var(--yellow) 45%, var(--panel));
}

#board-rows .rank {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#board-rows .pts {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

#company-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#company-tools[hidden] {
  display: none;
}

.maker-step {
  margin: 8px 0 0;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

#prompt-text {
  margin: 0;
  max-height: 160px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--glass-edge);
  border-radius: 14px;
  background: var(--glass);
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.4;
  white-space: pre-wrap;
  -webkit-user-select: text;
  user-select: text;
}

.maker-hint {
  font-size: 0.875rem;
  color: var(--muted);
}

/* The pasted answer is never readable: the text is transparent and the field empties at once. */
#answer-field {
  width: 100%;
  min-height: 52px;
  resize: none;
  border: 1px dashed var(--glass-edge);
  border-radius: 14px;
  background: var(--glass);
  padding: 12px 14px;
  font: inherit;
  font-size: 1rem;
  color: transparent;
  -webkit-text-fill-color: transparent;
  caret-color: var(--ink);
}

.maker-status {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 800;
  line-height: 1.35;
}

#jump-error {
  margin: 0 0 10px;
  color: var(--danger);
}

#number-list {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  align-content: start;
  margin-top: 8px;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}

.num {
  min-height: 52px;
  min-width: 0;
  padding: 0 2px;
  border: 1px solid var(--glass-edge);
  border-radius: 14px;
  background:
    linear-gradient(180deg, oklch(0.99 0.02 80), var(--tile));
  color: var(--tile-ink);
  font: inherit;
  font-size: clamp(0.8125rem, 3.6vw, 1.0625rem);
  font-weight: 800;
  white-space: nowrap;
  box-shadow:
    inset 0 1px 0 oklch(1 0.01 80 / 0.8),
    0 5px 0 var(--tile-edge);
  transform: translateY(-2px);
  transition: transform var(--press), box-shadow var(--press);
}

.num.solved {
  background: linear-gradient(180deg, oklch(0.58 0.16 28), var(--selected));
  color: oklch(0.99 0.01 80);
  box-shadow:
    inset 0 1px 0 oklch(0.8 0.08 40 / 0.4),
    0 5px 0 var(--selected-edge);
}

.num.current {
  box-shadow:
    inset 0 0 0 2px var(--ink),
    0 5px 0 var(--tile-edge);
}

@keyframes card-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes miss-shake {
  0%, 100% { transform: translate(0, -3px); }
  25% { transform: translate(-6px, -3px); }
  50% { transform: translate(5px, -3px); }
  75% { transform: translate(-3px, -3px); }
}

@keyframes again-wait {
  0%, 100% { transform: translateY(-3px); }
  50% { transform: translateY(-6px); }
}

@keyframes heart-in {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (hover: hover) and (pointer: fine) {
  .word:hover,
  .level-card:hover,
  .tool:hover,
  #check:hover:not(:disabled),
  #hint:hover:not(:disabled),
  #clear:hover:not(:disabled),
  #next:hover,
  #again:hover,
  .num:hover {
    filter: brightness(1.04);
  }
}

.word:active,
.level-card:active,
.wide:active:not(:disabled),
.tool:active,
#next:active,
#again:active,
.num:active,
#jump-form button:active {
  transform: translateY(4px);
  box-shadow:
    inset 0 1px 0 oklch(1 0.01 80 / 0.3),
    0 2px 0 var(--tile-edge),
    0 6px 10px var(--shadow);
}

#check:active:not(:disabled),
#hint:active:not(:disabled),
#clear:active:not(:disabled) {
  transform: translateY(2px);
  box-shadow:
    0 2px 0 var(--accent-strong),
    0 6px 10px var(--shadow);
}

.level-card.hard:active,
.wide:active:not(:disabled),
#check:active:not(:disabled),
#hint:active:not(:disabled),
#clear:active:not(:disabled),
#next:active,
#again:active,
#jump-form button:active,
.tool:active {
  box-shadow:
    0 2px 0 var(--accent-strong),
    0 6px 10px var(--shadow);
}

.level-card.mine:active {
  box-shadow:
    0 2px 0 #5f43b8,
    0 6px 10px var(--shadow);
}

.word[aria-pressed="true"]:active,
.num.solved:active {
  box-shadow:
    inset 0 1px 0 oklch(0.8 0.08 40 / 0.3),
    0 2px 0 var(--selected-edge),
    0 6px 10px var(--shadow);
}

@media (max-height: 760px) {
  h1 { font-size: 1.8125rem; }
  .card { padding: 10px 14px 9px; }
  .card h2 { font-size: 1rem; }
  #cards { gap: 8px; }
  .word { aspect-ratio: 1.5; }
  .actions { margin-top: 12px; }
}

@media (max-height: 680px) {
  main { padding-top: 12px; padding-bottom: 16px; }
  h1 { font-size: 1.6875rem; margin-bottom: 6px; }
  .toolbar { margin-bottom: 8px; }
  .word {
    aspect-ratio: 1.68;
    border-radius: 14px;
    box-shadow:
      inset 0 1px 0 oklch(1 0.01 80 / 0.85),
      0 4px 0 var(--tile-edge),
      0 8px 10px var(--shadow);
    transform: translateY(-2px);
  }
  .word[aria-pressed="true"] {
    box-shadow:
      inset 0 1px 0 oklch(0.8 0.08 40 / 0.45),
      0 4px 0 var(--selected-edge),
      0 8px 10px var(--shadow);
  }
  .word.hint {
    box-shadow:
      inset 0 1px 0 oklch(1 0.02 95 / 0.85),
      0 4px 0 #e0b43a,
      0 8px 10px var(--shadow);
  }
}

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