/* 텍사스 홀덤 헤즈업 — 위가 AI, 가운데가 보드/팟, 아래가 나. 조작은 화면 맨 아래. */
* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0; height: 100%; overflow: hidden;
  background: #0a0a0a; color: #f5f5f5;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}
main {
  height: 100%; max-width: 480px; margin: 0 auto;
  display: flex; flex-direction: column; gap: 9px;
  padding: max(60px, env(safe-area-inset-top)) 10px max(14px, env(safe-area-inset-bottom));
}
.score-bar { display: flex; gap: 6px; align-items: stretch; flex: 0 0 auto; }
.score-box {
  flex: 1; background: #161616; border: 1px solid #2a2a2a; border-radius: 12px;
  padding: 6px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-width: 0;
}
.score-label { font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase; color: #a0a0a0; }
.score-val, .best-val { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.new-btn {
  flex: 0 0 auto; font: inherit; color: #0a0a0a; background: #4f9eff; border: none;
  border-radius: 12px; padding: 0 14px; min-height: 56px; cursor: pointer;
  font-weight: 700; font-size: 14px;
}
.new-btn:active { background: #3d8ae8; }

/* ── 테이블 ─────────────────────────────────────────────────────────────── */
.table {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(120% 70% at 50% 45%, #17402c 0%, #102a1e 55%, #0c1a13 100%);
  border: 1px solid #24382c; border-radius: 18px; padding: 10px 8px;
}
.seat { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.seat-info { display: flex; align-items: baseline; gap: 8px; }
.seat-name { font-size: 11px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: #9fc0ac; }
.stack { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
.cards { display: flex; gap: 5px; justify-content: center; }
.bet {
  min-height: 17px; font-size: 12px; font-weight: 800; color: #ffd479;
  font-variant-numeric: tabular-nums;
}

.middle { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.pot-row { display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; justify-content: center; }
.pot-label, .blinds-label { font-size: 10px; letter-spacing: 0.05em; text-transform: uppercase; color: #8fae9c; }
.pot-val { font-size: 21px; font-weight: 800; font-variant-numeric: tabular-nums; }
.blinds-val { font-size: 13px; font-weight: 700; color: #cfe3d7; font-variant-numeric: tabular-nums; }

/* ── 카드 ───────────────────────────────────────────────────────────────── */
.pcard {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  width: 40px; height: 56px; border-radius: 6px; background: #f7f4ec;
  border: 1px solid #cfc9b8; line-height: 1; user-select: none;
}
.pcard .pr { font-size: 16px; font-weight: 800; }
.pcard .ps { font-size: 14px; margin-top: 2px; }
.pcard.blk { color: #16181d; }
.pcard.red { color: #c0182c; }
.pcard.big { width: 50px; height: 70px; }
.pcard.big .pr { font-size: 20px; }
.pcard.big .ps { font-size: 18px; }
.pcard.back {
  background: repeating-linear-gradient(45deg, #2c4a6b 0 5px, #22405f 5px 10px);
  border-color: #3a5c80;
}
.pcard.slot { background: rgba(255,255,255,0.05); border: 1px dashed rgba(255,255,255,0.18); }

.status { margin: 0; text-align: center; font-size: 13px; font-weight: 700; color: #a0a0a0; min-height: 19px; flex: 0 0 auto; }
.status.ok { color: #52d97f; }
.status.bad { color: #ff8a8a; }

/* ── 조작 ───────────────────────────────────────────────────────────────── */
.pad { flex: 0 0 auto; display: flex; flex-direction: column; gap: 7px; }
.pad[hidden] { display: none; }
.pad-row { display: flex; gap: 7px; }
.pbtn {
  flex: 1; font: inherit; font-weight: 800; font-size: 15px;
  color: #0a0a0a; background: #4f9eff; border: none; border-radius: 12px;
  min-height: 52px; cursor: pointer;
}
.pbtn:active { background: #3d8ae8; }
.pbtn:disabled { background: #33383f; color: #7f868e; cursor: default; }
.fold-btn { background: #e2685c; }
.fold-btn:active { background: #cc5a4f; }
.pbtn.raise { background: #ffc24d; }
.pbtn.raise:active { background: #e8ad3d; }
.next-btn { width: 100%; flex: 0 0 auto; }
.next-btn[hidden] { display: none; }

.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; border: none; cursor: pointer;
  font-family: inherit; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.home-link { left: max(12px, env(safe-area-inset-left)); }
.hof-link { right: max(12px, env(safe-area-inset-right)); }

.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; }
.overlay-score { margin: 0; font-size: 34px; font-weight: 800; font-variant-numeric: tabular-nums; }
.overlay-sub { margin: -4px 0 0; font-size: 14px; font-weight: 600; color: #a0a0a0; }
.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%;
}
.overlay-card button:active { background: rgba(255,255,255,0.18); }
.overlay-card .save-btn { background: #4f9eff; border-color: #4f9eff; color: #0a0a0a; }
