/* Page reset */
:root{color-scheme:light;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
html{scroll-padding-top:env(safe-area-inset-top,0px)}
body{margin:0;padding:0;font:14px -apple-system,BlinkMacSystemFont,sans-serif;background:#faf9f5;color:#141413}
img{max-width:100%}
[hidden]:not([hidden=until-found i]){display:none!important}

/* Layout: one narrow column. Scoreboard on top, current round card in the middle (card-count tile + sequence strip), round history table below. Winner overlay on top of everything. */
:root {
  --bg: #ECEFE5;
  --surface: #F8FAF3;
  --ink: #18271F;
  --muted: #5B6B61;
  --line: #D1D8C8;
  --muted-line: #9BA79C;
  --felt: #1E5B43;
  --felt-ink: #F4F8EE;
  --focus: #1E5B43;
  --win: #1B6446;
  --win-bg: #DCEBDD;
  --lose: #B03A2D;
  --lose-bg: #F4DDD7;
  --over: #9A5A12;
  --over-bg: #F6E7CF;
  --under: #245F9C;
  --under-bg: #DCE8F5;
  --font-display: 'Google Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-body: 'Google Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1713;
    --surface: #16231C;
    --ink: #E8EEE5;
    --muted: #93A499;
    --line: #28392F;
    --muted-line: #55695C;
    --felt: #4DAA83;
    --felt-ink: #07130D;
    --focus: #7FD1A8;
    --win: #6FCB9C;
    --win-bg: #1C3A2B;
    --lose: #EE8678;
    --lose-bg: #3E1F1B;
    --over: #E8B069;
    --over-bg: #41301A;
    --under: #86B8EE;
    --under-bg: #1B2E44;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1713;
  --surface: #16231C;
  --ink: #E8EEE5;
  --muted: #93A499;
  --line: #28392F;
  --muted-line: #55695C;
  --felt: #4DAA83;
  --felt-ink: #07130D;
  --focus: #7FD1A8;
  --win: #6FCB9C;
  --win-bg: #1C3A2B;
  --lose: #EE8678;
  --lose-bg: #3E1F1B;
  --over: #E8B069;
  --over-bg: #41301A;
  --under: #86B8EE;
  --under-bg: #1B2E44;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
/* This is an app, not a document: text is not selectable by accident (taps, drags, double-clicks). Name fields stay editable. */
body, .ov, .modal { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
input, textarea { -webkit-user-select: text; user-select: text; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  padding-inline: 22px;
  padding-block: 18px 48px;
}
.wrap { max-width: 520px; margin-inline: auto; display: flex; flex-direction: column; gap: 18px; }
h1, h2, h3, p, ul, ol { margin: 0; padding: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; text-wrap: balance; }
h2 { font-size: 21px; }
button, input { font: inherit; color: inherit; }
button, a, [data-act], [data-tut] { touch-action: manipulation; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.brand { display: flex; align-items: center; justify-content: space-between; gap: 12px; direction: ltr; }
html[dir="rtl"] .brand .btn { direction: rtl; }
.hright { display: flex; flex-direction: row-reverse; align-items: center; gap: 8px; }
.hright .btn.ghost { color: var(--muted); }
@supports (color: color-mix(in srgb, red, blue)) { .hright .btn.ghost { color: color-mix(in srgb, var(--ink) 72%, var(--bg)); } }
.icon.rm { position: relative; padding: 0; flex: none; }
.icon.rm svg { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; display: block; }
.icon.snd { position: relative; width: 40px; height: 40px; padding: 0; flex: none; }
.icon.snd svg { position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; display: block; }
.brand-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand h1 { font-size: 25px; line-height: 1; }
.brand h1 b { font-weight: 700; }
.brand h1 .tld { font-size: .65em; font-weight: 400; opacity: .35; margin-inline-start: 1px; }
.suit { display: flex; line-height: 1; color: var(--felt); }
.suit svg { display: block; width: 23px; height: 23px; }
.lede { color: var(--muted); max-width: 46ch; }

.btn {
  min-height: 50px; width: 100%; border: 0; border-radius: 12px; padding-inline: 20px;
  background: var(--felt); color: var(--felt-ink); font-weight: 700; font-size: 17px; cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); font-weight: 600; }
.btn.small { width: auto; min-height: 40px; padding-inline: 14px; font-size: 15px; white-space: nowrap; }
/* Soft, unhurried press feedback on every control. */
.btn, .step, .segb, .chip, .icon { -webkit-tap-highlight-color: transparent; transition: background-color .35s ease, border-color .35s ease, color .35s ease, opacity .35s ease, transform .3s cubic-bezier(.2,.8,.2,1); }
.btn:active, .step:active, .segb:active, .icon:active { transform: scale(.97); opacity: .88; transition-duration: .12s; }
.chip:active { opacity: .7; transition-duration: .12s; }
@media (hover: hover) {
  .btn:not(:disabled):hover { opacity: .92; }
  .btn.ghost:not(:disabled):hover, .step:not(:disabled):hover, .segb:hover, .icon:hover { background: var(--surface); }
  .chip:hover { background: var(--surface); }
}
@keyframes fxin { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.btn:disabled { opacity: .45; cursor: default; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }

/* Setup */
.names { display: flex; flex-direction: column; gap: 10px; }
.namerow { display: flex; gap: 8px; align-items: center; }
.name {
  flex: 1; min-width: 0; height: 50px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--bg); padding-inline: 14px; font-size: 17px;
}
.icon { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: transparent; cursor: pointer; color: var(--muted); }

/* Scoreboard */
.board { list-style: none; display: flex; flex-direction: column; position: relative; }
.srow { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; column-gap: 12px; padding-block: 9px; border-top: 1px solid var(--line); will-change: transform; }
.srow:first-child { border-top: 0; }
.rank { width: 28px; height: 28px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.sname { font-weight: 700; font-size: 17px; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stotal { font-family: var(--font-display); font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; display: inline-block; }
.stotal { position: relative; }
.srow { position: relative; }
.srow::before { content: ""; position: absolute; inset: 2px -10px; border-radius: 12px; background: var(--win-bg); opacity: 0; z-index: -1; pointer-events: none; }
.srow.overtook::before { animation: leadrow 4.6s ease-in-out both; }
@keyframes leadrow { 0% { opacity: 0; } 20% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
.bar { grid-column: 1 / -1; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; margin-top: 6px; }
.bar i { display: block; height: 100%; background: var(--felt); border-radius: 3px; }
.board:not(.go) .gain { animation-play-state: paused; }
.gain { font-size: 13px; font-weight: 700; padding: 1px 9px; border-radius: 99px; opacity: 0; animation: gain 4.2s ease .25s both; font-variant-numeric: tabular-nums; }
.gain.ok { background: var(--win-bg); color: var(--win); }
.gain.no { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--muted-line); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.28); } 100% { transform: scale(1); } }
@keyframes gain {
  0% { opacity: 0; transform: translateY(8px) scale(.8); }
  7% { opacity: 1; transform: translateY(0) scale(1.08); }
  12% { transform: scale(1); }
  88% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: translateY(-6px); }
}

/* Round panel */
.phead.peak { margin-bottom: -6px; }
.phead { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ptext { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; min-width: 0; }
.step-note { color: var(--muted); font-size: 14px; }
.tag { font-family: var(--font-body); font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--felt); color: var(--felt-ink); }
.cardtile {
  flex: none; position: relative; width: 70px; height: 94px; margin-inline: auto; border-radius: 10px; border: 2px solid var(--ink);
  background: var(--surface); display: grid; align-content: center; justify-items: center;
}
.cardtile b { display: block; width: 100%; text-align: center; font-family: var(--font-display); font-weight: 400; font-size: 48px; line-height: 1; font-variant-numeric: tabular-nums; }
.cardtile small { font-size: 11px; color: var(--muted); font-weight: 600; }
.cardtile::before, .cardtile::after { content: ""; position: absolute; width: 12px; height: 12px; background: var(--felt); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='9.5' r='6.5'/%3E%3Ccircle cx='8.5' cy='19' r='6.5'/%3E%3Ccircle cx='23.5' cy='19' r='6.5'/%3E%3Ccircle cx='16' cy='17' r='5.5'/%3E%3Cpath d='M13.6 18h4.8l2.2 11.5H11.4z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'%3E%3Ccircle cx='16' cy='9.5' r='6.5'/%3E%3Ccircle cx='8.5' cy='19' r='6.5'/%3E%3Ccircle cx='23.5' cy='19' r='6.5'/%3E%3Ccircle cx='16' cy='17' r='5.5'/%3E%3Cpath d='M13.6 18h4.8l2.2 11.5H11.4z'/%3E%3C/svg%3E") center / contain no-repeat; }
.cardtile::before { inset-block-start: 4px; inset-inline-start: 6px; }
.cardtile::after { inset-block-end: 4px; inset-inline-end: 6px; transform: rotate(180deg); }
/* Round strip: one thin bar per round, its height is the card count, so the whole game reads as a hill. */
.prog { display: flex; align-items: flex-end; justify-content: center; gap: 3px; height: 24px; }
.prog i { flex: 1; min-width: 0; min-height: 4px; border-radius: 2px; background: var(--line); transition: background .3s ease; }
.prog i.done { background: var(--felt); opacity: .55; }
.prog i.cur { background: var(--ink); }
.phase { align-self: center; font-size: 15px; font-weight: 700; color: var(--ink); letter-spacing: .02em; padding: 3px 16px; border: 1px solid var(--muted-line); border-radius: 12px; margin-top: -2px; margin-bottom: -4px; }
.rows > .row:first-child { padding-top: 4px; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 12px; padding-block: 10px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.turn { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.nm { font-weight: 700; overflow-wrap: anywhere; }
.sub { font-size: 14px; color: var(--muted); }
.sub.ok { color: var(--win); font-weight: 600; }
.sub.no { color: var(--lose); font-weight: 600; }
.stepper { flex: none; display: flex; align-items: center; gap: 4px; }
.step { width: 46px; height: 46px; padding: 0; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); line-height: 1; cursor: pointer; display: grid; place-items: center; }
.step svg { display: block; }
.step:disabled { opacity: .35; cursor: default; }
.wheel { position: relative; width: 2.2em; height: 46px; overflow: hidden; font-size: 25px; }
.strip { will-change: transform; }
.strip span { display: grid; place-items: center; height: 46px; font-family: var(--font-display); font-size: 25px; line-height: 1; font-variant-numeric: tabular-nums; }
.row.res { flex-direction: column; align-items: stretch; gap: 8px; padding-block: 12px; }
.rhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row.res .segb { min-height: 44px; font-size: 16px; }
.facts { display: flex; align-items: center; flex-wrap: nowrap; margin-top: 3px; white-space: nowrap; }
.fact { font-size: 14px; color: var(--muted); padding-inline-end: 10px; }
.fact + .fact { padding-inline: 10px 0; border-inline-start: 1.5px solid var(--muted-line, var(--muted)); }
.fact b { color: var(--ink); font-variant-numeric: tabular-nums; }
.ptsc {
  flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center;
  border: 2px solid var(--line); color: var(--muted);
  font-family: var(--font-display); font-size: 18px; line-height: 1; padding: 0;
}
.flyc { position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--muted-line); background: var(--surface); color: var(--ink); font-family: var(--font-display); font-size: 19px; line-height: 1; will-change: transform, opacity; }
.frozen { pointer-events: none; }
.modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; padding: 20px; }
.scrim { position: absolute; inset: 0; background: rgba(20, 30, 24, .38); animation: scrimin 1s ease-out both; }
@supports (backdrop-filter: blur(2px)) { .scrim { backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: scrimblur 1s ease-out both; } }
@keyframes scrimin { from { background: rgba(20, 30, 24, 0); } to { background: rgba(20, 30, 24, .38); } }
@keyframes scrimblur { from { background: rgba(20, 30, 24, 0); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); } to { background: rgba(20, 30, 24, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); } }
.modal.closing { pointer-events: none; }
.modal.closing .scrim { animation: scrimout .4s ease-in-out both; }
.modal.closing .dlg { animation: dlgout .4s ease-in-out both; }
@keyframes scrimout { from { background: rgba(20, 30, 24, .38); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); } to { background: rgba(20, 30, 24, 0); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); } }
@keyframes dlgout { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(14px) scale(.96); } }
.ov.closing { pointer-events: none; animation: ovout .4s ease-in-out both; }
.ov.closing .win-card, .ov.closing .intro { animation: dlgout .4s ease-in-out both; }
#confetti.closing { opacity: 0; transition: opacity .4s ease-in-out; }
@keyframes ovout { from { background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); } to { background: color-mix(in srgb, var(--bg) 0%, transparent); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); } }
.dlg.help { max-width: 460px; max-height: calc(100dvh - 32px); overflow-y: auto; }
.rules { margin: 0; padding-inline-start: 20px; display: flex; flex-direction: column; gap: 12px; line-height: 1.55; }
.rules b { font-weight: 700; }
.helpbtn { align-self: center; margin-top: 4px; }
.dlg { position: relative; width: 100%; max-width: 380px; margin: 0; box-shadow: 0 18px 50px rgba(0, 0, 0, .25); animation: rise .75s cubic-bezier(.2, .9, .3, 1.1) .1s both; }
.ghost { background: transparent !important; border-color: transparent !important; box-shadow: none !important; }
.ghost .cardtile { border-color: transparent; background: transparent; }
.ghost .cardtile::before, .ghost .cardtile::after, .ghost .cardtile small, .ghost .ptext, .ghost .prog { visibility: hidden; }
.pn { display: block; line-height: 1; text-align: center; unicode-bidi: isolate; letter-spacing: 0; }
.warn { color: var(--lose); font-size: 14px; font-weight: 600; }
.ptsc.ok { border: 2px solid var(--muted-line); background: transparent; color: var(--ink); }
.ptsc.no { border: 2px solid var(--muted-line); background: transparent; color: var(--ink); }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.segb { min-height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); font-weight: 700; font-size: 16px; cursor: pointer; }
.segb.on.ok { background: var(--win-bg); border-color: var(--win); color: var(--win); }
.segb.on.no { background: var(--lose-bg); border-color: var(--lose); color: var(--lose); }
/* Compact segmented strip: every option in one row, no wrapping. */
.chips { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--bg); }
.chip { flex: 1; min-width: 0; height: 38px; padding: 0; display: grid; place-items: center; line-height: 1; border: 0; border-inline-start: 1px solid var(--line); border-radius: 0; background: transparent; font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; cursor: pointer; }
.chip:first-child { border-inline-start: 0; }
/* Options that would break the card total are only dimmed; they stay tappable. */
.dim { opacity: .3; }

