@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;600;700&family=Noto+Serif+SC:wght@600;700&display=swap');

:root {
  --night: #07140f;
  --night-2: #0b1d16;
  --felt: #0e4937;
  --felt-light: #176149;
  --ink: #f0ece2;
  --muted: #98a69e;
  --line: rgba(226, 216, 194, .16);
  --gold: #d5b873;
  --gold-deep: #9e7d3e;
  --paper: #f4f0e7;
  --panel: #e9e3d7;
  --panel-line: #cfc6b7;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; overflow: hidden; color: var(--ink); background: var(--night); font-family: "Noto Sans SC", system-ui, sans-serif; line-height: 1.45; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.mobile-only { display: none; }

.app-header { height: 58px; padding: 0 clamp(18px, 3vw, 44px); display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-bottom: 1px solid var(--line); background: rgba(7, 20, 15, .96); }
.brand { display: inline-flex; align-items: center; gap: 10px; width: max-content; color: var(--ink); font: 700 15px "Noto Serif SC", serif; letter-spacing: .06em; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--gold-deep); border-radius: 50%; color: var(--gold); font: 18px Georgia, serif; }
.table-identity { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.table-identity i { width: 1px; height: 12px; background: var(--line); }
.table-identity strong { color: var(--gold); font: 600 12px Georgia, serif; }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: #69c692; box-shadow: 0 0 10px #69c692; }
.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 7px; }
.header-button, .sound-toggle { height: 30px; border: 1px solid var(--line); color: var(--muted); background: transparent; cursor: pointer; }
.header-button { padding: 0 12px; font-size: 10px; letter-spacing: .08em; }
.sound-toggle { width: 30px; border-radius: 50%; color: var(--gold); }
.header-button:hover, .sound-toggle:hover { color: var(--ink); border-color: var(--gold-deep); }

