:root {
  color-scheme: dark;
  --felt: #0f6b45;
  --felt-deep: #08422b;
  --ink: #f6f1e4;
  --muted: #d7cbb6;
  --gold: #e6c36a;
  --panel: #17211c;
  --line: rgba(246, 241, 228, 0.16);
  --red: #d64545;
  --blue: #3d7ea6;
  --green: #2f9e6b;
  --orange: #d9832b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% 20%, #1d4d38, #07140f 62%);
}
button, input { font: inherit; }
button { cursor: pointer; }
.eyebrow { margin: 0; letter-spacing: 0.14em; color: var(--gold); font-size: 12px; }
.login, .result {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.panel {
  width: min(440px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
}
h1, h2 { margin: 8px 0 12px; }
.lead, .panel p { color: var(--muted); line-height: 1.5; }
label { display: block; margin: 18px 0 8px; }
input {
  width: 100%;
  border: 1px solid var(--line);
  background: #0d1512;
  color: var(--ink);
  border-radius: 10px;
  padding: 12px 14px;
}
.panel button, .chat button {
  margin-top: 16px;
  width: 100%;
  border: 0;
  border-radius: 10px;
  padding: 12px 14px;
  background: var(--gold);
  color: #241b09;
  font-weight: 700;
}
.error { color: #ffb4b4; min-height: 1.2em; }
.game { width: min(1100px, calc(100% - 24px)); margin: 0 auto; padding: 16px 0 28px; }
.who { display: flex; justify-content: flex-start; gap: 14px; align-items: center; }
.top, .bottom { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.felt {
  margin-top: 14px;
  padding: 22px 16px 16px;
  border-radius: 180px;
  background:
    radial-gradient(circle at 50% 45%, var(--felt), var(--felt-deep) 72%);
  border: 10px solid #6b4a22;
  box-shadow: inset 0 0 0 3px rgba(230, 195, 106, 0.35);
}
.cards { display: flex; gap: 8px; min-height: 118px; flex-wrap: wrap; }
.card, .back {
  width: 74px;
  height: 108px;
  border-radius: 10px;
  position: relative;
  background: #fffaf2;
  color: #1b1b1b;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.25);
}
.card.red { color: var(--red); }
.card b, .card i { position: absolute; font-style: normal; }
.card b { top: 6px; left: 8px; font-size: 18px; }
.card i { inset: 0; display: grid; place-items: center; font-size: 34px; }
.card.open { outline: 2px solid var(--gold); }
.card.pick { cursor: pointer; }
.card.pick:hover { transform: translateY(-6px); }
.back {
  background:
    repeating-linear-gradient(45deg, #183b73, #183b73 8px, #24518f 8px, #24518f 16px);
  border: 3px solid #f4efe4;
}
.center { text-align: center; padding: 18px 0; }
.pot {
  display: inline-grid;
  justify-items: center;
  min-width: 140px;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.28);
}
.pot span { font-size: 12px; letter-spacing: 0.12em; color: var(--gold); }
.pot strong { font-size: 28px; }
.hint, #turnText, #clock { text-align: center; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.actions button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  color: white;
  background: #44524b;
}
.actions button small { display: block; font-weight: 400; opacity: 0.85; }
.act-check { background: #5c6770; }
.act-bbing { background: var(--blue); }
.act-call { background: var(--green); }
.act-ddadang { background: var(--orange); }
.act-half { background: var(--red); }
.act-allin { background: #b68b2c; color: #241b09; }
.act-die { background: #2b3130; }
.bottom { align-items: stretch; margin-top: 14px; }
.me-money strong, .who b { color: var(--gold); }
.log {
  flex: 1;
  min-height: 120px;
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 12px;
  padding: 10px 12px;
  color: var(--muted);
  line-height: 1.45;
}
.chat { width: min(280px, 100%); display: flex; flex-direction: column; }
.chat button { margin-top: 8px; }
.result {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--gold);
  color: #241b09;
  font-size: 12px;
}
@media (max-width: 720px) {
  .felt { border-radius: 28px; }
  .card, .back { width: 58px; height: 86px; }
  .card i { font-size: 26px; }
  .bottom { flex-direction: column; }
  .chat { width: 100%; }
}