.chip.on { background: var(--lose-bg); color: var(--lose); }
.sum { color: var(--muted); font-size: 15px; }
.sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
.actions { display: flex; flex-direction: column; gap: 8px; }

/* Over / under meter */
.ou { display: flex; flex-direction: column; gap: 10px; }
.ou-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: 15px; color: var(--muted); }
.ou-top b { color: var(--ink); font-variant-numeric: tabular-nums; }
.pill { font-size: 13px; font-weight: 700; padding: 3px 10px; border-radius: 99px; white-space: nowrap; }
.pill.over { background: var(--over-bg); color: var(--over); }
.pill.under { background: var(--under-bg); color: var(--under); }
.pill.even { background: var(--win-bg); color: var(--win); }
.ou-bar { position: relative; }
.trk { position: relative; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); }
.trk i { position: absolute; top: 0; bottom: 0; display: block; }
.trk .base { inset-inline-start: 0; }
.trk .over { inset-inline-end: 0; }
.trk .even { background: var(--felt); }
.trk .over { background: var(--over); }
.trk .under { background: var(--under); }

/* History */
.hist { display: flex; flex-direction: column; gap: 12px; }
.hhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 8px 6px; text-align: center; min-width: 60px; }
thead th { font-size: 14px; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
tbody th { font-size: 14px; color: var(--muted); font-weight: 600; min-width: 80px; }
tbody th .rcell { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.mcard { display: inline-grid; place-items: center; width: 20px; height: 27px; border: 1.5px solid var(--ink); border-radius: 4px; font-family: var(--font-display); font-size: 12px; line-height: 1; color: var(--ink); opacity: .45; }
tbody th strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 23px; line-height: 1.1; color: var(--ink); }
tbody th small { display: block; font-size: 12px; font-weight: 600; }
tbody th small.over { color: var(--over); }
tbody th small.under { color: var(--under); }
tbody th small.even { color: var(--win); }
th:first-child { position: sticky; inset-inline-start: 0; background: var(--surface); z-index: 1; }
tbody tr + tr > * { border-top: 1px solid var(--line); }
tr > * + * { border-inline-start: 1px solid var(--line); }
td strong { display: block; font-family: var(--font-display); font-weight: 400; font-size: 19px; line-height: 1.1; }
td small { display: block; font-size: 12px; color: var(--muted); }
td.ok { background: var(--win-bg); }
td.ok strong { color: var(--ink); }
td.no { background: transparent; }
td.no strong { color: var(--ink); }
tfoot th, tfoot td { border-top: 1px solid var(--muted-line); font-weight: 700; font-size: 18px; padding-block: 10px; }
.legend { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); border: 1px dashed var(--line); border-radius: 12px; padding: 16px; }

