:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
  touch-action: manipulation;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100dvh;
  overflow: hidden;
  background: #0a0a0a;
  color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
}

main {
  height: 100%;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding:
    max(60px, env(safe-area-inset-top))
    16px
    max(20px, env(safe-area-inset-bottom));
  gap: 16px;
}

/* 점수바: SCORE | BEST | New 버튼 */
.score-bar {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.score-box {
  flex: 1;
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  padding: 8px 12px;
  text-align: center;
  min-width: 0;
}

.score-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #a0a0a0;
}

.score-val,
.best-val {
  display: block;
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #f5f5f5;
  margin-top: 2px;
  line-height: 1.1;
}

.new-btn {
  flex: 0 0 auto;
  font: inherit;
  color: #fff;
  background: #4f9eff;
  border: none;
  border-radius: 12px;
  padding: 0 18px;
  min-height: 56px;
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
  -webkit-tap-highlight-color: transparent;
}

.new-btn:active { background: #3d8ae8; }

/* 게임 영역 — 보드/캠버스/그리드 등을 여기에 */
#game {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;   /* 작은 폰에서 아래 조작 요소가 화면 밖으로 밀리지 않게 */
}

/* 좌상단 ← 홈, 우상단 🏆 명예의 전당 — 모든 게임 공통 chrome */
.home-link,
.hof-link {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  z-index: 10;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  text-decoration: none;
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.15s ease;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.home-link { left:  max(12px, env(safe-area-inset-left)); }
.hof-link  { right: max(12px, env(safe-area-inset-right)); }

@media (hover: hover) {
  .home-link:hover,
  .hof-link:hover {
    background: rgba(0, 0, 0, 0.55);
  }
}

/* 오버레이 (게임 종료 / 완료 시 점수 + 저장 버튼) */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
  padding: 20px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.overlay[hidden] { display: none; }

.overlay-card {
  background: #161616;
  border: 1px solid #2a2a2a;
  border-radius: 18px;
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  text-align: center;
  min-width: 240px;
  max-width: 320px;
  width: 100%;
}

.overlay-card h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.overlay-score {
  margin: 0;
  font-size: 56px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

.overlay-card button {
  font: inherit;
  color: #fff;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 12px 20px;
  min-height: 44px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.overlay-card button:active {
  background: rgba(255, 255, 255, 0.18);
}

.overlay-card .save-btn {
  background: #4f9eff;
  border-color: #4f9eff;
}

.overlay-card .save-btn:active {
  background: #3d8ae8;
}

/* ─── Pinochle ─────────────────────────────────────────────────────────
   Top to bottom: rival row (name · level · cards left · melded cards on show) · felt table (stock with
   the face-up trump card, the trick, banners, meld panel) · totals bar · status line · your hand. */
main { gap: 8px; }
.score-bar .new-btn { min-height: 52px; }
.score-box { padding: 6px 10px; }

#game {
  position: relative;
  flex: 1; min-height: 0;
  flex-direction: column; align-items: stretch; justify-content: flex-start;
  gap: 6px;
  --cw: clamp(42px, min(19vw, 9.6dvh), 88px);
  --ch: calc(var(--cw) * 1.42);
}

/* rival row */
.pn-opp { display: flex; align-items: center; gap: 8px; min-height: 38px; }
.pn-name {
  font-size: 12px; font-weight: 800; white-space: nowrap;
  padding: 5px 10px; border-radius: 999px;
  background: #1b1d24; color: #ffd3d3; border: 2px solid rgba(255,143,143,.5);
  transition: background .2s, box-shadow .2s;
}
.pn-name .pn-lv { color: #c9cbd3; font-weight: 700; }
.pn-name.turn { background: #f2c14e; color: #1b1d24; border-color: #f2c14e; box-shadow: 0 0 12px rgba(242,193,78,.7); }
.pn-name.turn .pn-lv { color: #4a3b0a; }
.pn-backs { position: relative; flex: 0 0 auto; width: 30px; height: 36px; }
.pn-backs i {
  position: absolute; left: 0; top: 2px; width: 22px; height: 31px; border-radius: 4px;
  background:
    radial-gradient(circle at 50% 50%, #f2c14e 0 2px, transparent 2.5px),
    repeating-linear-gradient(45deg, #2b4a8a 0 2px, #1d3566 2px 4px);
  border: 1.5px solid #eef1f7; box-shadow: 3px -2px 0 -1px #1d3566, 3px -2px 0 0 #eef1f7, 0 1px 3px rgba(0,0,0,.5);
}
.pn-backs b {
  position: absolute; right: -2px; bottom: -1px; z-index: 2;
  font-size: 11px; font-weight: 900; color: #1b1d24; background: #eef1f7; border-radius: 999px;
  min-width: 18px; padding: 0 4px; text-align: center; line-height: 16px;
}
.pn-known { display: flex; flex: 1; min-width: 0; justify-content: flex-end; }
.pn-known .pn-card + .pn-card { margin-left: -9px; }

/* cards */
.pn-card {
  position: relative; display: block;
  background: linear-gradient(#ffffff, #eef0f4);
  border: 1px solid #b9bfcc; border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0,0,0,.45);
  font-family: inherit; padding: 0; color: #1c1f2a; overflow: hidden;
  --ink: #1c1f2a;
}
.pn-card.red { --ink: #c8283a; }
.pn-card svg { fill: var(--ink); }
.pn-rank {
  position: absolute; left: 4px; top: 3px; font-weight: 900; line-height: 1; color: var(--ink);
  font-size: calc(var(--w) * 0.3); letter-spacing: -0.06em;
}
.pn-suit.idx { position: absolute; left: 4px; top: calc(var(--w) * 0.33); width: calc(var(--w) * 0.22); height: calc(var(--w) * 0.22); }
.pn-suit.big { position: absolute; left: 58%; top: 58%; width: 54%; height: 54%; transform: translate(-50%, -50%); }
/* court cards: gold frame with a large letter, small suit underneath */
.pn-card.court::after {
  content: ''; position: absolute; left: 32%; right: 7%; top: 9%; bottom: 7%; border-radius: 5px;
  background: linear-gradient(160deg, #fff6d8, #f3dc94); border: 1.5px solid #c99a2e; z-index: 0;
}
.pn-face {
  position: absolute; left: 32%; right: 7%; top: 12%; z-index: 1; text-align: center; font-style: normal;
  font-family: Georgia, "Times New Roman", serif; font-weight: 700; color: var(--ink);
  font-size: calc(var(--w) * 0.42); line-height: 1.05;
}
.pn-card.court .pn-suit.big { z-index: 1; left: 59%; top: 72%; width: 34%; height: 34%; }
.pn-card u {
  position: absolute; left: 3px; top: calc(var(--w) * 0.6); z-index: 2; text-decoration: none;
  font-size: calc(var(--w) * 0.17); font-weight: 900; color: #3a2a00;
  background: #f2c14e; border-radius: 6px; padding: 0 3px; line-height: 1.25;
}
.pn-card.mini { --w: 24px; width: 24px; height: 34px; border-radius: 4px; flex: 0 0 auto; box-shadow: 0 0 0 1.5px #f2c14e, 0 2px 4px rgba(0,0,0,.5); }
.pn-card.mini .pn-rank { left: 2px; top: 2px; font-size: 11px; }
.pn-card.mini .pn-suit.idx, .pn-card.mini u, .pn-card.mini .pn-face, .pn-card.mini.court::after { display: none; }
.pn-card.mini .pn-suit.big, .pn-card.mini.court .pn-suit.big { left: 55%; top: 66%; width: 62%; height: 50%; }
svg.pn-suit { display: inline-block; }
svg.pn-suit.inl { width: 1.1em; height: 1.1em; vertical-align: -0.18em; fill: currentColor; }

/* felt table */
.pn-table {
  position: relative; flex: 1; min-height: 0;
  border-radius: 22px;
  background:
    radial-gradient(ellipse at 55% 45%, rgba(255,255,255,.09), transparent 62%),
    repeating-linear-gradient(-45deg, rgba(0,0,0,.035) 0 2px, transparent 2px 5px),
    #17485f;
  border: 5px solid #5a3a22;
  box-shadow: inset 0 0 0 2px #8a6038, inset 0 6px 22px rgba(0,0,0,.45), 0 4px 14px rgba(0,0,0,.45);
  overflow: hidden;
}
.pn-stock { position: absolute; left: 10px; top: 50%; transform: translateY(-42%); width: calc(var(--cw) * 1.7); height: calc(var(--ch) + 8px); }
.pn-up { position: absolute; left: 0; top: 0; transform: rotate(-8deg); transform-origin: 50% 80%; }
.pn-stock.gone .pn-up { left: 0; top: calc(var(--ch) / 2); transform: translateY(-50%); }
.pn-card.upc { --w: var(--cw); width: var(--cw); height: var(--ch); }
.pn-pile { position: absolute; left: calc(var(--cw) * 0.68); top: 4px; width: var(--cw); height: var(--ch); z-index: 2; }
.pn-pile[hidden] { display: none; }
.pn-pile i {
  position: absolute; inset: 0; border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, #f2c14e 0 4px, #1d3566 4.5px 7px, transparent 7.5px),
    repeating-linear-gradient(45deg, #2b4a8a 0 3px, #1d3566 3px 6px);
  border: 2px solid #eef1f7; box-shadow: 0 2px 4px rgba(0,0,0,.5);
}
.pn-pile i:nth-child(2) { transform: translate(-2px, -2px); }
.pn-pile i:nth-child(3) { transform: translate(-4px, -4px); }
.pn-left {
  position: absolute; left: 50%; top: 50%; transform: translate(-60%, -60%); z-index: 4;
  font-size: 13px; font-weight: 900; color: #1b1d24; background: #eef1f7; border-radius: 999px; padding: 2px 7px;
}
.pn-po {
  display: inline-block; font-size: 12px; font-weight: 900; letter-spacing: .06em; text-transform: uppercase;
  color: #f2c14e; background: rgba(0,0,0,.35); padding: 4px 8px; border-radius: 8px; white-space: nowrap;
}
.pn-trump {
  position: absolute; left: 10px; top: 10px; z-index: 3;
  display: inline-flex; flex-direction: column; align-items: flex-start;
  background: #eef1f7; color: #1c1f2a; border-radius: 10px; padding: 3px 8px 4px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.pn-trump em { font-style: normal; font-size: 9px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #5a5d66; }
.pn-tsuit { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; }
.pn-tsuit svg { width: 16px; height: 16px; fill: #1c1f2a; }
.pn-trump.red .pn-tsuit { color: #b21f31; } .pn-trump.red .pn-tsuit svg { fill: #c8283a; }
.pn-trump.flash { animation: pn-flash 1.2s ease-out; }
@keyframes pn-flash { 0%,40% { transform: scale(1.2); box-shadow: 0 0 0 4px #f2c14e, 0 2px 6px rgba(0,0,0,.4); } 100% { transform: none; } }
.pn-sheet-btn {
  position: absolute; right: 8px; top: 8px; z-index: 3;
  font: inherit; font-size: 12px; font-weight: 800; color: #eef1f7; min-height: 32px; padding: 0 12px;
  background: rgba(0,0,0,.32); border: 1px solid rgba(255,255,255,.28); border-radius: 999px; cursor: pointer;
}
.pn-sheet-btn::before { content: '★ '; color: #f2c14e; }

.pn-mark { position: absolute; left: 58%; top: 52%; width: calc(var(--ch) * 1.8); height: calc(var(--ch) * 1.8); transform: translate(-50%, -50%); opacity: .07; pointer-events: none; }
.pn-mark svg { width: 100%; height: 100%; fill: #eef1f7; }
/* trick */
.pn-trick { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.pn-slot { position: absolute; left: calc(50% + var(--cw) * 0.62); top: 52%; width: var(--cw); height: var(--ch); margin: calc(var(--ch) / -2) 0 0 calc(var(--cw) / -2); }
.pn-slot.opp { transform: translate(calc(var(--cw) * -0.34), calc(var(--ch) * -0.34)) rotate(-6deg); }
.pn-slot.me { transform: translate(calc(var(--cw) * 0.34), calc(var(--ch) * 0.34)) rotate(5deg); }
.pn-card.tbl { --w: var(--cw); width: 100%; height: 100%; transition: transform .32s cubic-bezier(.2,.8,.25,1), opacity .25s; }
.pn-card.tbl.sweep { transition: transform .34s ease-in, opacity .34s ease-in; }
.pn-slot.win { z-index: 5; }
.pn-slot.win .pn-card { box-shadow: 0 0 0 3px #f2c14e, 0 0 18px rgba(242,193,78,.8); }
.pn-slot.win::after {
  content: attr(data-pts); position: absolute; left: 50%; top: -13px; transform: translateX(-50%); z-index: 6;
  font-size: 13px; font-weight: 900; color: #1b1d24; background: #f2c14e; border-radius: 999px; padding: 1px 7px; white-space: nowrap;
}
.pn-slot.win[data-pts=""]::after { display: none; }

/* banner (melds, playoff, last trick) */
.pn-banner {
  position: absolute; left: 50%; top: 46px; transform: translate(-50%, -8px); z-index: 7;
  width: max-content; max-width: calc(100% - 20px); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 13px; font-weight: 800; line-height: 1.3;
  padding: 7px 12px; border-radius: 12px; background: #eef1f7; color: #1c1f2a;
  box-shadow: 0 6px 18px rgba(0,0,0,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.pn-banner.show { opacity: 1; transform: translate(-50%, 0); }
.pn-banner.good { box-shadow: 0 0 0 3px #6fd3a2, 0 6px 18px rgba(0,0,0,.5); }
.pn-banner.bad { box-shadow: 0 0 0 3px #ff8f8f, 0 6px 18px rgba(0,0,0,.5); }
.pn-banner.info { box-shadow: 0 0 0 3px #f2c14e, 0 6px 18px rgba(0,0,0,.5); }
.pn-banner b { font-size: 15px; letter-spacing: -0.01em; }
.pn-banner small { font-size: 12px; font-weight: 700; color: #4a4d58; }
.pn-bcards { display: flex; gap: 3px; flex-wrap: wrap; justify-content: center; }
.pn-bcards .pn-card.mini { box-shadow: 0 1px 3px rgba(0,0,0,.45); }
.pn-banner.big.show { animation: pn-pop .5s ease-out; }
@keyframes pn-pop { 0% { transform: translate(-50%, 0) scale(.6); } 60% { transform: translate(-50%, 0) scale(1.08); } 100% { transform: translate(-50%, 0) scale(1); } }

/* meld panel */
.pn-decl {
  position: absolute; left: 6px; right: 6px; bottom: 6px; z-index: 8;
  background: rgba(10, 24, 34, .94); border: 2px solid #f2c14e; border-radius: 14px;
  padding: 7px; box-shadow: 0 6px 20px rgba(0,0,0,.55);
  max-height: calc(100% - 12px); overflow-y: auto;
  animation: pn-rise .25s ease-out;
}
.pn-decl[hidden] { display: none; }
@keyframes pn-rise { from { transform: translateY(14px); opacity: 0; } }
.pn-decl-t { margin: 0 0 6px; font-size: 12px; font-weight: 800; color: #f2c14e; text-align: center; line-height: 1.25; }
.pn-decl-b { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pn-act {
  font: inherit; font-size: 13px; font-weight: 800; min-height: 40px; padding: 4px 12px;
  border-radius: 12px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.1); color: #fff; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px; text-align: left;
}
.pn-act.meld { background: #eef1f7; color: #1c1f2a; border-color: #eef1f7; flex-wrap: wrap; column-gap: 6px; row-gap: 0; }
.pn-act.meld.mid { box-shadow: 0 0 0 2px #f2c14e; }
.pn-act.meld.big { background: #f2c14e; border-color: #f2c14e; animation: pn-glow 1s ease-in-out infinite alternate; }
@keyframes pn-glow { to { box-shadow: 0 0 0 4px rgba(242,193,78,.3), 0 0 14px rgba(242,193,78,.6); } }
.pn-act-c { font-size: 12px; font-weight: 700; color: #3c404c; white-space: nowrap; }
.pn-act-c .red { color: #c8283a; }
.pn-act b { font-size: 14px; color: #0f6a3e; }
.pn-act.draw { background: #1b1d24; }
.pn-act:active { filter: brightness(1.15); }

/* totals bar */
.pn-pts { display: flex; align-items: center; gap: 8px; min-height: 22px; }
.pn-p { display: inline-flex; align-items: baseline; gap: 5px; font-variant-numeric: tabular-nums; transition: transform .2s; }
.pn-p em { font-style: normal; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #a9adb8; }
.pn-p b { font-size: 18px; font-weight: 900; min-width: 2ch; }
.pn-p small { font-size: 11px; font-weight: 800; color: #f2c14e; }
.pn-p.me b { color: #6fd3a2; } .pn-p.ai b { color: #ff8f8f; text-align: right; }
.pn-p.bump { transform: scale(1.22); }
.pn-bar { flex: 1; position: relative; height: 8px; border-radius: 4px; background: #23262f; overflow: hidden; }
.pn-bar::after { content: ''; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 2px; background: #eef1f7; opacity: .7; }
.pn-bar i { position: absolute; inset: 0; background:
  linear-gradient(90deg, #2fae74 0 var(--me, 0%), transparent var(--me, 0%) calc(100% - var(--ai, 0%)), #d9485b calc(100% - var(--ai, 0%)));
}

.pn-msg { margin: 0; min-height: 20px; text-align: center; font-size: 13px; font-weight: 700; color: #c9cbd3; line-height: 1.25; }
.pn-msg.me { color: #f2c14e; }
.pn-msg.ok { color: #6fd3a2; } .pn-msg.bad { color: #ff8f8f; }
.pn-msg.nudge { animation: pn-nudge .35s; }
@keyframes pn-nudge { 30% { transform: translateX(-4px); } 60% { transform: translateX(4px); } }

/* hand: one fanned row, or two rows on narrow screens — positions set by game.js */
.pn-hand {
  position: relative; flex: 0 0 auto;
  height: clamp(100px, 21dvh, 190px);
}
.pn-hand .pn-card {
  --w: var(--hw, 56px);
  position: absolute; width: var(--hw, 56px); height: calc(var(--hw, 56px) * 1.42);
  cursor: pointer;
  transition: transform .15s, filter .15s, left .25s, top .25s;
  -webkit-tap-highlight-color: transparent;
}
.pn-hand .pn-card.tr { background: linear-gradient(#fffaf0, #f6e7bf); }
.pn-hand .pn-card.shown { box-shadow: inset 0 0 0 2px #f2c14e, 0 2px 5px rgba(0,0,0,.45); }
.pn-hand .pn-card.shown::before {
  content: '★'; position: absolute; left: 4px; top: calc(var(--w) * 0.84); z-index: 3; font-size: calc(var(--w) * 0.2); color: #c99a2e; line-height: 1;
}
.pn-hand.my-turn .pn-card.ok { transform: translateY(-5px); box-shadow: 0 0 0 2px #f2c14e, 0 4px 10px rgba(0,0,0,.5); }
.pn-hand.my-turn .pn-card.must { box-shadow: 0 0 0 3px #f2c14e, 0 4px 12px rgba(242,193,78,.5); }
.pn-hand.my-turn .pn-card.ok:active { transform: translateY(-1px) scale(.97); }
.pn-hand .pn-card.no { filter: brightness(.5) saturate(.6); }
.pn-hand .pn-card.idle { filter: brightness(.9); }
.pn-hand .pn-card.dealt { animation: pn-deal .4s backwards; animation-delay: calc(var(--i) * 40ms); }
.pn-hand .pn-card.drawn { animation: pn-drawn .45s backwards; }
@keyframes pn-deal { from { transform: translateY(-60px) scale(.6); opacity: 0; } }
@keyframes pn-drawn { from { transform: translate(-60px, -90px) scale(.5) rotate(-20deg); opacity: 0; } }
.pn-hand .pn-card.shake { animation: pn-shake .3s; }
@keyframes pn-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* meld cheat sheet */
.pn-sheet {
  position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.6);
  display: flex; align-items: center; justify-content: center;
  padding: max(64px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
}
.pn-sheet[hidden] { display: none; }
.pn-sheet-card {
  background: #161616; border: 1px solid #2a2a2a; border-radius: 16px; padding: 14px 14px 12px;
  width: 100%; max-width: 360px; max-height: 100%; overflow-y: auto; overscroll-behavior: contain; touch-action: pan-y;
  display: flex; flex-direction: column; gap: 8px;
}
.pn-sheet-card h3 { margin: 0; font-size: 18px; text-align: center; }
.pn-sheet-card table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 13px; background: #1e2028; border-radius: 10px; overflow: hidden; }
.pn-sheet-card th { text-align: left; padding: 4px 8px; font-weight: 800; color: #eef1f7; width: 36%; }
.pn-sheet-card td.n { width: 3.2em; }
.pn-sheet-card td { padding: 4px 6px; color: #c9cbd3; }
.pn-sheet-card td.n { text-align: right; font-weight: 900; color: #f2c14e; font-variant-numeric: tabular-nums; }
.pn-sheet-card p { margin: 0; font-size: 12px; line-height: 1.4; color: #a9adb8; }
.pn-sheet-close {
  font: inherit; font-weight: 800; color: #fff; min-height: 44px; border-radius: 999px; cursor: pointer;
  background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.22);
}

/* start + result cards */
.pn-intro h2 { font-size: 26px; display: flex; align-items: center; gap: 8px; }
.pn-intro-suits { display: inline-flex; gap: 2px; font-size: 18px; color: #eef1f7; }
.pn-intro-suits .red { color: #ff6b7a; }
.pn-rules { margin: 0; padding: 0 0 0 18px; text-align: left; font-size: 14px; line-height: 1.42; color: #d5d7de; display: flex; flex-direction: column; gap: 5px; }
.pn-note { margin: 0; font-size: 13px; color: #a9adb8; }
.overlay-card .start-btn { background: #f2c14e; border-color: #f2c14e; color: #1b1d24; font-weight: 800; font-size: 16px; }
.overlay-sub { margin: 0; font-size: 14px; color: #c9cbd3; }
.pn-line { font-size: 12px; color: #a9adb8; }
.pn-cap { margin: -6px 0 0; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #a9adb8; }
.pn-result.won h2 { color: #6fd3a2; } .pn-result.lost h2 { color: #ff8f8f; } .pn-result.drawn h2 { color: #f2c14e; }
.pn-sum { border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; width: 100%; }
.pn-sum th, .pn-sum td { padding: 3px 6px; text-align: right; }
.pn-sum th:first-child { text-align: left; color: #a9adb8; font-weight: 700; }
.pn-sum thead th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: #a9adb8; }
.pn-sum tr.tot td, .pn-sum tr.tot th { border-top: 1px solid #2a2a2a; font-weight: 900; font-size: 15px; color: #fff; }

@media (max-height: 620px) {
  .pn-rules { font-size: 13px; gap: 3px; }
  .pn-opp { min-height: 34px; }
  .overlay { padding-top: 58px; padding-bottom: 10px; }
  .overlay-card { padding: 14px 16px; gap: 7px; }
  .overlay-card .overlay-score { font-size: 38px; }
  .pn-sum th, .pn-sum td { padding: 1px 6px; }
  .overlay-card button { min-height: 40px; padding: 8px 16px; }
  .pn-act { min-height: 36px; }
  .pn-banner { top: 40px; }
}
