:root {
  --bg: #0a1524;
  --panel: #122339;
  --panel2: #1b3352;
  --line: #2a4a73;
  --txt: #eaf1f9;
  --dim: #8ea6c4;
  --acc: #ffd166;
  --good: #45d0b4;
  --bad: #ff7a7a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { margin: 0; height: 100%; }
html { background: var(--bg); } /* what shows at the edges when the screen shakes */

body {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(120% 70% at 50% 0%, #14305a 0%, var(--bg) 62%) var(--bg);
  color: var(--txt);
  font: 15px/1.35 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  overscroll-behavior: none;
}

button { font: inherit; color: inherit; border: 0; cursor: pointer; touch-action: manipulation; }

#app {
  height: 100%;
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
/* The table view on a big screen (spectator) may use the whole width. */
#app[data-joined="0"]:not([data-phase="lobby"]) { max-width: 1280px; }

#view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.wait { text-align: center; color: var(--dim); margin-top: 30vh; }

/* ---------- lobby ---------- */

#brand, #join { display: none; }
#app[data-phase="lobby"] #brand, #app[data-phase="home"] #brand { display: block; text-align: center; padding: 22px 16px 6px; }
#brand h1 { margin: 0; font-size: 34px; letter-spacing: 0.5px; font-weight: 800; }
#brand h1::after {
  content: '';
  display: block;
  height: 8px;
  width: 132px;
  margin: 6px auto 0;
  background: radial-gradient(circle at 50% 0, transparent 6px, var(--good) 6.5px, var(--good) 8px, transparent 8.5px) 0 0 / 22px 8px repeat-x;
}
#brand p { margin: 8px 0 0; color: var(--dim); }

#app[data-phase="lobby"][data-joined="0"] #join { display: flex; gap: 8px; padding: 12px 16px 4px; }
.line-form { display: flex; gap: 8px; }
#join input, .line-form input {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 17px; /* 16px+ keeps iOS from zooming on focus */
  padding: 12px 14px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--panel);
  color: var(--txt);
  -webkit-user-select: text;
  user-select: text;
}
#join input:focus, .line-form input:focus { outline: none; border-color: var(--acc); }
#join .btn, .line-form .btn { width: auto; }
#code { text-transform: uppercase; letter-spacing: 5px; font-weight: 800; text-align: center; }
#code::placeholder { text-transform: none; letter-spacing: 0; font-weight: 400; }
.notice { margin: 0; padding: 10px 12px; border: 1px solid var(--bad); border-radius: 12px; background: #33151a; color: #ffd9d9; text-align: center; }

.lobby { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 20px; display: flex; flex-direction: column; gap: 14px; }
.card-box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; }
.card-box h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; color: var(--dim); }

.plist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.plist li { display: flex; align-items: center; gap: 8px; background: var(--panel2); border-radius: 10px; padding: 9px 10px; font-size: 16px; }
.plist li b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plist em { font-style: normal; font-size: 11px; color: var(--bg); background: var(--acc); padding: 1px 7px; border-radius: 99px; font-weight: 700; }
.plist em.you { background: var(--good); }
.plist .x { background: transparent; color: var(--dim); font-size: 16px; padding: 2px 6px; }
.plist .empty { color: var(--dim); background: transparent; justify-content: center; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--good); flex: none; }
.off .dot { background: var(--bad); }

