/* Lost Cities: Roll & Write — page furniture from the Up and Down styles (jungle green), the sheet and dice at the end. */
:root {
  --felt-glow: #3d7a52; /* the glow at the top of the home page */
  --sheet: #13281c; /* pop-up window background */
  --felt: #1f4a30;
  --felt-dark: #0c1f14;
  --gold: #f5b700;
  --gold-deep: #c98a00;
  --ink: #1d1d1f;
  --paper: #fffdf6;
  --panel: rgba(8, 24, 14, 0.84);
  --text: #f4f1e8;
  --muted: #b9c8bf;
  --cw: 70px;
  --ch: 100px;
  --pw: 64px;
  --ph: 92px;
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

input { -webkit-user-select: text; user-select: text; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; }

/* ---------- shared bits ---------- */
#home, #lobby {
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  background: radial-gradient(ellipse at 50% 20%, var(--felt-glow) 0%, var(--felt) 40%, var(--felt-dark) 100%);
}
.home-wrap { max-width: 560px; margin: 0 auto; padding: 24px 16px 48px; }
.brand { text-align: center; margin: 8px 0 20px; }
.brand h1 { font-family: Georgia, "Times New Roman", serif; font-size: 44px; margin: 8px 0 0; letter-spacing: 1px; text-shadow: 0 3px 0 rgba(0,0,0,.3); }

.panel { background: var(--panel); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; padding: 16px; margin: 14px 0; box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.panel h2 { margin: 0 0 8px; font-size: 20px; display: flex; align-items: center; gap: 8px; }
.field { display: block; margin: 8px 0 4px; }
.field span { display: block; font-size: 14px; color: var(--muted); margin-bottom: 4px; }
.field input { width: 100%; font-size: 20px; padding: 12px 14px; border-radius: 12px; border: 2px solid rgba(255,255,255,.15); background: rgba(0,0,0,.3); color: var(--text); outline: none; }
.row { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

.btn { border: 0; border-radius: 12px; padding: 12px 18px; font-size: 17px; font-weight: 700; background: rgba(255,255,255,.12); }
.btn.gold:disabled { filter: grayscale(.8); opacity: .6; }
.btn.ghost { background: transparent; border: 2px solid rgba(255,255,255,.25); }
.btn.danger { background: #a3242f; }
.btn.small { padding: 8px 12px; font-size: 15px; }
.linkish { display: block; margin: 16px auto 0; background: none; border: 0; color: var(--gold); text-decoration: underline; font-size: 15px; }

.count-picker { display: flex; gap: 8px; margin: 8px 0 14px; }
.count-picker button { flex: 1; font-size: 22px; font-weight: 700; padding: 10px 0; border-radius: 12px; border: 2px solid rgba(255,255,255,.2); background: rgba(0,0,0,.25); }
.count-picker button.on { border-color: var(--gold); background: rgba(245,183,0,.2); color: var(--gold); }

.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4be08c; box-shadow: 0 0 8px #4be08c; animation: pulse 1.6s infinite; }
.game-list { display: flex; flex-direction: column; gap: 8px; }
.game-item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.06); }
.game-item .code { font-family: ui-monospace, Menlo, Consolas, monospace; background: rgba(0,0,0,.35); padding: 2px 6px; border-radius: 6px; font-size: 13px; margin-left: 6px; }

.code-row { display: flex; align-items: baseline; justify-content: space-between; }
.code-row strong { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 30px; color: var(--gold); letter-spacing: 4px; }
.seat-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; }
.seat-list li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: rgba(255,255,255,.06); }
.seat-list li.empty { opacity: .5; border: 2px dashed rgba(255,255,255,.2); background: transparent; }
.seat-list .tag { font-size: 12px; color: var(--muted); }

.avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: 18px; border: 2px solid rgba(255,255,255,.9); box-shadow: 0 2px 6px rgba(0,0,0,.4); flex: none; text-shadow: 0 1px 2px rgba(0,0,0,.4); }

