/* Remi Mai Vedem — every screen of the game. Values come from the design canvas
   (design_import/Masa.dc.html renderVals() is the source of truth for the table; the
   canvas sections 1/2/6/7 for lobby, room, score sheet and edge states).

   Sizes are custom properties switched by viewport: desktop ≥1100, tablet 768–1099, phone
   <768 (the table is played landscape on a phone). Themes are `data-theme` on .scene. */

/* ---------------------------------------------------------------- shared bits */
.wordmark {
  font-family: var(--font-logo); font-weight: 800; letter-spacing: -0.02em; line-height: 1;
  font-size: 44px; color: var(--ink); margin: 0;
}
.wordmark span { color: var(--teal); }
.wordmark--sm { font-size: 17px; }
.muted-2 { color: var(--muted-2); }
.neg { color: var(--error); }
.link-btn { color: var(--teal); font-weight: 600; font-size: inherit; }
.link-btn:hover { color: var(--teal-hover); }
.sticker { display: inline-flex; width: 56px; height: 56px; flex: none; }
.sticker svg { width: 100%; height: 100%; display: block; }
.sticker--xl { width: 96px; height: 96px; }
.avatar svg { width: 100%; height: 100%; display: block; }
b.num { font-weight: 600; color: var(--ink); }
.center-page { min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.center-card { max-width: 440px; padding: 32px 28px; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.center-card h1 { font-size: 26px; }

/* Rules sheet */
.rules-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rules-head h2 { font-size: 26px; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; font-size: 14.5px; line-height: 1.55; color: var(--body-c); }
.rules li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid var(--divider); }
.rules li:last-child { border-bottom: 0; }
.rules li > .num:first-child { color: var(--teal); font-weight: 600; flex: none; width: 22px; }
.rules-foot { display: flex; justify-content: flex-end; }
@media (max-width: 767px) {
  .rules-head h2 { font-size: 22px; }
  .rules { font-size: 13.5px; }
  .rules li { gap: 12px; padding: 9px 0; }
  .rules-foot .btn { width: 100%; height: 44px; }
}

/* ---------------------------------------------------------------- 1 · Lobby */
.lobby { max-width: 1100px; min-height: calc(100dvh - 64px); margin: 0 auto; padding: 40px 20px; display: flex; flex-direction: column; justify-content: center; gap: 36px; box-sizing: border-box; }
.lobby-head { display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.lobby-hello { font-family: var(--font-serif); font-weight: 600; font-size: clamp(30px, 4.4vw, 46px); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
.lobby-sub { margin: -8px 0 0; font-size: 16px; }
.who { display: flex; align-items: center; gap: 10px; margin: 0; }
.who-chip { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 6px 0 5px; background: var(--card); border: 1.5px solid var(--border-2); border-radius: var(--r-pill); transition: border-color .15s ease, box-shadow .15s ease; }
.who-chip:hover, .who.is-editing .who-chip { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,124,123,.12); }
.who .avatar { width: 34px; height: 34px; border: 0; }
.who-name { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 2px; font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1; cursor: text; }
.who-name[hidden] { display: none; }
.who-pen { color: var(--teal); flex: none; }
.who-name:hover .who-pen { color: var(--teal-hover); }
.who-input { width: 180px; height: 34px; border: 0; background: transparent; padding: 0 4px; font-size: 15px; font-weight: 600; box-shadow: none; outline: none; }
.who-input[hidden] { display: none; }
.who-save { height: 34px; padding: 0 14px; font-size: 13px; }
.who-save[hidden] { display: none; }
.lobby-msgs { display: flex; flex-direction: column; gap: 8px; }
.lobby-msg { background: var(--error-tint); border: 1px solid #EFB49F; color: var(--error); border-radius: var(--r-sm); padding: 10px 14px; font-size: 13.5px; font-weight: 600; }
.lobby-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.lobby-card { padding: 22px; display: flex; flex-direction: column; gap: 14px; min-height: 250px; margin: 0; }
.lobby-card-body { flex: 1; }
.lobby-card h2 { font-size: 21px; }
.lobby-card p { margin: 4px 0 0; font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.lobby-cta { height: 44px; }
.lobby-code { display: flex; gap: 8px; }
.lobby-code-input { height: 44px; flex: 1; letter-spacing: .12em; font-weight: 600; font-size: 16px; text-transform: uppercase; min-width: 0; }
.lobby-code .btn { height: 44px; padding: 0 16px; }
.lobby-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); padding-top: 22px; }
.lobby-msgs { align-items: center; }
.lobby-recent { display: flex; align-items: center; gap: 12px; font-size: 13.5px; }
.lobby-recent strong { color: var(--ink); font-weight: 600; }
.lobby-links { display: flex; gap: 18px; }
.lobby-rules-link { font-size: 14px; font-weight: 600; color: var(--teal); }
@media (max-width: 1023px) { .lobby-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .lobby { padding: 24px 20px 28px; gap: 18px; }
  .wordmark { font-size: 30px; }
  .lobby-head { gap: 12px; }
  .who-input { width: 140px; }
  .lobby-grid { grid-template-columns: 1fr; gap: 14px; }
  .lobby-card { flex-direction: row; align-items: center; min-height: 0; padding: 16px; flex-wrap: wrap; }
  .lobby-card .sticker { width: 48px; height: 48px; }
  .lobby-card-body { flex: 1; min-width: 0; }
  .lobby-card h2 { font-size: 18px; }
  .lobby-card p { font-size: 12.5px; margin-top: 2px; }
  .lobby-cta { height: 38px; padding: 0 15px; font-size: 13px; }
  .lobby-code { flex-basis: 100%; }
  .lobby-code-input { height: 42px; }
  .lobby-foot { border-top: 0; padding: 6px 2px 0; }
  .lobby-recent { font-size: 12.5px; }
  .lobby-recent .avatar { width: 30px; height: 30px; }
}

/* ---------------------------------------------------------------- 2 · Masa privată */
.room { max-width: 1200px; margin: 0 auto; padding: 44px 20px 40px; display: flex; flex-direction: column; gap: 28px; min-height: 100dvh; }
.room[hidden] { display: none; }
.room-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.room-title { font-size: 34px; line-height: 1.1; }
.room-meta { margin-top: 6px; font-size: 14px; }
.room-meta b { font-weight: 600; color: var(--ink); }
.room-link { display: flex; align-items: center; gap: 10px; }
.room-url { display: flex; align-items: center; width: 300px; font-size: 14px; color: var(--body-c); letter-spacing: .02em; overflow: hidden; white-space: nowrap; }
.room-link .btn.is-copied { border-color: var(--teal-border); background: var(--teal-tint); color: var(--teal-ink); }
.room-leave { font-size: 13.5px; margin-left: 10px; }
.room-grid { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; }
.room-main { display: flex; flex-direction: column; gap: 20px; }
.seats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.seat-card { padding: 10px; display: flex; flex-direction: column; gap: 10px; }
.seat-pv { position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden; background: #EDE7DA; border: 2px solid transparent; }
.seat-pv.is-ready { border-color: var(--teal); }
.seat-pv video, .seat-pv .seat-cam, .seat-pv .seat-av { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.seat-pv .seat-av svg { width: 100%; height: 100%; display: block; }
.seat-pv video[hidden] { display: none; }
.seat-pv-label { position: absolute; left: 8px; bottom: 6px; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.seat-check { position: absolute; right: 6px; bottom: 6px; width: 22px; height: 22px; border-radius: var(--r-pill); background: var(--teal); display: flex; align-items: center; justify-content: center; }
.seat-mic { position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
.seat-card-foot { padding: 0 4px 4px; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.seat-card-name { font-size: 14px; font-weight: 600; }
.seat-card-state { font-size: 12px; color: var(--muted-2); }
.seat-card-state.is-ready { color: var(--teal-ink); font-weight: 600; }
.seat-empty { border: 2px dashed var(--border-2); border-radius: var(--r-md); padding: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; min-height: 170px; font-size: 13px; color: var(--muted-2); }
.seat-empty .chip { padding: 6px 14px; cursor: pointer; }
.seat-empty .chip:hover { border-color: var(--teal-border); color: var(--teal-ink); }
.seat-empty small { font-size: 12px; color: var(--muted-3); }
.seat-bot-x { font-size: 11.5px; color: var(--muted-2); }
.seat-bot-x:hover { color: var(--error); }
.cam-test { padding: 16px 20px; display: flex; align-items: center; gap: 18px; }
.cam-test-preview { width: 120px; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #EDE7DA; position: relative; flex: none; }
.cam-test-preview video, .cam-test-preview .seat-cam { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-test-preview video[hidden] { display: none; }
.cam-test-body { flex: 1; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cam-test-title { font-size: 14px; font-weight: 600; }
.cam-test-row { display: flex; align-items: center; gap: 22px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.cam-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.vu { display: inline-flex; gap: 3px; align-items: flex-end; height: 14px; }
.vu i { width: 4px; height: 4px; background: var(--teal-border); border-radius: 1px; transition: height .08s linear, background .08s linear; }
.vu i.on { background: var(--teal); }
.cam-note { font-size: 12.5px; }
.room-settings { padding: 22px; display: flex; flex-direction: column; gap: 16px; }
.room-settings-title { font-size: 19px; }
.rs-group { display: flex; flex-direction: column; gap: 8px; }
.rs-row { display: flex; gap: 8px; }
.rs-row .cc { flex: 1; }
.cc--text { font-family: var(--font-body); }
.rs-switches { display: flex; flex-direction: column; border-top: 1px solid var(--divider); padding-top: 6px; }
.rs-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; cursor: pointer; }
.rs-switch + .rs-switch { border-top: 1px solid var(--divider); }
.rs-switch-title { font-size: 13.5px; font-weight: 600; }
.rs-switch-sub { font-size: 12px; }
.room-settings.is-guest .cc, .room-settings.is-guest .switch { pointer-events: none; }
.room-cta { display: flex; flex-direction: column; gap: 8px; align-items: center; padding-top: 6px; }
.room-cta .btn { width: 100%; }
.room-cta-note { font-size: 12.5px; text-align: center; }
.room-cta-note b { font-weight: 600; color: var(--ink); }
@media (max-width: 1023px) {
  .room-grid { grid-template-columns: 1fr; }
  .seats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1023px) and (min-width: 700px) { .seats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767px) {
  .room { padding: 14px 18px 18px; gap: 10px; }
  .room-title { font-size: 24px; }
  .room-meta { font-size: 12.5px; margin-top: 4px; }
  .room-link { width: 100%; gap: 8px; }
  .room-url { width: auto; flex: 1; font-size: 13px; height: 40px; }
  .room-link .btn { height: 40px; font-size: 13px; padding: 0 15px; }
  .room-leave { display: none; }
  .seats { gap: 10px; }
  .seat-card { padding: 6px; gap: 6px; }
  .seat-pv { aspect-ratio: 16 / 9; border-radius: 10px; }
  .seat-pv-label { display: none; }
  .seat-card-foot { flex-direction: column; align-items: flex-start; gap: 0; padding: 0 4px 2px; }
  .seat-card-name { font-size: 13.5px; }
  .seat-card-state { font-size: 11.5px; }
  .seat-empty { min-height: 0; padding: 8px; font-size: 12.5px; }
  .cam-test { padding: 10px 14px; gap: 12px; }
  .cam-test-preview { width: 72px; }
  .cam-test-title { display: none; }
  .cam-test-row { gap: 12px; font-size: 12.5px; }
  .room-settings { padding: 10px 14px; gap: 8px; }
  .room-settings-title { display: none; }
  .rs-group { flex-direction: row; align-items: center; justify-content: space-between; }
  .rs-row { gap: 6px; }
  .rs-row .cc { flex: none; height: 32px; min-width: 38px; padding: 0 8px; }
  .rs-switch { padding: 6px 0; }
  .rs-switch-sub { display: none; }
  .room-cta { position: sticky; bottom: 0; background: var(--canvas); padding: 8px 0 calc(8px + env(safe-area-inset-bottom)); margin-top: 4px; }
  .room-cta .btn { height: 46px; }
}

/* ---------------------------------------------------------------- the scene (3, 4, 7) */
.scene {
  /* desktop values; tablet and phone override below */
  --pw0: clamp(34px, calc((100vw - 368px - var(--feedW)) / 15.7), 52px); --ph0: calc(var(--pw0) * 1.385); --pf0: calc(var(--pw0) * .77); --ts: .8; --seat: 160px; --gap: 4px;
  --padY: 10px; --padX: 24px; --headH: 46px; --rowgap: 20px; --you: 72px;
  --tableMargin: 56px 70px 64px; --tableRadius: 84px; --tableLip: 8px; --inset: 18px; --tablePad: 0 24px calc(var(--boardH) + 2 * var(--inset) + var(--ctaH) + 10px);
  --seatTopMt: -62px; --sideW: 200px; --sideMl: -90px;
  --sirMaxW: 620px; --doodle: 14px; --rs: 1; 
  --stickerPx: 84px; --seatGap: 28px; --smallGap: 10px; --midGap: 28px; --boardPad: 12px;
  --metaFs: 12.5px; --pillFs: 11.5px; --seatNameFs: 14px; --wordmarkFs: 17px; --bannerFs: 14px;
  --chipH: 36px; --chipFs: 13px; --ctaH: 44px; --ctaFs: 14px; --ringPx: 80px; --ringFs: 22px;
  --bannerPad: 10px 14px;
  --youH: var(--boardH); --feedW: clamp(180px, 17vw, 270px);
  --pw: var(--pw0); --ph: var(--ph0); --pf: var(--pf0);
  --boardH: calc(2 * var(--ph0) + var(--gap) + 2 * var(--boardPad) + 2px);
  --tw: calc(var(--pw0) * var(--ts)); --th: calc(var(--ph0) * var(--ts)); --tf: calc(var(--pf0) * var(--ts));

  position: relative; width: 100%; height: 100dvh; overflow: hidden;
  display: flex; flex-direction: column; box-sizing: border-box;
  padding: var(--padY) var(--padX); gap: var(--rowgap);
  background: var(--floor); color: var(--ink); font-family: var(--font-body);
}
.scene[hidden] { display: none; }
@media (max-width: 1099px), (max-height: 780px) {
  .scene {
    --pw0: clamp(30px, calc((100vw - 304px - var(--feedW)) / 15.7), 48px); --seat: 110px; --padY: 8px; --padX: 18px; --headH: 42px; --rowgap: 16px; --you: 64px;
    --tableMargin: 44px 48px 44px; --tableRadius: 66px; --tableLip: 7px; --inset: 14px; --tablePad: 0 16px calc(var(--boardH) + 2 * var(--inset) + var(--ctaH) + 10px);
    --seatTopMt: -44px; --sideW: 150px; --sideMl: -64px;
    --sirMaxW: 470px; --doodle: 12px; --rs: .75; --stickerPx: 64px;
    --feedW: clamp(150px, 17vw, 180px);
  }
}
@media (max-width: 767px), (max-height: 560px) {
  .scene {
    --pw0: 44px; --ph0: 60px; --pf0: 33px; --ts: .75; --seat: 92px; --gap: 3px; --padY: 8px; --padX: 12px; --headH: 34px; --rowgap: 6px; --you: 48px;
    --tableMargin: 22px 10px 10px; --tableRadius: 32px; --tableLip: 5px; --inset: 8px; --tablePad: 0 12px calc(var(--boardH) + 2 * var(--inset) + var(--ctaH) + 8px);
    --seatTopMt: -30px; --sideW: 0px; --sideMl: 0px;
    --sirMaxW: 420px; --doodle: 10px; --rs: .45; --stickerPx: 0px;
    --seatGap: 14px; --smallGap: 6px; --midGap: 14px; --boardPad: 8px;
    --metaFs: 11px; --pillFs: 10.5px; --seatNameFs: 12px; --wordmarkFs: 13px; --bannerFs: 12px;
    --chipH: 32px; --chipFs: 12px; --ctaH: 40px; --ctaFs: 13px; --ringPx: 56px; --ringFs: 15px; --bannerPad: 6px 10px;
    --youH: 48px; --feedW: 0px;
  }
}

/* Themes: floor, rug, table, the colours of text on the table, the board. */
.scene[data-theme="covor"], .scene {
  --floor: #EFEADF; --rugBg: #C05336; --ringOut: calc(42px * var(--rs));
  --rugPattern: repeating-linear-gradient(45deg, transparent 0 16px, rgba(251,227,192,.10) 16px 18px), repeating-linear-gradient(-45deg, transparent 0 16px, rgba(251,227,192,.10) 16px 18px);
  --rugRings: 0 0 0 calc(8px * var(--rs)) #FBE3C0, 0 0 0 calc(14px * var(--rs)) #1E497B, 0 0 0 calc(20px * var(--rs)) #FBE3C0, 0 0 0 calc(30px * var(--rs)) #C99A22, 0 0 0 calc(36px * var(--rs)) #FBE3C0, 0 0 0 calc(42px * var(--rs)) #0F2230;
  --tableBg: #0B5F5E; --rim: #0A6362; --lipColor: #073D3C; --inlay: rgba(253,244,227,.35);
  --onMuted: #BFE4E2; --onInk: #FDF4E3; --onLive: #8FD4D2; --dropB: #8FD4D2; --dropC: #E3F2F0;
  --roomInk: #0F2230; --roomMuted: #5B6B78; --roomTeal: #0E7C7B; --sirOpen: #BFE4E2; --sirLive: #8FD4D2;
  --boardBg: #0F2230; --groove: rgba(253,244,227,.08); --boardEdge: #0F2230; --labelColor: #FDF4E3;
  --boardInk: #FDF4E3; --boardMuted: rgba(253,244,227,.62); --boardLine: rgba(253,244,227,.12);
}
.scene[data-theme="postav"] {
  --floor: #1B3A52; --rugBg: #0F2230; --ringOut: calc(26px * var(--rs));
  --rugPattern: repeating-linear-gradient(0deg, transparent 0 22px, rgba(253,244,227,.06) 22px 24px), repeating-linear-gradient(90deg, transparent 0 22px, rgba(253,244,227,.06) 22px 24px);
  --rugRings: 0 0 0 calc(6px * var(--rs)) #1B3A52, 0 0 0 calc(10px * var(--rs)) #F4A340, 0 0 0 calc(14px * var(--rs)) #1B3A52, 0 0 0 calc(24px * var(--rs)) #0F2230, 0 0 0 calc(26px * var(--rs)) rgba(253,244,227,.35);
  --tableBg: #4C7A46; --rim: #3E6638; --lipColor: #2E4F2A; --inlay: rgba(253,244,227,.45);
  --onMuted: #F1F7EF; --onInk: #FFFFFF; --onLive: #FFFFFF; --dropB: #A3C48B; --dropC: #F1F7EF;
  --roomInk: #FDF4E3; --roomMuted: #A9BCC9; --roomTeal: #8FD4D2; --sirOpen: #F1F7EF; --sirLive: #FDF4E3;
  --boardBg: #EFEADF; --groove: #E7E0D2; --boardEdge: #E7E0D2; --labelColor: #5B6B78;
  --boardInk: #0F2230; --boardMuted: #5B6B78; --boardLine: #E1D9C8;
}
.scene[data-theme="kilim"] {
  --floor: #FBE3C0; --rugBg: #C99A22; --ringOut: calc(40px * var(--rs));
  --rugPattern: repeating-linear-gradient(45deg, transparent 0 14px, rgba(15,34,48,.08) 14px 17px), repeating-linear-gradient(-45deg, transparent 0 14px, rgba(15,34,48,.08) 14px 17px);
  --rugRings: 0 0 0 calc(8px * var(--rs)) #FBE3C0, 0 0 0 calc(16px * var(--rs)) #E76F51, 0 0 0 calc(22px * var(--rs)) #FBE3C0, 0 0 0 calc(30px * var(--rs)) #0F2230, 0 0 0 calc(36px * var(--rs)) #FBE3C0, 0 0 0 calc(40px * var(--rs)) #E76F51;
  --tableBg: #0F2230; --rim: #1B3A52; --lipColor: #07131C; --inlay: rgba(253,244,227,.3);
  --onMuted: #A9BCC9; --onInk: #FDF4E3; --onLive: #8FD4D2; --dropB: #A9BCC9; --dropC: #FDF4E3;
  --roomInk: #0F2230; --roomMuted: #5B6B78; --roomTeal: #0E7C7B; --sirOpen: #A9BCC9; --sirLive: #8FD4D2;
  --boardBg: #EFEADF; --groove: #E7E0D2; --boardEdge: #E7E0D2; --labelColor: #5B6B78;
  --boardInk: #0F2230; --boardMuted: #5B6B78; --boardLine: #E1D9C8;
}

/* The rug's outermost ring lines up with the header bar: same side padding, just below it. */
.rug { position: absolute; left: calc(var(--padX) + var(--ringOut)); right: calc(var(--padX) + var(--ringOut)); top: calc(var(--padY) + var(--headH) + var(--rowgap) + var(--ringOut)); bottom: calc(var(--padY) + var(--ringOut)); background: var(--rugPattern), var(--rugBg); box-shadow: var(--rugRings); border-radius: 4px; z-index: 0; }
.doodles { position: absolute; inset: 0; pointer-events: none; z-index: 0; }   /* out of the flex flow */
.doodles .dd { position: absolute; display: block; }
.dd-x { width: var(--doodle); height: var(--doodle); background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3E%3Cpath d='M2 2l6 6M8 2l-6 6' stroke='%23F4A340' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat center / contain; }
.dd-dot { width: 7px; height: 7px; border-radius: 50%; }
.dd-dot.t { background: #2FA8A6; } .dd-dot.c { background: #E76F51; }
.scene-sticker { position: absolute; width: var(--stickerPx); height: var(--stickerPx); z-index: 0; }
.scene-sticker--l { left: 3%; top: 12%; transform: rotate(-6deg); }
.scene-sticker--r { right: 3%; bottom: 5%; transform: rotate(5deg); }
@media (max-width: 767px), (max-height: 560px) { .scene-sticker, .doodles { display: none; } .forms--top { padding-top: 10px; } }

/* The header bar: logo, round, kind of game on the left; links on the right. Same white
   bar on every theme, so its text always uses the page inks. */
.scene-head {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex: none; position: relative; z-index: 4;
  background: rgba(255,255,255,.94); border: 1px solid var(--border); border-radius: 14px;
  height: var(--headH); box-sizing: border-box; padding: 0 var(--headPadX, 14px); box-shadow: 0 4px 14px rgba(15,34,48,.08);
}
.scene-head-l { display: flex; align-items: center; gap: 14px; min-width: 0; }
.scene-head .wordmark { font-size: var(--wordmarkFs); color: var(--ink); white-space: nowrap; }
.scene-head .wordmark span { color: var(--teal); }
.scene-meta { font-size: var(--metaFs); color: var(--muted); line-height: 1.3; padding-left: 14px; border-left: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scene-meta b { font-family: var(--font-serif); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.scene-head-r { display: flex; align-items: center; gap: 16px; flex: none; }
.scene-link { font-size: var(--metaFs); font-weight: 600; color: var(--muted); line-height: 1.3; }
.scene-link:hover { color: var(--teal); }
#pill-dublu { font-size: var(--pillFs); cursor: pointer; border: 0; gap: 4px; }
#pill-dublu[hidden] { display: none; }
#pill-dublu:hover, #pill-dublu[aria-expanded="true"] { box-shadow: 0 0 0 2px #F4C77F; }
.pill-q { display: inline-flex; align-items: center; justify-content: center; width: 15px; height: 15px; border-radius: 50%; background: var(--warn-ink); color: #fff; font-size: 10px; font-weight: 700; line-height: 1; }
.scene-head-r { position: relative; }
.dublu-info {
  position: absolute; top: calc(100% + 12px); right: 0; width: 300px; z-index: 8;
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--gold); border-radius: 12px;
  padding: 12px 14px; font-size: 13px; line-height: 1.5; color: var(--body-c); box-shadow: var(--shadow-pop);
}
.dublu-info[hidden] { display: none; }
.dublu-info b { color: var(--ink); font-weight: 600; }
@media (max-width: 767px) { #scene-leave, #rules-open, #tut-open { display: none; } .scene { --headPadX: 10px; } }
.scene-link.is-off { text-decoration: line-through; opacity: .7; }

/* „Scor" — the sheet so far, opened from the table */
.scores-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.scores-head h2 { font-size: 26px; }
.scores-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
.scores-foot { display: flex; justify-content: flex-end; }
@media (max-width: 767px) { .scores-head h2 { font-size: 22px; } .scores-foot .btn { width: 100%; height: 44px; } }

.table {
  position: relative; flex: 1; min-height: 0; margin: var(--tableMargin);
  background: var(--tableBg); border: 1px solid var(--rim); border-radius: var(--tableRadius);
  box-shadow: 0 var(--tableLip) 0 0 var(--lipColor);
  display: flex; align-items: stretch; padding: var(--tablePad); color: var(--onInk);
}
.side { width: var(--sideW); display: flex; align-items: center; justify-content: center; flex: none; }
.side--l { margin-left: var(--sideMl); } .side--r { margin-right: var(--sideMl); }
@media (max-width: 767px) { .side { display: none; } }
.table-mid { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--smallGap); align-items: center; }
.seats-top { display: flex; gap: var(--seatGap); justify-content: center; margin-top: var(--seatTopMt); flex: none; position: relative; z-index: 2; }

/* A seat: tile + label */
.seat { display: flex; flex-direction: column; align-items: center; gap: 6px; position: relative; }
@media (max-width: 767px) { .seats-top .seat { flex-direction: row; gap: 8px; } }
.seat-tile {
  position: relative; width: var(--seat); height: calc(var(--seat) * 3 / 4); border-radius: 14px; overflow: hidden; background: #EDE7DA;
  border: 4px solid var(--seat-color, var(--border)); flex: none; transition: box-shadow .15s ease;
}
/* The ring is the player's colour; turn and voice show as a halo outside it. */
.seat-tile.is-turn { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--teal-bright); }
.seat-tile.is-speaking { box-shadow: 0 0 0 3px #fff, 0 0 0 6px rgba(47,168,166,.55); }
.seat-tile.is-turn.is-speaking { box-shadow: 0 0 0 3px #fff, 0 0 0 7px var(--teal-bright), 0 0 0 11px rgba(47,168,166,.35); }
.seat-tile video, .seat-tile .seat-cam, .seat-tile .seat-av { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.seat-tile .seat-av svg, .seat-tile .seat-cam { display: block; }
.seat-tile video[hidden], .seat-tile .seat-cam[hidden], .seat-tile .seat-av[hidden] { display: none; }
/* The silhouette and its label are the placeholder until frames play; the live video
   (rtc.attachAll sets .has-video) must not sit under them. */
.seat-tile video.has-video ~ .seat-cam, .seat-tile video.has-video ~ .seat-cam-label,
.seat-pv video.has-video ~ .seat-cam, .seat-pv video.has-video ~ .seat-pv-label { display: none; }
.seat-cam-label { position: absolute; left: 8px; bottom: 6px; font-size: 10.5px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
@media (max-width: 767px) { .seat-cam-label { display: none; } }
.seat-label { display: flex; flex-direction: column; gap: 3px; align-items: center; text-align: center; background: rgba(255,255,255,.92); border-radius: 10px; padding: 4px 8px; color: var(--ink); }
@media (max-width: 767px) { .seat-label { align-items: flex-start; text-align: left; } }
.seat-name { font-size: var(--seatNameFs); font-weight: 600; line-height: 1.2; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.seat-name i { width: 8px; height: 8px; border-radius: 50%; background: var(--seat-color, #2FA8A6); flex: none; }
.seat-name .num { color: var(--muted); font-weight: 600; }
.seat-pills { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.seat-pills:empty { display: none; }
.pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; line-height: 1.3; }
.pill--teal { background: var(--teal-tint); color: var(--teal-ink); }
.pill--gold { background: #F9E9C8; color: var(--warn-ink); }
.pill--navy { background: var(--ink); color: #fff; }
.pill--coral { background: #FCEAE4; color: var(--trap); }
.seat-score { font-size: var(--pillFs); line-height: 1.2; color: var(--muted); white-space: nowrap; }
.seat-score b { font-family: var(--font-serif); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.seat-score .plus { color: var(--teal-ink); font-weight: 600; }
.seat-score .neg, .you-score .neg { color: var(--error); }
/* The atu announcer's mark, kept for the whole game */
.atu-badge { position: absolute; left: 3px; top: 3px; width: 34%; max-width: 40px; min-width: 20px; aspect-ratio: 1; z-index: 2; background: #FFF6DC; border: 2px solid #E0A93B; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(15,34,48,.18); }
.atu-badge svg { width: 78%; height: 78%; display: block; }
.seat-tile.has-atu, .you-tile.has-atu { border-color: #E0A93B; }
.th-atu { display: inline-block; width: 18px; height: 18px; margin-left: 4px; vertical-align: -4px; }
.th-atu svg { width: 100%; height: 100%; display: block; }
.seat-turn { font-size: var(--metaFs); color: var(--teal-ink); font-weight: 600; line-height: 1.2; }
.seat-turn:empty { display: none; }

/* Formations on the table */
.forms { display: flex; gap: 14px 22px; flex-wrap: wrap; justify-content: center; align-items: flex-start; flex: none; min-height: var(--th); position: relative; z-index: 1; max-width: 100%; }
.forms--top, .forms--side { padding-top: 14px; }   /* room for the owner labels */
.mid-row { display: flex; align-items: center; gap: var(--midGap); flex: 1; min-height: 0; width: 100%; }
.mid-center { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: center; }
.forms--side { flex-direction: column; flex-wrap: nowrap; gap: 20px; padding: 14px 8px 6px; max-width: 34%; max-height: 100%; overflow-y: auto; scrollbar-width: none; }
.forms--l { align-items: flex-start; }
.forms--r { align-items: flex-end; }
.forms--r .form-owner { left: auto; right: 2px; }
.forms:empty { display: none; }

.forms[hidden] { display: none; }
.form { position: relative; display: flex; gap: 4px; padding: 4px; margin: -4px; border-radius: 10px; outline: 2px solid transparent; transition: background .15s ease, outline-color .15s ease; }
.form.is-target, .form.is-over { background: #EDF6F5; outline-color: var(--teal-bright); }
.form.is-pulse { animation: rd-pulse 1s ease-out 1; }
.form-owner { position: absolute; top: -14px; left: 2px; font-size: 10px; font-weight: 600; color: var(--onMuted); white-space: nowrap; letter-spacing: .02em; }
.form .slot { --pw: var(--tw); --ph: var(--th); --pf: var(--tf); background: transparent; }
.form.has-joker .piece.is-joker { cursor: pointer; }

/* The middle: talon + șir */
.middle { display: flex; align-items: center; gap: var(--midGap); flex: 1; min-height: 0; width: 100%; justify-content: center; position: relative; z-index: 1; }
.middle[hidden] { display: none; }
.talon-wrap { display: flex; flex-direction: column; gap: 6px; align-items: center; flex: none; }
.talon { position: relative; width: calc(var(--tw) * 1.9); height: calc(var(--th) + 6px); cursor: default; }
.talon-back { position: absolute; width: var(--tw); height: var(--th); border-radius: 8px; background: #1B3A52; border: 2px solid #0F2230; border-bottom-width: 4px; }
.talon-back.b1 { left: 0; top: 6px; } .talon-back.b2 { left: 3px; top: 3px; }
.talon-back.b3 { left: 6px; top: 0; display: flex; align-items: center; justify-content: center; transition: border-color .15s ease, box-shadow .15s ease; }
.talon-mark { width: 45%; height: 45%; display: block; }
.talon-mark svg { width: 100%; height: 100%; display: block; }
.talon.is-live { cursor: pointer; }
.talon-stack { position: absolute; left: 0; top: 0; width: calc(var(--tw) + 6px); height: calc(var(--th) + 6px); border-radius: 10px; transition: filter .15s ease; }
.talon.is-live .talon-back { border-color: var(--teal-bright); }
.talon.is-live .talon-stack { filter: drop-shadow(0 0 3px rgba(143,212,210,.9)); }
.talon.is-empty .talon-back { opacity: .35; }
.atu { position: absolute; left: calc(var(--tw) * .95); top: 2px; width: var(--tw); height: var(--th); }
.atu .slot { --pw: var(--tw); --ph: var(--th); --pf: var(--tf); background: transparent; }
.atu .piece { transform: rotate(8deg); box-shadow: 0 4px 12px rgba(15,34,48,.10); }
.atu.is-live .piece { cursor: pointer; }
.atu.is-target .piece, .atu.is-over .piece { border-color: #E0A93B; box-shadow: 0 0 0 4px rgba(244,163,64,.35); cursor: pointer; }
.atu.is-shown .piece { animation: rd-new 1.8s ease-out 1; }
.atu:empty { display: none; }
.talon-label { font-size: var(--metaFs); color: var(--onMuted); line-height: 1.2; white-space: nowrap; }
.talon-label b { font-family: var(--font-serif); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--onInk); }
.talon-label .live { font-weight: 600; color: var(--onLive); }
.sir-wrap { display: flex; align-items: center; gap: 6px; min-width: 0; max-width: var(--sirMaxW); padding-bottom: 16px; }
.sir { display: flex; align-items: center; gap: 4px; min-width: 0; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 12px 12px 20px; margin: -12px -6px -20px -12px; }   /* padding = room for the glow; the negative margin keeps the layout */
.sir::-webkit-scrollbar { display: none; }
.sir-cell { position: relative; width: var(--tw); height: var(--th); display: flex; align-items: center; justify-content: center; flex: none; }
.sir-cell.is-opening { width: var(--th); }
/* The last piece (the one you can take) stands apart, so its glow reads and it is clearly the last. */
.sir-cell:last-child:not(:first-child) { margin-left: calc(var(--tw) * .32); }
.sir-cell .slot { --pw: var(--tw); --ph: var(--th); --pf: var(--tf); background: transparent; }
.sir-cell.is-opening .piece { transform: rotate(-90deg); }
.sir-cell .sir-label { position: absolute; top: 100%; left: 50%; transform: translateX(-50%); margin-top: 3px; font-size: var(--pillFs); font-weight: 600; white-space: nowrap; color: var(--sirOpen); }
.sir-cell.is-live .sir-label { color: var(--sirLive); }
.sir-cell.is-break .piece { cursor: pointer; }
.sir-cell.is-break-hot .piece { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,124,123,.16); }
.sir-cell:not(.is-live) .slot { touch-action: pan-x; }   /* the line scrolls under a finger */
.drop-slot {
  width: calc(var(--tw) * 1.4); height: var(--th); border-radius: 8px; border: 2px dashed var(--dropB);
  display: flex; align-items: center; justify-content: center; font-size: var(--pillFs); font-weight: 600; color: var(--dropC);
  flex: none; text-align: center; line-height: 1.2; padding: 0 6px; transition: background .15s ease, border-color .15s ease;
}
.drop-slot[hidden] { display: none; }
.drop-slot.is-over, .drop-slot.is-target { background: rgba(237,246,245,.25); border-color: var(--teal-bright); border-style: solid; }
.drop-slot.is-pulse { animation: rd-pulse 1s ease-out 1; }

/* Duble phase panel */
.duble-panel { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--smallGap); flex: 1; min-height: 0; width: 100%; position: relative; z-index: 1; }
.duble-panel[hidden] { display: none; }
.duble-chips { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.chip--board { height: var(--chipH); padding: 0 14px; border: 2px solid var(--border); border-bottom-width: 4px; font-size: var(--chipFs); color: var(--ink); cursor: pointer; }
.chip--board:disabled { opacity: .5; cursor: default; }
.chip--board.is-on { border-color: var(--teal); background: var(--teal-tint); color: var(--teal-ink); }
.chip--danger { background: #FCEAE4; border-color: #F0C5B2; color: #C05336; }
.chip--danger[hidden] { display: none; }
.duble-offers { display: flex; flex-direction: column; gap: 6px; width: min(100%, 360px); }
.duble-offers:empty { display: none; }
.offer { display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 6px 6px 6px 14px; color: var(--ink); }
.offer span { flex: 1; font-size: var(--chipFs); }
.offer .btn { height: var(--chipH); font-size: var(--chipFs); padding: 0 14px; border-bottom: 3px solid var(--teal-hover); }
.offer.is-mine { opacity: .8; }
.ring { position: relative; width: var(--ringPx); height: var(--ringPx); }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); display: block; }
.ring-num { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: var(--ringFs); color: var(--onInk); }
#gata { height: var(--ctaH); font-size: var(--ctaFs); padding: 0 22px; }
#gata.is-done { background: var(--teal-tint) !important; color: var(--teal-ink) !important; border-bottom-color: var(--teal-border) !important; }

/* You: preview + rack + actions */
/* Camera · rack · feed: inside the felt, the same distance from its bottom and side edges.
   The outer corners follow the table's curve (concentric), so the gap stays even there too. */
.you-row { position: absolute; left: var(--inset); right: var(--inset); bottom: var(--inset); z-index: 3;
  display: flex; align-items: flex-end; gap: 10px; color: var(--ink); --outerR: calc(var(--tableRadius) - var(--inset)); }
.you-row .you-tile { border-bottom-left-radius: var(--outerR); }
.you-row .feed { border-bottom-right-radius: var(--outerR); }
@media (max-width: 767px) { .you-row { gap: 12px; } }
.you-seat { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.you-tile { position: relative; height: var(--youH); aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; border: 2px solid var(--border); background: #EDE7DA; transition: border-color .15s ease; }
.you-tile.is-turn { border-color: var(--teal); }
.you-tile video, .you-tile .seat-cam, .you-tile .seat-av { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.you-tile video[hidden], .seat-cam-ph[hidden] { display: none; }
.you-timer { position: absolute; right: 3px; top: 3px; width: 18px; height: 18px; transform: rotate(-90deg); }
.you-timer[hidden] { display: none; }
/* camera / mic switches under your own tile (the same state as the room's switches) */
.you-media { position: absolute; right: 6px; bottom: 6px; display: flex; gap: 4px; z-index: 1; }
.media-btn { width: 24px; height: 24px; border-radius: var(--r-pill); display: inline-flex; align-items: center; justify-content: center;
  background: #fff; border: 1px solid var(--border); color: var(--teal-ink); cursor: pointer; padding: 0; transition: background .15s ease, border-color .15s ease; }
.media-btn:hover { border-color: var(--teal-border); }
.media-btn:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.media-btn:disabled { opacity: .55; cursor: default; }
.media-btn.is-off { background: #FCEAE4; border-color: #F0C5B2; color: #A34B3E; }
.media-btn:not(.is-off) .slash { display: none; }
.media-btn .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.media-btn svg { width: 14px; height: 14px; }
@media (max-width: 767px) { .you-name { display: none; } .you-media { right: 2px; bottom: 2px; gap: 2px; } .media-btn { width: 20px; height: 20px; } .media-btn svg { width: 12px; height: 12px; } }
.you-name { position: absolute; left: 6px; top: 6px; max-width: calc(100% - 12px); z-index: 1; padding: 2px 8px; border-radius: var(--r-pill); background: rgba(255,255,255,.9); font-size: var(--pillFs); font-weight: 600; color: var(--ink); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.you-name .etalat { color: var(--teal-ink); margin-left: 4px; }
/* Bottom right, in the board's colour: your sheet so far, then what happened at the table. */
.feed { width: var(--feedW); height: var(--boardH); flex: none; display: flex; flex-direction: column; gap: 8px; box-sizing: border-box;
  background: var(--boardBg); border: 1px solid var(--boardEdge); border-radius: 14px; padding: 10px 12px; color: var(--boardInk);
  box-shadow: 0 10px 24px rgba(15,34,48,.18); min-height: 0; }
/* the turn line closes the feed: what to do now, under what just happened */
.feed .banner { align-self: stretch; flex: none; background: rgba(253,244,227,.07); border: 0; border-radius: 10px;
  padding: 8px 10px; font-size: var(--metaFs); color: var(--boardInk); }
.feed .banner.is-turn { background: rgba(47,168,166,.22); }
.feed .banner.is-closing, .feed .banner.is-gold { background: rgba(244,163,64,.18); }
.feed .banner.is-teal { color: var(--boardInk); }
.feed .banner.is-muted { color: var(--boardMuted); }
.feed .banner.is-gold { color: #F4C27A; }
/* a very small screen has no room for the panel: it goes (events fall back to a toast) */
@media (max-width: 767px), (max-height: 560px) { .feed { display: none; } }

.feed-score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 12px; padding-bottom: 8px; border-bottom: 1px solid var(--boardLine); font-size: var(--metaFs); color: var(--boardMuted); line-height: 1.3; flex: none; }
.feed-score b { font-family: var(--font-serif); font-variant-numeric: tabular-nums; font-weight: 600; font-size: 20px; color: var(--boardInk); margin-left: 4px; }
.feed-score b.neg { color: #F08A7A; }
.feed-score .plus { color: var(--teal-bright); font-weight: 600; }
.feed-score .neg { color: #F08A7A; }
.feed-list { list-style: none; margin: 0; padding: 0; flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; font-size: var(--metaFs); line-height: 1.35; scrollbar-width: thin; }
.feed-list li { color: var(--boardMuted); }
.feed-list li:last-child { color: var(--boardInk); }
.feed-list li.is-new { animation: feed-in .5s ease-out 1; }
@keyframes feed-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .feed-list li.is-new { animation: none; } }

.board {
  height: var(--boardH); box-sizing: border-box;
  display: inline-flex; flex-direction: column; gap: var(--gap); background: var(--boardBg); border-radius: 14px;
  padding: var(--boardPad); border: 1px solid var(--boardEdge); position: relative; box-shadow: 0 10px 24px rgba(15,34,48,.18); flex: none;
}
.board-row { display: flex; gap: var(--gap); }
.board .slot.is-over { outline: 2px dashed var(--teal-bright); outline-offset: -2px; }
.board .slot.is-pulse { outline: 2px dashed var(--teal-bright); outline-offset: -2px; animation: rd-pulse 1s ease-out 1; }
.slot-label { position: absolute; top: 100%; left: 0; width: calc(200% + var(--gap)); margin-top: 5px; text-align: center; font-size: 11px; font-weight: 600; color: var(--labelColor); line-height: 1; pointer-events: none; z-index: 3; text-shadow: 0 0 4px var(--boardBg), 0 0 2px var(--boardBg); }

/* the rack, with what you can do right now standing on the felt just above it */
.rack-wrap { position: relative; flex: none; display: flex; }
.actions { position: absolute; left: 0; bottom: calc(100% + 10px); display: flex; align-items: center; gap: var(--smallGap); flex-wrap: nowrap; white-space: nowrap; }
.actions .actions-reason { color: var(--onMuted); }
.you-row .feed { margin-left: auto; }
.banner {
  display: inline-flex; align-self: flex-start; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border);
  border-left: 4px solid var(--border-2); border-radius: 12px; padding: var(--bannerPad); font-size: var(--bannerFs); font-weight: 600;
  color: var(--ink); line-height: 1.3; max-width: 100%;
}
.banner:empty { display: none; }
.banner.is-turn { border-left-color: var(--teal); }
.banner.is-closing { border-left-color: var(--gold); }
.banner.is-teal { color: var(--teal-ink); }
.banner.is-muted { color: var(--muted); }
.banner.is-gold { color: var(--warn-ink); }
.meter { display: inline-flex; align-self: flex-start; align-items: center; gap: 6px; padding: 4px 12px; border-radius: var(--r-pill); background: #fff; border: 1px solid var(--border); font-size: var(--metaFs); color: var(--ink); }
.meter[hidden] { display: none; }
.meter .num { font-weight: 600; }
.meter .ok { color: var(--teal-ink); font-weight: 600; }
.meter .no { color: var(--error); font-weight: 600; }
.actions-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.actions-row .btn[hidden], .actions-reason[hidden] { display: none; }
#btn-etala { height: var(--ctaH); font-size: var(--ctaFs); padding: 0 22px; }
.actions-reason { font-size: var(--metaFs); line-height: 1.2; }
#btn-undo, #btn-atu { height: var(--chipH); font-size: var(--chipFs); padding: 0 16px; }

/* Pieces */
.slot { position: relative; width: var(--pw); height: var(--ph); border-radius: 8px; background: var(--groove); flex: none; touch-action: none; }
.slot.is-ghost { background: transparent; outline: 2px dashed var(--border-2); outline-offset: -2px; }
.piece {
  --pc: var(--ink); --mark: max(7px, calc(var(--pf) * .24));
  position: absolute; inset: 0; border-radius: 8px; background: #FFFDF9; border: 2px solid #E4DCCB; border-bottom: 4px solid #D3C8B2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: max(3px, calc(var(--pf) * .1));
  cursor: grab; user-select: none; -webkit-user-select: none;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
}
.piece-num { font-family: var(--font-serif); font-weight: 700; font-variant-numeric: tabular-nums; font-size: var(--pf); line-height: .9; color: var(--pc); }
/* Four vivid colours on a plain white face; the pip under the numeral is the second channel
   (colour-blind players): roșu ●, galben ■, albastru ▲, negru ◆. */
.piece[data-color="rosu"]     { --pc: #E0241B; }
.piece[data-color="galben"]   { --pc: #EE8A00; }
.piece[data-color="albastru"] { --pc: #1463E6; }
.piece[data-color="negru"]    { --pc: #15171A; }
.piece-joker { width: 86%; height: 86%; display: block; }
.piece-mark { width: var(--mark); height: var(--mark); flex: none; background: var(--pc); }
.piece.is-joker .piece-mark { display: none; }
.piece[data-color="rosu"] .piece-mark { border-radius: 50%; }
.piece[data-color="galben"] .piece-mark { border-radius: 1px; transform: scale(.9); }
.piece[data-color="albastru"] .piece-mark { clip-path: polygon(50% 0, 100% 100%, 0 100%); transform: scale(1.1); }
.piece[data-color="negru"] .piece-mark { border-radius: 1px; transform: rotate(45deg) scale(.82); }
.piece.is-staged { background: var(--teal-tint); border-color: var(--teal); }
.piece.is-sel { transform: translateY(-4px); border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,124,123,.22); }
.piece.is-lifted { transform: scale(1.06); box-shadow: 0 10px 24px rgba(14,124,123,.28); z-index: 5; }
.piece.is-live { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,124,123,.16); cursor: pointer; }
.piece.is-lift6 { transform: translateY(-6px); }
.piece.is-snap { animation: rd-snap .22s cubic-bezier(.2,.9,.3,1.2) 1; }
.piece.is-static { cursor: default; }
.piece.is-flying { visibility: hidden; }
.piece.is-new { animation: rd-new 1.6s ease-out 1; }
.piece.is-swap { border-color: var(--gold, #F4A340); box-shadow: 0 0 0 3px rgba(244,163,64,.35); cursor: pointer; }
.form .piece.is-over { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14,124,123,.3); }
.slot.ul::after { content: ""; position: absolute; bottom: -6px; left: calc(-1 * var(--gap)); right: calc(-1 * var(--gap)); height: 2px; background: var(--teal-2); border-radius: 1px; }
.slot.ul-first::after { left: 0; } .slot.ul-last::after { right: 0; }
.drag-ghost { position: fixed; left: 0; top: 0; pointer-events: none; z-index: 1000; width: var(--pw); height: var(--ph); }
.drag-ghost .piece { transform: scale(1.06); box-shadow: 0 10px 24px rgba(14,124,123,.28); cursor: grabbing; }

/* A piece in flight between two places (talon → seat, rack → șir, rack → table …) */
.fly { position: fixed; left: 0; top: 0; z-index: 900; pointer-events: none; transform-origin: 0 0; will-change: transform, opacity; }
.fly .piece { box-shadow: 0 8px 20px rgba(15,34,48,.28); transform: none; }
.fly-back { position: absolute; inset: 0; border-radius: 8px; background: #1B3A52; border: 2px solid #0F2230; border-bottom-width: 4px; box-shadow: 0 8px 20px rgba(15,34,48,.28); }
.pts-float {
  position: fixed; z-index: 901; pointer-events: none; padding: 2px 10px; border-radius: var(--r-pill); background: #fff;
  border: 1px solid var(--teal-border); color: var(--teal-ink); font-family: var(--font-serif); font-variant-numeric: tabular-nums;
  font-weight: 700; font-size: 15px; line-height: 1.4; white-space: nowrap; box-shadow: 0 6px 16px rgba(15,34,48,.18);
  animation: rd-float 1.7s ease-out 1 forwards;
}

/* Toast position on the scene: top-centre on phone landscape, bottom elsewhere. */
@media (max-width: 767px) { .page-masa .toast { bottom: auto; top: 8px; transform: translate(-50%, -12px); } .page-masa .toast.is-on { transform: translate(-50%, 0); } }

/* Freeze overlay (închidere, strică jocul, talon terminat) */
.overlay { position: absolute; inset: 0; background: rgba(251,246,236,.72); display: flex; align-items: center; justify-content: center; z-index: 6; }
.overlay[hidden] { display: none; }
.overlay-card { background: #fff; border: 1px solid var(--border); border-radius: 16px; padding: 22px 30px; box-shadow: var(--shadow-pop); display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; max-width: 80%; }
.overlay-title { font-family: var(--font-serif); font-weight: 600; font-size: 22px; letter-spacing: -0.015em; color: var(--ink); line-height: 1.25; }
.overlay-sub { font-size: var(--metaFs); }
@media (max-width: 767px) { .overlay-card { padding: 14px 20px; } .overlay-title { font-size: 16px; } }

/* Joker swap popover */
.popover { position: absolute; z-index: 7; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 8px 8px 8px 12px; box-shadow: var(--shadow-pop); white-space: nowrap; font-size: var(--chipFs); color: var(--ink); }
.popover[hidden] { display: none; }
.popover .num { font-weight: 700; color: var(--warn-ink); }
.popover .btn { height: var(--chipH); font-size: var(--chipFs); padding: 0 14px; border-bottom: 3px solid var(--teal-hover); }

/* ---------------------------------------------------------------- 6 · Foaia de scor */
.score { max-width: 900px; margin: 0 auto; padding: 48px 20px 40px; display: flex; flex-direction: column; gap: 24px; min-height: 100dvh; }
.score[hidden] { display: none; }
.score-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.score-title { font-size: 34px; line-height: 1.1; margin-top: 6px; }
.score-sub { margin: 8px 0 0; font-size: 14.5px; }
.score-who { display: flex; align-items: center; gap: 8px; }
.score-card { overflow: hidden; }
.score-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.score-legend { font-size: 12.5px; }
.score-cta { display: flex; align-items: center; gap: 14px; }
.score-cta .btn[hidden] { display: none; }
#score-next-note { font-size: 13px; }
#score-next-note b { font-weight: 600; color: var(--ink); }
@media (max-width: 767px) {
  .score { padding: 14px 16px 22px; gap: 14px; }
  .score-head { flex-direction: column; align-items: flex-start; }
  .score-who { display: none; }
  .score-title { font-size: 24px; margin-top: 4px; }
  .score-sub { font-size: 13px; margin-top: 4px; }
  .score-legend { font-size: 12px; }
  .score-foot { flex-direction: column; align-items: stretch; margin-top: auto; }
  .score-cta { flex-direction: column-reverse; gap: 6px; }
  .score-cta .btn { width: 100%; height: 50px; }
}

/* ---------------------------------------------------------------- 7d · Întoarce telefonul */
.rotate { position: fixed; inset: 0; z-index: 200; background: var(--canvas); display: flex; align-items: center; justify-content: center; padding: 24px; }
.rotate[hidden] { display: none; }
.rotate-card { width: 100%; max-width: 420px; padding: 40px 28px; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center; }
.rotate-card h2 { font-size: 24px; }
.rotate-card p { margin: 0; font-size: 14px; line-height: 1.5; }
.rotate-card .muted-2 { font-size: 12.5px; }
.rotate-card b { font-weight: 600; color: var(--ink); }

.reconnect { position: fixed; top: 8px; left: 50%; transform: translateX(-50%); z-index: 150; background: var(--ink); color: #FDF4E3; font-size: 12.5px; font-weight: 500; padding: 6px 14px; border-radius: var(--r-pill); }
.reconnect[hidden] { display: none; }

/* ---------------------------------------------------------------- motion */
@keyframes rd-pulse { 0% { box-shadow: 0 0 0 0 rgba(14,124,123,.35); } 100% { box-shadow: 0 0 0 10px rgba(14,124,123,0); } }
@keyframes rd-new { 0%, 30% { box-shadow: 0 0 0 4px rgba(244,163,64,.8); } 100% { box-shadow: 0 0 0 4px rgba(244,163,64,0); } }
@keyframes rd-float { 0% { opacity: 0; transform: translate(-50%, 4px); } 12%, 70% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -34px); } }
@keyframes rd-snap { 0% { transform: translate(6px, -3px) rotate(-3deg); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .form.is-pulse, .drop-slot.is-pulse, .board .slot.is-pulse { animation: none; }
  .piece.is-snap, .piece.is-new, .atu.is-shown .piece { animation: none; }
  .pts-float { animation-duration: 2.2s; }
  .piece, .seat-tile, .form, .drop-slot, .toast, .you-tile { transition: none; }
}

/* ---------------------------------------------------------------- the piece you just took */
.piece.is-drawn:not(.is-live) { border-color: #F4A340; box-shadow: 0 0 0 3px rgba(244,163,64,.45); }
.piece.is-drawn-new { animation: rd-drawn .6s cubic-bezier(.2,.9,.3,1.2) 1; }
.drawn-tag {
  position: absolute; left: 50%; bottom: 100%; transform: translate(-50%, 4px); z-index: 4; pointer-events: none;
  background: #F4A340; color: var(--ink); font-size: 10px; font-weight: 700; line-height: 1; letter-spacing: .02em;
  padding: 3px 7px; border-radius: var(--r-pill); white-space: nowrap; box-shadow: 0 2px 6px rgba(15,34,48,.18);
}
/* Where you can take from, while you still have to. */
.middle.must-draw .talon.is-live .talon-stack { animation: rd-glow-stack 1.4s ease-in-out infinite; }
.middle.must-draw .sir-cell.is-live .piece { animation: rd-glow 1.4s ease-in-out infinite; }
@keyframes rd-glow-stack { 0%, 100% { filter: drop-shadow(0 0 2px rgba(143,212,210,.7)); } 50% { filter: drop-shadow(0 0 9px rgba(143,212,210,1)); } }
@keyframes rd-drawn { 0% { transform: translateY(-16px) scale(1.1); box-shadow: 0 0 0 10px rgba(244,163,64,.0); } 60% { box-shadow: 0 0 0 6px rgba(244,163,64,.55); } 100% { transform: none; } }
@keyframes rd-glow { 0%, 100% { box-shadow: 0 0 0 3px rgba(143,212,210,.35); } 50% { box-shadow: 0 0 0 8px rgba(143,212,210,.6); } }
@media (prefers-reduced-motion: reduce) { .piece.is-drawn-new, .middle.must-draw .talon.is-live .talon-stack, .middle.must-draw .sir-cell.is-live .piece { animation: none; } }

/* ---------------------------------------------------------------- first-visit tutorial */
.tut-card { width: min(880px, 94vw); gap: 18px; padding: 28px 32px; }
.tut-card .tut-media { width: min(100%, calc((100dvh - 330px) * 16 / 9)); align-self: center; }
.tut-media {
  position: relative; aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; container-type: inline-size;
  background: #EFEADF; border: 1px solid var(--border);
}
.tut-scene { position: absolute; inset: 0; }
.tut-scene[hidden] { display: none; }
.tut-body { text-align: center; }
.tut-body h2 { font-size: 30px; margin-top: 6px; }
.tut-body p { margin: 8px auto 0; font-size: 17px; line-height: 1.5; max-width: 560px; }
.tut-dots { display: flex; gap: 6px; justify-content: center; }
.tut-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--border-2); }
.tut-dots i.on { background: var(--teal); width: 20px; border-radius: var(--r-pill); }
.tut-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tut-nav { display: flex; gap: 8px; }
.tut-foot .btn { height: 48px; padding: 0 24px; font-size: 15px; }
.tut-foot .btn[hidden] { display: none; }
.tut.is-forced .tut-foot { justify-content: flex-end; }   /* no „Sari peste" */
@media (max-width: 767px), (max-height: 560px) {
  .tut-card { width: 100%; padding: 14px 20px 20px; gap: 12px; }
  .tut-card .tut-media { width: min(100%, calc((100dvh - 260px) * 16 / 9), 420px); }
  .tut-body p { font-size: 14.5px; }
  .tut-foot .btn { height: 44px; }
  .tut-body h2 { font-size: 22px; }
}

/* Tutorial scenes. The stage is 100 × 56.25 cqw; every part is placed with --x/--y (in cqw).
   One 4.2 s loop per step; the scene restarts each time it is shown (hidden → shown). */
.tut-scene > *, .ts-talon > * { position: absolute; left: calc(var(--x) * 1cqw); top: calc(var(--y) * 1cqw); }
.ts-felt { left: 3cqw !important; top: 3cqw !important; width: 94cqw; height: 30cqw; background: #0B5F5E; border-radius: 5cqw; box-shadow: 0 1cqw 0 #073D3C; }
.ts-rack { width: calc(var(--w) * 1cqw); height: calc(var(--h) * 1cqw); background: #0F2230; border-radius: 2cqw; }
.tsl { width: 7cqw; height: 9.6cqw; border-radius: 1.2cqw; background: rgba(253,244,227,.08); }
.tp {
  width: 7cqw; height: 9.6cqw; box-sizing: border-box; border-radius: 1.2cqw; background: #fff;
  border: .4cqw solid #E7E0D2; border-bottom-width: .9cqw; display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-weight: 700; font-size: 4.6cqw; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink);
}
.tp.r { color: #C05336; } .tp.b { color: #1E497B; } .tp.y { color: #8A6A1F; } .tp.k { color: #0F2230; }
.tp.dn { background: #1B3A52; border-color: #0F2230; }
.ts-talon { width: 7cqw; height: 9.6cqw; border-radius: 1.2cqw; box-shadow: -.8cqw .8cqw 0 #1B3A52, -1.6cqw 1.6cqw 0 #0F2230; }
.ts-label { font-size: 2.4cqw; font-weight: 600; color: #BFE4E2; }
.ts-tag { background: #F4A340; color: var(--ink); font-size: 2.1cqw; font-weight: 700; padding: .5cqw 1.2cqw; border-radius: 99px; white-space: nowrap; }
.ts-meter { background: #fff; border-radius: 99px; padding: .8cqw 2.2cqw; font-size: 2.6cqw; font-weight: 600; color: var(--teal-ink); white-space: nowrap; }
.ts-btn { background: var(--teal); color: #fff; border-bottom: .8cqw solid var(--teal-hover); border-radius: 99px; padding: .7cqw 4cqw; font-size: 2.6cqw; font-weight: 700; }
.ts-target { width: calc(var(--w) * 1cqw); height: 12.4cqw; border-radius: 1.8cqw; outline: .5cqw solid #8FD4D2; background: rgba(237,246,245,.15); opacity: 0; }
.ts-drop { width: 9.8cqw; height: 9.6cqw; box-sizing: border-box; border: .4cqw dashed #8FD4D2; border-radius: 1.2cqw; display: flex; align-items: center; justify-content: center; text-align: center; font-size: 2cqw; font-weight: 600; color: #E3F2F0; line-height: 1.1; }
.ts-win { transform: translate(-50%, -50%); background: #fff; border-radius: 2.4cqw; padding: 1.6cqw 3.6cqw; font-family: var(--font-serif); font-size: 4cqw; font-weight: 600; color: var(--ink); box-shadow: var(--shadow-pop); white-space: nowrap; opacity: 0; }
.ts-win b { color: var(--teal); }
.ts-hand { width: 4.4cqw; height: 4.4cqw; border-radius: 50%; background: rgba(15,34,48,.25); border: .5cqw solid #fff; box-shadow: 0 .5cqw 1.5cqw rgba(15,34,48,.3); }

.tut-scene [class*="a-"] { animation-duration: 4.2s; animation-iteration-count: infinite; animation-timing-function: ease-in-out; animation-fill-mode: both; }
.a-move1, .a-hand1 { animation-name: tut-move1; z-index: 2; }
.a-hand1 { z-index: 3; }
@keyframes tut-move1 {
  0%, 12% { transform: none; opacity: 1; }
  24% { transform: translate(0, -3cqw); }
  58% { transform: translate(48cqw, -3cqw); }
  68%, 90% { transform: translate(48cqw, 0); opacity: 1; }
  95% { transform: translate(48cqw, 0); opacity: 0; }
  96% { transform: none; opacity: 0; }
  100% { transform: none; opacity: 1; }
}
.a-glow { animation-name: tut-glow; }
@keyframes tut-glow { 0%, 4% { outline: 0 solid rgba(143,212,210,.0); } 10%, 22% { outline: .8cqw solid rgba(143,212,210,.9); } 30%, 100% { outline: 0 solid rgba(143,212,210,0); } }
.a-fly2 { animation-name: tut-fly2; z-index: 2; }
@keyframes tut-fly2 { 0%, 18% { transform: none; opacity: 0; } 22% { opacity: 1; transform: translate(0, -2cqw); } 48% { transform: translate(40.5cqw, 28.5cqw); opacity: 1; } 50%, 100% { transform: translate(40.5cqw, 28.5cqw); opacity: 0; } }
.a-land2 { animation-name: tut-land2; }
.tp.a-land2 { border-color: #F4A340; box-shadow: 0 0 0 .7cqw rgba(244,163,64,.5); }
@keyframes tut-land2 { 0%, 48% { opacity: 0; transform: translateY(-2cqw); } 54% { opacity: 1; transform: none; } 92% { opacity: 1; } 98%, 100% { opacity: 0; } }
.a-stage3a { animation-name: tut-stage3a; }
.a-stage3b { animation-name: tut-stage3b; }
@keyframes tut-stage3a { 0%, 14% { background: #fff; border-color: #E7E0D2; opacity: 1; transform: none; } 18%, 56% { background: #E3F2F0; border-color: var(--teal); opacity: 1; transform: none; } 62%, 95% { opacity: 0; transform: translateY(-6cqw); } 100% { opacity: 1; background: #fff; border-color: #E7E0D2; transform: none; } }
@keyframes tut-stage3b { 0%, 28% { background: #fff; border-color: #E7E0D2; opacity: 1; transform: none; } 32%, 56% { background: #E3F2F0; border-color: var(--teal); opacity: 1; transform: none; } 62%, 95% { opacity: 0; transform: translateY(-6cqw); } 100% { opacity: 1; background: #fff; border-color: #E7E0D2; transform: none; } }
.a-meter3 { animation-name: tut-meter3; }
@keyframes tut-meter3 { 0%, 34% { opacity: 0; } 38%, 58% { opacity: 1; } 62%, 100% { opacity: 0; } }
.a-btn3 { animation-name: tut-btn3; }
@keyframes tut-btn3 { 0%, 38% { opacity: 0; transform: none; } 42%, 52% { opacity: 1; transform: none; } 55% { transform: translateY(.6cqw) scale(.95); } 58% { opacity: 1; transform: none; } 62%, 100% { opacity: 0; } }
.a-meld3 { animation-name: tut-meld3; }
@keyframes tut-meld3 { 0%, 58% { opacity: 0; transform: translateY(8cqw); } 68%, 92% { opacity: 1; transform: none; } 98%, 100% { opacity: 0; } }
.a-target4 { animation-name: tut-target4; }
@keyframes tut-target4 { 0%, 14% { opacity: 0; } 22%, 62% { opacity: 1; } 72%, 100% { opacity: 0; } }
.a-move4 { animation-name: tut-move4; z-index: 2; }
@keyframes tut-move4 {
  0%, 14% { transform: none; opacity: 1; }
  24% { transform: translate(0, -3cqw); }
  58%, 92% { transform: translate(24.1cqw, -28.5cqw); opacity: 1; }
  96% { transform: translate(24.1cqw, -28.5cqw); opacity: 0; }
  97% { transform: none; opacity: 0; } 100% { transform: none; opacity: 1; }
}
.a-move5 { animation-name: tut-move5; z-index: 2; }
@keyframes tut-move5 {
  0%, 12% { transform: none; opacity: 1; }
  22% { transform: translate(0, -3cqw); }
  48%, 92% { transform: translate(41.5cqw, -28.5cqw); opacity: 1; }
  96% { transform: translate(41.5cqw, -28.5cqw); opacity: 0; }
  97% { transform: none; opacity: 0; } 100% { transform: none; opacity: 1; }
}
.a-win5 { animation-name: tut-win5; z-index: 3; }
@keyframes tut-win5 { 0%, 52% { opacity: 0; transform: translate(-50%, -50%) scale(.7); } 60% { opacity: 1; transform: translate(-50%, -50%) scale(1.06); } 64%, 90% { opacity: 1; transform: translate(-50%, -50%) scale(1); } 96%, 100% { opacity: 0; transform: translate(-50%, -50%) scale(1); } }
@media (prefers-reduced-motion: reduce) { .tut-scene [class*="a-"] { animation-duration: 8s; } }

/* ---------------------------------------------------------------- leave confirmation */
.leave-card { width: 420px; gap: 12px; }
.leave-card h2 { font-size: 22px; }
.leave-card p { margin: 0; font-size: 14px; line-height: 1.5; }
.leave-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 8px; }
.leave-foot .btn { height: 44px; padding: 0 20px; }
.btn--danger-solid { background: #C05336; color: #fff; border-bottom: 4px solid #8E3A24; }
.btn--danger-solid:hover { background: #A94A30; color: #fff; }
.btn--danger-solid:disabled { opacity: .6; }
@media (max-width: 767px), (max-height: 560px) {
  .leave-card { width: 100%; }
  .leave-foot .btn { flex: 1; }
}

/* ---------------------------------------------------------------- rack: insert, push, grow, resize */
/* the joint a dragged piece would drop into; dashed at an edge (the row gets pushed) */
.rack-caret { position: absolute; width: 4px; margin-left: -2px; border-radius: 4px; background: var(--teal-bright); box-shadow: 0 0 0 3px rgba(47,168,166,.25); pointer-events: none; z-index: 4; }
.rack-caret::before, .rack-caret::after { content: ""; position: absolute; left: 50%; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--teal-bright); }
.rack-caret::before { top: -4px; } .rack-caret::after { bottom: -4px; }
.rack-caret.is-edge { width: 6px; margin-left: -3px; background: repeating-linear-gradient(180deg, var(--teal-bright) 0 6px, transparent 6px 10px); }
/* the grip on the right edge, like a window's */
.board-grip { position: absolute; right: -9px; top: 50%; width: 16px; height: 52px; margin-top: -26px; border-radius: 8px; z-index: 4; touch-action: none;
  background: #FFFDF9; border: 2px solid #D3C8B2; cursor: ew-resize; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  box-shadow: 0 4px 10px rgba(15,34,48,.25); opacity: .85; transition: opacity .15s ease, border-color .15s ease; }
.board-grip i { width: 4px; height: 4px; border-radius: 50%; background: #8A97A3; }
.board:hover .board-grip, .board-grip.is-on { opacity: 1; }
.board-grip:hover, .board-grip.is-on { border-color: var(--teal-bright); }
.board-grip:hover i, .board-grip.is-on i { background: var(--teal); }
@media (max-width: 767px), (max-height: 560px) { .board-grip { display: none; } }
.piece.is-block { border-color: #E0241B; box-shadow: 0 0 0 3px rgba(224,36,27,.3); }
/* grew by itself: a soft wobble, new slots pop in one after another */
.board.is-blob { animation: rack-blob .7s cubic-bezier(.3,1.5,.5,1) 1; }
@keyframes rack-blob {
  0% { border-radius: 14px; }
  30% { border-radius: 22px 40px 40px 22px / 22px 60px 60px 22px; transform: scaleY(.96); }
  55% { border-radius: 16px 26px 26px 16px / 16px 34px 34px 16px; transform: scaleY(1.02); }
  100% { border-radius: 14px; transform: none; }
}
.slot.is-born { animation: rack-born .55s cubic-bezier(.3,1.6,.5,1) both; }
@keyframes rack-born { 0% { transform: scale(.2); opacity: 0; border-radius: 50%; } 60% { opacity: 1; } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .board.is-blob, .slot.is-born { animation: none; } }

/* small screens: the seat label is the name and, on the right, the score — no pills, no count */
.seat-name .seat-total-sm { display: none; }
@media (max-width: 767px), (max-height: 560px) {
  .seat-pills, .seat-score, .seat-turn, .seat-name .seat-count { display: none; }
  .seat-name .seat-total-sm { display: inline; margin-left: 8px; font-family: var(--font-serif); font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
  .seat-name .seat-total-sm.neg { color: var(--error); }
  .seat-label { flex-direction: row; align-items: center; padding: 3px 8px; }
}
