:root {
  --gold: #d8b56f;
  --gold-hi: #f3d999;
  --gold-deep: #9b7738;
  --cream: #f6ecd8;
  --ink: #1d1a17;
  --red: #a3182b;
  --leather: #5d1b21;
  --wood: #4a2b18;
  --glass: rgba(26, 9, 10, 0.86);
  --ui: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --move: 460ms;
  --flip: 420ms;
  --ease: cubic-bezier(.22, .9, .28, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  /* The room the status bar takes at the top and the navigation bar at the bottom. Browsers and iOS report
     them as safe areas; Android's WebView reports only the camera cut-out, so the app (mobile/App.tsx) sets
     --sat and --sab to the bars' heights there. */
  --safe-top: max(env(safe-area-inset-top), var(--sat, 0px));
  --safe-bottom: max(env(safe-area-inset-bottom), var(--sab, 0px));
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overscroll-behavior: none; }
/* No text autosizing: Android's WebView otherwise enlarges the card indices (SVG text) by about a third on
   phones, so they no longer fit the card. iOS Safari uses the same property in landscape. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Chromium (also Android's WebView) draws SVG text with a font sized for the card's size on screen, and after a
   card has changed size (dealt, bought, laid open) that font can be out of step: the index is then drawn up to
   1.7 times too large although the layout is right. With geometricPrecision the text is always scaled with the
   card instead. */
svg text { text-rendering: geometricPrecision; }
body {
  font-family: var(--ui);
  color: var(--cream);
  background-color: #2a170d;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.008 0.22' numOctaves='4' seed='7'/><feColorMatrix values='0 0 0 0 0.16  0 0 0 0 0.08  0 0 0 0 0.03  0 0 0 0.75 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(90deg, rgba(0,0,0,.25), rgba(255,200,140,.05) 30%, rgba(0,0,0,.1) 60%, rgba(255,200,140,.06) 85%, rgba(0,0,0,.25)),
    linear-gradient(180deg, #6a4126, #4a2b18 40%, #3a2112);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
}
button { font: inherit; color: inherit; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* The game fills exactly the screen (fixed, so it can never scroll), inside the phone's safe areas:
   under the status bar and above the home indicator, also when started from the home screen. */
#app {
  position: fixed; inset: 0;
  display: flex;
  flex-direction: column;
  padding: var(--safe-top) env(safe-area-inset-right) var(--safe-bottom) env(safe-area-inset-left);
  /* Phones: the full width. Tablets and desktops: wider than a phone (up to 820px), but never wider than
     ~0.6 × the height, so the trick in the middle keeps room and the fans stay close to their seats. */
  max-width: max(560px, min(820px, 62dvh));
  margin: 0 auto;
}

/* ---------- Top bar ---------- */
.topbar {
  height: 50px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  position: relative;
}
.brand {
  position: absolute; left: 50%; transform: translateX(-50%); pointer-events: none; transition: left .25s, transform .25s;
  font-family: var(--serif); font-style: italic; font-weight: 700; font-size: 22px;
  letter-spacing: .5px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 1px 0 rgba(0,0,0,.0);
  filter: drop-shadow(0 1px 1px rgba(0,0,0,.6));
}
.topbar-right { display: flex; gap: 2px; }
.icon-btn {
  width: 40px; height: 40px; border: 0; border-radius: 12px; background: transparent;
  display: grid; place-items: center; cursor: pointer;
  transition: background .2s, transform .15s;
}
.icon-btn:active { transform: scale(.9); background: rgba(255,220,170,.08); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[hidden] { display: none; }

/* ---------- Table ---------- */
#table {
  position: relative;
  flex: 1;
  margin: 0 8px 8px;
  border-radius: 26px;
  overflow: hidden;
  box-shadow:
    0 0 0 2px #24130a,
    0 0 0 4px rgba(255, 214, 160, .12),
    0 10px 30px rgba(0,0,0,.55);
}
.leather {
  position: absolute; inset: 0;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.28 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(120% 80% at 50% 38%, #7a262e 0%, #5d1b21 45%, #3a0e13 100%);
}
.leather::before, .leather::after {
  content: ''; position: absolute; border-radius: 18px; pointer-events: none;
}
.leather::before { inset: 9px; border: 1.5px solid rgba(216, 181, 111, .55); box-shadow: inset 0 0 0 3px rgba(0,0,0,.18); }
.leather::after { inset: 14px; border: 1px dashed rgba(216, 181, 111, .28); border-radius: 14px; }
#table::after {
  content: ''; position: absolute; inset: 0; border-radius: 26px; pointer-events: none;
  box-shadow: inset 0 0 60px rgba(0,0,0,.6), inset 0 2px 6px rgba(0,0,0,.6);
}

/* ---------- Seats ---------- */
.seat {
  position: absolute;
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px 7px 7px;
  border-radius: 30px;
  background: linear-gradient(180deg, rgba(40, 14, 14, .82), rgba(22, 7, 8, .82));
  box-shadow: inset 0 0 0 1px rgba(216,181,111,.35), 0 4px 12px rgba(0,0,0,.35);
  z-index: 3;
  transition: box-shadow .4s, transform .4s var(--spring);
  min-width: 0;
}
.seat[data-pos="w"] { top: 22px; left: 22px; }
.seat[data-pos="e"] { top: 22px; right: 22px; flex-direction: row-reverse; padding: 7px 7px 7px 10px; text-align: right; }
.seat[data-pos="s"] { left: 22px; padding: 5px 10px 5px 5px; }
.seat[data-pos="s"] .avatar { width: 32px; height: 32px; font-size: 14px; }
.avatar {
  flex: none; position: relative;
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 17px; color: #2a170d;
  background: radial-gradient(circle at 35% 30%, #fbe7b4, #d8b56f 45%, #8e6a2e);
  box-shadow: inset 0 -2px 3px rgba(0,0,0,.35), 0 2px 5px rgba(0,0,0,.4);
  transition: box-shadow .4s;
}
.seat.active .avatar { animation: glow 1.6s ease-in-out infinite; }
/* The declarer: a green circle (as the baize of a card table) instead of a label next to the name. */
.seat.declarer .avatar {
  color: #f6ecd8;
  background: radial-gradient(circle at 35% 30%, #a8dcb0, #3f8f58 45%, #1d4a2c);
  animation: pop .5s var(--spring) both;
}
.seat.declarer.active .avatar { animation: glow 1.6s ease-in-out infinite; }
.seat.active { box-shadow: inset 0 0 0 1px rgba(243,217,153,.8), 0 0 22px rgba(243, 200, 110, .28), 0 4px 12px rgba(0,0,0,.35); }
@keyframes glow {
  0%, 100% { box-shadow: inset 0 -2px 3px rgba(0,0,0,.35), 0 0 0 2px rgba(243,217,153,.9), 0 0 0 5px rgba(243,217,153,.15); }
  50% { box-shadow: inset 0 -2px 3px rgba(0,0,0,.35), 0 0 0 2px rgba(243,217,153,.9), 0 0 0 9px rgba(243,217,153,0); }
}
.seat-info { min-width: 0; line-height: 1.15; }
.seat-name { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.seat[data-pos="e"] .seat-name { justify-content: flex-end; }
.seat-name .away-ico { font-size: 13px; transform: translateY(-2px); }   /* the computer plays the seat: lined up with the name */
.seat-sub { font-size: 12px; color: rgba(246,236,216,.7); display: flex; align-items: center; gap: 8px; margin-top: 2px; }
.seat[data-pos="e"] .seat-sub { justify-content: flex-end; }
.lam, .pind { display: inline-flex; align-items: center; gap: 4px; font-variant-numeric: lining-nums tabular-nums; }
/* Lam: an old Danish bronze 5-øre coin with a raised rim. */
.lam::before {
  content: ''; width: 12px; height: 12px; border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 52%, rgba(60,25,8,.45) 56%, transparent 62%),
    radial-gradient(circle at 35% 30%, #f0b98a, #b8733f 50%, #6e3b18);
  box-shadow: 0 0 0 1px rgba(40,15,4,.6), inset 0 -1px 1px rgba(0,0,0,.3);
}
/* Pind: an ivory jeton. */
.pind::before {
  content: ''; width: 11px; height: 7px; border-radius: 3px;
  background: linear-gradient(180deg, #fffdf4, #efe3c4 60%, #d8c79f);
  box-shadow: 0 0 0 1px rgba(90,70,40,.55), inset 0 1px 0 rgba(255,255,255,.8);
}
.lam.bump, .pind.bump { animation: bump .5s var(--spring); }
.tricks { display: inline-flex; gap: 3px; align-items: center; min-height: 10px; }
.tricks i {
  width: 7px; height: 7px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff1c9, #d8b56f 60%, #8e6a2e);
  box-shadow: 0 0 4px rgba(243,217,153,.6);
  animation: pop .45s var(--spring) both;
}
.role {
  font-size: 9.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase;
  color: #2a170d; background: linear-gradient(180deg, var(--gold-hi), var(--gold));
  padding: 2px 6px; border-radius: 6px;
  animation: pop .5s var(--spring) both;
}
.dots { display: none; gap: 3px; }
.seat.thinking .dots { display: inline-flex; }
.dots b { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); animation: dot 1.1s infinite; }
.dots b:nth-child(2) { animation-delay: .15s; }
.dots b:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.35); color: var(--gold-hi); } 100% { transform: scale(1); } }

/* ---------- Bubbles ---------- */
.bubble {
  position: absolute; z-index: 6;
  padding: 7px 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, #fffaf0, #f0e3c8);
  color: var(--ink);
  font-family: var(--serif); font-weight: 700; font-size: 15px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,.4), inset 0 0 0 1px rgba(155,119,56,.4);
  opacity: 0; transform: scale(.6) translateY(6px);
  transition: opacity .25s, transform .45s var(--spring);
  pointer-events: none;
}
.bubble.show { opacity: 1; transform: scale(1) translateY(0); }
.bubble small { font-family: var(--ui); font-weight: 600; font-size: 10.5px; color: var(--gold-deep); margin-left: 4px; letter-spacing: .3px; }
.bubble::after {
  content: ''; position: absolute; top: -6px; width: 12px; height: 12px;
  background: #fffaf0; transform: rotate(45deg); border-radius: 2px;
  box-shadow: -1px -1px 0 rgba(155,119,56,.4);
}
.bubble[data-pos="w"]::after { left: 22px; }
.bubble[data-pos="e"]::after { right: 22px; }
.bubble[data-pos="s"]::after { top: auto; bottom: -6px; left: 22px; box-shadow: 1px 1px 0 rgba(155,119,56,.4); }
.bubble .red { color: var(--red); }

/* ---------- Contract banner ---------- */
#contract {
  position: absolute; left: 50%; z-index: 4;
  transform: translate(-50%, -8px) scale(.92); opacity: 0;
  transition: opacity .35s, transform .55s var(--spring);
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(30,10,11,.9), rgba(18,6,7,.9));
  box-shadow: inset 0 0 0 1px rgba(216,181,111,.5), 0 6px 16px rgba(0,0,0,.4);
  white-space: nowrap; overflow: hidden;
  pointer-events: none;
}
#contract.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#contract::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(105deg, transparent 30%, rgba(255,230,170,.35) 50%, transparent 70%);
  transform: translateX(-120%);
}
#contract.show::after { animation: sheen 1.4s .35s ease-out; }
@keyframes sheen { to { transform: translateX(120%); } }
.trump-coin {
  width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #fffaf0, #eadbb9);
  box-shadow: inset 0 0 0 1.5px var(--gold-deep);
}
.trump-coin svg { width: 15px; height: 15px; }
.trump-coin.none { font-family: var(--serif); font-weight: 800; font-size: 13px; color: var(--ink); }
#contract .c-name { font-family: var(--serif); font-weight: 700; font-size: 15px; color: var(--gold-hi); }
#contract .c-by { font-size: 12px; color: rgba(246,236,216,.7); }