/* ---------- table ---------- */
#table { overflow: hidden; touch-action: none; }
.felt {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255,255,255,.10), transparent 60%),
    repeating-radial-gradient(circle at 30% 30%, rgba(0,0,0,.025) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at 50% 40%, #8a5530 0%, var(--felt) 45%, var(--felt-dark) 100%);
}
.topbar { position: absolute; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: center; padding: 6px calc(10px + var(--safe-r)) 0 calc(10px + var(--safe-l)); z-index: 5; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.round-info { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 16px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.top-buttons { display: flex; gap: 6px; }
.icon-btn { height: 34px; min-width: 34px; padding: 0 8px; border-radius: 10px; border: 0; background: rgba(0,0,0,.35); font-size: 16px; display: flex; align-items: center; gap: 4px; }
.icon-btn span { font-size: 13px; font-weight: 700; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }

/* ---------- overlays ---------- */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.6); display: grid; place-items: center; padding: 12px; animation: fade .2s ease-out; }
.sheet.narrow { width: 420px; }
.sheet.wide { width: 900px; }
.sheet h2 { margin: 0 0 10px; font-family: Georgia, serif; }
.sheet .btn { margin-top: 8px; }
.sheet .btn.ghost, .sheet .btn.danger { width: 100%; }
.toggle { display: flex; gap: 10px; align-items: center; font-size: 15px; margin: 8px 0; }
.toggle input { width: 22px; height: 22px; }
.rules h3 { color: var(--text); margin: 0 0 4px; font-size: 15px; }
.rules p { margin: 4px 0; }
.claim-list { display: flex; flex-direction: column; gap: 8px; }
.claim-list button { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; border: 0; background: rgba(255,255,255,.08); font-size: 17px; font-weight: 700; text-align: left; }

