:root {
  --flesh: #ff4766;
  --flesh-dark: #c81f45;
  --flesh-light: #ff8fa3;
  --rind: #2a9c46;
  --rind-dark: #1b7333;
  --pale: #eafbd2;
  --ink: #183a1f;
  --cream: #fff8ec;
  --pc: #ff4f9a;
  --pc-light: #ffd3e6;
  --safe-top: 0px;
  --font: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  font-family: var(--font);
  color: var(--ink);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  touch-action: none;
  background-color: #ff5c7a;
  background-image:
    radial-gradient(ellipse 5px 8px at 22px 20px, rgba(29, 23, 22, 0.22) 95%, transparent 100%),
    radial-gradient(ellipse 5px 8px at 58px 52px, rgba(29, 23, 22, 0.22) 95%, transparent 100%),
    radial-gradient(circle at 50% 120%, #ff8fa3 0%, #ff4766 55%, #d92b4b 100%);
  background-size: 72px 72px, 72px 72px, 100% 100%;
}

#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

#game {
  position: absolute;
  display: block;
  touch-action: none;
}

#app.wide #game {
  box-shadow: 0 0 0 6px var(--pale), 0 0 0 13px var(--rind), 0 0 0 15px var(--ink), 0 24px 70px rgba(60, 0, 20, 0.45);
}

#fx {
  position: absolute;
  pointer-events: none;
}

#ui {
  position: absolute;
  font-size: 16px;
  pointer-events: none;
  overflow: hidden;
}

/* ------------------------------------------------------------- top bar */

#topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  padding: calc(0.6em + var(--safe-top)) 0.6em 0.6em;
  z-index: 5;
}

.grow { flex: 1; }

.icon-btn {
  pointer-events: auto;
  width: 2.6em;
  height: 2.6em;
  border-radius: 50%;
  border: 0.15em solid var(--ink);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0.2em 0 var(--ink);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  color: var(--ink);
  transition: transform 0.08s;
}
.icon-btn:active { transform: translateY(0.15em); box-shadow: 0 0.05em 0 var(--ink); }
.icon-btn[hidden] { display: none; }
.icon-btn svg { width: 1.4em; height: 1.4em; fill: currentColor; }
.icon-btn svg .wave { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
#btn-mute .off { display: none; }
#btn-mute[aria-pressed="true"] .on { display: none; }
#btn-mute[aria-pressed="true"] .off { display: block; }

/* ------------------------------------------------------------- screens */

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75em;
  padding: calc(3.6em + var(--safe-top)) 1.1em 1.2em;
  pointer-events: auto;
  animation: screenIn 0.28s ease-out both;
}
.screen[hidden] { display: none; }
.screen.pass { pointer-events: none; }
.screen.leaving { animation: screenOut 0.2s ease-in both; }

@keyframes screenIn { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: none; } }
@keyframes screenOut { from { opacity: 1; } to { opacity: 0; transform: scale(0.97); } }