/* "Let's go!" splash shown once the game starts */
.splash { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; align-content: center; gap: 18px; background: var(--felt); color: var(--felt-ink); overflow: hidden; cursor: pointer; animation: splin .45s ease-out both; }
.splash::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 46%, rgba(255,255,255,.16), transparent 62%); opacity: 0; animation: splglow 2s ease-out .15s both; }
.splash.out { pointer-events: none; animation: splout .7s ease-in-out both; }
.splash > * { position: relative; grid-area: auto; }
.splash h1 { font-family: var(--font-display); font-weight: 700; -webkit-text-stroke: .022em currentColor; paint-order: stroke fill; font-size: clamp(48px, 17vw, 84px); line-height: 1; letter-spacing: .01em; display: flex; justify-content: center; white-space: pre; margin: 0; color: inherit; }
.splash h1 span { display: inline-block; opacity: 0; animation: splch .8s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.25s + var(--i) * .055s); }
.splash .ss { display: flex; gap: 16px; font-size: 30px; line-height: 1; }
.splash .ss span { display: inline-block; opacity: 0; animation: splsu .6s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(.85s + var(--i) * .12s); }
@keyframes splin { from { opacity: 0; } to { opacity: 1; } }
@keyframes splout { from { opacity: 1; filter: blur(0); } to { opacity: 0; filter: blur(10px); } }
@keyframes splch { from { opacity: 0; transform: translateY(22px) scale(.9); filter: blur(8px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes splsu { from { opacity: 0; transform: translateY(10px) scale(.7); } to { opacity: .85; transform: none; } }
@keyframes splglow { 0% { opacity: 0; } 40% { opacity: 1; } 100% { opacity: .55; } }

/* Winner overlay */
.ov {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: calc(20px + env(safe-area-inset-top, 0px)) 20px calc(20px + env(safe-area-inset-bottom, 0px));
  background: var(--bg); animation: fade .35s ease;
}
@supports (background: color-mix(in srgb, red, blue)) {
  .ov { background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: ovin 1.1s ease-out both; }
  @keyframes ovin { from { background: color-mix(in srgb, var(--bg) 0%, transparent); backdrop-filter: blur(0px); -webkit-backdrop-filter: blur(0px); } to { background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); } }
}
.win-card {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: 24px 20px; display: flex; flex-direction: column; gap: 14px; text-align: center; animation: rise .6s cubic-bezier(.2, .9, .3, 1.25);
}
.suits { display: flex; justify-content: center; gap: 12px; font-size: 40px; line-height: 1; }
.suits span { display: inline-block; animation: bounce 1.1s ease-in-out infinite; animation-delay: calc(var(--d) * .14s); }
.suits .r { color: var(--lose); }
.ov > * { grid-area: 1 / 1; }
.win-card { animation: none; }
.win-card.in { animation: rise 1s cubic-bezier(.22, .7, .2, 1) both; }
.win-card:not(.in) { visibility: hidden; opacity: 0; }
.win-card:not(.in) * { animation-play-state: paused !important; }
.intro { display: flex; align-items: baseline; gap: 4px; font-family: var(--font-display); font-weight: 700; font-size: 32px; color: var(--ink); animation: introin 1s ease-out both; transition: opacity .4s ease, filter .4s ease; }
.intro.out { opacity: 0; filter: blur(8px); }
.dots i { font-style: normal; animation: dotp 1.2s ease-in-out infinite; opacity: .15; }
.dots i:nth-child(2) { animation-delay: .25s; }
.dots i:nth-child(3) { animation-delay: .5s; }
@keyframes dotp { 0%, 100% { opacity: .15; } 40% { opacity: 1; } }
@keyframes introin { from { opacity: 0; filter: blur(8px); } to { opacity: 1; filter: blur(0); } }
.win-card h2 { font-size: 31px; line-height: 1.1; font-weight: 700; }
.win-msg { color: var(--muted); }
.win-msg b { color: var(--ink); font-variant-numeric: tabular-nums; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 8px; direction: ltr; padding-top: 6px; }
.pod { flex: 1; min-width: 0; max-width: 130px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pn2 { display: flex; flex-direction: column; align-items: center; font-weight: 700; -webkit-text-stroke: .02em currentColor; font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; text-align: center; animation: fxin .6s ease-out both; animation-delay: calc(var(--d) * .3s + .5s); }
.psc { font-family: var(--font-display); font-size: 21px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--muted); animation: fxin .6s ease-out both; animation-delay: calc(var(--d) * .3s + .5s); }
.pl1 .psc { color: var(--ink); }
.block { width: 100%; height: var(--h); border-radius: 10px 10px 0 0; background: var(--felt); display: grid; place-items: center; transform-origin: bottom; animation: grow .9s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--d) * .3s); }
.pl2 .block { opacity: .72; }
.pl3 .block { opacity: .5; }
.block b { font-family: var(--font-display); font-weight: 400; font-size: 32px; line-height: 1; color: var(--felt-ink); }
@keyframes grow { from { transform: scaleY(0); } to { transform: scaleY(1); } }
.final { list-style: none; display: flex; flex-direction: column; text-align: start; border-top: 1px solid var(--line); }
.final li { display: flex; justify-content: space-between; gap: 12px; padding-block: 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.final li.first { font-weight: 700; }
#confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 60; transform: translateZ(0); animation: confin .5s ease-out both; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.97); filter: blur(6px); } to { opacity: 1; transform: none; filter: blur(0); } }
@keyframes confin { from { opacity: 0; } to { opacity: 1; } }
@keyframes bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .gain { opacity: 1; }
}