/* ---------- Status ---------- */
#status {
  position: absolute; right: 22px; z-index: 3;
  max-width: 62%;
  display: flex; justify-content: flex-end;
  pointer-events: none;
}
#status span {
  font-size: 13px; font-weight: 500; color: rgba(246,236,216,.92);
  padding: 7px 12px; border-radius: 16px;
  background: rgba(20, 6, 7, .6);
  box-shadow: inset 0 0 0 1px rgba(216,181,111,.2);
  transition: opacity .25s, transform .3s var(--ease);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block;
}
#status.swap span { opacity: 0; transform: translateY(4px); }
#status.mine span { color: #2a170d; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); font-weight: 600; box-shadow: 0 0 16px rgba(243,217,153,.35); }

/* ---------- Cards ---------- */
#cards { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.card {
  position: absolute; left: 0; top: 0;
  width: var(--cw); height: var(--ch);
  transition: transform var(--move) var(--ease), opacity .4s ease;
  will-change: transform;
  pointer-events: none;
}
.card.instant, .card.gone.instant { transition: none; }   /* also for hidden cards: .gone sets its own transition */
.card.mine { pointer-events: auto; cursor: pointer; }
.card.gone { opacity: 0; transition: transform var(--move) var(--ease), opacity .3s ease calc(var(--move) * .55); }
.card-inner {
  position: absolute; inset: 0;
  transform-style: preserve-3d;
  transition: transform var(--flip) cubic-bezier(.3,.7,.3,1);
}
.card.down .card-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0;
  border-radius: calc(var(--cw) * .075);
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  overflow: hidden;
  box-shadow: 0 1px 1px rgba(0,0,0,.35), 0 3px 8px rgba(0,0,0,.28);
  transition: box-shadow .35s, filter .3s;
}
.face.front { background: #fbf4e3; }
.face.front svg { display: block; width: 100%; height: 100%; }
.face.back {
  transform: rotateY(180deg);
  background:
    radial-gradient(ellipse 34% 26% at 50% 50%, rgba(216,181,111,.0) 60%, rgba(216,181,111,.75) 62%, rgba(216,181,111,.0) 66%),
    repeating-linear-gradient(45deg, rgba(216,181,111,.32) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(216,181,111,.32) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 50% 45%, #7d1f2b, #4d0f18);
  box-shadow: inset 0 0 0 calc(var(--cw) * .045) #f2e6cc, inset 0 0 0 calc(var(--cw) * .06) var(--gold-deep), 0 1px 1px rgba(0,0,0,.35), 0 3px 8px rgba(0,0,0,.28);
}
/* Two decks are used in turn: every other game the backs are blue. */
#table.deck-blue .face.back {
  background:
    radial-gradient(ellipse 34% 26% at 50% 50%, rgba(216,181,111,.0) 60%, rgba(216,181,111,.75) 62%, rgba(216,181,111,.0) 66%),
    repeating-linear-gradient(45deg, rgba(216,181,111,.32) 0 1px, transparent 1px 7px),
    repeating-linear-gradient(-45deg, rgba(216,181,111,.32) 0 1px, transparent 1px 7px),
    radial-gradient(circle at 50% 45%, #2a4f8f, #12264f);
}
.card.lift .face { box-shadow: 0 2px 3px rgba(0,0,0,.3), 0 14px 26px rgba(0,0,0,.45); }
.card.dim .face.front { filter: brightness(.58) saturate(.6) sepia(.15); }
.card.mine.legal:active .card-inner { transform: translateY(-6px) scale(1.02); }
.card.sel .face.front { box-shadow: 0 0 0 2px #e05a4f, 0 10px 22px rgba(0,0,0,.45); }
.card.win .face.front { animation: winglow 1s ease-in-out infinite alternate; }
@keyframes winglow {
  from { box-shadow: 0 0 0 2px rgba(243,217,153,.9), 0 0 10px rgba(243,217,153,.4), 0 4px 10px rgba(0,0,0,.4); }
  to   { box-shadow: 0 0 0 2px rgba(243,217,153,1), 0 0 24px rgba(243,217,153,.85), 0 4px 10px rgba(0,0,0,.4); }
}
.card.fresh .face.front::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(115deg, transparent 35%, rgba(255,245,210,.85) 50%, transparent 65%);
  transform: translateX(-130%);
  animation: sheen .9s calc(var(--move) * .8) ease-out forwards;
}
.card.shake .card-inner { animation: shake .4s; }
@keyframes shake { 20% { transform: translateX(-5px) rotate(-2deg); } 40% { transform: translateX(5px) rotate(2deg); } 60% { transform: translateX(-3px); } 80% { transform: translateX(3px); } }
.card.turned .face.front { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(243,217,153,.6); }

/* ---------- Dock (actions) ---------- */
#dock {
  /* Centred, at most 560px wide: on a wide table the buttons would otherwise be far apart. */
  position: absolute; left: max(14px, calc(50% - 280px)); right: max(14px, calc(50% - 280px)); z-index: 7;
  padding: 12px;
  border-radius: 18px;
  background: var(--glass);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: inset 0 0 0 1px rgba(216,181,111,.38), 0 14px 34px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(18px) scale(.98); pointer-events: none;
  transition: opacity .25s, transform .45s var(--spring);
}
#dock.show { opacity: 1; transform: none; pointer-events: auto; }
/* Wide table (js/ui/cards-layer.js sets .wide): the dock centred and up to 760px wide, the bids in six columns
   with pass as the last cell, so it stays two rows low. */
#table.wide #dock { left: max(14px, calc(50% - 380px)); right: max(14px, calc(50% - 380px)); padding: 10px 12px; }
#table.wide #dock .grid:not(.two) { grid-template-columns: repeat(6, 1fr); }
#table.wide #dock .grid:not(.two) .btn.wide { grid-column: auto; }
#table.wide #dock .grid.two { grid-template-columns: repeat(4, 1fr); }   /* choose your game: up to 7 options in two rows */
#table.wide .dock-head { margin-bottom: 7px; }
#table.wide #status { max-width: 24%; }
.dock-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 2px 10px; }
.dock-title { font-family: var(--serif); font-weight: 700; font-size: 17px; color: var(--gold-hi); }
.dock-sub { font-size: 12px; color: rgba(246,236,216,.65); text-align: right; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.grid.two { grid-template-columns: repeat(2, 1fr); }
.btn {
  position: relative;
  min-height: 42px; padding: 6px 8px;
  border: 0; border-radius: 12px;
  font-weight: 600; font-size: 13.5px; line-height: 1.1;
  color: var(--ink);
  background: linear-gradient(180deg, #fffaf0, #eadcbd);
  box-shadow: inset 0 -2px 0 rgba(0,0,0,.12), 0 2px 6px rgba(0,0,0,.3);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform .15s, filter .2s, opacity .2s;
  animation: btnin .4s var(--spring) both;
}
.btn:active:not(:disabled) { transform: scale(.95); filter: brightness(.95); }
.btn:disabled { opacity: .28; filter: grayscale(.6); cursor: default; }
.btn small { font-size: 10.5px; font-weight: 600; color: var(--gold-deep); }
.btn.gold { background: linear-gradient(180deg, var(--gold-hi), var(--gold) 60%, #c39c56); color: #2a170d; }
.btn.ghost { background: transparent; color: var(--cream); box-shadow: inset 0 0 0 1px rgba(246,236,216,.35); }
.btn.danger { background: linear-gradient(180deg, #d9564b, #a8322b); color: #fff; }
.btn.wide { grid-column: 1 / -1; }
.btn .suit { width: 15px; height: 15px; vertical-align: -2px; }
/* Row buttons (choose your game): suit and name on one line, the coach's figures on the next. */
.btn.row { flex-direction: row; flex-wrap: wrap; column-gap: 6px; row-gap: 2px; }
.btn.row > span { white-space: nowrap; }
@keyframes btnin { from { opacity: 0; transform: translateY(8px) scale(.96); } }
.dock-note { font-size: 12px; color: rgba(246,236,216,.7); margin: 10px 2px 0; text-align: center; }

/* ---------- "Gense spillet": the game played again, one trick at a time (js/ui/replay.js) ---------- */
.replay { display: flex; align-items: center; gap: 6px; }
.rp-nav {
  flex: none; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; color: var(--gold-hi);
  background: rgba(246,236,216,.07); box-shadow: inset 0 0 0 1px rgba(216,181,111,.4);
  transition: opacity .2s, transform .15s;
}
.rp-nav:active:not(:disabled) { transform: scale(.92); }
.rp-nav:disabled { opacity: .28; cursor: default; }
.rp-nav svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* The line: a dot for the hands before the first trick, a coin per trick with the initials of who took it
   (gold: the declarer's side, dark: a defender, dashed: broken off), and a flag where a game stopped early. */
.rp-line {
  flex: 1; min-width: 0; position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 2px 2px; touch-action: none; cursor: pointer;
}
.rp-line::before {
  content: ''; position: absolute; left: 11px; right: 11px; top: calc(50% + 5px); height: 2px; margin-top: -1px;
  border-radius: 1px; background: rgba(216,181,111,.28);
}
.rp-dot {
  position: relative; flex: none; width: 22px; height: 22px; padding: 0; border: 0; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  font: 700 9px/1 var(--ui); letter-spacing: -.2px;
  background: #1f0b0c; color: var(--cream);
  transition: transform .35s var(--spring), opacity .3s, box-shadow .3s;
}
.rp-dot:not(.past):not(.cur) { opacity: .5; }
.rp-dot.cur { transform: scale(1.28); z-index: 1; }
.rp-dot.decl { background: radial-gradient(circle at 35% 30%, #fff1c9, #d8b56f 60%, #8e6a2e); color: #2a170d; }
.rp-dot.def { background: radial-gradient(circle at 35% 30%, #6b2b31, #2a0d10); box-shadow: inset 0 0 0 1.5px var(--gold-deep); }
.rp-dot.open { box-shadow: none; border: 1.5px dashed rgba(216,181,111,.8); }
.rp-dot.start::after { content: ''; width: 8px; height: 8px; border-radius: 1.5px; transform: rotate(45deg); background: var(--cream); }
.rp-dot.flag { color: var(--gold-hi); box-shadow: inset 0 0 0 1.5px rgba(216,181,111,.6); }
.rp-dot.flag svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.rp-dot.cur { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 14px rgba(243,217,153,.65); }
.rp-dot.open.cur { box-shadow: 0 0 14px rgba(243,217,153,.65); }
/* A claim that was not accepted: an eye over the trick it was made in. */
.rp-eye { position: absolute; left: 50%; top: -13px; width: 13px; height: 13px; margin-left: -6.5px; color: var(--gold-hi); }
.rp-eye svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2.2; }
.rp-text {
  margin: 7px 2px 0; min-height: 2.7em; text-align: center;   /* two lines kept, so the dock does not jump */
  font-size: 12.5px; line-height: 1.35; color: rgba(246,236,216,.8);
}
.rp-text b { color: var(--gold-hi); font-weight: 600; }
/* The cards never played glow in gold at the end of a game that stopped early – nowhere else. Not dimmed – .dim
   means a card that may not be played. */
#table.replay-end .card.never .face.front { box-shadow: 0 0 0 2px var(--gold), 0 0 16px rgba(243,217,153,.55), 0 3px 8px rgba(0,0,0,.28); }
/* A small table: the trick is lifted over the contract, which steps aside while it lies there. */
#table.replay-lift #contract.show { opacity: 0; }

/* ---------- Overlay sheets ---------- */
#overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 4, 3, 0);
  -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0);
  transition: background .3s, backdrop-filter .3s;
}
#overlay.show { background: rgba(10, 4, 3, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
#overlay.center { align-items: center; }
#overlay[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 560px; max-height: 86dvh; overflow: auto;
  padding: 10px 18px calc(22px + var(--safe-bottom));
  border-radius: 24px 24px 0 0;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    linear-gradient(180deg, #4a141a, #2c0b0f);
  box-shadow: 0 -10px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(216,181,111,.5);
  transform: translateY(100%);
  transition: transform .45s var(--ease);
}
#overlay.show .sheet { transform: none; }
.sheet::before { content: ''; display: block; width: 40px; height: 4px; border-radius: 2px; background: rgba(246,236,216,.3); margin: 0 auto 12px; }
.sheet h2 { font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--gold-hi); margin: 4px 0 14px; }
.sheet h3 { font-family: var(--serif); font-size: 16px; color: var(--gold); margin: 20px 0 8px; }
.sheet p, .sheet li { font-size: 14px; line-height: 1.5; color: rgba(246,236,216,.88); }
.sheet ul { padding-left: 18px; }
.menu-list { display: grid; gap: 8px; }
.menu-item {
  display: flex; align-items: center; gap: 14px; text-align: left;
  padding: 14px; border: 0; border-radius: 14px; cursor: pointer;
  background: rgba(255, 240, 210, .06); box-shadow: inset 0 0 0 1px rgba(216,181,111,.18);
  font-size: 15px; font-weight: 500;
  transition: background .2s, transform .15s;
  animation: btnin .4s var(--spring) both;
}
.menu-item:active { transform: scale(.98); background: rgba(255,240,210,.12); }
.menu-item svg { width: 22px; height: 22px; fill: none; stroke: var(--gold); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.menu-item span small { display: block; font-size: 12px; color: rgba(246,236,216,.55); font-weight: 400; margin-top: 2px; }
/* The open tables: equal rows in one box, a dot per seat; tables nobody sits at behind a fold. */
.net-now { font-size: 13px; color: rgba(246,236,216,.7); margin: 0 0 10px; }
.net-rows { border-radius: 14px; overflow: hidden; box-shadow: inset 0 0 0 1px rgba(216,181,111,.18); background: rgba(255,240,210,.06); }
.net-row { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 11px 14px; border: 0; cursor: pointer; background: none; color: inherit; font: inherit; }
.net-row + .net-row { border-top: 1px solid rgba(216,181,111,.14); }
.net-row:active { background: rgba(255,240,210,.12); }
.net-main { flex: 1; min-width: 0; display: block; }
.net-main b { display: block; font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-main small { display: block; font-size: 12px; color: rgba(246,236,216,.55); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.net-seats { display: flex; gap: 4px; flex: none; }
.net-seats i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(246,236,216,.45); box-sizing: border-box; }
.net-seats i.on { background: var(--gold); border-color: var(--gold); }
.net-seats i.away { background: rgba(216,181,111,.32); border-color: rgba(216,181,111,.32); }
.net-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin: 10px 2px 0; font-size: 12px; color: rgba(246,236,216,.55); }
.net-legend i { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid rgba(246,236,216,.45); box-sizing: border-box; margin-left: 8px; }
.net-legend i:first-child { margin-left: 0; }
.net-legend i.on { background: var(--gold); border-color: var(--gold); }
.net-legend i.away { background: rgba(216,181,111,.32); border-color: rgba(216,181,111,.32); }
.net-fold { display: block; width: 100%; margin-top: 10px; padding: 8px; border: 0; background: none; color: rgba(246,236,216,.6); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.net-fold + .net-rows { margin-top: 6px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th { text-align: left; font-weight: 600; color: var(--gold); font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; padding: 6px 4px; }
.tbl td { padding: 8px 4px; border-top: 1px solid rgba(216,181,111,.14); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.pos { color: #9fd59a; } .neg { color: #f19a90; }
.seg { display: flex; padding: 3px; border-radius: 12px; background: rgba(0,0,0,.3); box-shadow: inset 0 0 0 1px rgba(216,181,111,.2); }
.seg button { flex: 1; border: 0; padding: 9px 4px; border-radius: 9px; background: transparent; font-size: 13.5px; font-weight: 600; color: rgba(246,236,216,.7); cursor: pointer; transition: background .25s, color .25s; }
.seg button.on { background: linear-gradient(180deg, var(--gold-hi), var(--gold)); color: #2a170d; }
.setting { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 14px 0; }
.setting label { font-size: 14.5px; }
.setting .seg { flex: 0 0 60%; }
.sheet .actions { display: grid; gap: 8px; margin-top: 18px; }
/* "Afslut spillet": one section to win (lay the cards down) and one to lose (throw them), each in its own colour. */
.sheet .end { --c: 111, 190, 126; margin: 0 0 12px; padding: 12px 14px 14px; border-radius: 14px; background: rgba(var(--c), .08); box-shadow: inset 0 0 0 1px rgba(var(--c), .4); }
.sheet .end.lose { --c: 233, 108, 96; }
.sheet .end h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 6px; font-size: 15px; font-weight: 700; color: rgb(var(--c)); }
.sheet .end h3 svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sheet .end p { margin: 0; }
.sheet .end .actions { margin-top: 12px; }
.mini-trick { display: flex; justify-content: center; gap: 10px; margin: 6px 0 4px; }
.mini-card { width: 84px; text-align: center; font-size: 12px; color: rgba(246,236,216,.75); }
.mini-card .mc { width: 84px; height: 118px; border-radius: 7px; overflow: hidden; box-shadow: 0 4px 12px rgba(0,0,0,.4); margin-bottom: 6px; background: #fbf4e3; }
.mini-card .mc svg { width: 100%; height: 100%; display: block; }
.mini-card.won .mc { box-shadow: 0 0 0 2px var(--gold), 0 0 18px rgba(243,217,153,.6); }

/* ---------- Result ---------- */
.result {
  width: min(92vw, 400px);
  padding: 26px 20px 20px;
  border-radius: 24px;
  text-align: center;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.25 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(120% 90% at 50% 0%, #6a2028, #2c0b0f);
  box-shadow: inset 0 0 0 1px rgba(216,181,111,.55), inset 0 0 0 6px rgba(0,0,0,.15), inset 0 0 0 7px rgba(216,181,111,.25), 0 24px 60px rgba(0,0,0,.6);
  transform: scale(.85) translateY(30px); opacity: 0;
  transition: transform .6s var(--spring), opacity .3s;
}
#overlay.show .result { transform: none; opacity: 1; }
.result .eyebrow { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: rgba(246,236,216,.6); }
.result h1 {
  font-family: var(--serif); font-style: italic; font-weight: 800; font-size: 46px; margin: 4px 0 2px; line-height: 1.15;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.45));
}
.result h1 .word { display: inline-block; white-space: nowrap; padding: 0; background: none; animation: none; }
.result h1 span:not(.word) {
  display: inline-block; padding: 0 1px;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: letter .6s var(--spring) both;
}
.result h1.lose span:not(.word) { background-image: linear-gradient(180deg, #ffb3a8, #e0675b 60%, #a8322b); }
@keyframes letter { from { opacity: 0; transform: translateY(18px) rotate(-8deg) scale(.6); } }
.result .desc { font-size: 14px; color: rgba(246,236,216,.85); margin-bottom: 16px; }
.result .rows { display: grid; gap: 6px; margin-bottom: 18px; }
.result .row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  padding: 10px 12px; border-radius: 12px; background: rgba(0,0,0,.22); text-align: left;
  animation: btnin .5s var(--spring) both;
}
.result .row .who { font-weight: 600; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.result .row .stik { font-size: 12.5px; color: rgba(246,236,216,.65); }
.result .row .delta { font-family: var(--serif); font-weight: 800; font-size: 18px; min-width: 40px; text-align: right; font-variant-numeric: lining-nums tabular-nums; }
.result .row .delta small { display: block; font-family: var(--ui); font-weight: 500; font-size: 10px; letter-spacing: .4px; color: rgba(246,236,216,.5); margin-top: -2px; }

/* ---------- Splash ---------- */
.splash {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  padding: 24px;
  background: inherit;
  background-color: #2a170d;
  transition: opacity .6s, transform .6s var(--ease);
}
.splash.out { opacity: 0; transform: scale(1.06); pointer-events: none; }
.splash .plate {
  width: min(88vw, 380px); padding: 34px 22px 26px; border-radius: 28px; text-align: center;
  background:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='220' height='220'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 0.28 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    radial-gradient(120% 80% at 50% 30%, #7a262e, #3a0e13);
  box-shadow: inset 0 0 0 1.5px rgba(216,181,111,.6), inset 0 0 0 7px rgba(0,0,0,.18), inset 0 0 0 8px rgba(216,181,111,.28), 0 30px 70px rgba(0,0,0,.6);
  animation: rise .9s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(30px) scale(.96); } }
.splash .fan { position: relative; height: 112px; margin: 0 auto 12px; width: 220px; }
.splash .fan .fc {
  position: absolute; left: 50%; bottom: 0; width: 66px; height: 92px; margin-left: -33px;
  border-radius: 6px; overflow: hidden; box-shadow: 0 6px 16px rgba(0,0,0,.45);
  transform-origin: 50% 120%;
  animation: fanout 1s var(--spring) both;
}
.splash .fan .fc svg { width: 100%; height: 100%; display: block; }
@keyframes fanout { from { transform: rotate(0) translateY(20px); opacity: 0; } }
.splash h1 {
  font-family: var(--serif); font-style: italic; font-weight: 800; font-size: 52px; margin: 0; line-height: 1;
  background: linear-gradient(180deg, var(--gold-hi), var(--gold) 55%, var(--gold-deep));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 2px 2px rgba(0,0,0,.5));
  animation: rise 1s .15s var(--ease) both;
}
.splash .tag { font-size: 13px; letter-spacing: 3px; text-transform: uppercase; color: rgba(246,236,216,.65); margin: 10px 0 24px; animation: rise 1s .25s var(--ease) both; }
.splash .actions { display: grid; gap: 10px; }
.splash .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }   /* rules and settings share a row */
.splash .btn { min-height: 50px; font-size: 16px; }
.splash .foot { margin-top: 16px; font-size: 11.5px; color: rgba(246,236,216,.45); }
.splash .fact { margin: 18px auto 0; max-width: 300px; font-size: 13px; line-height: 1.45; color: rgba(246,236,216,.72); font-style: italic; animation: rise 1s .5s var(--ease) both; }
.splash .fact b { display: block; font-style: normal; font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--gold); margin-bottom: 4px; }
.history p { line-height: 1.55; }
.history ul { padding-left: 18px; line-height: 1.5; }
.history li { margin-bottom: 6px; }

/* ---------- Toast & effects ---------- */
#toast {
  position: fixed; left: 50%; top: calc(58px + var(--safe-top)); z-index: 90;
  transform: translate(-50%, -20px); opacity: 0;
  padding: 9px 16px; border-radius: 14px;
  background: linear-gradient(180deg, #fffaf0, #eadcbd); color: var(--ink);
  font-size: 13.5px; font-weight: 600;
  box-shadow: 0 10px 26px rgba(0,0,0,.45);
  transition: opacity .25s, transform .45s var(--spring);
  pointer-events: none;
  /* Long messages wrap and stay inside the screen (16px from each edge). */
  width: max-content; max-width: calc(100vw - 32px); box-sizing: border-box;
  white-space: normal; text-align: center; line-height: 1.35;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 8; pointer-events: none; }
.float-delta {
  font-variant-numeric: lining-nums;
  position: absolute; z-index: 9; pointer-events: none;
  font-family: var(--serif); font-weight: 800; font-size: 20px;
  text-shadow: 0 2px 6px rgba(0,0,0,.6);
  animation: floatup 1.6s var(--ease) forwards;
}
@keyframes floatup { 0% { opacity: 0; transform: translateY(8px) scale(.7); } 20% { opacity: 1; transform: translateY(0) scale(1.1); } 100% { opacity: 0; transform: translateY(-34px) scale(1); } }

@media (prefers-reduced-motion: reduce) {
  :root { --move: 1ms; --flip: 1ms; }
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- Coach ---------- */
.coach-pill {
  position: absolute; left: 1px; top: calc(var(--ch) * 0.4); z-index: 2;
  padding: 2px 6px; border-radius: 8px;
  font-size: 11px; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap;
  color: var(--cream); background: rgba(20, 6, 7, .85);
  box-shadow: inset 0 0 0 1px rgba(216,181,111,.45), 0 2px 6px rgba(0,0,0,.4);
  opacity: 0; transform: translateY(6px) scale(.8);
  transition: opacity .25s, transform .4s var(--spring);
  pointer-events: none;
}
.coach-pill.show { opacity: 1; transform: none; }
.coach-pill.best { color: #2a170d; background: linear-gradient(180deg, var(--gold-hi), var(--gold)); box-shadow: 0 0 12px rgba(243,217,153,.6); }
/* Under the value: what the card costs compared with the best one. It wraps, so it fits the narrow strip of a card in a full hand. */
.coach-pill small { display: block; max-width: 27px; margin-top: 1px; font-size: 8.5px; font-weight: 600; line-height: 1.15; white-space: normal; color: rgba(246,236,216,.7); }
.coach-pill.best small { color: #4a3413; }
.coach-pill.meh small { color: #f0c26a; }
.coach-pill.bad small { color: #ff9d8c; }
.coach-pill.swap { color: #2a170d; background: var(--gold); box-shadow: 0 0 10px rgba(243,217,153,.5); text-transform: uppercase; letter-spacing: .5px; font-size: 10px; }
.btn small.advice { color: #6b4f1d; font-weight: 700; font-variant-numeric: lining-nums tabular-nums; white-space: nowrap; animation: pop .35s var(--spring); }
.btn small.advice .win.good { color: #23662b; }
.btn small.advice .win.bad { color: var(--red); }
.btn.coach-best { box-shadow: 0 0 0 2px var(--gold-hi), 0 0 14px rgba(243,217,153,.55); }
.coach-help { font: inherit; color: var(--gold-hi); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.btn.row small.advice { flex-basis: 100%; text-align: center; }
.advice-note b { color: var(--gold-hi); }
.setting-note { font-size: 12.5px !important; color: rgba(246,236,216,.55) !important; margin: -6px 0 10px; line-height: 1.4; }
.analysis-wait { animation: dot 1.4s infinite; }
.analysis-row {
  display: flex; align-items: center; gap: 14px; padding: 12px; margin: 10px 0;
  border-radius: 14px; background: rgba(0,0,0,.22); box-shadow: inset 0 0 0 1px rgba(216,181,111,.15);
  animation: btnin .5s var(--spring) both;
}
.analysis-cards { display: flex; align-items: center; gap: 6px; flex: none; }
.analysis-cards .mini-card { width: 52px; font-size: 10.5px; }
.analysis-cards .mini-card .mc { width: 52px; height: 73px; border-radius: 5px; margin-bottom: 4px; }
.analysis-cards .arrow { color: var(--gold); font-size: 18px; }
.analysis-text { font-size: 13.5px; line-height: 1.45; min-width: 0; }
.analysis-foot { font-size: 12px !important; color: rgba(246,236,216,.5) !important; }

/* Many buttons on the right (e.g. tout, lay down, give up, score): the title moves next to the menu. */
.topbar.crowded .brand { left: 60px; transform: none; }

/* ---------- Start in the native app ---------- */
/* A flat layer in the system splash colour over everything, fading away so the wood and the start page come up
   from the colour the system already shows (js/app.js adds the class for about a second). */
body.veil::after { content: ''; position: fixed; inset: 0; z-index: 200; background: #2a170d; pointer-events: none; animation: veil .7s .15s ease forwards; }
@keyframes veil { to { opacity: 0; } }

/* ---------- Wide and low screens (last, so they win over the rules above) ---------- */
/* Wide screens (phones and tablets on their side, desktops): the table may be wide, bound to the height so the
   hand stays a fan and the seats stay within reach; the arrangement itself is chosen in js/ui/cards-layer.js. */
@media (min-aspect-ratio: 23/20) {
  #app { max-width: min(1400px, 220dvh); }
}
/* Little height (a phone on its side): lower top bar, compact start page and dock. */
@media (max-height: 520px) {
  .topbar { height: 40px; }
  .brand { font-size: 19px; }
  .splash .plate { width: min(92vw, 560px); padding: 14px 22px 12px; }
  .splash .fan { height: 56px; width: 110px; margin-bottom: 2px; }
  .splash .fan .fc { width: 34px; height: 48px; margin-left: -17px; }
  .splash h1 { font-size: 30px; }
  .splash .tag { font-size: 11px; margin: 4px 0 10px; }
  .splash .actions { grid-template-columns: repeat(2, 1fr); }
  .splash .pair { display: contents; }
  .splash .actions > .btn:first-child:nth-last-child(2), .splash .btn.back { grid-column: 1 / -1; }   /* no online button: the first one takes the row; "back to the table" always does */
  .splash .btn { min-height: 40px; font-size: 14px; }
  .splash .fact { display: none; }
  .splash .foot { margin-top: 8px; }
  #table.wide #dock { padding: 8px 10px; }
  #table.wide #dock .btn { min-height: 36px; }
  #table.wide .dock-note { margin-top: 6px; }
  .result { padding: 14px 16px 12px; }
  .result h1 { font-size: 30px; }
  .result .desc { margin-bottom: 8px; }
  .result .rows { gap: 4px; margin-bottom: 10px; }
}
/* The result dialog never grows past the screen: it scrolls instead. */
.result { max-height: 94dvh; overflow: auto; }