.qr { display: flex; align-items: center; gap: 14px; }
.qr img { width: 124px; height: 124px; border-radius: 10px; flex: none; background: #fff; }
.qr small { color: var(--dim); display: block; }
.qr strong { display: block; font-size: 17px; word-break: break-all; -webkit-user-select: text; user-select: text; }
.qr strong.code { font-size: 28px; letter-spacing: 4px; color: var(--acc); line-height: 1.1; }
.qr strong + small { margin-top: 6px; }

.seg { display: flex; gap: 6px; margin-bottom: 12px; }
.seg button { flex: 1; padding: 10px 0; border-radius: 10px; background: var(--panel2); font-weight: 700; }
.seg button.on { background: var(--good); color: #04231d; }
.hint { color: var(--dim); font-size: 13px; text-align: center; margin: 8px 0 0; }

.btn {
  display: block;
  width: 100%;
  background: var(--acc);
  color: #241a00;
  font-weight: 800;
  font-size: 16px;
  padding: 13px 16px;
  border-radius: 12px;
}
.btn:disabled { opacity: 0.4; }
a.btn { text-decoration: none; text-align: center; }
.btn.ghost { background: var(--panel2); color: var(--txt); font-weight: 600; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid var(--bad); font-weight: 600; }
.btn + .btn { margin-top: 8px; }

/* ---------- cards ---------- */

.card {
  position: relative;
  display: grid;
  place-items: center;
  border-radius: 12% / 10%;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35);
  min-width: 0;
  min-height: 0;
}
.card.face { box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.28), 0 2px 0 rgba(0, 0, 0, 0.35); }
.card.back {
  background-color: #1a5383;
  background-image:
    radial-gradient(circle at 50% 0, transparent 7px, rgba(255, 255, 255, 0.16) 7.5px, rgba(255, 255, 255, 0.16) 9px, transparent 9.5px),
    linear-gradient(160deg, #23679f, #123f68);
  background-size: 20px 11px, 100% 100%;
}
.card.gone { background: transparent; box-shadow: none; border: 2px dashed var(--line); opacity: 0.6; }
.card.tap { box-shadow: 0 0 0 3px var(--acc), 0 0 14px 2px rgba(255, 209, 102, 0.55); animation: pulse 1.1s ease-in-out infinite; }
.card.soft { box-shadow: 0 0 0 2px var(--acc); }

@keyframes pulse { 50% { transform: scale(0.94); } }

/* ---------- motion ---------- */
/* Every animation below is an entrance: it ends on the element's normal look,
   so a redraw in the middle of one simply shows the final state. --d is the
   delay, set inline when several cards must move one after the other. */

/* A card turning over: it narrows showing its back, then widens showing its face. */
.card.flip { animation: flipx 0.46s ease-in-out var(--d, 0ms) both; }
.card.flip::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: #1a5383 linear-gradient(160deg, #23679f, #123f68);
  animation: flipcover 0.46s steps(1, end) var(--d, 0ms) both;
}
@keyframes flipx { 0%, 100% { transform: scaleX(1); } 50% { transform: scaleX(0.04); } }
@keyframes flipcover { 0% { opacity: 1; } 50%, 100% { opacity: 0; } }

/* Cards dealt at the start of a round. */
.card.deal { animation: deal 0.34s cubic-bezier(0.2, 0.8, 0.3, 1) var(--d, 0ms) both; }
.card.tap.deal { animation: deal 0.34s cubic-bezier(0.2, 0.8, 0.3, 1) var(--d, 0ms) both, pulse 1.1s ease-in-out calc(var(--d, 0ms) + 0.34s) infinite; }
@keyframes deal { from { opacity: 0; transform: translateY(-60%) scale(0.6) rotate(-8deg); } }

/* Cards in flight and announcements, drawn above the table by app.js. */
#fx { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
#fx .card { position: absolute; margin: 0; transform-origin: 0 0; will-change: transform; }
#fx .card.flip, #fx .card.hero, #fx .card.doomed { transform-origin: 50% 50%; }
#fx .card.match { box-shadow: 0 0 0 3px var(--acc), 0 0 16px 3px rgba(255, 209, 102, 0.7); }

/* A −1 or a −2 about to be turned over: the card shivers harder and harder,
   light leaking out of it. --j is the size of one jolt, scaled to the card. */
.card.tease {
  --j: calc(1px + 0.045em);
  animation: tease var(--s, 0.8s) linear var(--d0, 0ms) backwards;
}
/* The copy shown on the discard pile shivers and turns over in one go. */
.card.flip.tease { animation: flipx 0.46s ease-in-out var(--d, 0ms) both, tease var(--s, 0.8s) linear var(--d0, 0ms) backwards; }
@keyframes tease {
  0% { translate: 0 0; scale: 1; box-shadow: 0 0 0 0 transparent; }
  8% { translate: calc(var(--j) * -1) 0; }
  16% { translate: var(--j) 0; }
  24% { translate: calc(var(--j) * -1) var(--j); }
  32% { translate: calc(var(--j) * 1.5) 0; }
  40% { translate: calc(var(--j) * -1.5) calc(var(--j) * -1); }
  48% { translate: calc(var(--j) * 2) var(--j); scale: 1.02; }
  56% { translate: calc(var(--j) * -2) 0; }
  64% { translate: calc(var(--j) * 2.5) calc(var(--j) * -1); box-shadow: 0 0 10px 2px var(--glow); }
  72% { translate: calc(var(--j) * -2.5) var(--j); scale: 1.05; }
  80% { translate: calc(var(--j) * 3) 0; }
  88% { translate: calc(var(--j) * -3) calc(var(--j) * -1); box-shadow: 0 0 18px 6px var(--glow); }
  94% { translate: calc(var(--j) * 3) var(--j); }
  100% { translate: 0 0; scale: 1.1; box-shadow: 0 0 28px 10px var(--glow); }
}