/* Interactive how-to-play walkthrough */
.tut { display: flex; flex-direction: column; gap: 12px; }
.thead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.tclose { position: relative; width: 36px; height: 36px; padding: 0; flex: none; }
.tclose svg { position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px; display: block; }
.tstep { font-family: var(--font-display); font-weight: 700; font-size: 16px; }
.tnum { color: var(--muted); font-weight: 400; font-size: 13px; margin-inline-end: 4px; font-variant-numeric: tabular-nums; }
.ttext { color: var(--ink); line-height: 1.55; min-height: 4.2em; }
.ttext b { font-weight: 700; }
.tsuit { display: inline-block; width: .95em; height: .95em; vertical-align: -.12em; }
.tsuit svg { display: block; width: 100%; height: 100%; }
.tsuit.red { color: #d8503f; }
.pc { position: relative; flex: none; width: 38px; height: 55px; background: #fff; color: #1b1f23; border-radius: 5px; border: 1px solid rgba(0,0,0,.2); box-shadow: 0 1px 3px rgba(0,0,0,.3); font-weight: 700; user-select: none; transition: transform .18s ease, opacity .2s ease; }
.pc.red { color: #c8352b; }
.pc-c { position: absolute; display: flex; flex-direction: column; align-items: center; line-height: 1; font-size: 11px; font-family: var(--font-body); direction: ltr; }
.pc-c svg { width: 9px; height: 9px; margin-top: 1px; }
.pc-c.tl { top: 3px; left: 4px; }
.pc-c.br { bottom: 3px; right: 4px; transform: rotate(180deg); }
.pc-big { position: absolute; inset: 0; display: grid; place-items: center; }
.pc-big svg { width: 19px; height: 19px; }
.pc.slot { background: transparent; border: 1.5px dashed var(--muted-line); box-shadow: none; }
.pc.ok { cursor: pointer; transform: translateY(-3px); box-shadow: 0 6px 12px rgba(0,0,0,.28); }
.pc.ok:hover { transform: translateY(-5px); }
.pc.no { opacity: .4; }
.pc.win { outline: 3px solid #e0a526; box-shadow: 0 0 14px rgba(224,165,38,.65); }
.pc.drop { animation: tdrop .4s ease-out both; }
.pc.shake { animation: tshake .35s ease; }
@keyframes tdrop { from { opacity: 0; transform: translateY(-16px) scale(.9); } to { opacity: 1; transform: none; } }
@keyframes tshake { 25% { transform: translateX(-4px); } 50% { transform: translateX(4px); } 75% { transform: translateX(-3px); } }
.tt { display: flex; align-items: flex-start; justify-content: center; gap: 8px; padding: 12px 10px; border-radius: 12px; background: var(--felt); }
.ts { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.ts { position: relative; }
.ts.winner small { color: #ffd66b; font-weight: 700; opacity: 1; }
.ts small { font-size: 10px; color: var(--felt-ink); opacity: .85; white-space: nowrap; }
.tsep { align-self: stretch; width: 1px; background: rgba(255,255,255,.25); margin-inline: 2px; }
.tdom { align-self: center; font-size: 13px; color: var(--muted); }
.th { position: relative; display: flex; flex-direction: column; gap: 6px; }
.thl { position: absolute; left: -1px; right: -1px; top: 0; border-radius: 11px; border: 1.5px solid rgba(128,140,132,.75); background: rgba(128,140,132,.14); pointer-events: none; z-index: 0; transition: transform .95s cubic-bezier(.45,.05,.25,1), height .95s cubic-bezier(.45,.05,.25,1), opacity .5s ease, border-color .5s ease, background-color .5s ease; }
@supports (color: color-mix(in srgb, red, blue)) { .thl { border-color: color-mix(in srgb, var(--ink) 55%, transparent); background: color-mix(in srgb, var(--ink) 9%, transparent); } }
.thl.gold { border-color: #e0a526; background: rgba(224,165,38,.1); }
.trow { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--line); transition: background .2s ease, border-color .2s ease; }
.trow .who { display: flex; flex-direction: column; min-width: 0; }
.trow .nm { font-weight: 700; }
.trow .fact { font-size: 12px; color: var(--muted); white-space: nowrap; }
.trow .fact b { color: var(--ink); }
.hand { display: flex; gap: 6px; padding-top: 4px; min-height: 60px; align-items: center; }
.tscore { width: 100%; table-layout: fixed; border-collapse: collapse; font-variant-numeric: tabular-nums; text-align: center; }
.tscore th, .tscore td { padding: 8px 2px; border-bottom: 1px solid var(--line); }
.tscore thead th { color: var(--muted); font-size: 12px; font-weight: 600; }
.tscore tbody th { text-align: start; font-weight: 700; }
.tscore .calc { color: var(--muted); font-size: 12px; white-space: nowrap; }
.tscore th:first-child { width: 21%; }
.tscore th:nth-child(2), .tscore th:nth-child(3) { width: 15%; }
.tscore th:nth-child(4) { width: 29%; }
.tscore .pt b { font-family: var(--font-display); font-size: 20px; }
.tscore tr.ok .pt { color: var(--win); }
.tscore tr.lead th { color: #e0a526; }
.tscore tr.lead th::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 6px; border-radius: 50%; background: #e0a526; }
.tapp { margin: 0; padding-inline-start: 18px; display: flex; flex-direction: column; gap: 10px; line-height: 1.55; }
.tnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.tdots { display: flex; gap: 6px; }
.tdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .2s ease, transform .2s ease; }
.tdots i.on { background: #3fae85; transform: scale(1.3); }
@media (prefers-reduced-motion: reduce) { .pc.drop, .pc.shake { animation: none; } }

/* Winner marks */
.crown { color: #e0a526; animation: tcrown .55s cubic-bezier(.2,.9,.3,1.4) both; }
.crown svg { display: block; width: 100%; height: 100%; }
.crown.inl { position: static; display: inline-block; width: 15px; height: 15px; margin: 0 5px 0 0; vertical-align: -2px; color: #e0a526; filter: none; }
@keyframes tcrown { from { opacity: 0; transform: translateY(8px) scale(.3) rotate(-20deg); } to { opacity: 1; transform: none; } }
.pc.win::after { content: ""; position: absolute; inset: -3px; border-radius: 9px; border: 2px solid #ffd66b; opacity: 0; animation: twin 1s ease-out .15s 2; pointer-events: none; }
@keyframes twin { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.55); } }
@media (prefers-reduced-motion: reduce) { .crown, .pc.win::after { animation: none; opacity: 1; } .pc.win::after { opacity: 0; } }

/* Bid chip: big, right next to the name */
.nmline { display: flex; align-items: center; gap: 10px; }
.bid { box-sizing: border-box; min-width: 68px; min-height: 33px; justify-content: center; display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border-radius: 10px; border: 1.5px solid var(--muted-line); line-height: 1; }
.bid small { font-size: 11px; color: var(--muted); }
.bid b { font-family: var(--font-display); font-size: 21px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bid.pop { animation: tbid .55s cubic-bezier(.2,.9,.3,1.5) both; }
@keyframes tbid { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .bid.pop { animation: none; } .thl { transition: none; } }

/* Reminder when "next" is pressed on an opening nobody played */
.tut { position: relative; }
.tnag { position: absolute; left: 0; right: 0; bottom: 56px; z-index: 6; padding: 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--muted-line); box-shadow: 0 12px 34px rgba(0,0,0,.4); line-height: 1.5; animation: tnagin .35s cubic-bezier(.2,.9,.3,1.2) both; }
.tnag b { font-weight: 700; }
.tnagb { display: flex; gap: 8px; margin-top: 10px; }
@keyframes tnagin { from { opacity: 0; transform: translateY(10px) scale(.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tnag { animation: none; } }

/* Short message at the bottom (copied to clipboard) */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 90; max-width: calc(100vw - 44px); padding: 12px 18px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 600; text-align: center; box-shadow: 0 8px 24px rgba(0,0,0,.35); opacity: 0; transform: translate(-50%, 12px); pointer-events: none; transition: opacity .3s ease, transform .3s cubic-bezier(.2,.9,.3,1.2); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* Winner screen: "back to the table" is the quietest option */
.actions .tbl { align-self: center; border-color: transparent; color: var(--muted); font-weight: 600; }

/* Opening screen: the "who plays" block sits in the middle of the screen, a touch above true centre. */
.wrap.is-setup { min-height: calc(100dvh - 66px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)); }
.setup-main { margin-block: auto; padding-bottom: 7vh; display: flex; flex-direction: column; gap: 14px; }

/* Example 1: the whole round, one strip per opening */
.tround { display: flex; flex-direction: column; gap: 12px; }
.topen { display: flex; flex-direction: column; gap: 6px; }
.topen-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; }
.topen-h span { color: var(--muted); }
.topen .tt { padding: 10px 6px; }
.tnote { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.45; }
.tnote b { color: var(--ink); }

/* Walkthrough layout pieces that stay put while the steps change */
.tbody { display: flex; flex-direction: column; gap: 12px; }
.tnagslot { display: contents; }
.tnext { display: inline-flex; }

/* Bottom row: how to play + language */
.foot { display: flex; justify-content: center; align-items: center; gap: 10px; flex-wrap: wrap; }
.langbtn { min-width: 0; }

/* ===== Home screen ===== */
.homebtn { background: none; border: 0; padding: 0; color: inherit; font: inherit; cursor: pointer; text-align: start; }
.home { gap: 12px; }
.hcard { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-align: start; cursor: pointer; transition: transform .25s cubic-bezier(.2,.8,.2,1), border-color .25s ease, background-color .25s ease; }
.hcard:active { transform: scale(.985); }
@media (hover: hover) { .hcard:hover { border-color: var(--muted-line); } }
.hico { flex: none; width: 64px; height: 64px; border-radius: 14px; background: var(--felt); color: var(--felt-ink); display: grid; place-items: center; }
.hico svg { width: 34px; height: 34px; }
.htxt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.htxt b { font-family: var(--font-display); font-size: 19px; font-weight: 700; }
.htxt small { color: var(--muted); font-size: 14px; line-height: 1.35; }
.hsoon { color: var(--muted); font-size: 14px; text-align: center; margin: 2px 0 4px; line-height: 1.4; }
.hcards { position: relative; display: block; width: 46px; height: 46px; }
.pc.mini { position: absolute; width: 27px; height: 39px; border-radius: 4px; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.hcards .pc:nth-child(1) { left: 2px; top: 5px; transform: rotate(-12deg); }
.hcards .pc:nth-child(2) { right: 2px; top: 2px; transform: rotate(10deg); }
.pc.mini .pc-c { font-size: 8px; }
.pc.mini .pc-c svg { width: 6px; height: 6px; }
.pc.mini .pc-c.tl { top: 2px; left: 3px; }
.pc.mini .pc-c.br { bottom: 2px; right: 3px; }
.pc.mini .pc-big svg { width: 13px; height: 13px; }

/* ===== Game against the computer: a card table ===== */
.wrap.is-play { gap: 10px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field label { color: var(--muted); font-size: 14px; }
.seg.three { grid-template-columns: repeat(3, 1fr); }
.pinfo { display: flex; align-items: baseline; justify-content: center; gap: 8px; min-height: 22px; }
.pinfo b { font-size: 15px; }
.pcards { color: var(--muted); font-size: 14px; }
.pcards::before { content: "·"; margin-inline-end: 6px; }

/* the table */
.pfelt { position: relative; isolation: isolate; height: clamp(320px, calc(100dvh - 372px), 470px); color: #fff; }
/* a wooden table: boards of walnut with the grain running along it, and a darker rim round the top */
.pfelt { --wood-top: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 500' preserveAspectRatio='none'><filter id='w' color-interpolation-filters='sRGB' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.0025 0.2' numOctaves='5' seed='7'/><feColorMatrix values='0.26 0 0 0 0.30  0.16 0 0 0 0.16  0.08 0 0 0 0.075  0 0 0 0 1'/></filter><rect width='800' height='500' filter='url(%23w)'/></svg>"); --wood-rim: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 800 500' preserveAspectRatio='none'><filter id='w' color-interpolation-filters='sRGB' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.16 0.003' numOctaves='5' seed='21'/><feColorMatrix values='0.26 0 0 0 0.30  0.16 0 0 0 0.16  0.08 0 0 0 0.075  0 0 0 0 1'/></filter><rect width='800' height='500' filter='url(%23w)'/></svg>"); }
.pfelt::before, .pfelt::after { content: ""; position: absolute; pointer-events: none; z-index: 0; }
.pfelt::before { inset: 0; border-radius: 30px; background:
  linear-gradient(150deg, rgba(255,225,180,.16), rgba(0,0,0,.38) 70%),
  var(--wood-rim) center / 100% 100%;
  box-shadow: 0 8px 24px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,230,190,.22); }
.pfelt::after { inset: 6px; border-radius: 25px; background:
  radial-gradient(110% 85% at 50% 40%, rgba(255,220,170,.14) 0%, transparent 55%, rgba(0,0,0,.34) 100%),
  var(--wood-top) center / 100% 100%;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.45), inset 0 3px 8px rgba(0,0,0,.35), 0 1px 0 rgba(255,225,180,.18); }
/* five players: a table with five sides, one for each of them, with softly rounded corners */
.pfelt.n5 { filter: drop-shadow(0 8px 12px rgba(0,0,0,.32)); }
.pfelt.n5::before, .pfelt.n5::after { inset: 0; border-radius: 0; box-shadow: none; }
.pfelt.n5::before { -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M56 4.32 L94 31.68 Q100 36 98.08 43.68 L85.28 94.88 Q84 100 78.56 100 L21.44 100 Q16 100 14.72 94.88 L1.92 43.68 Q0 36 6 31.68 L44 4.32 Q50 0 56 4.32 Z'/></svg>") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path d='M56 4.32 L94 31.68 Q100 36 98.08 43.68 L85.28 94.88 Q84 100 78.56 100 L21.44 100 Q16 100 14.72 94.88 L1.92 43.68 Q0 36 6 31.68 L44 4.32 Q50 0 56 4.32 Z'/></svg>") center / 100% 100% no-repeat; }
.pfelt.n5::after { -webkit-mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path transform='translate(50 51) scale(.972 .974) translate(-50 -51)' d='M56 4.32 L94 31.68 Q100 36 98.08 43.68 L85.28 94.88 Q84 100 78.56 100 L21.44 100 Q16 100 14.72 94.88 L1.92 43.68 Q0 36 6 31.68 L44 4.32 Q50 0 56 4.32 Z'/></svg>") center / 100% 100% no-repeat; mask: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'><path transform='translate(50 52) scale(.925 .93) translate(-50 -52)' d='M56 4.32 L94 31.68 Q100 36 98.08 43.68 L85.28 94.88 Q84 100 78.56 100 L21.44 100 Q16 100 14.72 94.88 L1.92 43.68 Q0 36 6 31.68 L44 4.32 Q50 0 56 4.32 Z'/></svg>") center / 100% 100% no-repeat; }
.pfelt .pseat { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 5px; z-index: 2; }
.pfelt.n3 .p-TL { left: 24%; top: 19%; } .pfelt.n3 .p-TR { left: 76%; top: 19%; }
.pfelt.n4 .p-L { left: 11%; top: 47%; } .pfelt.n4 .p-T { left: 50%; top: 14%; } .pfelt.n4 .p-R { left: 89%; top: 47%; }
.pfelt.n5 .p-L { left: 16%; top: 60%; } .pfelt.n5 .p-TL { left: 32%; top: 22%; } .pfelt.n5 .p-TR { left: 68%; top: 22%; } .pfelt.n5 .p-R { left: 84%; top: 60%; }
.pfelt.n5 .bidbox { bottom: 7%; }
/* where each player's played card lands */
.pslot { position: absolute; transform: translate(-50%, -50%); z-index: 3; }
.pfelt .p-me { left: 50%; top: 77%; }
.pfelt.n3 .pslot.p-TL { left: 36%; top: 41%; } .pfelt.n3 .pslot.p-TR { left: 64%; top: 41%; }
.pfelt.n4 .pslot.p-L { left: 29%; top: 53%; } .pfelt.n4 .pslot.p-T { left: 50%; top: 31%; } .pfelt.n4 .pslot.p-R { left: 71%; top: 53%; }
.pfelt.n5 .pslot.p-L { left: 27%; top: 58%; } .pfelt.n5 .pslot.p-TL { left: 41%; top: 35%; } .pfelt.n5 .pslot.p-TR { left: 59%; top: 35%; } .pfelt.n5 .pslot.p-R { left: 73%; top: 58%; }
/* the deck with the main dominant on top, in the middle */
.stock { position: absolute; left: 50%; top: 55%; width: 42px; height: 61px; transform: translate(-50%, -50%); z-index: 1; }
.stock .pc { position: absolute; left: 0; top: 0; }
.stock .pc.back:nth-child(2) { transform: translate(2px, 2px); } .stock .pc.back:nth-child(3) { transform: translate(4px, 4px); }
.stock .trump { left: -5px; top: -9px; transform: rotate(-12deg); z-index: 1; }
.pc.tbl { width: 42px; height: 61px; border-radius: 6px; }
.pc.tbl .pc-c { font-size: 12px; } .pc.tbl .pc-c svg { width: 9px; height: 9px; } .pc.tbl .pc-big svg { width: 22px; height: 22px; }
.stock .pc { width: 42px; height: 61px; border-radius: 6px; }
.stock .pc .pc-c { font-size: 12px; } .stock .pc .pc-big svg { width: 22px; height: 22px; }

/* the other players' hands, face down */
.fan { position: relative; height: 32px; }
.fan.v { width: 32px; }
.fan.peek { height: auto; display: flex; gap: 4px; }
.fan.peek .pc { width: 36px; height: 52px; }
.fan.peek .pc-c { font-size: 11px; } .fan.peek .pc-big svg { width: 20px; height: 20px; }
.fcard { position: absolute; top: 0; width: 22px; height: 32px; border-radius: 4px; border: 1px solid rgba(255,255,255,.6); box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.fan.v .fcard { left: 0; width: 32px; height: 22px; }
.fcard, .pc.back, .pc.turned { background: #2f3d73 repeating-linear-gradient(45deg, rgba(255,255,255,.15) 0 2px, transparent 2px 6px); }
.pc.back { border-color: rgba(255,255,255,.6); }
.pc.back > *, .pc.turned > * { visibility: hidden; }

/* minimal scoreboard: name, bid (with tricks taken so far), points */
.slabel { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 6px; max-width: 96px; text-align: center; font-size: 12px; color: rgba(255,255,255,.85); }
.slabel .sn { width: 100%; font-size: 13px; font-weight: 700; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pfelt .slabel { text-shadow: 0 1px 2px rgba(0,0,0,.6); }
.sbid { min-width: 30px; padding: 1px 8px; border-radius: 99px; background: rgba(0,0,0,.32); color: #fff; font-weight: 700; font-variant-numeric: tabular-nums; }
.sbid s { text-decoration: none; opacity: .65; font-weight: 400; }
.sbid.none { opacity: .55; }
.spts { font-size: 11px; opacity: .85; font-variant-numeric: tabular-nums; }
.pseat.act .sn::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-inline-end: 5px; border-radius: 50%; background: #fff; animation: ppulse 1.2s ease-in-out infinite; }
@keyframes ppulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: .35; transform: scale(.7); } }
.pseat.won .sn, .pseat.won .sbid { color: #ffd66b; }
.pstatus { min-height: 2.7em; margin: 0; text-align: center; line-height: 1.35; font-size: 14px; }
.mebar { display: flex; justify-content: center; padding: 6px 12px; border: 1px solid var(--line); border-radius: 12px; transition: border-color .4s ease, background-color .4s ease; }
.mebar .slabel { flex-wrap: nowrap; max-width: none; gap: 10px; color: var(--muted); font-size: 13px; }
.mebar .slabel .sn { width: auto; color: var(--ink); font-size: 15px; }
.mebar .sbid { background: var(--line); color: var(--ink); }
.mebar .pseat.act, .mebar.act { border-color: var(--muted-line); }
.mebar.act .sn::before { background: var(--ink); }
.mebar.won .sn, .mebar.won .sbid { color: #e0a526; }

/* my hand */
.pc.lg { width: 50px; height: 72px; border-radius: 7px; }
.pc.lg .pc-c { font-size: 13px; }
.pc.lg .pc-c svg { width: 10px; height: 10px; }
.pc.lg .pc-c.tl { top: 4px; left: 5px; }
.pc.lg .pc-c.br { bottom: 4px; right: 5px; }
.pc.lg .pc-big svg { width: 26px; height: 26px; }
.myhand { display: flex; justify-content: center; align-items: flex-end; padding: 8px 4px 2px; min-height: 84px; }
.myhand .pc + .pc { margin-inline-start: var(--ov, 6px); }
.myhand .pc.ok { z-index: 1; }

/* my bid, chosen where my card will go */
.bidbox { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); display: grid; grid-template-columns: repeat(var(--cols, 4), 44px); gap: 6px; padding: 8px; border-radius: 16px; background: rgba(0,0,0,.26); box-shadow: inset 0 0 0 1px rgba(255,255,255,.1); z-index: 4; direction: ltr; }
.bidnum { width: 44px; height: 42px; border-radius: 10px; border: 1px solid rgba(255,255,255,.4); background: rgba(0,0,0,.34); color: #fff; font: inherit; font-size: 20px; font-weight: 700; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .2s cubic-bezier(.2,.8,.2,1), background-color .25s ease; }
.bidnum:active { transform: scale(.94); }
@media (hover: hover) { .bidnum:hover { background: rgba(0,0,0,.5); } }

/* dialogs */
.psum th, .psum td { min-width: 0; padding: 8px 4px; }
.psum thead th { font-size: 13px; }
.psum tbody th { text-align: start; font-weight: 700; color: var(--ink); font-size: 15px; }
.psum td.ok b { color: var(--win); }
.psum td.no b { color: var(--muted); }
.dlg.scores { max-width: 480px; max-height: calc(100dvh - 24px); overflow-y: auto; }

/* the table between rounds: the board of the scorekeeper, with the points of the round beside each name */
.sumboard { margin: 6px 0 14px; }
.sumboard .gain { opacity: 1; animation: none; }
.sumboard .sfact { font-size: 12px; font-weight: 400; color: var(--muted); }
.sumboard .srow.me .sname { color: var(--ink); }
