:root {
  --felt: #0b3d2e;
  --felt-deep: #07261c;
  --gold: #e4c06a;
  --gold-bright: #f5d887;
  --ink: #f6efe4;
  --muted: #c9d5cc;
  --red: #d94334;
  --line: rgba(228, 192, 106, 0.45);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: radial-gradient(circle at 50% 22%, #15654a, var(--felt-deep) 68%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
#shared-playground-header {
  position: sticky;
  top: 0;
  z-index: 1100;
}
#shared-playground-header .playground-site-header .navbar {
  background: rgba(6, 32, 23, 0.94) !important;
  border-bottom: 1px solid rgba(228, 192, 106, 0.25) !important;
  backdrop-filter: blur(10px);
}
#shared-playground-header .container-fluid {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#shared-playground-header .navbar-brand {
  color: var(--gold-bright) !important;
  text-decoration: none;
  font-weight: 800;
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
#shared-playground-header .navbar-brand:hover,
#shared-playground-header .navbar-brand:focus-visible {
  color: #fff !important;
}
#shared-playground-header .navbar-toggler {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(228, 192, 106, 0.35) !important;
  border-radius: 8px;
  color: var(--gold-bright);
}
#shared-playground-header .navbar-toggler-icon {
  display: inline-block;
  width: 18px;
  height: 2px;
  background: var(--gold-bright);
  position: relative;
  border-radius: 2px;
}
#shared-playground-header .navbar-toggler-icon::before,
#shared-playground-header .navbar-toggler-icon::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: var(--gold-bright);
  border-radius: 2px;
}
#shared-playground-header .navbar-toggler-icon::before { top: -6px; }
#shared-playground-header .navbar-toggler-icon::after { top: 6px; }
#shared-playground-header .navbar-collapse {
  width: 100%;
  display: none;
}
#shared-playground-header .navbar-collapse.show {
  display: block;
}
#shared-playground-header .navbar-nav {
  list-style: none;
  margin: 6px 0 2px;
  padding: 6px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#shared-playground-header .nav-link {
  display: block;
  padding: 8px 10px;
  color: var(--ink) !important;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
#shared-playground-header .nav-link:hover,
#shared-playground-header .nav-link:focus-visible {
  background: rgba(228, 192, 106, 0.16);
  color: var(--gold-bright) !important;
}
#shared-playground-header > div.bg-white {
  background: rgba(6, 32, 23, 0.94) !important;
  border-bottom: 1px solid rgba(228, 192, 106, 0.25) !important;
  padding: 8px 14px;
}
#shared-playground-header > div.bg-white a {
  color: var(--gold-bright) !important;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
