:root {
  color-scheme: light;
  --ink: #20352e;
  --muted: #738177;
  --paper: #f7f7f0;
  --line: #dce3d9;
  --green: #173b32;
  --green-deep: #102b25;
  --mint: #aee0bf;
  --orange: #dc8658;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-width: 320px;
  background: radial-gradient(circle at 50% -20%, #fffdf6 0, #edf1e9 42%, #e6ece3 100%);
  color: var(--ink);
}

button { font: inherit; cursor: pointer; }
button:focus-visible { outline: 3px solid #eeae79; outline-offset: 4px; }
button:disabled { cursor: not-allowed; }

.app-shell { max-width: 1500px; margin: auto; padding: 30px clamp(18px, 3.5vw, 58px) 28px; }

.site-header, .header-actions, .brand, .seat-heading, .seat-stats, .hand-heading,
.score-strip, .table-topline, .table-footer, .pile-display, .action-buttons {
  display: flex;
  align-items: center;
}

.site-header { justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.brand { gap: 15px; }
.brand-mark {
  width: 51px;
  height: 59px;
  display: grid;
  place-items: center;
  background: var(--green);
  border: 2px solid #316655;
  border-radius: 8px;
  box-shadow: 4px 5px 0 #c6d5c8;
  color: var(--mint);
  font-family: Georgia, serif;
  font-size: 38px;
  line-height: 1;
  transform: rotate(-7deg);
}
.brand-mark span { transform: translateY(-2px); }
.eyebrow, .seat-kicker, .result-eyebrow {
  color: #658173;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .21em;
  text-transform: uppercase;
}
h1 { margin: 1px 0 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 3vw, 43px); letter-spacing: -.055em; line-height: 1; }
.brand-stop { color: var(--orange); }
.header-actions { gap: 10px; }
.header-button {
  min-height: 43px;
  padding: 10px 17px;
  border: 1px solid var(--green);
  border-radius: 9px;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 750;
  transition: transform .16s ease, background .16s ease;
}
.header-button:hover { background: #285445; transform: translateY(-2px); }
.header-button span { margin-left: 13px; color: var(--mint); }
.header-button.quiet { background: transparent; border-color: #cedbd0; color: var(--ink); }
.header-button.quiet:hover { background: #fff; }

.rules-panel {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin: -6px 0 20px;
  padding: 18px 22px;
  border: 1px solid #d4dfd3;
  border-radius: 13px;
  background: #fffdf8;
  box-shadow: 0 8px 25px #19372b0a;
  color: #5e6d61;
  font-size: 13px;
  line-height: 1.55;
}
.rules-panel strong { color: var(--ink); }

.game-layout {
  display: grid;
  grid-template-columns: minmax(245px, 1fr) minmax(380px, 1.47fr) minmax(245px, 1fr);
  align-items: stretch;
  gap: 16px;
  min-height: 665px;
}
.center-stack { display: flex; flex-direction: column; min-width: 0; gap: 12px; }

.seat {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px 20px 20px;
  border: 1px solid #dce5da;
  border-radius: 17px;
  background: #fcfdf9;
  box-shadow: 0 12px 35px #173b320b;
}
.seat-you { background: #f8fcf7; }
.seat-heading { gap: 11px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.avatar { width: 43px; height: 43px; display: grid; place-items: center; flex: none; border-radius: 12px; font-family: Georgia, serif; font-size: 21px; font-weight: 700; }
.avatar-opponent { background: #f3e6db; color: #a46742; }
.avatar-you { background: #deeee2; color: #28634d; }
.seat h2 { margin: 3px 0 0; font-family: Georgia, serif; font-size: 22px; letter-spacing: -.04em; }
.seat-marker { margin-left: auto; align-self: flex-start; color: #adbaae; font-family: Georgia, serif; font-size: 15px; }
.seat-stats { align-items: stretch; gap: 9px; padding: 20px 0 22px; }
.stat { flex: 1; min-width: 0; padding: 15px 14px 13px; background: #f0f4ee; border-radius: 9px; }
.stat span { display: block; color: #687a6e; font-size: 11px; font-weight: 650; }
.stat strong { display: block; margin-top: 6px; font-family: Georgia, serif; font-size: 30px; line-height: 1; font-weight: 500; }
.stat-chips { position: relative; overflow: hidden; padding-bottom: 39px; }
.stat-chip-row { position: absolute; right: 14px; bottom: 10px; left: 14px; display: flex; height: 17px; pointer-events: none; }
.stat .stat-chip {
  position: relative;
  flex: 0 1 16px;
  min-width: 0;
  height: 16px;
}
.stat .stat-chip:last-child { flex-shrink: 0; }
.stat .stat-chip::before { position: absolute; top: 0; left: 0; width: 16px; height: 16px; content: ""; border: 2px dashed #ffe4b1; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f7cf92, #dc9252 75%); box-shadow: 0 2px 2px #83512d80; }
.stat .stat-chip::after { position: absolute; top: 5px; left: 5px; width: 6px; height: 6px; content: ""; border-radius: 50%; background: #f0b674; box-shadow: inset 0 1px 2px #ad6d37; }
.hand-heading { justify-content: space-between; gap: 8px; color: #485b4e; font-size: 12px; font-weight: 750; }
.hand-heading span:last-child { color: #8c9b8c; font-weight: 600; }
.hand-runs { flex: 1; display: flex; flex-wrap: wrap; align-content: flex-start; align-items: flex-start; gap: 13px 10px; min-height: 220px; padding: 18px 0 20px; }
.empty-hand { margin: 2px 0; color: #9aa79b; font-family: Georgia, serif; font-size: 15px; font-style: italic; }
.run-group { display: inline-flex; flex-direction: column; gap: 5px; max-width: 100%; }
.run-cards { display: flex; align-items: center; max-width: 100%; overflow-x: auto; padding: 3px 0 7px 7px; }
.mini-card {
  position: relative;
  width: 40px;
  height: 56px;
  display: grid;
  place-items: center;
  flex: none;
  margin-left: -7px;
  border: 1px solid #bdcbbb;
  border-radius: 5px;
  background: #fffefa;
  box-shadow: 1px 2px 0 #b5c8b7;
  color: #345348;
  font-family: Georgia, serif;
  font-size: 19px;
}
.seat-opponent .mini-card { border-color: #ddc6b5; box-shadow: 1px 2px 0 #dac2b1; color: #995e3d; }
.run-points { color: #7d8c7e; font-size: 11px; font-weight: 750; letter-spacing: .03em; }
.score-strip { justify-content: space-between; gap: 10px; min-height: 76px; margin-top: auto; padding: 14px 16px; border-radius: 10px; background: #e5f0e7; }
.seat-opponent .score-strip { background: #f4e9df; }
.score-strip span { font-size: 12px; font-weight: 800; }
.score-strip small { display: block; margin-top: 3px; color: #738975; font-size: 10px; font-weight: 550; }
.seat-opponent .score-strip small { color: #9b8170; }
.score-strip strong { font-family: Georgia, serif; font-size: 35px; font-weight: 500; line-height: 1; }

.table {
  position: relative;
  flex: 1;
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #12362e;
  border-radius: 17px;
  background: radial-gradient(circle at 50% 43%, #29584a 0, #20493d 36%, #183d33 69%, #14362e 100%);
  color: #f4f7e9;
  box-shadow: 0 17px 32px #173b3228, inset 0 0 0 6px #ffffff0b;
}
.table::before { position: absolute; inset: 0; z-index: -1; content: ""; background-image: repeating-linear-gradient(100deg, #ffffff05 0 1px, transparent 1px 5px); opacity: .38; }
.table-inner { display: flex; flex-direction: column; height: 100%; min-height: 665px; padding: 25px clamp(20px, 3vw, 35px) 29px; }
.table-topline { justify-content: space-between; color: #c5decc; font-size: 12px; font-weight: 650; }
.round-label { letter-spacing: .16em; font-size: 10px; font-weight: 850; }
.round-divider { margin: 0 2px; opacity: .5; }
.progress-track { height: 4px; margin-top: 14px; overflow: hidden; border-radius: 5px; background: #ffffff28; }
.progress-fill { width: 0; height: 100%; background: #b9e7c5; border-radius: inherit; transition: width .35s ease; }
.turn-badge { display: flex; align-items: center; justify-content: center; align-self: center; gap: 8px; min-height: 28px; margin-top: 25px; padding: 6px 13px; border: 1px solid #a5c9b53b; border-radius: 30px; background: #0c2b2494; color: #e2f2df; font-size: 11px; font-weight: 750; letter-spacing: .04em; }
.turn-dot { width: 7px; height: 7px; border-radius: 50%; background: #e6ad76; box-shadow: 0 0 0 3px #e6ad7633; }
.turn-dot.your-turn { background: #b9e7c5; box-shadow: 0 0 0 3px #b9e7c53a; }
.offer-scene { position: relative; display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; width: 100%; min-height: 340px; margin: 0 auto; padding: 20px 0 6px; }
.offer-halo { position: absolute; top: 45%; left: 50%; width: 310px; height: 310px; border: 1px solid #c6e6cb20; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.offer-halo::before, .offer-halo::after { position: absolute; inset: 22px; content: ""; border: 1px solid #c6e6cb20; border-radius: 50%; }
.offer-halo::after { inset: 49px; }
.offer-card { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: min(100%, 176px); aspect-ratio: 176 / 237; border: 2px solid #fdf9ed; border-radius: 12px; background: linear-gradient(145deg, #fffdf5, #f2efe1); box-shadow: 0 15px 0 #17332a, 0 22px 28px #071d17a1, inset 0 0 0 6px #f5f0df; color: var(--green); transform: rotate(-3deg); }
.offer-card.dealt { animation: deal-in .34s cubic-bezier(.2,.8,.2,1) both; }
.card-corner { position: absolute; top: 15px; left: 17px; z-index: 3; font-family: Georgia, serif; font-size: 23px; font-weight: 700; }
.card-number { font-family: Georgia, serif; font-size: 99px; line-height: 1; letter-spacing: -.1em; transform: translateX(-5px); }
.card-caption { position: absolute; bottom: 20px; left: 0; width: 100%; text-align: center; color: #67947c; font-size: 9px; font-weight: 900; letter-spacing: .28em; }
.pile-display { z-index: 1; display: flex; align-items: baseline; justify-content: center; gap: 9px; margin-top: 27px; }
.pile-display strong { color: #fff6d8; font-family: Georgia, serif; font-size: 37px; font-weight: 500; line-height: 1; }
.pile-display span { color: #d6e5d6; font-size: 11px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.chip-pile { position: absolute; inset: 0; z-index: 2; overflow: hidden; border-radius: inherit; pointer-events: none; }
.chip-token { position: absolute; width: 46px; height: 46px; border: 6px dashed #ffe1a9; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #f4c286, #da9050 72%); box-shadow: 0 5px 0 #8d5330, 0 8px 12px #10291e7a, inset 0 0 0 3px #efb57e; }
.chip-token::after { position: absolute; inset: 7px; content: ""; border-radius: 50%; background: #e6a763; box-shadow: inset 0 2px 3px #a86231; }
.eval-panel { padding: 15px 18px 13px; border: 1px solid #d9e2d6; border-radius: 13px; background: #fcfdf9; box-shadow: 0 8px 22px #173b320b; }
.eval-heading, .eval-labels { display: flex; justify-content: space-between; gap: 10px; }
.eval-heading { margin-bottom: 10px; color: #496052; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.eval-heading span:last-child { color: #87998a; font-size: 10px; font-weight: 650; letter-spacing: 0; text-transform: none; }
.eval-bar { display: flex; height: 15px; overflow: hidden; border-radius: 10px; background: #e3eae0; }
.eval-segment { width: 0; height: 100%; transition: width .3s ease; }
.eval-win { background: #d58d60; }
.eval-lose { background: #8fc5a0; }
.eval-labels { margin-top: 9px; color: #617264; font-size: 11px; font-weight: 650; }
.eval-labels span { white-space: nowrap; }
.eval-labels strong { margin-left: 3px; color: #263f32; font-size: 12px; }
.eval-note { margin: 8px 0 0; color: #8c9b8d; font-size: 10px; }
.action-area { margin-top: auto; }
.action-hint { min-height: 18px; margin: 0 0 13px; color: #d7e9d6; font-size: 12px; text-align: center; }
.action-buttons { gap: 10px; }
.action-button { flex: 1; min-height: 75px; padding: 11px 11px; border: 1px solid transparent; border-radius: 10px; text-align: left; transition: transform .15s ease, filter .15s ease, opacity .15s ease; }
.action-button:not(:disabled):hover { transform: translateY(-3px); filter: brightness(1.05); }
.action-button:disabled { opacity: .58; }
.pass-button { background: #f3d1b6; color: #593827; }
.take-button { background: #c0e7c3; color: #1a4634; }
.button-title { display: block; font-family: Georgia, serif; font-size: 20px; font-weight: 700; letter-spacing: -.04em; }
.button-detail { display: block; margin-top: 3px; font-size: 10px; font-weight: 680; }
kbd { float: right; min-width: 19px; padding: 2px 4px; border: 1px solid currentColor; border-radius: 3px; font-family: inherit; font-size: 10px; line-height: 1; text-align: center; opacity: .64; }
.result-panel { margin-top: auto; padding: 19px 4px 4px; text-align: center; }
.result-eyebrow { color: #a7d4b2; }
.result-panel h2 { margin: 8px 0 5px; color: #fffdf3; font-family: Georgia, serif; font-size: 35px; letter-spacing: -.04em; }
.result-panel p { margin: 0 0 18px; color: #c8ddcd; font-size: 13px; }
.play-again { width: 100%; min-height: 53px; padding: 12px 18px; border: 0; border-radius: 9px; background: #c0e7c3; color: #1a4634; font-weight: 800; }
.play-again span { float: right; }

.table-footer { align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 16px; padding: 7px 2px; color: #687a6b; font-size: 12px; }
.footer-rule { display: flex; align-items: center; gap: 9px; padding-top: 9px; }
.footer-rule strong { color: #3c5746; }
.rule-star { color: #b67d58; font-size: 21px; }
.move-history { width: min(100%, 470px); padding: 14px 17px 8px; border: 1px solid #d4dfd3; border-radius: 11px; background: #fcfdf9; }
.history-heading { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 9px; color: #688070; font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.history-heading span:last-child { color: #96a99b; letter-spacing: .02em; text-transform: none; }
.move-log { max-height: 144px; min-height: 44px; margin: 0; padding: 0; overflow-y: auto; list-style: none; scrollbar-color: #b7cbbb transparent; }
.move-log li { display: flex; gap: 12px; padding: 9px 2px; border-top: 1px solid #e4ebe2; color: #617366; font-size: 14px; line-height: 1.35; }
.move-log li.latest { color: #284636; font-size: 16px; font-weight: 750; }
.log-round { flex: 0 0 53px; padding-top: 3px; color: #8fa093; font-size: 10px; font-weight: 850; letter-spacing: .04em; text-transform: uppercase; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes deal-in { from { opacity: .4; transform: translateY(-18px) rotate(-8deg) scale(.96); } to { opacity: 1; transform: translateY(0) rotate(-3deg) scale(1); } }

@media (max-width: 1120px) {
  .game-layout { grid-template-columns: 1fr 1fr; min-height: 0; }
  .center-stack { grid-column: 1 / -1; grid-row: 1; }
  .table-inner { min-height: 590px; }
  .seat { min-height: 345px; }
  .hand-runs { min-height: 125px; }
}

@media (max-width: 640px) {
  .app-shell { padding: 18px 13px 24px; }
  .site-header { align-items: flex-start; margin-bottom: 17px; }
  .brand { gap: 10px; }
  .brand-mark { width: 39px; height: 47px; font-size: 29px; }
  .brand h1 { font-size: 29px; }
  .eyebrow { font-size: 8px; letter-spacing: .13em; }
  .header-actions { flex-direction: column-reverse; gap: 5px; }
  .header-button { min-height: 33px; padding: 6px 9px; font-size: 10px; }
  .header-button span { margin-left: 4px; }
  .rules-panel { grid-template-columns: 1fr; gap: 9px; }
  .game-layout { grid-template-columns: 1fr; gap: 10px; }
  .center-stack { grid-column: 1; }
  .table-inner { min-height: 548px; padding: 19px 18px 20px; }
  .turn-badge { margin-top: 16px; }
  .offer-scene { min-height: 317px; }
  .offer-halo { width: 266px; height: 266px; }
  .offer-card { width: min(100%, 149px); }
  .card-number { font-size: clamp(60px, 20vw, 83px); }
  .chip-token { width: 41px; height: 41px; border-width: 5px; }
  .chip-token::after { inset: 6px; }
  .pile-display { margin-top: 23px; }
  .pile-display strong { font-size: 34px; }
  .action-button { min-height: 68px; }
  .button-title { font-size: 18px; }
  .seat { min-height: 270px; padding: 17px; }
  .seat-stats { padding: 13px 0; }
  .stat { padding: 11px 12px; }
  .stat-chips { padding-bottom: 39px; }
  .stat strong { font-size: 26px; }
  .hand-runs { min-height: 80px; padding: 13px 0; }
  .table-footer { align-items: flex-start; flex-direction: column; gap: 4px; }
  .move-history { width: 100%; }
}

@media (max-width: 370px) {
  .chip-token { width: 35px; height: 35px; border-width: 4px; }
  .chip-token::after { inset: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