button { font-family: inherit; }
button:focus-visible { outline: 0.2em solid #fff; outline-offset: 0.2em; }

/* ------------------------------------------------------------- title */

#screen-title { padding-top: calc(2.7em + var(--safe-top)); gap: 0.5em; }

.logo {
  margin: 0;
  text-align: center;
  line-height: 0.92;
  font-weight: 900;
  letter-spacing: 0.01em;
}
.logo-line { display: block; white-space: nowrap; animation: dropIn 0.7s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.logo-line.l1 { font-size: 2.42em; letter-spacing: -0.01em; }
.logo-line.l2 { font-size: 2.6em; animation-delay: 0.12s; }
.logo-line span {
  display: inline-block;
  --o: #183a1f;
  color: var(--flesh);
  text-shadow:
    0.045em 0 0 var(--pale), -0.045em 0 0 var(--pale), 0 0.045em 0 var(--pale), 0 -0.045em 0 var(--pale),
    0.032em 0.032em 0 var(--pale), -0.032em 0.032em 0 var(--pale), 0.032em -0.032em 0 var(--pale), -0.032em -0.032em 0 var(--pale),
    0.085em 0 0 var(--o), -0.085em 0 0 var(--o), 0 0.085em 0 var(--o), 0 -0.085em 0 var(--o),
    0.06em 0.06em 0 var(--o), -0.06em 0.06em 0 var(--o), 0.06em -0.06em 0 var(--o), -0.06em -0.06em 0 var(--o),
    0 0.15em 0 var(--o), 0.05em 0.14em 0 var(--o), -0.05em 0.14em 0 var(--o),
    0 0.22em 0.16em rgba(60, 0, 20, 0.35);
  animation: wave 2.6s ease-in-out infinite;
}
.logo-line.l2 span { color: #4cc664; }
.logo-line span:nth-child(1) { animation-delay: 0s; }
.logo-line span:nth-child(2) { animation-delay: -0.2s; }
.logo-line span:nth-child(3) { animation-delay: -0.4s; }
.logo-line span:nth-child(4) { animation-delay: -0.6s; }
.logo-line span:nth-child(5) { animation-delay: -0.8s; }
.logo-line span:nth-child(6) { animation-delay: -1s; }
.logo-line span:nth-child(7) { animation-delay: -1.2s; }
.logo-line span:nth-child(8) { animation-delay: -1.4s; }

.logo-ar {
  display: inline-block;
  margin-top: 0.3em;
  font-size: 1em;
  font-weight: 800;
  color: var(--rind-dark);
  background: var(--pale);
  border: 0.13em solid var(--ink);
  border-radius: 999px;
  padding: 0.12em 0.8em 0.22em;
  box-shadow: 0 0.18em 0 var(--ink);
  font-family: "Geeza Pro", "Noto Naskh Arabic", "Segoe UI", Tahoma, sans-serif;
  animation: dropIn 0.7s 0.24s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

@keyframes dropIn { 0% { opacity: 0; transform: translateY(-0.9em) scale(0.6); } 100% { opacity: 1; transform: none; } }
@keyframes wave { 0%, 100% { translate: 0 0; rotate: -3deg; } 50% { translate: 0 -0.08em; rotate: 3deg; } }

.stage-gap { height: 5.5em; flex: none; }

.chip {
  display: flex;
  align-items: center;
  gap: 0.5em;
  background: #fff;
  border: 0.15em solid var(--ink);
  border-radius: 999px;
  padding: 0.22em 0.9em 0.22em 0.25em;
  box-shadow: 0 0.22em 0 var(--ink);
  color: var(--ink);
  cursor: pointer;
  font-size: 1em;
  transition: transform 0.08s;
}
.chip:active { transform: translateY(0.15em); box-shadow: 0 0.07em 0 var(--ink); }
.chip .avatar { width: 2.5em; height: 2.5em; display: block; }
.chip-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.chip-text small { font-size: 0.68em; font-weight: 700; opacity: 0.65; }
.chip-text b { font-size: 1.2em; font-weight: 900; color: var(--pc); }
.chip-swap { font-size: 1.1em; font-weight: 900; opacity: 0.55; margin-left: 0.2em; }

.diff, .tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.94);
  border: 0.15em solid var(--ink);
  border-radius: 999px;
  padding: 0.18em;
  gap: 0.15em;
  box-shadow: 0 0.22em 0 var(--ink);
}
.diff button, .tabs button {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 900;
  font-size: 0.98em;
  padding: 0.48em 0.95em;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.35em;
  transition: background 0.15s, color 0.15s, transform 0.15s;
}
.diff button[aria-checked="true"], .tabs button[aria-selected="true"] {
  background: var(--flesh);
  color: #fff;
  box-shadow: inset 0 -0.15em 0 rgba(0, 0, 0, 0.18);
  transform: scale(1.04);
}
.diff .dot { width: 0.62em; height: 0.62em; border-radius: 50%; border: 0.12em solid var(--ink); }
.diff [data-diff="easy"] .dot { background: #59d66b; }
.diff [data-diff="normal"] .dot { background: #ffb12b; }
.diff [data-diff="hard"] .dot { background: #ff3b5c; }

.diff-desc {
  margin: -0.15em 0 0.1em;
  font-size: 0.86em;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0.08em 0 rgba(24, 58, 31, 0.8), 0 0 0.4em rgba(24, 58, 31, 0.5);
  min-height: 1.2em;
}

.btn {
  pointer-events: auto;
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 900;
  font-size: 1.1em;
  padding: 0.6em 1.5em;
  color: #fff;
  background: linear-gradient(#ff6a84, var(--flesh) 55%, #f03a5b);
  box-shadow: 0 0 0 0.16em var(--pale), 0 0 0 0.33em var(--rind), 0 0 0 0.45em var(--ink), 0 0.5em 0 0.45em var(--ink);
  text-shadow: 0 0.08em 0 rgba(100, 0, 20, 0.35);
  transition: transform 0.08s, box-shadow 0.08s;
  margin: 0.4em 0 0.5em;
}
.btn:active {
  transform: translateY(0.3em);
  box-shadow: 0 0 0 0.16em var(--pale), 0 0 0 0.33em var(--rind), 0 0 0 0.45em var(--ink), 0 0.2em 0 0.45em var(--ink);
}
.btn.big { font-size: 1.6em; padding: 0.42em 2.1em; }
.btn.primary.big { animation: pulse 1.8s ease-in-out infinite; }
.btn.ghost {
  background: rgba(255, 255, 255, 0.95);
  color: var(--ink);
  text-shadow: none;
  font-size: 1em;
  padding: 0.55em 1.25em;
  margin: 0.2em 0 0.3em;
  box-shadow: 0 0 0 0.15em var(--ink), 0 0.3em 0 0.15em var(--ink);
}
.btn.ghost:active { box-shadow: 0 0 0 0.15em var(--ink), 0 0.08em 0 0.15em var(--ink); transform: translateY(0.22em); }
.btn:disabled { filter: grayscale(0.6) brightness(0.9); }

@keyframes pulse { 0%, 100% { scale: 1; } 50% { scale: 1.05; } }

/* ------------------------------------------------------------- names */

#screen-names, #screen-board {
  background: linear-gradient(rgba(255, 246, 240, 0.9), rgba(255, 236, 242, 0.95));
}

.title-pop {
  margin: 0.2em 0 0.3em;
  font-size: 2.2em;
  font-weight: 900;
  color: var(--flesh);
  text-shadow: 0.05em 0 0 var(--ink), -0.05em 0 0 var(--ink), 0 0.05em 0 var(--ink), 0 -0.05em 0 var(--ink),
    0.035em 0.035em 0 var(--ink), -0.035em 0.035em 0 var(--ink), 0.035em -0.035em 0 var(--ink), -0.035em -0.035em 0 var(--ink),
    0 0.12em 0 var(--ink);
  animation: dropIn 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}

.names { display: flex; flex-direction: column; gap: 0.75em; width: 100%; max-width: 17em; margin-top: 0.4em; }
.name-card {
  display: flex;
  align-items: center;
  gap: 0.9em;
  padding: 0.5em 1em 0.5em 0.6em;
  background: #fff;
  border: 0.17em solid var(--ink);
  border-radius: 1.2em;
  box-shadow: 0 0.3em 0 var(--ink);
  cursor: pointer;
  font-size: 1.15em;
  font-weight: 900;
  color: var(--ink);
  transition: transform 0.1s;
  animation: dropIn 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both;
}
.name-card:nth-child(2) { animation-delay: 0.07s; }
.name-card:nth-child(3) { animation-delay: 0.14s; }
.name-card:active { transform: translateY(0.2em); box-shadow: 0 0.1em 0 var(--ink); }
.name-card .avatar-lg { width: 3.6em; height: 3.6em; display: block; }
.name-card span { font-size: 1.35em; }
.name-card.current { outline: 0.2em solid var(--flesh); outline-offset: 0.15em; }
.name-card[data-name="Fatima"] span { color: #e2337f; }
.name-card[data-name="Reem"] span { color: #6d3fe0; }
.name-card[data-name="Maryam"] span { color: #c27a00; }
.hint { font-size: 0.85em; font-weight: 700; opacity: 0.7; text-align: center; margin: 0.6em 0 0; }

/* ------------------------------------------------------------- ready */

#screen-ready { justify-content: space-between; padding-bottom: 7.5em; }
.ready-top { display: flex; gap: 0.5em; margin-top: 4.6em; }
.tag {
  display: inline-block;
  font-weight: 900;
  font-size: 0.85em;
  padding: 0.25em 0.8em;
  border-radius: 999px;
  background: var(--flesh);
  color: #fff;
  border: 0.13em solid var(--ink);
  box-shadow: 0 0.15em 0 var(--ink);
}
.tag.soft { background: #fff; color: var(--ink); }
.ready-hint { display: flex; flex-direction: column; align-items: center; margin-top: 6em; }
.ready-hint p {
  margin: 0.4em 0 0;
  font-weight: 900;
  font-size: 1.05em;
  color: #fff;
  text-align: center;
  text-shadow: 0 0.09em 0 var(--ink), 0.06em 0 0 var(--ink), -0.06em 0 0 var(--ink), 0 -0.06em 0 var(--ink);
}
kbd {
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  border: 0.12em solid var(--ink);
  border-radius: 0.35em;
  padding: 0 0.35em;
  text-shadow: none;
  box-shadow: 0 0.12em 0 var(--ink);
}
.tap-hand { font-size: 2.6em; animation: tap 0.9s ease-in-out infinite; filter: drop-shadow(0 0.08em 0 rgba(0, 0, 0, 0.3)); }
@keyframes tap { 0%, 100% { transform: translateY(0) scale(1); } 40% { transform: translateY(0.18em) scale(0.92); } }

/* ------------------------------------------------------------- paused */

#screen-paused { justify-content: center; background: rgba(24, 58, 31, 0.35); }
.stack { display: flex; flex-direction: column; align-items: center; gap: 0.4em; }
.row { display: flex; gap: 0.7em; justify-content: center; }
.countdown {
  font-size: 6em;
  font-weight: 900;
  color: #fff;
  height: 1.1em;
  line-height: 1.1;
  text-shadow: 0 0.06em 0 var(--ink), 0.04em 0 0 var(--ink), -0.04em 0 0 var(--ink), 0 -0.04em 0 var(--ink);
}
.countdown.go { animation: popNum 0.6s cubic-bezier(0.2, 1.6, 0.4, 1) both; }
@keyframes popNum { 0% { transform: scale(2.2); opacity: 0; } 60% { opacity: 1; } 100% { transform: scale(1); } }

/* ------------------------------------------------------------- game over */

#screen-over { justify-content: center; gap: 0.6em; padding-top: calc(2.4em + var(--safe-top)); }
.splat { margin: 0 0 0.15em; font-size: 3.3em; font-weight: 900; line-height: 1; }
.splat span {
  display: inline-block;
  color: var(--flesh);
  --o: #183a1f;
  text-shadow: 0.06em 0 0 var(--o), -0.06em 0 0 var(--o), 0 0.06em 0 var(--o), 0 -0.06em 0 var(--o),
    0.045em 0.045em 0 var(--o), -0.045em 0.045em 0 var(--o), 0.045em -0.045em 0 var(--o), -0.045em -0.045em 0 var(--o),
    0 0.13em 0 var(--o), 0 0.2em 0.12em rgba(0, 0, 0, 0.3);
  animation: splatIn 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) both;
}
.splat span:nth-child(2) { animation-delay: 0.05s; }
.splat span:nth-child(3) { animation-delay: 0.1s; }
.splat span:nth-child(4) { animation-delay: 0.15s; }
.splat span:nth-child(5) { animation-delay: 0.2s; }
.splat span:nth-child(6) { animation-delay: 0.25s; color: #4cc664; }
@keyframes splatIn {
  0% { opacity: 0; transform: translateY(-1.4em) scale(0.5, 1.6); }
  55% { opacity: 1; transform: translateY(0.05em) scale(1.35, 0.7); }
  75% { transform: translateY(-0.04em) scale(0.92, 1.1); }
  100% { transform: none; }
}

.card {
  background: var(--cream);
  border: 0.18em solid var(--ink);
  border-radius: 1.2em;
  box-shadow: 0 0.35em 0 var(--ink), 0 0.9em 1.6em rgba(40, 0, 10, 0.25);
}
.over-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.9em;
  width: 19.5em;
  padding: 0.95em 1em;
  animation: cardUp 0.55s 0.15s cubic-bezier(0.2, 1.35, 0.4, 1) both;
}
@keyframes cardUp { from { opacity: 0; transform: translateY(3em) scale(0.9); } to { opacity: 1; transform: none; } }
.badge-col { display: flex; flex-direction: column; align-items: center; width: 6.2em; }
#badge { width: 4.6em; height: 4.6em; display: block; animation: badgeSpin 0.9s 0.45s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
@keyframes badgeSpin { from { transform: scale(0) rotate(-200deg); } to { transform: none; } }
.badge-name { font-size: 0.78em; font-weight: 900; text-align: center; margin-top: 0.3em; color: var(--rind-dark); line-height: 1.1; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0.2em 0.6em; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat small { font-size: 0.78em; font-weight: 900; text-transform: uppercase; letter-spacing: 0.06em; color: var(--flesh-dark); }
.stat b { font-size: 2.3em; font-weight: 900; line-height: 1.05; font-variant-numeric: tabular-nums; }
.stat-meta { grid-column: 1 / -1; display: flex; justify-content: center; gap: 0.35em; margin-top: 0.3em; }
.stat-meta .tag { font-size: 0.72em; }
.ribbon {
  position: absolute;
  top: -0.85em;
  right: -0.7em;
  background: linear-gradient(100deg, #ffcf2e 0%, #fff3b0 40%, #ffcf2e 60%);
  background-size: 250% 100%;
  color: var(--ink);
  font-weight: 900;
  font-size: 0.95em;
  padding: 0.3em 0.8em;
  border: 0.15em solid var(--ink);
  border-radius: 0.6em;
  transform: rotate(8deg);
  box-shadow: 0 0.2em 0 var(--ink);
  animation: ribbonIn 0.6s 0.6s cubic-bezier(0.2, 1.8, 0.4, 1) both, shine 1.6s 1.2s linear infinite;
}
.ribbon[hidden] { display: none; }
@keyframes ribbonIn { from { transform: rotate(8deg) scale(0); } to { transform: rotate(8deg) scale(1); } }
@keyframes shine { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.status {
  margin: 0.2em 0 0;
  min-height: 1.3em;
  font-weight: 800;
  font-size: 0.9em;
  color: #fff;
  text-align: center;
  text-shadow: 0 0.08em 0 rgba(24, 58, 31, 0.9), 0 0 0.35em rgba(24, 58, 31, 0.6);
}
#board-status { color: var(--ink); text-shadow: none; opacity: 0.75; }

/* ------------------------------------------------------------- leaderboard */

#screen-board { gap: 0.55em; }
.tabs button { padding: 0.45em 1.1em; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 0.45em; width: 100%; height: 12.2em; margin-top: 0.2em; }
.pod { display: flex; flex-direction: column; align-items: center; width: 6.3em; }
.pod-avatar { position: relative; width: 3.3em; height: 3.3em; animation: dropIn 0.5s cubic-bezier(0.2, 1.5, 0.4, 1) both; }
.pod-avatar canvas { width: 100%; height: 100%; display: block; }
.pod-crown { position: absolute; top: -0.95em; left: 50%; transform: translateX(-50%) rotate(-8deg); font-size: 1.35em; animation: crown 1.8s ease-in-out infinite; }
@keyframes crown { 0%, 100% { translate: 0 0; } 50% { translate: 0 -0.15em; } }
.pod-name { font-weight: 900; font-size: 0.95em; margin-top: 0.15em; }
.pod-score { font-weight: 900; font-size: 1.5em; line-height: 1; font-variant-numeric: tabular-nums; }
.pod-games { font-size: 0.68em; font-weight: 800; opacity: 0.6; margin-bottom: 0.25em; }
.pod-block {
  width: 100%;
  border: 0.16em solid var(--ink);
  border-bottom: 0;
  border-radius: 0.7em 0.7em 0 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 0.2em;
  font-size: 1.5em;
  font-weight: 900;
  color: #fff;
  text-shadow: 0 0.08em 0 rgba(0, 0, 0, 0.3);
  transform-origin: bottom;
  animation: rise 0.6s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.pod.r1 .pod-block { height: 3.1em; background: linear-gradient(#ffd84d, #f2a900); animation-delay: 0.2s; }
.pod.r2 .pod-block { height: 2.2em; background: linear-gradient(#e5edf5, #a7b6c6); animation-delay: 0.1s; }
.pod.r3 .pod-block { height: 1.6em; background: linear-gradient(#ffc08f, #d77a3a); }
.pod.none .pod-score { opacity: 0.4; }
.pod.none .pod-block { background: linear-gradient(#f4f4f4, #d9d9d9); }
@keyframes rise { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.list-title { margin: 0.3em 0 0; font-size: 1em; font-weight: 900; color: var(--flesh-dark); text-transform: uppercase; letter-spacing: 0.08em; }
.toplist {
  list-style: none;
  margin: 0;
  padding: 0.1em 0.2em 0.3em;
  width: 100%;
  max-width: 19.5em;
  display: flex;
  flex-direction: column;
  gap: 0.32em;
  overflow-y: auto;
  flex: 1 1 auto;
  min-height: 3em;
  touch-action: pan-y;
  overscroll-behavior: contain;
}
.toplist li {
  display: grid;
  grid-template-columns: 1.7em 1.5em 1fr auto;
  align-items: center;
  gap: 0.5em;
  background: #fff;
  border: 0.13em solid var(--ink);
  border-radius: 0.7em;
  padding: 0.3em 0.7em;
  font-weight: 800;
  animation: slideIn 0.35s cubic-bezier(0.2, 1.3, 0.4, 1) both;
}
.toplist li.me { background: var(--pc-light); }
.toplist .rank { font-weight: 900; text-align: center; }
.toplist .pdot { width: 1.3em; height: 1.3em; border-radius: 50%; border: 0.12em solid var(--ink); }
.toplist .who { line-height: 1.05; }
.toplist .when { display: block; font-size: 0.72em; opacity: 0.6; font-weight: 700; }
.toplist .pts { font-size: 1.25em; font-weight: 900; font-variant-numeric: tabular-nums; }
.toplist .empty { display: block; text-align: center; grid-template-columns: none; background: rgba(255, 255, 255, 0.7); }
@keyframes slideIn { from { opacity: 0; transform: translateX(2em); } to { opacity: 1; transform: none; } }

/* ------------------------------------------------------------- toast and hints */

.toast {
  position: absolute;
  left: 50%;
  top: 8.6em;
  transform: translateX(-50%);
  white-space: nowrap;
  font-weight: 900;
  font-size: 1em;
  color: var(--ink);
  background: #fff;
  border: 0.14em solid var(--ink);
  border-radius: 999px;
  padding: 0.3em 0.9em;
  box-shadow: 0 0.2em 0 var(--ink);
  opacity: 0;
  pointer-events: none;
}
.toast.show { animation: toast 1.6s ease-out both; }
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -0.6em) scale(0.6); }
  15% { opacity: 1; transform: translate(-50%, 0) scale(1.08); }
  25% { transform: translate(-50%, 0) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -0.4em); }
}

.rotate-hint {
  display: none;
  position: absolute;
  bottom: 0.4em;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  font-size: 0.8em;
  font-weight: 800;
  color: #fff;
  text-shadow: 0 0.08em 0 var(--ink);
}
@media (orientation: landscape) and (pointer: coarse) and (max-height: 520px) {
  .rotate-hint { display: block; }
}

.noscript { position: fixed; inset: 0; display: grid; place-items: center; font: 800 20px var(--font); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  .logo-line span, .btn.primary.big, .tap-hand, .pod-crown, .ribbon { animation: none; }
}