.game-page { height: calc(100dvh - 58px); padding: clamp(10px, 1.5vw, 22px); background: radial-gradient(circle at 50% 0, #10291f 0, var(--night) 64%); }
.game-shell { width: min(1480px, 100%); height: 100%; margin: 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) clamp(220px, 18vw, 270px); overflow: hidden; border: 1px solid var(--line); background: #0a1913; box-shadow: 0 18px 60px rgba(0, 0, 0, .35); }
.table-wrap { min-width: 0; min-height: 0; padding: clamp(10px, 1.2vw, 18px); display: grid; grid-template-rows: minmax(0, 1fr) 82px; gap: 8px; }
.poker-table { min-height: 0; position: relative; overflow: hidden; border: clamp(8px, 1vw, 13px) solid #302a24; border-radius: 48% / 44%; background: radial-gradient(ellipse at center, var(--felt-light) 0%, var(--felt) 58%, #093126 100%); box-shadow: inset 0 0 0 3px #76654e, inset 0 0 90px rgba(0, 0, 0, .46), 0 9px 24px rgba(0, 0, 0, .28); }
.felt-grain { position: absolute; inset: 0; opacity: .21; background-image: radial-gradient(rgba(255,255,255,.16) .6px, transparent .7px); background-size: 7px 7px; pointer-events: none; }

.table-center { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); width: 72%; text-align: center; }
.pot-label { margin-bottom: 9px; color: rgba(255,255,255,.64); font-size: 9px; letter-spacing: .14em; }
.pot-label strong { display: block; color: #f2d690; font: 600 20px Georgia, serif; }
.pot-label strong::before { content: "●"; margin-right: 7px; color: #cc9b34; font-size: 10px; vertical-align: 2px; }
.community-cards { min-height: 82px; display: flex; justify-content: center; gap: clamp(5px, .7vw, 9px); }
.round-status { margin: 9px 0 0; color: rgba(255,255,255,.66); font-size: 10px; letter-spacing: .04em; }

.card, .card-placeholder { width: clamp(48px, 4.8vw, 63px); height: clamp(68px, 6.7vw, 88px); border-radius: 6px; }
.card { position: relative; flex: 0 0 auto; color: #171a16; background: var(--paper); box-shadow: 0 4px 12px rgba(0,0,0,.27); animation: dealCard .28s cubic-bezier(.2,.8,.2,1) both; }
.card.red { color: #b83e39; }
.card .corner { position: absolute; top: 6px; left: 7px; font: 700 clamp(12px, 1.2vw, 16px)/.95 Georgia, serif; text-align: center; }
.card .corner small { display: block; font-size: .85em; }
.card .suit-big { position: absolute; inset: 0; display: grid; place-items: center; padding-top: 10px; font: clamp(23px, 2.2vw, 29px) Georgia, serif; }
.card-placeholder { border: 1px solid rgba(255,255,255,.14); background: rgba(0,0,0,.08); }
.card-back { border: 3px solid #e4dccd; background-color: #182b23; background-image: linear-gradient(45deg, transparent 45%, rgba(213,184,115,.28) 46%, rgba(213,184,115,.28) 54%, transparent 55%), linear-gradient(-45deg, transparent 45%, rgba(213,184,115,.28) 46%, rgba(213,184,115,.28) 54%, transparent 55%); background-size: 12px 12px; }

.seat { position: absolute; z-index: 3; display: grid; grid-template-columns: 38px auto; align-items: center; gap: 7px; color: white; transition: opacity .25s, filter .25s; }
.seat-top { top: 4%; left: 50%; transform: translateX(-50%); }
.seat-left { left: 3%; top: 45%; transform: translateY(-50%); }
.seat-right { right: 3%; top: 45%; transform: translateY(-50%); }
.seat-bottom { bottom: 3%; left: 50%; transform: translateX(-50%); grid-template-columns: 38px auto auto; }
.player-avatar { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid rgba(255,255,255,.46); border-radius: 50%; font: 700 12px "Noto Serif SC", serif; box-shadow: 0 4px 11px rgba(0,0,0,.3); }
.avatar-blue { background: #5f8290; }.avatar-gold { background: #ad8551; }.avatar-red { background: #9b5b56; }.avatar-you { color: #ead494; background: #263d34; border-color: var(--gold); }
.player-copy { min-width: 58px; padding: 5px 8px; border: 1px solid rgba(255,255,255,.12); border-radius: 4px; background: rgba(6,17,13,.84); }
.player-copy strong, .player-copy span { display: block; }.player-copy strong { font-size: 10px; }.player-copy span { color: #d7c28a; font: 11px Georgia, serif; }
.you-label { position: absolute; left: -1px; top: -16px; color: #e7d29c; font-size: 8px; letter-spacing: .15em; }
.dealer-chip { position: absolute; left: -6px; bottom: -10px; width: 20px; height: 20px; display: grid; place-items: center; border: 2px solid #b59a5b; border-radius: 50%; color: #17221d; background: #eee7d6; font: 700 9px Georgia, serif; }
.mini-cards { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); display: flex; gap: 2px; }
.seat-left .mini-cards, .seat-right .mini-cards { top: -38px; }
.mini-cards .card { width: 26px; height: 36px; border-radius: 3px; border-width: 2px; }
.mini-cards .corner { top: 3px; left: 3px; font-size: 8px; }.mini-cards .suit-big { padding-top: 7px; font-size: 12px; }
.hole-cards { min-width: 126px; margin-left: 6px; display: flex; gap: 5px; }
.hole-cards .card { width: clamp(54px, 4.4vw, 59px); height: clamp(75px, 6.2vw, 82px); }
.player-action { position: absolute; top: -24px; left: 50%; transform: translateX(-50%); padding: 3px 7px; border-radius: 2px; opacity: 0; white-space: nowrap; color: #1e2e27; background: #e8d59d; font-size: 8px; font-weight: 700; letter-spacing: .05em; transition: opacity .2s; }
.player-action.show { opacity: 1; }.seat.folded { opacity: .4; filter: grayscale(.55); }

.action-dock { min-width: 0; display: flex; align-items: center; gap: 14px; padding: 8px 12px; border: 1px solid var(--line); background: #0d2119; }
.hand-readout { min-width: 130px; }.hand-readout span, .hand-readout strong, .hand-readout small { display: block; }.hand-readout span { color: var(--muted); font-size: 8px; letter-spacing: .14em; }.hand-readout strong { margin: 2px 0; font: 700 16px "Noto Serif SC", serif; }.hand-readout small { color: #829188; font-size: 9px; }
.action-buttons { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex: 1; }
.btn { min-height: 40px; padding: 0 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid #42534a; color: #d9e0db; background: transparent; font-size: 11px; font-weight: 700; cursor: pointer; transition: .2s; }
.btn:hover:not(:disabled) { border-color: var(--gold-deep); background: #162c22; }.btn:disabled { opacity: .3; cursor: not-allowed; }
.btn kbd { padding: 1px 4px; border: 1px solid #4e6057; border-radius: 2px; color: #84938b; font: 8px inherit; }
.btn-raise { min-width: 120px; color: #17221d; background: var(--gold); border-color: var(--gold); }.btn-raise:hover:not(:disabled) { color: #17221d; background: #c5a55e; }.btn-raise kbd { color: #65532b; border-color: #947b44; }.btn-raise b { font: inherit; }
.btn-deal { min-width: 96px; color: white; background: #9b7b40; border-color: #9b7b40; }
.raise-control { position: relative; }.raise-control input { position: absolute; left: 0; bottom: -7px; width: 100%; height: 3px; accent-color: var(--gold); }

.game-sidebar { min-height: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: #e8e1d5; color: #1c2c25; }
.sidebar-head { padding: 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--panel-line); }.sidebar-head span, .sidebar-head strong { display: block; }.sidebar-head span { color: #8a806e; font-size: 8px; letter-spacing: .14em; }.sidebar-head strong { margin-top: 3px; font: 700 16px "Noto Serif SC", serif; }
.sidebar-actions { display: flex; align-items: center; gap: 10px; }.sidebar-actions button { padding: 0; border: 0; color: #897a60; background: transparent; text-decoration: underline; text-underline-offset: 3px; font-size: 9px; cursor: pointer; }.sidebar-actions .sidebar-close { width: 30px; height: 30px; border: 1px solid #c3b8a6; border-radius: 50%; text-decoration: none; font-size: 18px; }
.hand-log { min-height: 0; margin: 0; padding: 10px 18px; flex: 1; overflow-y: auto; list-style: none; scrollbar-width: thin; }
.hand-log li { position: relative; padding: 8px 0 8px 14px; border-left: 1px solid #d2c8b7; color: #615c52; font-size: 9px; }.hand-log li::before { content: ""; position: absolute; top: 13px; left: -3px; width: 5px; height: 5px; border-radius: 50%; background: #a58a54; }.hand-log li strong { color: #27372f; }
.hand-log .empty-log { padding: 70px 0; border: 0; color: #aaa08f; text-align: center; }.hand-log .empty-log::before { display: none; }.empty-log span { color: #c2b397; font: 27px Georgia, serif; }.empty-log p { line-height: 1.8; }
.table-tip { margin: 10px 12px; padding: 13px; background: #dcd3c4; }.table-tip span { color: #887755; font-size: 8px; font-weight: 700; letter-spacing: .12em; }.table-tip p { margin: 5px 0 0; color: #665f52; font-size: 9px; line-height: 1.65; }
.safe-note { margin: 0 0 12px; color: #9b9180; font-size: 8px; text-align: center; }

.rules-dialog { width: min(660px, calc(100vw - 30px)); max-height: calc(100dvh - 40px); padding: 0; overflow: hidden; border: 1px solid #716347; color: var(--ink); background: #0b1d16; box-shadow: 0 30px 90px rgba(0,0,0,.6); }.rules-dialog::backdrop { background: rgba(2,10,7,.75); backdrop-filter: blur(4px); }.dialog-head { padding: 22px 24px 17px; display: flex; justify-content: space-between; align-items: start; border-bottom: 1px solid var(--line); }.dialog-head span { color: var(--gold); font-size: 8px; letter-spacing: .16em; }.dialog-head h2 { margin: 3px 0 0; font: 700 25px "Noto Serif SC", serif; }.dialog-head button { width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); background: transparent; font-size: 19px; cursor: pointer; }
.rank-list { padding: 10px 24px; display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }.rank-list div { min-width: 0; padding: 10px 0; display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }.rank-list b { color: var(--gold); font: italic 10px Georgia, serif; }.rank-list strong { font: 600 13px "Noto Serif SC", serif; }.rank-list span { color: #cfc5b1; font: 10px Georgia, serif; white-space: nowrap; }.rules-foot { margin: 0; padding: 14px 24px 18px; color: var(--muted); font-size: 9px; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 20px; transform: translate(-50%, 16px); padding: 10px 17px; opacity: 0; pointer-events: none; color: #16251e; background: #e8d9af; box-shadow: 0 10px 30px rgba(0,0,0,.3); font-size: 11px; font-weight: 700; transition: .25s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes dealCard { from { opacity: 0; transform: translateY(-16px) rotate(-3deg); } to { opacity: 1; transform: none; } }

@media (max-width: 820px) {
  .mobile-only { display: inline-flex; }
  .app-header { height: 48px; padding: 0 12px; grid-template-columns: 1fr auto; }.brand { font-size: 13px; }.brand-mark { width: 27px; height: 27px; font-size: 16px; }.table-identity { display: none; }.header-button, .sound-toggle { height: 28px; }.sound-toggle { width: 28px; }
  .game-page { height: calc(100dvh - 48px); padding: 6px; }
  .game-shell { display: block; border: 0; overflow: visible; }
  .table-wrap { width: 100%; height: 100%; padding: 0; grid-template-rows: minmax(0, 1fr) 126px; gap: 5px; }
  .poker-table { border-width: 7px; border-radius: 42% / 24%; }
  .seat { grid-template-columns: 32px auto; gap: 5px; }.player-avatar { width: 32px; height: 32px; font-size: 10px; }.player-copy { min-width: 48px; padding: 4px 6px; }.player-copy strong, .player-copy span { font-size: 9px; }
  .seat-top { top: 2.5%; }.seat-left { left: 2%; top: 40%; }.seat-right { right: 2%; top: 40%; }.seat-bottom { bottom: 2.5%; grid-template-columns: 32px auto; }
  .mini-cards { display: none; }.seat-bottom .hole-cards { position: absolute; left: 50%; bottom: 41px; transform: translateX(-50%); margin: 0; min-width: 103px; }.seat-bottom .player-avatar, .seat-bottom .player-copy { grid-row: 2; }.you-label { top: -14px; }
  .table-center { top: 44%; width: 96%; }.community-cards { min-height: 62px; gap: 4px; }.card, .card-placeholder { width: clamp(40px, 11.5vw, 48px); height: clamp(57px, 16vw, 67px); border-radius: 5px; }.hole-cards .card { width: 49px; height: 68px; }.card .corner { top: 4px; left: 5px; font-size: 11px; }.card .suit-big { padding-top: 8px; font-size: 21px; }.pot-label { margin-bottom: 6px; }.pot-label strong { font-size: 17px; }.round-status { margin-top: 6px; font-size: 9px; }
  .action-dock { padding: 7px; display: grid; grid-template-rows: 30px 1fr; gap: 3px; }.hand-readout { min-width: 0; display: flex; align-items: baseline; justify-content: center; gap: 8px; }.hand-readout span { font-size: 7px; }.hand-readout strong { font-size: 14px; }.hand-readout small { font-size: 8px; }.action-buttons { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }.btn { min-width: 0; min-height: 37px; padding: 0 5px; font-size: 10px; }.btn kbd { display: none; }.btn-raise { width: 100%; min-width: 0; }.btn-deal { grid-column: 1 / -1; min-height: 36px; }
  .game-sidebar { position: fixed; z-index: 80; inset: 48px 0 0; border: 0; transform: translateY(102%); visibility: hidden; transition: transform .25s ease, visibility .25s; }.log-open .game-sidebar { transform: translateY(0); visibility: visible; }.sidebar-head { padding: 18px 20px; }.sidebar-actions .sidebar-close { display: inline-flex; align-items: center; justify-content: center; }.hand-log .empty-log { padding: 55px 0; }
  .rules-dialog { max-height: calc(100dvh - 20px); }.dialog-head { padding: 17px 18px 13px; }.dialog-head h2 { font-size: 21px; }.rank-list { padding: 6px 18px; grid-template-columns: 1fr; overflow-y: auto; max-height: calc(100dvh - 150px); }.rank-list div { padding: 8px 0; }.rules-foot { padding: 11px 18px 15px; }
}

@media (max-width: 390px), (max-height: 680px) and (max-width: 820px) {
  .brand-name { display: none; }.table-wrap { grid-template-rows: minmax(0, 1fr) 116px; }.seat-left .player-copy, .seat-right .player-copy { display: none; }.seat-bottom .hole-cards { bottom: 37px; }.hole-cards .card { width: 44px; height: 62px; }.action-dock { grid-template-rows: 26px 1fr; }.btn { min-height: 34px; }.btn-deal { min-height: 32px; }
}

@media (max-height: 640px) and (min-width: 821px) {
  .game-page { padding: 8px; }.table-wrap { grid-template-rows: minmax(0, 1fr) 70px; padding: 9px; }.action-dock { padding: 6px 10px; }.btn { min-height: 36px; }.hole-cards .card { width: 50px; height: 70px; }.card, .card-placeholder { width: 48px; height: 67px; }.community-cards { min-height: 67px; }
}

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