:root {
  --paper: #f7f4ef;
  --paper-deep: #eee8df;
  --ink: #171717;
  --muted: #77736d;
  --line: #dad5cd;
  --red: #bd4c38;
  --red-dark: #8e3427;
  --blue: #386d72;
  --shadow: 0 5px 0 rgba(23, 23, 23, .92);
  --soft-shadow: 0 14px 35px rgba(39, 31, 22, .08);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--paper); }

body { margin: 0; min-width: 320px; min-height: 100vh; background: var(--paper); }

button, input { font: inherit; }

button { color: inherit; }

button:focus-visible, a:focus-visible { outline: 3px solid rgba(56, 109, 114, .5); outline-offset: 3px; }

a { color: var(--red-dark); }

.site-shell { min-height: 100vh; overflow: hidden; }

.screen { width: min(100%, 1040px); margin: 0 auto; padding: 54px 28px 38px; }

.is-hidden { display: none !important; }

.landing-screen { min-height: 100vh; display: flex; flex-direction: column; align-items: center; text-align: center; }

.brand-lockup { max-width: 680px; margin: 28px auto 30px; }

.eyebrow, .table-label, .modal-kicker { margin: 0; color: #76716a; font-size: 10px; font-weight: 800; letter-spacing: .22em; text-transform: uppercase; }

.brand-lockup h1 { margin: 22px 0 9px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(68px, 12vw, 126px); line-height: .84; letter-spacing: -.085em; font-weight: 900; white-space: nowrap; }

.brand-lockup h1 span { color: var(--ink); }

.brand-lockup h1 strong { color: var(--red); font-weight: 900; }

.brand-subtitle { margin: 0; color: #716d67; font-size: 14px; letter-spacing: .09em; }

.mode-grid { display: grid; grid-template-columns: repeat(2, minmax(225px, 280px)); gap: 16px; margin: 20px auto 27px; }

.mode-card { position: relative; display: flex; min-height: 112px; flex-direction: column; align-items: center; justify-content: center; border: 1.5px solid var(--ink); border-radius: 17px; background: rgba(255, 253, 249, .38); box-shadow: var(--shadow); cursor: pointer; transition: transform .16s ease, box-shadow .16s ease, background .16s ease; }

.mode-card:hover { transform: translateY(-3px); box-shadow: 0 8px 0 rgba(23, 23, 23, .92); background: #fffdf9; }

.mode-card:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(23, 23, 23, .92); }

.mode-card-primary { background: #fffdf9; }

.mode-number { font-family: Georgia, "Times New Roman", serif; font-size: 34px; font-weight: 900; letter-spacing: -.08em; }

.mode-number i { margin: 0 4px; color: var(--red); font-family: inherit; font-size: 18px; font-style: normal; letter-spacing: -.04em; }

.mode-label { margin-top: 6px; color: #77716a; font-size: 12px; font-weight: 700; }

.mode-arrow { position: absolute; right: 16px; bottom: 14px; color: var(--red); font-size: 17px; }

.landing-caption { margin: 0 0 28px; color: #77716a; font-size: 12px; }

.feature-strip { display: grid; width: min(100%, 680px); grid-template-columns: repeat(3, 1fr); gap: 14px; }

.feature-card { min-height: 126px; padding: 19px 14px 12px; border: 1px solid var(--line); border-radius: 13px; background: rgba(255, 253, 249, .43); box-shadow: 0 2px 5px rgba(35, 29, 20, .02); }

.feature-value { display: block; font-family: Georgia, "Times New Roman", serif; font-size: 31px; font-weight: 900; line-height: 1; }

.feature-card-accent .feature-value { color: var(--red); }

.feature-unit { display: block; margin-top: 3px; color: #a09a91; font-size: 8px; font-weight: 800; letter-spacing: .17em; }

.feature-card p { margin: 15px auto 0; max-width: 140px; color: #8b857c; font-size: 10px; line-height: 1.55; }

.model-note { display: flex; align-items: center; gap: 10px; margin: 29px 0 0; padding: 12px 17px; border: 1px solid var(--line); border-radius: 999px; color: #6e6962; text-align: left; }

.model-note > span:last-child { display: flex; flex-direction: column; gap: 2px; }

.model-note b { font-size: 11px; }

.model-note small { color: #9a948b; font-size: 9px; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 4px rgba(56, 109, 114, .12); }

.fine-print { margin: auto 0 0; padding-top: 34px; color: #aaa39a; font-size: 10px; }

/* Game screen */
.game-screen { padding-top: 25px; }

.game-header, .scoreboard, .table-toolbar, .hand-heading, .action-row, .log-toggle { display: flex; align-items: center; }

.game-header { justify-content: space-between; margin-bottom: 18px; }

.game-title-lockup { display: flex; align-items: baseline; gap: 8px; }

.game-title-lockup strong { font-family: Georgia, "Times New Roman", serif; font-size: 21px; letter-spacing: -.06em; }

.game-title-lockup em { color: var(--red); font-style: normal; }

.header-meta { display: flex; align-items: center; gap: 12px; }

.icon-button { display: grid; width: 38px; height: 38px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: transparent; font-size: 20px; cursor: pointer; transition: background .16s ease, transform .16s ease; }

.icon-button:hover { background: #fffdf9; transform: translateY(-1px); }

.model-chip { padding: 7px 10px; border-radius: 999px; background: rgba(56, 109, 114, .1); color: var(--blue); font-size: 9px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }

.scoreboard { justify-content: space-between; padding: 14px 18px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255, 253, 249, .56); }

.player-line { display: flex; min-width: 175px; align-items: center; gap: 10px; }

.player-line b, .player-line small { display: block; }

.player-line b { font-size: 12px; }

.player-line small { margin-top: 3px; color: #999289; font-size: 9px; }

.player-line strong { margin-left: auto; font-family: Georgia, "Times New Roman", serif; font-size: 27px; line-height: 1; }

.player-line-human strong { margin: 0; }

.player-line strong small { display: inline; margin-left: 3px; font-family: inherit; font-size: 10px; }

.player-avatar { display: grid; width: 31px; height: 31px; flex: 0 0 31px; place-items: center; border-radius: 10px; font-size: 11px; font-weight: 900; }

.avatar-opponent { background: #eadbd1; color: var(--red-dark); }

.avatar-human { background: #d7e7e4; color: var(--blue); }

.match-state { display: flex; flex-direction: column; align-items: center; gap: 4px; }

.match-state > span:last-child { color: #a09a91; font-size: 9px; font-weight: 800; letter-spacing: .17em; }

.turn-indicator { padding: 7px 12px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 10px; font-weight: 800; }

.turn-indicator.opponent-turn { background: var(--red); }

.table-panel { margin-top: 15px; padding: 15px 18px 19px; border: 1px solid var(--line); border-radius: 17px; background: #ebe4db; }

.table-toolbar { justify-content: space-between; }

.rule-state { margin-left: auto; margin-right: 12px; padding: 5px 9px; border-radius: 999px; background: rgba(255, 253, 249, .7); color: var(--red-dark); font-size: 9px; font-weight: 900; }

.field-count { color: #90897f; font-size: 10px; }

.field-area { display: flex; min-height: 198px; align-items: center; justify-content: center; gap: 9px; padding: 25px 8px 18px; overflow-x: auto; }

.empty-table { display: flex; flex-direction: column; align-items: center; gap: 6px; color: #aba39a; }

.empty-table span { color: #c9c0b5; font-size: 22px; }

.empty-table b { color: #928b82; font-size: 12px; }

.empty-table small { font-size: 10px; }

.table-message { min-height: 18px; color: #777067; text-align: center; font-size: 11px; font-weight: 700; }

.card { position: relative; display: grid; width: 62px; height: 88px; flex: 0 0 62px; place-items: center; border: 1px solid #d3cdc3; border-radius: 9px; background: #fffdfa; box-shadow: 0 4px 7px rgba(51, 42, 30, .1); cursor: pointer; user-select: none; transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }

.card:hover { transform: translateY(-5px); }

.card.selected { transform: translateY(-12px); border-color: var(--red); box-shadow: 0 8px 12px rgba(112, 43, 32, .16); }

.card-rank { align-self: end; font-family: Georgia, "Times New Roman", serif; font-size: 24px; font-weight: 900; line-height: 1; }

.card-suit { align-self: start; margin-top: 8px; font-size: 17px; line-height: 1; }

.card-suit.red, .card-rank.red { color: var(--red); }

.card.suit-joker .card-rank { color: var(--red); font-size: 20px; }

.card-hidden { border-color: var(--red); background: repeating-linear-gradient(135deg, #c25743 0, #c25743 5px, #b54836 5px, #b54836 9px); color: #fff; }

.card-hidden::before { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; content: "裏"; font-size: 18px; font-weight: 900; letter-spacing: .12em; }

.card-hidden::after { position: absolute; inset: 5px; border: 1px solid rgba(255,255,255,.42); border-radius: 5px; content: ""; }

.card-hidden .card-rank, .card-hidden .card-suit { visibility: hidden; }

.hand-panel { margin-top: 15px; padding: 17px 18px 18px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255, 253, 249, .62); }

.hand-heading { justify-content: space-between; }

.hand-heading > div { display: flex; align-items: baseline; gap: 10px; }

.hand-heading b { font-size: 13px; }

.selection-count { color: var(--red); font-size: 10px; font-weight: 900; }

.hand-area { display: flex; min-height: 115px; align-items: end; justify-content: center; gap: 7px; padding: 23px 5px 4px; overflow-x: auto; }

.hand-area .card { cursor: pointer; }

.selection-preview { display: flex; min-height: 30px; align-items: center; justify-content: center; gap: 9px; border-top: 1px dashed var(--line); color: #9b938a; font-size: 10px; }

.preview-label { color: #b2aaa0; font-size: 8px; font-weight: 900; letter-spacing: .16em; }

.action-row { justify-content: center; gap: 9px; margin-top: 10px; }

.primary-action, .secondary-action, .danger-action { border: 1px solid var(--ink); border-radius: 10px; cursor: pointer; font-weight: 800; transition: transform .14s ease, opacity .14s ease, box-shadow .14s ease; }

.primary-action { min-height: 44px; padding: 0 17px; background: var(--ink); color: #fff; box-shadow: 0 3px 0 rgba(23,23,23,.25); font-size: 12px; }

.primary-action span { margin-left: 8px; color: #e37c69; }

.secondary-action { min-height: 42px; padding: 0 13px; border-color: var(--line); background: transparent; color: #68625a; font-size: 10px; }

.secondary-action span { margin-right: 3px; color: var(--red); font-size: 16px; vertical-align: -1px; }

.secondary-action small, .danger-action small { display: block; margin-top: 2px; font-size: 8px; font-weight: 500; opacity: .7; }

.danger-action { min-height: 51px; padding: 0 18px; border-color: var(--red); background: var(--red); color: #fff; font-size: 12px; }

.secondary-action:hover:not(:disabled), .primary-action:hover:not(:disabled), .danger-action:hover:not(:disabled) { transform: translateY(-2px); }

button:disabled { cursor: not-allowed; opacity: .38; }

.pass-action { min-width: 62px; }

.match-log { margin-top: 15px; }

.log-toggle { width: 100%; justify-content: space-between; padding: 10px 2px; border: 0; background: transparent; color: #928b82; cursor: pointer; font-size: 9px; font-weight: 900; letter-spacing: .17em; }

.log-toggle span:last-child { letter-spacing: 0; font-weight: 700; }

.log-list { max-height: 160px; overflow-y: auto; padding: 4px 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,249,.4); }

.log-list.is-collapsed { display: none; }

.log-entry { display: flex; gap: 9px; padding: 8px 0; border-bottom: 1px solid rgba(218,213,205,.7); color: #777067; font-size: 10px; line-height: 1.45; }

.log-entry:last-child { border-bottom: 0; }

.log-time { flex: 0 0 34px; color: #b2aaa0; font-variant-numeric: tabular-nums; }

.log-entry strong { color: var(--ink); }

/* Dialogs */
.modal-backdrop, .rules-drawer { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 20px; background: rgba(27, 22, 17, .36); backdrop-filter: blur(5px); }

.modal-card, .drawer-card { width: min(100%, 420px); padding: 29px; border: 1px solid var(--line); border-radius: 20px; background: var(--paper); box-shadow: 0 25px 60px rgba(24, 18, 12, .22); }

.modal-card h2, .drawer-card h2 { margin: 9px 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 27px; letter-spacing: -.05em; }

.modal-card p { margin: 0; color: #777067; font-size: 11px; line-height: 1.65; }

.modal-field, .penalty-field { display: flex; min-height: 123px; align-items: center; justify-content: center; gap: 8px; margin: 21px 0 22px; padding: 17px; border-radius: 12px; background: var(--paper-deep); overflow-x: auto; }

.modal-field .card, .penalty-field .card { width: 51px; height: 74px; flex-basis: 51px; cursor: default; }

.modal-field .card-rank, .penalty-field .card-rank { font-size: 19px; }

.modal-field .card-suit, .penalty-field .card-suit { margin-top: 6px; font-size: 14px; }

.modal-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.modal-actions-single { display: block; }

.modal-actions-single .primary-action { width: 100%; }

.result-card { text-align: center; }

.result-card .result-score { display: flex; flex-direction: column; align-items: center; margin: 23px 0; }

.result-score span { color: var(--red); font-family: Georgia, "Times New Roman", serif; font-size: 53px; font-weight: 900; letter-spacing: -.07em; }

.result-score small { color: #928b82; font-size: 9px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }

.result-card .primary-action { width: 100%; }

.drawer-card { position: relative; max-height: calc(100vh - 40px); overflow-y: auto; }

.drawer-close { position: absolute; top: 17px; right: 19px; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: #80786e; font-size: 22px; line-height: 1; cursor: pointer; }

.rules-list { margin-top: 20px; }

.rules-list p { display: flex; gap: 13px; margin: 0; padding: 13px 0; border-bottom: 1px solid var(--line); color: #6e675e; font-size: 11px; line-height: 1.6; }

.rules-list p:last-child { border-bottom: 0; }

.rules-list b { flex: 0 0 20px; color: var(--red); font-family: Georgia, "Times New Roman", serif; font-size: 16px; }

.drawer-note { margin-top: 19px; color: #9b938a; font-size: 10px; line-height: 1.5; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: min(360px, calc(100% - 40px)); padding: 11px 15px; border: 1px solid var(--ink); border-radius: 9px; background: var(--ink); color: #fff; font-size: 11px; opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .18s ease, transform .18s ease; }

.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (max-width: 640px) {
  .screen { padding: 28px 15px 25px; }
  .landing-screen { padding-top: 62px; }
  .brand-lockup { margin-top: 12px; }
  .brand-lockup h1 { font-size: clamp(42px, 11vw, 64px); letter-spacing: -.1em; }
  .brand-subtitle { font-size: 11px; letter-spacing: .05em; }
  .mode-grid { width: 100%; grid-template-columns: 1fr 1fr; gap: 9px; }
  .mode-card { min-height: 103px; }
  .mode-number { font-size: 27px; }
  .mode-label { font-size: 10px; }
  .landing-caption { max-width: 310px; font-size: 10px; line-height: 1.6; }
  .feature-strip { gap: 7px; }
  .feature-card { min-height: 112px; padding: 14px 7px 8px; }
  .feature-value { font-size: 26px; }
  .feature-card p { margin-top: 11px; font-size: 8px; }
  .model-note { max-width: 100%; padding: 10px 12px; }
  .model-note small { font-size: 8px; }
  .fine-print { padding-top: 28px; }
  .game-screen { padding-top: 16px; }
  .game-title-lockup { flex-direction: column; gap: 3px; }
  .game-title-lockup .eyebrow { font-size: 8px; }
  .game-title-lockup strong { font-size: 17px; }
  .header-meta { gap: 6px; }
  .model-chip { padding: 6px 7px; font-size: 8px; }
  .icon-button { width: 34px; height: 34px; }
  .scoreboard { padding: 11px 10px; }
  .player-line { min-width: 0; gap: 6px; }
  .player-line b { font-size: 10px; }
  .player-line strong { font-size: 23px; }
  .match-state { gap: 3px; }
  .turn-indicator { padding: 6px 7px; font-size: 8px; white-space: nowrap; }
  .match-state > span:last-child { font-size: 7px; }
  .table-panel, .hand-panel { padding-left: 11px; padding-right: 11px; }
  .field-area { min-height: 171px; gap: 5px; padding-top: 17px; }
  .card { width: 48px; height: 70px; flex-basis: 48px; border-radius: 7px; }
  .card-rank { font-size: 19px; }
  .card-suit { margin-top: 6px; font-size: 14px; }
  .hand-area { gap: 3px; min-height: 99px; padding-top: 18px; }
  .hand-area .card { width: 42px; height: 62px; flex-basis: 42px; }
  .hand-area .card-rank { font-size: 17px; }
  .hand-area .card-suit { font-size: 12px; }
  .action-row { flex-wrap: wrap; }
  .primary-action { flex: 1 1 120px; }
  .secondary-action { flex: 1 1 auto; }
  .modal-card, .drawer-card { padding: 24px 19px; }
  .modal-card h2, .drawer-card h2 { font-size: 24px; }
}

@media (max-width: 390px) {
  .hand-area .card { width: 38px; flex-basis: 38px; }
  .hand-area { gap: 2px; }
  .player-line small { font-size: 8px; }
  .selection-preview { font-size: 9px; }
}

/* Official-inspired mobile game skin */
:root {
  --stage-red: #8e2d35;
  --stage-red-deep: #461d25;
  --felt-green: #4d7c4d;
  --felt-green-deep: #315538;
  --wood-brown: #5d321f;
  --wood-deep: #2e1916;
  --warm-gold: #f0c65b;
  --warm-cream: #fff6d7;
}

body { background: #0c0b0d; }

.site-shell { width: min(100%, 420px); margin: 0 auto; background: var(--stage-red-deep); box-shadow: 0 0 70px rgba(0, 0, 0, .48); }

.screen { width: 100%; padding: 0; }

.landing-screen { position: relative; min-height: 100vh; justify-content: flex-start; overflow: hidden; padding: 0 15px 14px; background: radial-gradient(circle at 50% 35%, rgba(226, 132, 64, .34), transparent 42%), linear-gradient(180deg, var(--stage-red) 0%, #64232d 56%, var(--stage-red-deep) 100%); color: #fff6dc; }

.landing-screen::before { position: absolute; inset: 0; background: repeating-linear-gradient(78deg, transparent 0 23px, rgba(255, 211, 133, .055) 24px 27px, transparent 28px 47px); content: ""; pointer-events: none; }

.brand-lockup { position: relative; z-index: 1; width: 100%; max-width: none; margin: 0; padding: 38px 0 20px; }

.brand-lockup .eyebrow, .landing-screen .eyebrow { color: rgba(255, 238, 181, .72); font-size: 9px; letter-spacing: .2em; }

.brand-lockup h1 { margin: 17px 0 9px; color: var(--warm-gold); font-family: Georgia, "Times New Roman", serif; font-size: clamp(48px, 14vw, 64px); font-style: italic; letter-spacing: -.12em; line-height: .82; text-shadow: 0 3px 0 #4f2023, 0 0 18px rgba(255, 199, 78, .24); }

.brand-lockup h1 span, .brand-lockup h1 strong { color: inherit; }

.brand-lockup h1 strong { margin-left: .08em; color: #ffd98a; }

.brand-subtitle { color: rgba(255, 245, 216, .82); font-size: 11px; letter-spacing: .04em; }

.mode-grid { position: relative; z-index: 1; display: grid; width: 100%; grid-template-columns: 1fr; gap: 12px; margin: 30px auto 18px; }

.mode-card { border-color: rgba(255, 221, 133, .65); background: rgba(50, 17, 22, .34); box-shadow: 0 4px 0 rgba(39, 14, 20, .74); color: var(--warm-cream); }

.mode-card:hover { background: rgba(76, 26, 31, .6); box-shadow: 0 7px 0 rgba(39, 14, 20, .74); }

.mode-card-primary { width: 136px; min-height: 136px; justify-self: center; border: 3px solid var(--warm-gold); border-radius: 50%; background: radial-gradient(circle at 38% 30%, #fff3b0, #e4a943 55%, #9b542b 100%); box-shadow: 0 5px 0 #3f1c1c, 0 0 0 5px rgba(255, 207, 101, .18); color: #4a2020; }

.mode-card-primary:hover { background: radial-gradient(circle at 38% 30%, #fff8cd, #efbd53 55%, #a85d2d 100%); }

.mode-card-primary .mode-number { font-family: Georgia, "Times New Roman", serif; font-size: 29px; font-style: italic; }

.mode-card-primary .mode-label { color: #6a3026; font-size: 9px; }

.mode-card-primary .mode-arrow { right: 24px; bottom: 22px; color: #7c3329; }

.mode-card:not(.mode-card-primary) { min-height: 45px; flex-direction: row; gap: 10px; border-radius: 11px; box-shadow: none; }

.mode-card:not(.mode-card-primary) .mode-number { font-size: 19px; }

.mode-card:not(.mode-card-primary) .mode-label { margin-top: 0; color: rgba(255, 238, 196, .78); }

.mode-card:not(.mode-card-primary) .mode-arrow { right: 15px; bottom: 12px; }

.landing-caption { position: relative; z-index: 1; max-width: 300px; margin: 0 0 18px; color: rgba(255, 239, 202, .76); font-size: 10px; line-height: 1.6; }

.feature-strip { position: relative; z-index: 1; width: 100%; gap: 6px; }

.feature-card { min-height: 78px; padding: 13px 5px 8px; border-color: rgba(255, 220, 140, .22); border-radius: 9px; background: rgba(33, 13, 19, .28); }

.feature-value { color: var(--warm-gold); font-size: 24px; text-shadow: 0 1px 0 #512021; }

.feature-card-accent .feature-value { color: #ffe7a2; }

.feature-unit { color: rgba(255, 229, 161, .56); font-size: 7px; }

.feature-card p { margin-top: 8px; color: rgba(255, 239, 202, .63); font-size: 8px; }

.model-note { position: relative; z-index: 1; width: 100%; margin: 15px 0 0; padding: 10px 12px; border-color: rgba(255, 220, 140, .25); border-radius: 9px; background: rgba(30, 12, 17, .34); color: rgba(255, 239, 202, .8); }

.model-note b { font-size: 10px; }

.model-note small { color: rgba(255, 229, 161, .58); font-size: 8px; }

.status-dot { background: var(--warm-gold); box-shadow: 0 0 0 4px rgba(240, 198, 91, .14); }

.fine-print { position: relative; z-index: 1; padding-top: 22px; color: rgba(255, 229, 190, .44); font-size: 8px; }

/* The original game keeps the match in a narrow portrait stage. */
.game-screen { position: relative; display: flex; min-height: 100vh; flex-direction: column; overflow: hidden; padding: 0; background: var(--felt-green-deep); color: #fff8de; }

.game-screen::before { position: absolute; inset: 0; background: repeating-linear-gradient(16deg, transparent 0 31px, rgba(225, 244, 164, .035) 32px 34px, transparent 35px 65px); content: ""; pointer-events: none; }

.game-header { position: relative; z-index: 2; flex: 0 0 auto; margin: 0; padding: 8px 10px; border-bottom: 2px solid rgba(240, 198, 91, .74); background: linear-gradient(180deg, #9b3037, #631f2a); color: #fff4d0; }

.game-title-lockup { gap: 7px; }

.game-title-lockup .eyebrow { display: block; color: rgba(255, 228, 151, .78); font-size: 8px; letter-spacing: .12em; }

.game-title-lockup strong { color: #ffe4a0; font-size: 17px; text-shadow: 0 1px 0 #4b1b22; }

.game-title-lockup em { color: #fff2c7; }

.icon-button { width: 31px; height: 31px; border-color: rgba(255, 224, 145, .55); color: #fff1c5; font-size: 17px; }

.icon-button:hover { background: rgba(255, 234, 170, .12); }

.header-meta { gap: 6px; }

.model-chip { padding: 5px 7px; background: rgba(255, 222, 137, .14); color: #ffe3a2; font-size: 7px; letter-spacing: .1em; }

.scoreboard { position: relative; z-index: 1; display: grid; min-height: 108px; grid-template-columns: 1fr auto 1fr; flex: 0 0 auto; padding: 9px 10px 16px; border: 0; border-radius: 0; background: linear-gradient(180deg, rgba(28, 49, 32, .86), rgba(44, 76, 46, .72)); color: #fff8df; }

.player-line { min-width: 0; gap: 6px; }

.player-line-opponent { grid-column: 1 / -1; display: grid; grid-template-columns: auto 1fr auto; align-items: start; }

.player-line-human { grid-column: 3; align-self: end; justify-self: end; }

.player-line b { color: #fff5d4; font-size: 10px; }

.player-line small { color: rgba(255, 245, 209, .62); font-size: 8px; }

.player-line strong { color: #fff6d6; font-size: 24px; }

.player-line strong small { color: rgba(255, 245, 209, .62); }

.player-avatar { width: 34px; height: 34px; flex-basis: 34px; border: 2px solid #522620; border-radius: 9px; background: #fff5d6; color: #59302a; font-size: 17px; line-height: 1; }

.avatar-opponent { background: #f3d9a9; color: #71352e; }

.avatar-human { background: #fff4cb; color: #71352e; }

.opponent-hand { grid-column: 2 / -1; display: flex; min-height: 26px; align-items: center; justify-content: center; gap: 2px; margin-top: 4px; }

.mini-card-back { display: block; width: 14px; height: 23px; border: 1px solid #f3d383; border-radius: 2px; background: repeating-linear-gradient(135deg, #516a8a 0 2px, #d9d7bb 2px 4px); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }

.match-state { position: absolute; top: 49px; left: 50%; z-index: 2; gap: 3px; transform: translateX(-50%); }

.turn-indicator { padding: 5px 8px; border: 1px solid rgba(69, 42, 26, .45); background: var(--warm-gold); color: #4a271e; font-size: 8px; }

.turn-indicator.opponent-turn { background: #e9a750; color: #4a271e; }

.match-state > span:last-child { color: rgba(255, 239, 187, .68); font-size: 7px; letter-spacing: .14em; }

.table-panel { position: relative; z-index: 1; display: flex; min-height: 320px; flex: 1 1 auto; flex-direction: column; margin: 0; padding: 9px 9px 0; border: 0; border-radius: 0; background: linear-gradient(180deg, #5c9056, var(--felt-green)); }

.table-toolbar { color: rgba(255, 244, 203, .77); }

.table-label { color: rgba(255, 239, 187, .68); font-size: 8px; letter-spacing: .18em; }

.rule-state { margin-right: 8px; padding: 4px 7px; background: rgba(255, 250, 209, .18); color: #fff0bd; font-size: 8px; }

.field-count { color: rgba(255, 239, 187, .72); font-size: 8px; }

.field-area { min-height: 230px; flex: 1 1 auto; align-items: center; gap: 0; padding: 18px 8px 10px; }

.field-area .card { margin-left: -22px; border: 2px solid #4d3127; border-radius: 5px; box-shadow: 0 4px 3px rgba(25, 49, 27, .32); }

.field-area .card:first-child { margin-left: 0; }

.field-area .card:nth-child(odd) { transform: rotate(-2deg); }

.field-area .card:nth-child(even) { transform: rotate(2deg); }

.field-area .card-hidden { border-color: #f0c65b; }

.empty-table { color: rgba(255, 246, 210, .78); }

.empty-table span { color: rgba(255, 231, 157, .55); }

.empty-table b { color: rgba(255, 246, 210, .9); font-size: 11px; }

.empty-table small { color: rgba(255, 239, 187, .67); font-size: 9px; }

.table-message { min-height: 22px; margin: 0 -9px; padding: 6px 8px; background: rgba(29, 53, 32, .3); color: rgba(255, 245, 207, .88); font-size: 9px; }

.hand-panel { position: relative; z-index: 2; flex: 0 0 auto; margin: 0; padding: 10px 9px 13px; border: 0; border-radius: 0; background: linear-gradient(180deg, var(--wood-brown), var(--wood-deep)); color: #fff2ca; }

.hand-heading b { color: #fff0bf; font-size: 11px; }

.selection-count { color: var(--warm-gold); font-size: 9px; }

.hand-area { min-height: 93px; gap: 0; align-items: end; padding: 15px 0 5px; }

.hand-area .card { width: 52px; height: 73px; flex-basis: 52px; margin-left: -14px; border: 2px solid #56352a; border-radius: 5px; box-shadow: 0 4px 3px rgba(13, 8, 7, .35); }

.hand-area .card:first-child { margin-left: 0; }

.hand-area .card:hover { transform: translateY(-5px); }

.hand-area .card.selected { transform: translateY(-11px); border-color: var(--warm-gold); box-shadow: 0 8px 8px rgba(18, 8, 6, .35); }

.hand-area .card-hidden { border-color: #f0c65b; }

.hand-area .card-hidden::before { font-size: 14px; }

.selection-preview { min-height: 25px; border-top-color: rgba(255, 226, 153, .24); color: rgba(255, 236, 184, .68); font-size: 8px; }

.preview-label { color: rgba(255, 216, 125, .55); font-size: 7px; }

.action-row { gap: 6px; margin-top: 7px; }

.primary-action, .secondary-action, .danger-action { border-color: rgba(255, 224, 145, .7); }

.primary-action { min-height: 45px; padding: 0 22px; border-radius: 22px; background: var(--warm-cream); color: #4a251d; box-shadow: 0 3px 0 #251312; font-size: 12px; }

.primary-action span { color: #a74a2f; }

.secondary-action { min-height: 39px; padding: 0 10px; border-color: rgba(255, 219, 130, .42); background: rgba(35, 15, 13, .3); color: #ffeac0; font-size: 9px; }

.secondary-action span { color: var(--warm-gold); }

.match-log { position: relative; z-index: 2; margin: 0; padding: 0 9px 5px; background: var(--wood-deep); }

.log-toggle { padding: 8px 2px 4px; color: rgba(255, 220, 150, .58); font-size: 7px; }

.log-list { border-color: rgba(255, 222, 144, .18); background: rgba(17, 8, 8, .24); }

.log-entry { border-bottom-color: rgba(255, 222, 144, .12); color: rgba(255, 236, 188, .7); font-size: 8px; }

.modal-backdrop, .rules-drawer { background: rgba(18, 9, 12, .76); backdrop-filter: blur(2px); }

.modal-card, .drawer-card { border: 2px solid rgba(240, 198, 91, .74); border-radius: 8px; background: linear-gradient(180deg, #673722, #2e1917); box-shadow: 0 18px 50px rgba(0, 0, 0, .42); color: #fff1c8; }

.modal-kicker { color: rgba(255, 216, 125, .72); font-size: 8px; }

.modal-card h2, .drawer-card h2 { color: #fff2c8; font-size: 25px; text-shadow: 0 2px 0 #351a17; }

.modal-card p, .drawer-card p { color: rgba(255, 236, 190, .72); font-size: 10px; }

.modal-field, .penalty-field { min-height: 112px; margin: 18px 0 19px; border: 1px solid rgba(255, 221, 136, .25); background: rgba(19, 10, 9, .28); }

.modal-actions { gap: 8px; }

.modal-actions .secondary-action { border-color: rgba(255, 219, 130, .46); background: rgba(23, 11, 10, .35); color: #ffecc5; }

.modal-actions .danger-action { min-height: 60px; border-color: #f5d054; border-radius: 7px; background: #f4ce48; color: #3a2118; box-shadow: 0 4px 0 #6c321f; font-size: 15px; text-shadow: none; }

.modal-actions .danger-action small { color: #5e2e20; opacity: .8; }

.modal-actions-single .primary-action { width: 100%; }

.drawer-close { border-color: rgba(255, 219, 130, .4); color: #ffe9b7; }

.rules-list p { border-bottom-color: rgba(255, 221, 136, .2); color: rgba(255, 236, 190, .76); }

.rules-list b { color: var(--warm-gold); }

.drawer-note { color: rgba(255, 229, 174, .58); }

.drawer-note a { color: #ffdc78; }

.result-score span { color: var(--warm-gold); text-shadow: 0 2px 0 #4b211b; }

/* Match the original portrait proportions while retaining desktop letterboxing. */
@media (max-width: 420px) {
  .site-shell { box-shadow: none; }
}

@media (max-width: 390px) {
  .hand-area .card { width: 45px; flex-basis: 45px; }
  .hand-area { gap: 0; }
}

/* Interaction feedback keeps the table readable while actions resolve. */
.clock-chip {
  padding: 5px 7px;
  border: 1px solid rgba(255, 224, 145, .28);
  border-radius: 999px;
  color: rgba(255, 231, 170, .76);
  font-size: 8px;
  font-variant-numeric: tabular-nums;
}

.clock-chip.is-active {
  border-color: rgba(255, 224, 145, .72);
  color: #fff0b7;
}

.player-clock {
  color: rgba(255, 229, 161, .52) !important;
  font-variant-numeric: tabular-nums;
}

.card.is-revealing {
  animation: reveal-card .42s ease both;
}

@keyframes reveal-card {
  0% { transform: rotateY(90deg) scale(.92); opacity: .42; }
  55% { transform: rotateY(-8deg) scale(1.04); opacity: 1; }
  100% { transform: rotateY(0) scale(1); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .card.is-revealing { animation: none; }
}

/* Keep the live table inside the viewport and preserve contrast in the hand. */
body.is-game-active { overflow: hidden; }

.game-screen {
  height: 100vh;
  min-height: 100vh;
  max-height: 100vh;
}

@supports (height: 100svh) {
  .game-screen {
    height: 100svh;
    min-height: 100svh;
    max-height: 100svh;
  }
}

.game-screen .table-panel,
.game-screen .field-area {
  min-height: 0;
}

.game-screen .card { color: #2b2524; }

.game-screen .card-hidden { color: #fff; }

.hand-panel .secondary-action:disabled,
.hand-panel .primary-action:disabled {
  opacity: .72;
}

.hand-panel .secondary-action:disabled {
  border-color: rgba(255, 219, 130, .34);
  background: rgba(35, 15, 13, .22);
  color: rgba(255, 236, 192, .72);
}

.hand-panel .secondary-action:disabled span { color: rgba(240, 198, 91, .72); }

.hand-panel .primary-action:disabled {
  background: rgba(255, 246, 215, .62);
  color: rgba(74, 37, 29, .78);
  box-shadow: 0 3px 0 rgba(37, 19, 18, .65);
}