.score-table-wrap { overflow-x: auto; }
table.scores { border-collapse: collapse; width: 100%; font-size: 14px; }
table.scores th, table.scores td { padding: 5px 8px; text-align: center; border-bottom: 1px solid rgba(255,255,255,.08); white-space: nowrap; }
table.scores th { font-size: 13px; }
table.scores td.rd { color: var(--muted); text-align: left; }
table.scores tr.current td { background: rgba(245,183,0,.12); }
table.scores tr.total td { font-weight: 900; font-size: 16px; border-top: 2px solid rgba(255,255,255,.3); }
table.scores td.zero { color: #4be08c; font-weight: 800; }
table.scores td.leader { color: var(--gold); }
table.scores .th-name { display: inline-flex; align-items: center; gap: 4px; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }

.result-row { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 12px; background: rgba(255,255,255,.05); margin-bottom: 6px; }
.result-row.out { background: rgba(245,183,0,.15); border: 1px solid rgba(245,183,0,.5); }
.result-row .who { width: 110px; flex: none; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.result-row .who .avatar { width: 28px; height: 28px; font-size: 13px; }
.result-row .cards { flex: 1; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.result-row .left { display: flex; gap: 3px; padding: 3px; border-radius: 6px; background: rgba(214,40,58,.25); outline: 1px dashed rgba(255,120,120,.6); }
.result-row .pts { width: 70px; text-align: right; font-weight: 900; font-size: 18px; }
.result-row .pts small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.winner-banner { text-align: center; font-size: 22px; margin: 4px 0 12px; }
.winner-banner .big { font-size: 48px; display: block; animation: float 1.4s ease-in-out infinite; }

/* go-out show */
.goout { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; background: radial-gradient(circle, rgba(245,183,0,.35), rgba(0,0,0,.85) 70%); animation: fade .25s ease-out; }
.goout canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.goout-inner { position: relative; text-align: center; }
.goout-crown { font-size: 22vh; line-height: 1; animation: crownDrop .9s cubic-bezier(.2,1.6,.4,1) both, float 1.6s ease-in-out .9s infinite; filter: drop-shadow(0 0 30px rgba(245,183,0,.9)); }
.goout-name { font-family: Georgia, serif; font-size: 11vh; font-weight: 900; color: #fff; text-shadow: 0 0 20px var(--gold), 0 4px 0 #8a5d00; animation: zoomIn .6s .3s cubic-bezier(.2,1.6,.4,1) both; }
.goout-sub { font-size: 7vh; font-weight: 900; letter-spacing: 6px; color: var(--gold); text-shadow: 0 3px 0 #5a3d00; animation: zoomIn .6s .55s cubic-bezier(.2,1.6,.4,1) both; }
.goout-note { margin-top: 10px; font-size: 3.2vh; color: #fff; opacity: .9; animation: fade .6s 1s both; }
.goout.shake { animation: shake .5s ease-in-out; }

.rotate { display: none; }
@media (orientation: portrait) {
  body.in-game .rotate { display: flex; position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; background: var(--felt-dark); font-size: 20px; text-align: center; padding: 24px; }
  .rotate-phone { font-size: 80px; animation: turn 2s ease-in-out infinite; }
}

.toast { position: fixed; left: 50%; top: 14px; transform: translateX(-50%); z-index: 90; background: #222; color: #fff; padding: 10px 16px; border-radius: 12px; font-weight: 700; box-shadow: 0 8px 20px rgba(0,0,0,.5); animation: rise .2s ease-out; max-width: 90vw; }

.your-turn-flash { position: absolute; inset: 0; z-index: 25; pointer-events: none; box-shadow: inset 0 0 60px 10px rgba(245,183,0,.7); animation: fadeOut 1.2s ease-out forwards; }

@keyframes glow { 0%,100% { box-shadow: 0 0 0 3px var(--gold), 0 0 10px 3px rgba(245,183,0,.6); } 50% { box-shadow: 0 0 0 3px var(--gold), 0 0 22px 8px rgba(245,183,0,.95); } }
@keyframes bob { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -4px); } }

/* ================= Lost Cities: Roll & Write ================= */
.felt {
  background:
    radial-gradient(ellipse at 50% 45%, rgba(255,255,255,.08), transparent 60%),
    repeating-radial-gradient(circle at 30% 30%, rgba(0,0,0,.03) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at 50% 40%, #2f6b45 0%, var(--felt) 45%, var(--felt-dark) 100%);
}
.lc-title { font-family: Georgia, "Times New Roman", serif; }
.lc-title em { display: block; font-family: Kalam, "Comic Sans MS", cursive; font-style: normal; font-size: .5em; color: var(--gold); letter-spacing: 1px; }
.brand-dice { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; }
.bdie { width: 42px; height: 42px; display: grid; place-items: center; background: #fffdf6; border-radius: 9px; box-shadow: 0 3px 0 #b9ad92, 0 6px 12px rgba(0,0,0,.35); }
.bdie:nth-child(odd) { transform: rotate(-8deg); } .bdie:nth-child(even) { transform: rotate(6deg); }
.bdie.num { background: none; box-shadow: none; }
.bdie.num svg { width: 40px; height: 44px; filter: drop-shadow(0 3px 3px rgba(0,0,0,.4)); }
.trump-pill { background: rgba(0,0,0,.35); padding: 3px 12px; border-radius: 999px; font-size: 15px; font-weight: 900; }

/* ---------- the table: players | sheet | dice ---------- */
#table { --cell: 30px; --die: 50px; --left: calc(104px + var(--safe-l)); --right: calc(min(220px, 27vw) + var(--safe-r)); }
.lc-players { position: absolute; left: 0; top: 42px; bottom: calc(4px + var(--safe-b)); width: var(--left); padding: 0 4px 0 calc(4px + var(--safe-l)); display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; z-index: 3; overflow-y: auto; touch-action: pan-y; }
.pchip { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 4px 6px; border-radius: 10px; border: 2px solid transparent; background: rgba(0,0,0,.32); text-align: left; width: 100%; flex: none; }
.pchip .pc-top { display: flex; align-items: center; gap: 5px; width: 100%; min-width: 0; }
.pchip .avatar { width: 22px; height: 22px; font-size: 11px; border-width: 1.5px; }
.pchip b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pchip .pc-score { font-size: 17px; font-weight: 900; line-height: 1; }
.pchip .pc-score small { font-size: 10px; color: var(--muted); font-weight: 600; }
.pchip .pc-sub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.pchip.me { background: rgba(0,0,0,.45); border-color: rgba(255,255,255,.18); }
.pchip.roller { border-color: var(--gold); }
.pchip.roller .pc-sub { color: var(--gold); font-weight: 700; }
.pchip.done .pc-sub { color: #8fe3a8; }
.pchip.flash { animation: chipFlash .7s ease-out; }
@keyframes chipFlash { 0% { background: rgba(245,183,0,.6); } 100% { background: rgba(0,0,0,.32); } }

.sheet-wrap { position: absolute; left: var(--left); right: var(--right); top: 40px; bottom: calc(2px + var(--safe-b)); display: grid; place-items: center; z-index: 2; }
.sheet-wrap > .hint { text-align: center; }

/* ---------- the sheet (paper) ---------- */
.lc-sheet {
  --c: var(--cell);
  display: grid; gap: 2px; padding: 5px 6px; border-radius: 10px;
  grid-template-columns: var(--c) repeat(3, var(--c)) calc(var(--c) * .25) repeat(3, var(--c)) calc(var(--c) * .8) repeat(3, var(--c)) var(--c) calc(var(--c) * 1.4);
  grid-auto-rows: var(--c);
  background: #f7f0dc linear-gradient(180deg, rgba(255,255,255,.4), rgba(0,0,0,.04));
  box-shadow: 0 10px 26px rgba(0,0,0,.45), inset 0 0 0 1px #d8cba8;
  color: #3b3020; font-size: calc(var(--c) * .42);
}
.lc-sheet.small { --c: 22px; }
.lc-sheet > .c { position: relative; display: grid; place-items: center; min-width: 0; }
.lc-sheet > .c svg { width: 72%; height: 72%; }
.lc-sheet > .hd { font-size: calc(var(--c) * .46); font-weight: 800; color: #6b5a3a; align-self: end; height: calc(var(--c) * .7); line-height: 1.1; }
.lc-sheet > .hd.neg { color: #b4473b; }
.lc-sheet > .hd i { font-style: normal; display: block; font-size: .7em; color: #9a8a6a; line-height: 1; }
.lc-sheet > .hd.br { color: #2f7fd0; }
.lc-sheet > .gaprow { grid-column: 1 / -1; height: calc(var(--c) * .2); }
/* rows 1 (header) + 6 expeditions + gap + 2 + footer */
.lc-sheet { grid-template-rows: calc(var(--c) * .7) repeat(6, var(--c)) calc(var(--c) * .2) repeat(2, var(--c)) calc(var(--c) * .95); }
.lc-sheet > .hd:nth-last-child(-n+14) { align-self: start; }

.lc-sheet .box { border-radius: 4px; border: 1.5px solid rgba(0,0,0,.18); }
.lc-sheet .c0 { --tint: #f2b4ab; --deep: #c94d3f; } .lc-sheet .c1 { --tint: #f8cfa0; --deep: #d97a22; }
.lc-sheet .c2 { --tint: #f6e7a2; --deep: #c49f12; } .lc-sheet .c3 { --tint: #c4e4b4; --deep: #4e9e3a; }
.lc-sheet .c4 { --tint: #bcd6f3; --deep: #2f7fd0; } .lc-sheet .c5 { --tint: #d8cbee; --deep: #8a4fc0; }
.lc-sheet .box { background: var(--tint); }
.lc-sheet .box svg { opacity: .85; width: 58%; height: 58%; }
.lc-sheet .box.b-arrow svg { opacity: .9; }
.lc-sheet .box.full svg { display: none; }
.lc-sheet .ink { font-family: Kalam, "Comic Sans MS", cursive; font-weight: 700; color: #1f4fbf; font-size: calc(var(--c) * .7); line-height: 1; transform: rotate(-4deg); }
.lc-sheet .dbl .ring { position: absolute; inset: 6%; border-radius: 50%; border: 2px solid var(--deep); background: rgba(255,255,255,.55); }
.lc-sheet .dbl svg { position: relative; width: 52%; height: 52%; }
.lc-sheet .dbl .x, .lc-sheet .pot .x { position: absolute; inset: 0; display: grid; place-items: center; font-family: Kalam, cursive; font-size: calc(var(--c) * .9); color: #1f4fbf; z-index: 1; line-height: 1; }
.lc-sheet .dbl .strike { position: absolute; left: 6%; right: 6%; top: 50%; height: 2.5px; background: #1f4fbf; transform: rotate(-35deg); border-radius: 2px; z-index: 1; }
.lc-sheet .pot { border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.7), var(--tint)); border: 1.5px dashed var(--deep); }
.lc-sheet .pot.done svg { opacity: .5; }
.lc-sheet .tot { font-weight: 900; font-size: calc(var(--c) * .48); }
.lc-sheet .tot.pos { color: #2b7a2f; } .lc-sheet .tot.neg { color: #b4473b; }
.lc-sheet .grand { font-family: Georgia, serif; font-variant-numeric: lining-nums; line-height: 1; font-size: calc(var(--c) * .62); color: #3b3020; background: #fff8; border-radius: 6px; border: 2px solid #8a7a5a; }
.lc-sheet .bridge span { width: 82%; aspect-ratio: 1; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: calc(var(--c) * .34); color: #6b5a3a; background: #fff8; border: 1.5px dotted #8a7a5a; }
.lc-sheet .bridge.won span { border: 2.5px solid #1f4fbf; color: #1f4fbf; background: #fff; box-shadow: 0 0 0 2px rgba(31,79,191,.2); }
.lc-sheet .bridge.lost span, .lc-sheet .bridge.gone span { opacity: .35; text-decoration: line-through; text-decoration-thickness: 2px; }
.lc-sheet .lbl svg { width: 70%; height: 70%; }
.lc-sheet .side { border-radius: 6px; background: rgba(0,0,0,.05); border: 1.5px solid rgba(0,0,0,.1); }
.lc-sheet .side svg { width: 66%; height: 66%; }
.lc-sheet .side .scribble { position: absolute; inset: 8%; width: 84%; height: 84%; opacity: .9; }
.lc-sheet .side.dice.last { border-color: #b4473b; }
.lc-sheet .sp, .lc-sheet .blank { pointer-events: none; }

/* pencilled (your choice before it's sent), new ink, and the expeditions an arrow can move */
.lc-sheet .ghost { box-shadow: 0 0 0 2.5px var(--gold), 0 0 12px rgba(245,183,0,.8); z-index: 1; animation: ghostPulse 1.1s ease-in-out infinite; }
.lc-sheet .ghost .ink, .lc-sheet .ghost .x, .lc-sheet .ghost .scribble, .lc-sheet .ghost .strike { opacity: .55; }
.lc-sheet .box.accel { cursor: pointer; background: repeating-linear-gradient(135deg, var(--tint) 0 5px, #fff6 5px 10px); }
.lc-sheet .fresh .ink, .lc-sheet .fresh .x, .lc-sheet .fresh .scribble { animation: inkPop .5s cubic-bezier(.2,1.6,.4,1); }
@keyframes ghostPulse { 50% { box-shadow: 0 0 0 2.5px var(--gold), 0 0 4px rgba(245,183,0,.4); } }
@keyframes inkPop { from { transform: scale(2.2) rotate(-12deg); opacity: 0; } }

/* ---------- right: dice, prompt, buttons ---------- */
.lc-right { position: absolute; right: 0; top: 42px; bottom: calc(4px + var(--safe-b)); width: var(--right); padding: 0 calc(6px + var(--safe-r)) 0 4px; display: flex; flex-direction: column; gap: 6px; z-index: 3; overflow-y: auto; touch-action: pan-y; }
.dice-tray { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 14px; background: rgba(0,0,0,.28); flex: none; }
.tray-row { display: flex; justify-content: space-around; gap: 4px; }
.die { position: relative; width: var(--die); height: var(--die); padding: 0; border: 0; border-radius: 10px; display: grid; place-items: center; background: #fffdf6; box-shadow: 0 3px 0 #b9ad92, 0 5px 10px rgba(0,0,0,.35); transition: transform .15s, opacity .2s; }
.die svg { width: 76%; height: 76%; }
.die.num { background: none; box-shadow: none; }
.die.num svg { width: 92%; height: 100%; filter: drop-shadow(0 3px 2px rgba(0,0,0,.4)); }
.die.sel { transform: translateY(-4px) scale(1.06); box-shadow: 0 0 0 3px var(--gold), 0 0 16px rgba(245,183,0,.9); }
.die.num.sel { box-shadow: none; filter: drop-shadow(0 0 6px var(--gold)) drop-shadow(0 0 3px var(--gold)); }
.die.off { opacity: .55; cursor: default; }
.die.taken { opacity: .3; filter: grayscale(.6); }
.die .tk { position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%); font-size: 9px; font-weight: 800; background: #222; color: #fff; padding: 0 4px; border-radius: 4px; }
.die.rolling { animation: tumble .16s linear infinite; }
@keyframes tumble { 0% { transform: rotate(0) translateY(0); } 50% { transform: rotate(14deg) translateY(-5px); } 100% { transform: rotate(0) translateY(0); } }
.lc-prompt { font-size: 14px; line-height: 1.3; padding: 2px 4px; text-shadow: 0 1px 2px rgba(0,0,0,.5); }
.lc-prompt .sw, table.scores .sw { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 3px; vertical-align: -1px; border: 1px solid rgba(255,255,255,.6); }
.lc-actions { display: flex; flex-direction: column; gap: 5px; }
.lc-actions .btn { padding: 8px 10px; font-size: 15px; width: 100%; }
.lc-actions .btn small { font-weight: 600; font-size: 12px; opacity: .85; }

/* ---------- everyone's sheets + the end ---------- */
.sheets-body { display: flex; flex-direction: column; gap: 12px; align-items: center; max-height: 76vh; overflow-y: auto; touch-action: pan-y; }
.sheet-card { display: flex; flex-direction: column; gap: 4px; }
.sc-name { display: flex; align-items: center; gap: 6px; }
.sc-name .avatar { width: 26px; height: 26px; font-size: 12px; }
#sheetsWin .sheet, #final .sheet { max-height: 94vh; overflow: auto; touch-action: pan-y; }
table.final-table td .avatar { width: 22px; height: 22px; font-size: 11px; display: inline-grid; vertical-align: middle; }

/* short screens */
@media (max-height: 360px) {
  .topbar { padding-top: 3px; }
  .icon-btn { height: 30px; min-width: 30px; }
  .round-info { font-size: 14px; }
  .trump-pill { font-size: 13px; padding: 2px 8px; }
  .lc-players, .lc-right { top: 36px; }
  .sheet-wrap { top: 34px; }
  .pchip .pc-score { font-size: 15px; }
  .lc-prompt { font-size: 13px; }
  .lc-actions .btn { padding: 6px 8px; font-size: 14px; }
}
@media (min-height: 500px) {
  .lc-sheet.small { --c: 28px; }
}

.back-link { display: inline-block; text-decoration: none; font-weight: 700; font-size: 15px; padding: 4px 0; }
.back-link:active { color: var(--gold); }
.linkbtn { display: block; text-align: center; text-decoration: none; box-sizing: border-box; margin-top: 8px; }

/* Shell pieces copied from ud.css: the history list, its delete button (🗑), the lobby's bot rows, confetti */
.celebrate { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 70; pointer-events: none; }
/* game history */
#historyBtn { margin-top: 4px; }
.win-tally { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.win-chip b { color: var(--gold); margin-left: 4px; }
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-item { background: rgba(255,255,255,.06); border-radius: 12px; overflow: hidden; }
.history-item.open { background: rgba(255,255,255,.1); }
.history-item.incomplete .hi-title { color: var(--muted); }
.hi-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; }
.hi-main { flex: 1; min-width: 0; }
.hi-date { font-size: 12px; color: var(--muted); }
.hi-title { font-size: 16px; margin: 2px 0; }
.hi-sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hi-del { border: 0; background: rgba(0,0,0,.25); border-radius: 10px; width: 36px; height: 36px; font-size: 16px; flex: none; }
.hi-detail { padding: 0 12px 12px; overflow-x: auto; }
.seat-list li.can-bot { flex-wrap: wrap; }
.bot-tag { font-size: 12px; font-weight: 700; color: var(--muted); margin-left: 4px; }

/* Holding a player's name shows their sheet in place of yours */
.pchip { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; touch-action: pan-y; }
.pchip.peeking { border-color: #fff; background: rgba(255,255,255,.22); }
.peek-wrap { position: relative; }
.peek-wrap .lc-sheet { box-shadow: 0 0 0 4px #fff, 0 10px 26px rgba(0,0,0,.45); }
.peek-tag { position: absolute; left: 50%; top: 0; transform: translate(-50%, -60%); z-index: 3; display: flex; align-items: center; gap: 6px; padding: 3px 12px 3px 4px; border-radius: 999px; background: #fff; color: #222; white-space: nowrap; box-shadow: 0 4px 12px rgba(0,0,0,.4); }
.peek-tag .avatar { width: 24px; height: 24px; font-size: 11px; }
.peek-tag small { color: #777; font-size: 11px; }