@media (min-width: 640px) {
  #shared-playground-header .navbar-toggler {
    display: none;
  }
  #shared-playground-header .navbar-collapse,
  #shared-playground-header .navbar-collapse.show {
    width: auto;
    display: block;
  }
  #shared-playground-header .navbar-nav {
    margin: 0;
    padding: 0;
    border-top: 0;
    flex-direction: row;
    align-items: center;
    gap: 6px;
  }
  #shared-playground-header .nav-link {
    padding: 6px 12px;
  }
}
button, [role="button"], input[type="range"] {
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
}
.app {
  min-height: calc(100dvh - var(--playground-header-height, 0px));
  max-width: 520px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--safe-b);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 12px 0;
}
.title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar h1 { font-size: 18px; margin: 0; letter-spacing: 0.04em; }
.blinds-badge {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(228, 192, 106, 0.3);
  border-radius: 999px;
  padding: 2px 8px;
}
.ghost, .primary, .danger, .gold {
  border: 0;
  border-radius: 12px;
  min-height: 44px;
  padding: 0 12px;
  font: inherit;
  font-weight: 700;
  transition: transform 0.1s ease, filter 0.15s ease, opacity 0.15s ease;
}
.btn-sm {
  min-height: 36px;
  padding: 0 12px;
  font-size: 14px;
}
.ghost:active:not(:disabled),
.primary:active:not(:disabled),
.danger:active:not(:disabled),
.gold:active:not(:disabled) {
  transform: scale(0.97);
}
.ghost { background: rgba(0, 0, 0, 0.2); color: var(--gold); border: 1px solid var(--line); }
.primary { background: linear-gradient(180deg, #249b6e, #1a7a55); color: white; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.danger { background: linear-gradient(180deg, #a6393c, #80272a); color: white; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.gold { background: linear-gradient(180deg, #f0d48a, #c8922a); color: #2a1e16; box-shadow: 0 2px 6px rgba(0,0,0,0.25); }
.ghost:disabled, .primary:disabled, .danger:disabled, .gold:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.ghost:focus-visible, .primary:focus-visible, .danger:focus-visible, .gold:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}
.msg {
  margin: 6px 12px 0;
  min-height: 1.5em;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-bright);
}
.opps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 6px 10px;
}
.seat {
  background: rgba(0, 0, 0, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 5px 3px 6px;
  text-align: center;
  min-width: 0;
  transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}
.seat.on {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px var(--gold-bright), 0 0 10px rgba(228, 192, 106, 0.35);
  background: rgba(18, 65, 48, 0.72);
}
.seat.win {
  border-color: var(--gold);
  background: rgba(228, 192, 106, 0.22);
}
.seat.folded { opacity: 0.45; }
.seat-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.nm {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.role-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
  padding: 1px 4px;
  border-radius: 999px;
  background: var(--gold);
  color: #1f1710;
  flex-shrink: 0;
}
.role-badge.sb, .role-badge.bb {
  background: rgba(228, 192, 106, 0.22);
  color: var(--gold-bright);
  border: 1px solid rgba(228, 192, 106, 0.5);
}
.meta {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 2px;
}
.bet {
  font-size: 10px;
  color: var(--gold-bright);
  min-height: 1.3em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini {
  display: flex;
  justify-content: center;
  gap: 3px;
  margin-top: 4px;
}
.mini .card {
  width: 26px;
  height: 38px;
  border-radius: 5px;
}
.mini .card b { font-size: 11px; }
.mini .card span { font-size: 10px; }
.board {
  margin: 4px 12px;
  padding: 12px 8px 14px;
  border-radius: 20px;
  background: radial-gradient(ellipse at center, rgba(16, 78, 56, 0.72), rgba(5, 32, 22, 0.78));
  border: 2px solid rgba(228, 192, 106, 0.28);
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.35);
  text-align: center;
}
.pot-wrap {
  margin-bottom: 10px;
}
.pot {
  display: inline-block;
  font-size: 14px;
  font-weight: 800;
  color: var(--gold-bright);
  background: rgba(0, 0, 0, 0.36);
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid rgba(228, 192, 106, 0.28);
}
.cards {
  display: flex;
  justify-content: center;
  gap: 6px;
  min-height: 62px;
}
.card {
  width: 44px;
  height: 62px;
  border-radius: 7px;
  background: #faf6ee;
  color: #1c1915;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  line-height: 1.05;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(0, 0, 0, 0.12);
  user-select: none;
}
.card span { font-size: 14px; }
.card b { font-size: 16px; font-weight: 800; }
.card.red { color: var(--red); }
.card.best {
  box-shadow: 0 0 0 2px var(--gold-bright), 0 3px 8px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}
.card.back {
  background: repeating-linear-gradient(45deg, #163d6b, #163d6b 5px, #215594 5px, #215594 10px);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: transparent;
}
.card.placeholder {
  background: rgba(0, 0, 0, 0.16);
  box-shadow: none;
  border: 1px dashed rgba(255, 255, 255, 0.22);
}
.hero {
  margin-top: auto;
  padding: 8px 12px 12px;
}
.hero-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 10px 12px;
}
.hero.win .hero-row {
  border-color: var(--gold);
  background: rgba(228, 192, 106, 0.15);
}
.hero-info {
  min-width: 0;
  flex: 1;
}
.stack {
  font-size: 13px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.hero.win .stack { color: var(--gold-bright); }
.hero-cards-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.hero .cards {
  justify-content: flex-start;
  min-height: 82px;
}
.hero .card {
  width: 58px;
  height: 82px;
  border-radius: 9px;
}
.hero .card b { font-size: 22px; }
.hero .card span { font-size: 18px; }
.live-hand {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
  background: rgba(228, 192, 106, 0.14);
  border: 1px solid rgba(228, 192, 106, 0.35);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.live-hand:empty { display: none; }
.actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.raise {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 8px 10px;
}
.raise-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-bright);
  margin-bottom: 4px;
}
.raise input[type="range"] {
  width: 100%;
  accent-color: #d9a338;
  height: 24px;
}
.presets {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}
.presets button {
  flex: 1;
  min-height: 40px;
  padding: 0 6px;
  font-size: 13px;
}
.fine {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin: 8px 0 0;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 16px;
  max-width: min(440px, calc(100vw - 24px));
  background: #103328;
  color: var(--ink);
  padding: 16px 18px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}
dialog::backdrop { background: rgba(0, 0, 0, 0.65); }
dialog h2 { margin: 0 0 8px; font-size: 18px; color: var(--gold-bright); }
dialog h3 { margin: 12px 0 4px; font-size: 14px; color: var(--gold); }
dialog ul { padding-left: 20px; margin: 8px 0; font-size: 14px; line-height: 1.5; }
dialog li { margin: 5px 0; }
.hand-ranks {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin: 4px 0 12px;
}
kbd {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  font-family: inherit;
}
.full-btn { width: 100%; }
@media (max-width: 360px) {
  .opps { gap: 3px; padding: 6px 6px; }
  .mini .card { width: 22px; height: 32px; }
  .mini .card b { font-size: 10px; }
  .mini .card span { font-size: 9px; }
  .card { width: 38px; height: 54px; }
  .hero .card { width: 52px; height: 74px; }
  .nm { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
