/* 꼬들(kordle.kr)처럼 흰 바탕, 가는 테두리의 정사각 칸, 아래 키보드.
 * 없는 기호는 신호등처럼 탁한 빨강. 테마는 data-theme 로 바꾼다.
 */
:root {
  --bg: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #d3d6da;
  --tile-border: #e2e8f0;
  --tile-fill: #111827;
  --key: #e2e8f0;
  --key-text: #111827;
  --correct: #22c55e;
  --present: #eab308;
  --absent: #c4504a;
  --on: #ffffff;
  --present-ink: #1c1917;
  --modal: #ffffff;
  --overlay: rgba(107, 114, 128, 0.75);
  --toast-bad: #fecdd3;
  --toast-good: #bbf7d0;
  --toast-ink: #111827;
  --btn: #16a34a;
  --btn-ink: #ffffff;
  --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #121213;
  --text: #f8fafc;
  --muted: #9ca3af;
  --line: #3a3a3c;
  --tile-border: #3a3a3c;
  --tile-fill: #d7dadc;
  --key: #9aa0a6;
  --key-text: #f8fafc;
  --correct: #22c55e;
  --present: #eab308;
  --absent: #9a4540;
  --on: #ffffff;
  --present-ink: #1c1917;
  --modal: #1a1a1b;
  --overlay: rgba(0, 0, 0, 0.72);
  --toast-bad: #7f1d1d;
  --toast-good: #14532d;
  --toast-ink: #f8fafc;
  --btn: #22c55e;
  --btn-ink: #052e16;
  --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", ui-sans-serif, system-ui, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
#app {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top {
  display: flex;
  align-items: center;
  gap: 2px;
  min-height: 52px;
  padding: env(safe-area-inset-top) 8px 0;
  border-bottom: 1px solid var(--line);
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
}
.brand {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
h1 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
html[lang="en"] h1 { font-size: 0.92rem; letter-spacing: -0.05em; }
.sig {
  display: flex;
  gap: 3px;
  flex: none;
}
.sig-tile {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}
.sig-tile.absent { background: var(--absent); color: var(--on); }
.sig-tile.correct { background: var(--correct); color: var(--on); }
.sig-tile.present { background: var(--present); color: var(--present-ink); }
.iconbtn {
  flex: none;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  border-radius: 4px;
  display: grid;
  place-items: center;
  padding: 0;
}
a.iconbtn { color: inherit; text-decoration: none; }
.iconbtn:hover, .iconbtn:focus-visible { background: var(--key); outline: none; }

:root { --chip: #f3f4f6; --chip-line: #e5e7eb; }
html[data-theme="dark"] { --chip: #1c1d21; --chip-line: #3a3a3c; }
.meta {
  max-width: 560px;
  width: 100%;
  margin: 0 auto;
  padding: 6px 8px 0;
  text-align: center;
  color: var(--muted);
}
.visitors {
  display: inline-block;
  max-width: 100%;
  margin: 0 0 6px;
  padding: 3px 10px;
  border: 1px solid var(--chip-line);
  border-radius: 999px;
  background: var(--chip);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.35;
  white-space: normal;
  font-variant-numeric: tabular-nums;
}
.who { display: inline-flex; align-items: center; min-width: 0; gap: 0.2em; }
.ctabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 8px 0 4px;
  padding-bottom: 2px;
}
.ctab {
  flex: none;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  line-height: 1.3;
}
.ctab.on { background: var(--text); color: var(--bg); }
.rankline { margin: 4px 0; font-weight: 800; text-align: center; }
.flag {
  display: inline-grid;
  place-items: center;
  width: 1.35em;
  flex: none;
  line-height: 1;
}
.flag-code { display: none; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.02em; }
html[data-flags="code"] .flag-emoji { display: none; }
html[data-flags="code"] .flag-code { display: inline; }
.visitors[hidden] { display: none; }
.status {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr 0.95fr;
  gap: 6px;
  text-align: left;
}
.status.is-play { grid-template-columns: 1fr 1fr; }
.status.is-play #chip-next,
.status.is-create #chip-slot,
.status.is-create #chip-elapsed,
.status.is-create #chip-next { display: none; }
.status.is-create { grid-template-columns: 1fr; }
#chip-create { display: none; }
.status.is-create #chip-create { display: block; }
.chip {
  background: var(--chip);
  border: 1px solid var(--chip-line);
  border-radius: 8px;
  padding: 5px 8px 4px;
  min-width: 0;
}
.chip-k {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  line-height: 1.2;
}
.chip-v {
  display: block;
  margin-top: 1px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
#chip-slot .chip-v {
  white-space: normal;
  font-size: 12px;
  line-height: 1.25;
}
.chip-v.num {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  font-size: 16px;
  letter-spacing: -0.04em;
  line-height: 1.15;
}
.clk { display: block; flex: none; }
.modes { display: flex; justify-content: center; gap: 4px; margin-top: 2px; }
.modes button {
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 4px 10px 6px;
}
.modes button.on { color: var(--text); border-bottom-color: var(--text); }

.toast {
  position: relative;
  z-index: 5;
  width: max-content;
  max-width: min(92vw, 24rem);
  margin: 8px auto 0;
  background: var(--toast-bad);
  color: var(--toast-ink);
  border-radius: 4px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  pointer-events: none;
}
.toast.over {
  position: fixed;
  z-index: 80;
  top: calc(env(safe-area-inset-top) + 12px);
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
}
.toast.good { background: var(--toast-good); }
.toast[hidden] { display: none; }

main {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  overflow: auto;
  padding: 18px 8px 8px;
}
body.is-waiting main { min-height: 320px; }
.gate {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 20px;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
}
.gate[hidden] { display: none; }
.gate-note {
  margin: 0;
  max-width: 18rem;
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
}
.lucky {
  margin: 0 0 10px;
  padding: 14px 12px;
  border: 2px solid #15803d;
  border-radius: 14px;
  background: #ecfdf3;
  color: #14532d;
  text-align: center;
}
.lucky-mark { font-size: 3.4rem; line-height: 1; margin-bottom: 8px; }
.lucky-body { margin: 0; font-size: 1.05rem; font-weight: 800; line-height: 1.45; color: #14532d; }
.lucky-odds { margin: 8px 0 0; font-size: 1.15rem; font-weight: 800; color: #166534; }
.lucky-skip { margin: 8px 0 0; font-size: 0.95rem; font-weight: 800; color: #9f1239; }
html[data-theme="dark"] .lucky { background: #052e16; border-color: #4ade80; color: #dcfce7; }
html[data-theme="dark"] .lucky-body,
html[data-theme="dark"] .lucky-odds { color: #dcfce7; }
html[data-theme="dark"] .lucky-skip { color: #fecdd3; }
.keycard {
  margin: 0 0 10px;
  padding: 14px 12px 12px;
  border: 2px solid #d4a017;
  border-radius: 14px;
  background: linear-gradient(180deg, #fff8e1, #f3d27a);
  text-align: center;
}
.key-art { width: 132px; height: auto; display: block; margin: 0 auto 6px; }
.key-title { margin: 0; font-size: 1.15rem; font-weight: 800; color: #7c4a03; }
.key-body { margin: 8px 0 0; font-size: 0.98rem; font-weight: 700; line-height: 1.45; color: #6b3e06; }
html[data-theme="dark"] .keycard { background: linear-gradient(180deg, #3b2a08, #1c1404); border-color: #f6d56a; }
html[data-theme="dark"] .key-title, html[data-theme="dark"] .key-body { color: #fde68a; }
.device-note {
  margin: 0 0 10px;
  padding: 12px;
  border-radius: 12px;
  background: #fff7ed;
  color: #9a3412;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}
html[data-theme="dark"] .device-note { background: #431407; color: #fdba74; }
.lb.hall li { align-items: flex-start; }
.hall-round { font-weight: 800; }
.hall-who { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.hall-players { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.promo {
  display: block;
  margin: 8px 0 2px;
  padding: 12px;
  border: 2px solid #111827;
  border-radius: 12px;
  background: #f8fafc;
  color: #111827;
  text-decoration: none;
}
.mbody a.promo { color: #111827; }
.promo-row { display: flex; align-items: center; gap: 10px; text-align: left; }
.promo-copy { flex: 1; min-width: 0; }
.promo-name { display: block; font-size: 1.02rem; font-weight: 800; }
.promo-tag { display: block; margin-top: 2px; font-size: 0.86rem; font-weight: 700; line-height: 1.35; color: #374151; }
.promo-open {
  flex: none;
  padding: 6px 10px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
}
html[data-theme="dark"] .promo { background: #1c1d21; border-color: #e5e7eb; color: #f8fafc; }
html[data-theme="dark"] .mbody a.promo,
html[data-theme="dark"] .promo-name { color: #f8fafc; }
html[data-theme="dark"] .promo-tag { color: #d1d5db; }
html[data-theme="dark"] .promo-open { background: #f8fafc; color: #111827; }
.pop {
  position: fixed;
  inset: 0;
  z-index: 45;
  background: transparent;
}
.pop-sheet {
  position: absolute;
  top: calc(env(safe-area-inset-top) + 52px);
  right: 8px;
  width: min(280px, calc(100vw - 16px));
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg, #fff);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.16);
}
.pop-kicker { margin: 0 0 8px; font-weight: 800; color: var(--text); }
.pop-item, .pop-menu {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
}
.pop-item small, .promo-tag { font-weight: 650; }
.lb .ongoing { background: color-mix(in srgb, var(--present) 25%, transparent); }
.btn-start {
  min-width: 11rem;
  border: 0;
  border-radius: 14px;
  padding: 16px 36px;
  background: #111827;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
}
html[data-theme="dark"] .btn-start { background: #f8fafc; color: #111827; }
body.is-waiting #keyboard { display: none; }
.board {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.hint {
  margin: 10px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  min-height: 1.2em;
}
.hint.ok { color: var(--text); font-weight: 700; }
.hint button {
  background: none;
  border: 0;
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  padding: 0;
}

.row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 4px;
  perspective: 900px;
}
.tile {
  aspect-ratio: 1;
  border: 2px solid var(--tile-border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: clamp(16px, 4.8vw, 28px);
  line-height: 1;
  user-select: none;
  position: relative;
}
.tile.filled { border-color: var(--tile-fill); }
.tile.correct { background: var(--correct); border-color: var(--correct); color: var(--on); }
.tile.present { background: var(--present); border-color: var(--present); color: var(--present-ink); }
.tile.absent { background: var(--absent); border-color: var(--absent); color: var(--on); }
html[data-assist="1"] .tile.present {
  background-image: repeating-linear-gradient(135deg, transparent, transparent 3px, rgba(0, 0, 0, 0.22) 3px, rgba(0, 0, 0, 0.22) 5px);
}
html[data-assist="1"] .tile.absent {
  background-image: repeating-linear-gradient(90deg, transparent, transparent 3px, rgba(255, 255, 255, 0.28) 3px, rgba(255, 255, 255, 0.28) 5px);
}
.tile .mark {
  position: absolute;
  right: 1px;
  bottom: 0;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.extra { max-width: 560px; width: 100%; margin: 0 auto; padding: 0 8px 6px; }
.extra[hidden] { display: none; }

.kb {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  padding: 2px 6px calc(8px + env(safe-area-inset-bottom));
  user-select: none;
}
.kb-row { display: flex; gap: 4px; margin-bottom: 4px; }
.key {
  flex: 1;
  height: 58px;
  border: 0;
  border-radius: 4px;
  background: var(--key);
  color: var(--key-text);
  font-weight: 700;
  font-size: 1.05rem;
  touch-action: manipulation;
}
.key.wide { flex: 1.4; font-size: 0.92rem; }
.key:active { filter: brightness(0.92); }
.key.correct { background: var(--correct); color: var(--on); }
.key.present { background: var(--present); color: var(--present-ink); }
.key.absent { background: var(--absent); color: var(--on); }
.key:disabled { opacity: 0.45; }

#modal[hidden] { display: none; }
#modal { position: fixed; inset: 0; z-index: 30; overflow: auto; }
.overlay { position: fixed; inset: 0; background: var(--overlay); }
.panel {
  position: relative;
  z-index: 1;
  width: calc(100% - 2rem);
  max-width: 24rem;
  margin: 8vh auto 2rem;
  background: var(--modal);
  color: var(--text);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 1.35rem 1.15rem 1.25rem;
}
.close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  border-radius: 4px;
}
.close:hover { background: var(--key); }
.mtitle {
  margin: 0 1.5rem 0.6rem;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 500;
}
.mbody { color: var(--muted); font-size: 0.875rem; line-height: 1.55; }
.mbody p { margin: 0 0 0.55rem; }
.mbody .ink { color: var(--text); }
.legend { display: flex; gap: 8px; justify-content: center; margin: 10px 0 12px; }
.legend .tile { width: 42px; height: 42px; aspect-ratio: auto; font-size: 16px; }
.stats { display: flex; justify-content: center; gap: 4px; margin: 4px 0 12px; }
.stat { flex: 1; text-align: center; }
.stat b { display: block; color: var(--text); font-size: 1.7rem; font-weight: 700; line-height: 1.15; }
.stat span { font-size: 0.72rem; }
.lb { list-style: none; margin: 6px 0 0; padding: 0; }
.lb li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 0.9rem;
}
.lb .me { font-weight: 700; background: color-mix(in srgb, var(--correct) 22%, transparent); border-radius: 4px; padding-left: 6px; padding-right: 6px; }
.gridtext {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.95rem;
  letter-spacing: 0;
  text-align: center;
  margin: 8px 0;
  line-height: 1.35;
}
.btn, .btn-ghost {
  display: block;
  width: 100%;
  margin-top: 8px;
  border-radius: 6px;
  padding: 10px 14px;
  font-weight: 700;
  font-size: 0.95rem;
  text-align: center;
  text-decoration: none;
}
.btn { border: 0; background: var(--btn); color: var(--btn-ink); }
a.btn, a.btn-ghost { text-decoration: none; }
.btn-x { background: #111827; color: #fff; font-size: 0.9rem; line-height: 1.35; white-space: normal; }
html[data-theme="dark"] .btn-x,
html[data-theme="dark"] .mbody a.btn-x { background: #f8fafc; color: #111827; }
.mbody a.btn-x { color: #fff; }
.btn-boast {
  background: #111827;
  color: #fff;
  font-size: 1.05rem;
  padding: 14px 14px;
}
html[data-theme="dark"] .btn-boast { background: #f8fafc; color: #111827; }
.btn-boast:disabled { opacity: 0.7; }
.thanks {
  display: block;
  margin: 10px 0 2px;
  padding: 14px 14px 12px;
  border: 2px solid #111827;
  border-radius: 12px;
  background: #fef3c7;
  color: #111827;
  text-decoration: none;
  text-align: center;
}
.mbody a.thanks { color: #111827; font-weight: 700; }
.thanks-msg {
  display: block;
  font-size: 1.02rem;
  line-height: 1.45;
  font-weight: 700;
}
.thanks-handle {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 800;
}
html[data-theme="dark"] .thanks {
  background: #3b2a12;
  border-color: #fbbf24;
  color: #fef3c7;
}
html[data-theme="dark"] .mbody a.thanks { color: #fef3c7; }
html[data-theme="dark"] .thanks-handle { background: #fbbf24; color: #1c1917; }
.share-sheet {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(17, 24, 39, 0.5);
}
.share-card {
  position: relative;
  width: min(24rem, 100%);
  max-height: 92dvh;
  overflow: auto;
  margin: 0;
  padding: 1rem 1rem calc(1.1rem + env(safe-area-inset-bottom));
  background: var(--modal);
  color: var(--text);
  border-radius: 14px 14px 0 0;
  box-shadow: var(--shadow);
}
.share-preview {
  display: block;
  width: min(100%, 280px);
  height: auto;
  margin: 0.4rem auto 0.2rem;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
}
.share-hint { margin: 8px 0 0; text-align: center; }
@media (min-width: 640px) {
  .share-sheet { align-items: center; }
  .share-card { border-radius: 14px; margin: 1rem; }
}
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.mbody a { color: var(--text); font-weight: 700; }
.langs { display: flex; gap: 6px; margin: 6px 0 12px; }
.lang {
  flex: 1;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  border-radius: 6px;
  padding: 8px 4px;
  font-weight: 700;
}
.lang.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.mgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mcard {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--bg);
}
.mcard b { display: block; color: var(--text); font-size: 1.05rem; line-height: 1.2; }
.mcard span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.72rem; line-height: 1.3; }
.mhead { margin: 14px 0 6px; color: var(--text); font-size: 0.95rem; font-weight: 800; }
.mnote { margin: 0 0 8px; color: var(--muted); font-size: 0.75rem; line-height: 1.4; }
.mlist { margin: 0; padding: 0; list-style: none; }
.mlist li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); color: var(--text); }
.lb .num { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.nick {
  width: 100%;
  margin-top: 8px;
  font-size: 16px;
  padding: 8px 10px;
  border-radius: 6px;
  border: 2px solid var(--line);
  background: var(--bg);
}
.setrow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  color: var(--text);
}
.setrow small { display: block; color: var(--muted); font-size: 0.75rem; margin-top: 3px; }
.toggle {
  width: 56px;
  height: 32px;
  flex: none;
  border: 0;
  border-radius: 999px;
  background: #d1d5db;
  padding: 4px;
}
.toggle.on { background: #4ade80; }
.toggle i {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
}
.toggle.on i { transform: translateX(24px); }
.answer-row { margin: 8px auto 12px; width: min(100%, 320px); }

@keyframes pop {
  0% { transform: scale(1); }
  50% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes flip {
  0% { transform: rotateX(0); }
  50% { transform: rotateX(-90deg); }
  100% { transform: rotateX(0); }
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(3px); }
  30%, 50%, 70% { transform: translateX(-6px); }
  40%, 60% { transform: translateX(6px); }
}
.tile.pop { animation: pop 0.12s linear; }
.tile.flip { animation: flip 280ms ease-in-out; animation-delay: var(--d, 0ms); }
.row.shake { animation: shake 0.45s; }

@media (prefers-reduced-motion: reduce) {
  .tile.pop, .tile.flip, .row.shake, .toggle i { animation: none; transition: none; }
}
@media (max-height: 700px) {
  .key { height: 48px; }
  .tile { font-size: clamp(14px, 4.2vw, 22px); }
}