/* Showpieces for the −1 and the −2 (see app.js). Everything here is a
   throwaway element in #fx, placed by its centre and animated by script. */
#fx .bit { position: absolute; line-height: 1; will-change: transform, opacity; }
#fx .bit.bubble {
  width: 1em;
  height: 1em;
  border-radius: 50%;
  border: 0.1em solid rgba(170, 245, 235, 0.9);
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.85), rgba(69, 208, 180, 0.12) 60%);
}
#fx .ring { position: absolute; border-radius: 50%; border: 4px solid; }
#fx .rays {
  position: absolute;
  border-radius: 50%;
  background: repeating-conic-gradient(rgba(255, 209, 102, 0.9) 0 8deg, rgba(255, 209, 102, 0) 8deg 20deg);
  -webkit-mask-image: radial-gradient(circle, #000 15%, transparent 68%);
  mask-image: radial-gradient(circle, #000 15%, transparent 68%);
}
#fx .flash { position: absolute; width: 100%; height: 100%; }
#fx .flash.gold { background: radial-gradient(circle at var(--x) var(--y), rgba(255, 224, 140, 0.8), rgba(255, 209, 102, 0) 65%); }
#fx .flash.red { background: radial-gradient(circle, rgba(255, 60, 60, 0) 30%, rgba(200, 20, 30, 0.65) 100%); }
#fx .shout {
  position: absolute;
  white-space: nowrap;
  font-weight: 900;
  font-size: clamp(20px, 7vw, 40px);
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.6), 0 0 16px currentColor;
}
#fx .shout.big { font-size: clamp(30px, 11vw, 66px); }
#fx .shout.teal { color: #8ff5e6; }
#fx .shout.gold { color: var(--acc); }
#fx .shout.red { color: #ff8f8f; }
#fx .card.hero.teal { box-shadow: 0 0 0 3px #8ff5e6, 0 0 28px 8px rgba(69, 208, 180, 0.8); }
#fx .card.hero.gold { box-shadow: 0 0 0 3px var(--acc), 0 0 40px 12px rgba(255, 209, 102, 0.9); }
#fx .card.doomed {
  box-shadow: 0 0 0 3px var(--bad), 0 0 22px 6px rgba(255, 80, 80, 0.7);
  filter: saturate(0.45) brightness(0.85);
  animation: doomed 0.45s ease-in-out infinite alternate;
}
@keyframes doomed { from { transform: rotate(-8deg) scale(1.1); } to { transform: rotate(8deg) scale(1.02); } }
.announce {
  position: absolute;
  left: 50%;
  top: 17%; /* over the opponents, clear of the status line and the piles */
  max-width: 88vw;
  padding: 9px 22px;
  border-radius: 99px;
  background: rgba(10, 21, 36, 0.93);
  border: 2px solid var(--acc);
  color: var(--acc);
  font-weight: 800;
  font-size: clamp(18px, 6vw, 30px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  animation: announce 1.6s ease both;
}
@keyframes announce {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.7); }
  12% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }
  20%, 78% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90%) scale(0.96); }
}

/* Whose turn it is, and text that just changed. */
.opp.start { animation: oppturn 0.7s ease-out; }
@keyframes oppturn { 30% { transform: scale(1.06); box-shadow: 0 0 22px rgba(255, 209, 102, 0.8); } }
.mine.start { animation: myturn 1s ease-out; border-radius: 16px; }
@keyframes myturn {
  0%, 100% { box-shadow: inset 0 0 0 0 rgba(255, 209, 102, 0); }
  25% { box-shadow: inset 0 0 0 3px rgba(255, 209, 102, 0.9), inset 0 0 46px rgba(255, 209, 102, 0.22); }
}
.status.new, .log.new, .plist li.new, .req.new { animation: rise 0.3s ease-out; }
.status.me.new, .bar .lastturn.new { animation: callout 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.3); }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }
@keyframes callout {
  0% { opacity: 0; transform: scale(0.6); }
  55% { opacity: 1; transform: scale(1.18); }
  100% { transform: none; }
}

/* Sheets open with a short slide; the results fill in row by row. */
.sheet.in { animation: fade 0.2s ease-out; }
.sheet.in .box { animation: sheetup 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.sheet.in tr.row { animation: rise 0.32s ease-out var(--d, 0ms) both; }
.sheet.in .x2 { animation: stamp 0.4s cubic-bezier(0.2, 0.9, 0.3, 1.4) 1.1s both; }
.sheet.in h2.won { animation: callout 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.3) 0.15s both; }
@keyframes fade { from { opacity: 0; } }
@keyframes sheetup { from { opacity: 0; transform: translateY(28px) scale(0.97); } }
@keyframes stamp { from { opacity: 0; transform: scale(2.6) rotate(-14deg); } }

/* ---------- table ---------- */

.game { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.bar { display: flex; align-items: center; gap: 6px; padding: 8px 10px 6px; font-size: 13px; color: var(--dim); white-space: nowrap; }
.bar > * { flex: none; }
/* Secondary details give way first on a narrow phone, the rest never wraps. */
.bar .lim { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.bar b { color: var(--txt); }
.bar .sp { flex: 1; }
.bar button { background: var(--panel2); border-radius: 99px; padding: 6px 12px; font-size: 13px; color: var(--txt); }
.bar .lastturn { color: #241a00; background: var(--acc); border-radius: 99px; padding: 2px 9px; font-weight: 800; font-size: 12px; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--good); }
.conn.down { background: var(--bad); animation: pulse 0.8s infinite; }

.banner { margin: 0 10px 6px; padding: 8px 10px; background: var(--panel2); border-radius: 10px; font-size: 13px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.banner button { background: var(--acc); color: #241a00; border-radius: 99px; padding: 5px 11px; font-weight: 700; font-size: 13px; }

.banner button.quiet { background: var(--panel); color: var(--txt); font-weight: 600; }

/* Mid-game the name form is shown on demand, to ask the host for a seat. */
#app[data-asking="1"] #join { display: flex; gap: 8px; padding: 8px 10px 0; }

.req { margin: 0 10px 6px; padding: 8px 10px; background: var(--panel2); border: 1px solid var(--acc); border-radius: 10px; font-size: 13px; }
.box .req { margin: 12px 0 0; }
.req .line { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.req .line button { background: var(--panel); border-radius: 99px; padding: 5px 11px; font-size: 12px; flex: none; }
.req .row { display: flex; gap: 6px; margin-top: 7px; }
.req .row button { flex: 1; background: var(--panel); border-radius: 99px; padding: 8px 4px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.req .row button.go { background: var(--acc); color: #241a00; }

.opps {
  display: grid;
  /* --cols is set inline from the number of opponents, so they fit in two rows at most. */
  grid-template-columns: repeat(var(--cols, 4), minmax(0, 118px));
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  max-height: 36%;
  overflow-y: auto;
  flex: none;
}
.opp { container-type: inline-size; background: var(--panel); border: 2px solid transparent; border-radius: 10px; padding: 4px 5px 5px; min-width: 0; }
.opp.turn { border-color: var(--acc); box-shadow: 0 0 12px rgba(255, 209, 102, 0.35); }
.opp.off { opacity: 0.55; }
.opp .nm { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; font-size: 11px; }
.opp .nm b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: max(11px, 9cqw); }
.opp .nm i { font-style: normal; color: var(--dim); flex: none; }
.mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; margin-top: 3px; }
.mini .card { aspect-ratio: 4 / 5; font-size: max(10px, 11.5cqw); border-radius: 3px; box-shadow: none; background-image: none; }
.mini .card.gone { border-width: 1px; }
/* The card an opponent last touched stays outlined until the next move. */
.mini .card.last { outline: 2px solid rgba(255, 255, 255, 0.85); outline-offset: -1px; }
.opp .sm { font-size: 10px; color: var(--dim); margin-top: 3px; display: flex; justify-content: space-between; }

.mid { padding: 8px 10px 4px; flex: none; }
.status { text-align: center; font-weight: 800; font-size: 17px; min-height: 23px; }
.status.me { color: var(--acc); }
.log { text-align: center; font-size: 12px; color: var(--dim); height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.piles { display: flex; justify-content: center; align-items: flex-start; gap: 16px; margin-top: 6px; }
.pile { width: 64px; text-align: center; font-size: 11px; color: var(--dim); }
.pile .card { width: 64px; height: 80px; font-size: 32px; margin-bottom: 3px; }
.pile .card small { position: absolute; bottom: 4px; right: 6px; font-size: 11px; font-weight: 700; color: rgba(255, 255, 255, 0.85); }
/* Individual properties, so the tilt survives the card's transform animations. */
.pile.hand .card { top: -4px; rotate: -3deg; }
.pile.hand label { color: var(--txt); }
.pile.hint label { color: var(--acc); font-weight: 700; }
.pile label { display: block; margin: 0 -12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.linkbtn { display: block; margin: 6px auto 0; background: var(--panel2); border-radius: 99px; padding: 7px 14px; font-size: 13px; }

.mine { flex: 1; min-height: 150px; display: flex; flex-direction: column; padding: 2px 10px 10px; }
.me-line { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; color: var(--dim); padding: 2px 2px 6px; gap: 8px; }
.me-line b { color: var(--txt); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine.turn .me-line b { color: var(--acc); }
.gridwrap { flex: 1; min-height: 0; container-type: size; display: grid; place-items: center; }
.grid {
  --w: min(100cqw, 100cqh * 1.04);
  width: var(--w);
  aspect-ratio: 1.04;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: calc(var(--w) * 0.025);
  font-size: calc(var(--w) * 0.105);
}

/* Spectator screen: no own grid, roomy tiles. */
.game.watch .opps { grid-template-columns: repeat(var(--cols, 4), minmax(0, 250px)); max-height: none; flex: 1; align-content: center; gap: 12px; padding: 8px 12px 16px; }
.game.watch .opp { padding: 8px 10px 10px; border-radius: 14px; }
.game.watch .opp .sm { font-size: 12px; }
.game.watch .mini { gap: 3.5%; }
.game.watch .mini .card { border-radius: 8%; }

/* Phone held sideways: opponents and piles left, own grid right. */
@media (orientation: landscape) and (max-height: 520px) {
  .game:not(.watch) { display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto 1fr; }
  .game:not(.watch) .bar, .game:not(.watch) .banner { grid-column: 1 / -1; }
  .game:not(.watch) .opps { grid-column: 1; max-height: none; align-content: start; }
  .game:not(.watch) .mid { grid-column: 1; }
  .game:not(.watch) .mine { grid-column: 2; grid-row: 2 / -1; min-height: 0; }
}

/* ---------- sheets ---------- */

.sheet { position: fixed; inset: 0; z-index: 10; background: rgba(3, 9, 18, 0.74); display: grid; place-items: center; padding: 14px; }
.box { width: 100%; max-width: 480px; max-height: 90%; overflow-y: auto; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.box h2 { margin: 0 0 4px; font-size: 21px; text-align: center; }
.box .sub { text-align: center; color: var(--dim); margin: 0 0 12px; font-size: 13px; }
.box .actions { margin-top: 14px; }
.tblwrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th { text-align: right; color: var(--dim); font-weight: 600; font-size: 11px; text-transform: uppercase; padding: 4px 6px; }
th:first-child, td:first-child { text-align: left; }
td { padding: 8px 6px; text-align: right; border-top: 1px solid var(--line); white-space: nowrap; }
td.nm { max-width: 130px; overflow: hidden; text-overflow: ellipsis; font-weight: 700; text-align: left; }
th.nm { text-align: left; }
td.tot { font-weight: 800; font-size: 17px; }
td.rk { color: var(--dim); width: 20px; }
tr.win td { color: var(--acc); }
tr.goner td { opacity: 0.45; }
.x2 { display: inline-block; font-size: 10px; background: var(--bad); color: #300; border-radius: 99px; padding: 1px 5px; font-weight: 800; margin-left: 3px; vertical-align: middle; }
td .x { background: transparent; color: var(--bad); padding: 0 4px; }
.rules { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 7px; font-size: 14px; }
.rules b { color: var(--acc); }

#toast {
  position: fixed;
  left: 50%;
  top: calc(12px + env(safe-area-inset-top));
  transform: translate(-50%, -150%);
  background: #33151a;
  color: #ffd9d9;
  border: 1px solid var(--bad);
  padding: 9px 14px;
  border-radius: 12px;
  font-weight: 600;
  z-index: 20;
  transition: transform 0.2s;
  max-width: 92vw;
  text-align: center;
  pointer-events: none;
}
#toast.show { transform: translate(-50%, 0); }

/* Reduced motion: every animation jumps straight to its end (app.js also skips flights). */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; }
}
