@charset "UTF-8";

:root {
  --page: #f4f3ef;
  --surface: #fff;
  --ink: #211e1a;
  --muted: #746e66;
  --accent: #9b3c24;
  --accent-strong: #792c1a;
  --line: #ddd8ce;
  --soft: #eeece7;
  --gold: #9b3c24;
  --rose: #9b3c24;
  --teal: #62554b;
  --radius: 12px;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 15px;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 0; }
button, input, textarea, select { font: inherit; }
button, a, input { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button, a { touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .45; }
a { color: inherit; text-decoration: none; }
button, input, textarea { outline-offset: 4px; }
:focus-visible { outline: 3px solid #b3634d; outline-offset: 3px; }
input:focus-visible { outline-width: 2px; outline-offset: 2px; }
button svg, a svg { flex-shrink: 0; }
svg { display: block; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { font-weight: 650; }
strong { font-weight: 650; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 550;
  line-height: 1.5;
  background: transparent;
  transition: background .14s, color .14s, border-color .14s;
}
.button.primary { color: #fff; background: var(--accent); }
.button.primary:hover:not(:disabled) { background: var(--accent-strong); }
.button.secondary { background: var(--surface); border-color: var(--line); }
.button.secondary:hover:not(:disabled) { border-color: #b6aa9a; background: #fbfaf7; }
.button.danger { background: #9b3c24; color: #fff; }
.button.text-button { color: var(--muted); padding: 8px 6px; font-weight: 500; }
.button.text-button:hover { color: var(--accent); }
.button.icon-button { width: 44px; min-width: 44px; height: 44px; padding: 11px; border-radius: 50%; }
.button.icon-button:hover { background: var(--soft); }
.button.compact { min-height: 38px; padding: 6px 15px; font-size: 13px; }
.full-width { width: 100%; }
.initial-loading { min-height: 100dvh; display: grid; place-items: center; font: 40px "Songti SC", SimSun, serif; color: var(--accent); }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); white-space: nowrap; }
.brand > span { font-family: "Songti SC", SimSun, serif; font-weight: 700; font-size: 27px; letter-spacing: 1px; }
.brand > svg { color: var(--accent); }
.app-shell { display: grid; grid-template-columns: 188px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; padding: 34px 20px 24px; background: #171512; border-right: 1px solid #171512; display: flex; flex-direction: column; color: #f7f3eb; }
.sidebar .brand { color: #f7f3eb; }
.sidebar .nav-link { color: #b5afa5; }
.sidebar .nav-link:hover { color: #fff; background: #28241f; }
.sidebar .nav-link.selected { background: #30251f; color: #f7eee3; box-shadow: inset 3px 0 #ad4b31; }
.sidebar .nav-link.selected > svg { color: #d9805c; }
.sidebar .brand > svg { width: 43px; height: 43px; }
.sidebar .brand > span { font-size: 24px; letter-spacing: 2px; }
.sidebar .brand { margin: 0 4px 49px; }
.desktop-nav { display: flex; flex-direction: column; gap: 10px; }
.nav-link { display: flex; gap: 13px; align-items: center; min-height: 48px; padding: 12px 15px; border-radius: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.nav-link:hover { color: var(--accent); background: #ece8e0; }
.nav-link.selected { background: #f0e6df; color: var(--accent); font-weight: 650; }
.sidebar-bottom { margin-top: auto; }
.sidebar-bottom .button { justify-content: flex-start; width: 100%; font-weight: 500; }
.sidebar-signature { margin: 26px 14px 0; padding-top: 20px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 10px; color: #7a879e; font-size: 11px; letter-spacing: 1px; }
.signature-grid { width: 20px; height: 20px; background-image: linear-gradient(#cfd8e9 1px, transparent 1px), linear-gradient(90deg, #cfd8e9 1px, transparent 1px); background-size: 6px 6px; }
.main-column { min-width: 0; }
.topbar { height: 88px; display: flex; align-items: center; justify-content: space-between; padding: 0 40px; gap: 20px; }
.topbar-label { color: #81786d; font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 17px; margin-left: auto; }
.connection-status { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.status-dot { width: 6px; height: 6px; background: #9b3c24; border-radius: 50%; }
.preview-status .status-dot { background: var(--gold); }
.disconnected { color: #9b3c24; }
.disconnected .status-dot { background: #9b3c24; }
.user-button { gap: 9px; padding: 0 0 0 12px; min-height: 44px; }
.avatar { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: #e9e2d8; color: var(--accent); font-size: 15px; font-weight: 600; flex-shrink: 0; }
.avatar.large { width: 56px; height: 56px; font-size: 24px; }
.user-name { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-balance { display: flex; gap: 4px; align-items: center; color: #76503c; font-size: 12px; margin-left: 7px; font-variant-numeric: tabular-nums; }
.main-content { max-width: 1360px; padding: 9px 40px 32px; margin: auto; }
.page-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { font-size: clamp(26px, 2.4vw, 34px); font-weight: 650; letter-spacing: -.7px; }
.filter-tabs { display: flex; gap: 4px; }
.filter-tab { min-height: 38px; padding: 7px 16px; border-radius: 6px; color: var(--muted); font-weight: 450; }
.filter-tab.active { background: #e6e2da; color: var(--ink); }
.game-collection { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 15px; margin-bottom: 35px; }
.game-tile { position: relative; min-width: 0; padding: 0 0 17px; display: flex; flex-direction: column; gap: 14px; border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.game-tile-art { display: block; width: 100%; border-radius: 12px; overflow: hidden; background: #e8e5de; transition: background .15s; }
.game-art { width: 100%; height: auto; overflow: visible; }
.game-tile-art .game-art { transform: scale(1.09); }
.game-tile-name { font-size: 14px; font-weight: 550; }
.game-tile-check { position: absolute; right: 9px; top: 9px; display: none; align-items: center; justify-content: center; width: 21px; height: 21px; background: var(--accent); color: white; border: 3px solid #f4f3ef; border-radius: 50%; }
.game-tile.active { color: var(--accent); }
.game-tile.active::after { content: ""; height: 3px; width: 27px; border-radius: 3px; background: var(--accent); position: absolute; bottom: 0; }
.game-tile.active .game-tile-check { display: flex; }
.game-tile.active .game-tile-art { background: #211e19 !important; box-shadow: none !important; }
.game-tile.active .game-tile-check { border-color: #211e19; background: #a94b30; }
.game-tile:not(.active):hover .game-tile-art { background: #e4dfd6; }
.game-tile.teal .game-tile-art { background: #e9e6de; }
.game-tile.ink .game-tile-art { background: #e3e0d9; }
.game-tile.rose .game-tile-art { background: #efe5df; }
.game-tile.gold .game-tile-art { background: #ece7df; }
.game-tile.violet .game-tile-art { background: #e7e3dc; }
.game-tile:not(.blue).active .game-tile-art { box-shadow: inset 0 0 0 1px #b29a86; }
.lobby-room-layout { display: grid; grid-template-columns: minmax(0, 1fr) 292px; gap: 30px; align-items: start; }
.rooms-panel { min-width: 0; padding-top: 5px; }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; min-height: 36px; }
.section-heading h2 { font-size: 21px; letter-spacing: -.3px; }
.section-title { display: flex; align-items: center; gap: 12px; }
.section-title .muted { font-size: 13px; }
.section-divider { height: 15px; width: 1px; background: #c6bcaf; }
.room-tabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); margin-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.room-tabs::-webkit-scrollbar { display: none; }
.room-tab { position: relative; flex-shrink: 0; color: var(--muted); padding: 9px 1px 12px; border: 0; border-radius: 0; font-size: 13px; font-weight: 500; }
.room-tab.active { color: var(--accent); font-weight: 650; }
.room-tab.active::after { content: ""; position: absolute; left: 0; right: 0; height: 2px; bottom: 0; background: var(--accent); }
.room-list { min-height: 220px; }
.room-row { width: 100%; min-height: 83px; display: flex; justify-content: flex-start; padding: 16px 13px; gap: 16px; border: 0; border-bottom: 1px solid #e4ded4; border-radius: 0; text-align: left; }
.room-row:hover { background: #eae5dd; }
.room-row.selected { background: #f0e6df; border-radius: 7px; border-color: transparent; }
.room-symbol { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; flex-shrink: 0; color: var(--accent); background: #e7e1d7; border-radius: 10px; }
.room-symbol.rose { color: var(--rose); background: #efe2da; }
.room-symbol.gold { color: #9b3c24; background: #ece2d8; }
.room-symbol.teal { color: var(--teal); background: #e9e4dc; }
.room-row-main { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.room-row-main strong { font-size: 14px; font-weight: 550; }
.room-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 12px; font-weight: 400; }
.meta-separator { width: 3px; height: 3px; background: #b3a68f; border-radius: 50%; }
.room-selected-indicator { margin-left: auto; color: #9b8c7a; }
.room-row.selected .room-selected-indicator { color: var(--accent); }
.room-detail { overflow: hidden; background: white; border: 1px solid #ddd6cb; border-radius: 14px; }
.room-detail-top { position: relative; height: 154px; background: #211e1a; overflow: hidden; }
.room-detail-top.teal { background: #211e1a; }
.room-detail-top.ink { background: #211e1a; }
.room-detail-top.rose { background: #211e1a; }
.room-detail-top.gold { background: #211e1a; }
.room-detail-top.violet { background: #211e1a; }
.detail-game-title { position: absolute; top: 22px; left: 22px; font-family: "Songti SC", SimSun, serif; font-weight: bold; font-size: 25px; letter-spacing: 1px; color: #f8f4eb; }
.room-detail-top .game-art { position: absolute; width: 230px; right: -15px; top: 23px; }
.room-detail-content { padding: 21px 23px 23px; }
.room-detail-content h3 { font-size: 16px; line-height: 1.7; margin-bottom: 17px; }
.detail-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; font-size: 12px; line-height: 1.5; }
.detail-facts > span { color: var(--muted); }
.detail-facts > strong { text-align: right; font-weight: 500; }
.detail-link { margin: 4px 0 8px; font-size: 12px !important; }
.play-button { width: 100%; min-height: 47px; font-size: 14px; }
.lobby-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; border-top: 1px solid var(--line); margin-top: 29px; padding-top: 19px; }
.footer-link { padding: 5px 0; min-height: 38px; color: var(--muted); font-weight: 400; font-size: 12px; }
.footer-link:hover { color: var(--accent); }
.mobile-brand, .mobile-nav { display: none; }
.skip-link { position: fixed; top: -60px; left: 20px; z-index: 100; padding: 12px; background: white; border: 2px solid var(--accent); }
.skip-link:focus { top: 10px; }
.empty-state { min-height: 210px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 19px; color: var(--muted); text-align: center; padding: 24px 12px; }
.empty-state > svg { color: #9b8161; }
.empty-state p { font-size: 14px; }
.empty-copy { color: var(--muted); text-align: center; padding: 50px 15px; }
.inline-error, .game-network { display: flex; justify-content: space-between; align-items: center; gap: 16px; background: #f7e7de; color: #9b3c24; border-radius: 7px; padding: 8px 14px; font-size: 13px; margin: 12px 0; }
.inline-error .button, .game-network .button { flex-shrink: 0; color: inherit; }
.skeleton { background: #e5dfd5; border-radius: 6px; animation: breathe 1.8s ease-in-out infinite; }
.skeleton-room { height: 63px; margin: 15px 0; }
.loading-row { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 55px 12px; color: var(--muted); font-size: 14px; }
.spinner, .small-spinner { display: inline-block; width: 26px; height: 26px; border: 2px solid #ded0bf; border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
.small-spinner { width: 16px; height: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes breathe { 50% { opacity: .5; } }

/* Account */
.auth-page { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(440px, 1fr); min-height: 100dvh; background: white; }
.auth-visual { position: relative; min-height: 690px; background: #171512; overflow: hidden; }
.auth-visual::before { content: "♦"; position: absolute; bottom: -155px; right: -20px; color: #221d17; font-family: Georgia, serif; font-size: 580px; line-height: 1; }
.auth-brand { position: absolute; top: 45px; left: 48px; color: white; z-index: 1; }
.auth-brand > svg { color: white; }
.auth-brand > span { font-size: 24px; }
.auth-board { position: absolute; width: min(94%, 65vh); left: 50%; top: 10%; transform: translateX(-50%) rotate(-3deg); }
.auth-board .brand-art { width: 100%; filter: drop-shadow(0 24px 24px #0000003b); }
.auth-title { position: absolute; bottom: 70px; left: 53px; color: white; }
.auth-title h1 { font-family: "Songti SC", SimSun, serif; font-size: clamp(70px, 7.5vw, 116px); line-height: 1.15; font-weight: 700; letter-spacing: 8px; margin-bottom: 23px; }
.auth-game-names { font-size: 14px; letter-spacing: 4px; }
.auth-game-names span { opacity: .4; padding: 0 9px; }
.auth-form-area { display: flex; align-items: center; justify-content: center; padding: 50px 45px; }
.auth-form-inner { width: 100%; max-width: 350px; }
.auth-form-inner h2 { font-size: 34px; letter-spacing: -.8px; margin-bottom: 30px; }
.auth-tabs { display: flex; gap: 32px; border-bottom: 1px solid var(--line); margin-bottom: 30px; }
.auth-tabs .tab { position: relative; border-radius: 0; padding: 8px 2px 13px; min-height: 40px; color: var(--muted); font-size: 15px; }
.auth-tabs .tab.active { color: var(--accent); }
.auth-tabs .tab.active::after { position: absolute; content: ""; height: 2px; background: var(--accent); left: 0; right: 0; bottom: -1px; }
.auth-form, .form-stack { display: flex; flex-direction: column; gap: 21px; }
.field { display: flex; flex-direction: column; gap: 10px; color: var(--ink); font-size: 13px; font-weight: 500; }
input:not([type="range"]), textarea, select { min-height: 48px; width: 100%; padding: 12px 14px; border: 1px solid #d5ccbf; border-radius: 7px; color: var(--ink); background: #fff; font-size: 15px; }
input::placeholder, textarea::placeholder { color: #918474; font-weight: 400; }
.form-error { font-size: 13px; color: #9b3c24; line-height: 1.6; }
.form-error:empty { display: none; }
.auth-submit { width: 100%; min-height: 49px; margin-top: 8px; }
.auth-preview { display: flex; justify-content: center; margin-top: 19px; }
.auth-preview .button { color: var(--accent); }
.auth-footnote { margin-top: 46px; text-align: center; color: #8e8172; font-size: 12px; }
.auth-mobile-brand { display: none; }

/* Dialogs and secondary views */
.dialog { border: 0; border-radius: 16px; color: var(--ink); background: white; padding: 0; width: min(480px, calc(100vw - 32px)); max-height: min(86dvh, 800px); overflow: auto; box-shadow: 0 24px 100px #22160c26; }
.dialog.wide { width: min(720px, calc(100vw - 32px)); }
.dialog::backdrop { background: #211e1a66; backdrop-filter: blur(4px); }
.dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px 15px 27px; background: white; border-bottom: 1px solid #e9e3d9; gap: 10px; }
.dialog-header h2 { font-size: 20px; }
.dialog-body { padding: 25px 27px; line-height: 1.8; font-size: 14px; overflow-wrap: anywhere; }
.dialog-footer { position: sticky; bottom: 0; background: white; display: flex; justify-content: flex-end; gap: 10px; border-top: 1px solid #e9e3d9; padding: 17px 24px; }
.confirm-copy { color: var(--muted); line-height: 1.9; }
.rules { margin: 0; padding-left: 22px; color: #625649; line-height: 2; }
.rules li + li { margin-top: 13px; }
.room-rules h3 { font-size: 15px; margin-bottom: 15px; }
.facts { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 15px; margin: 25px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.toast { position: fixed; z-index: 10000; left: 50%; bottom: max(25px, env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(480px, calc(100vw - 32px)); display: flex; gap: 10px; align-items: center; padding: 13px 19px; background: var(--ink); color: white; border-radius: 9px; font-size: 13px; line-height: 1.65; box-shadow: 0 8px 25px #22160c26; }
.toast.error { background: #8e321d; }
.toast.success { background: #504737; }
.toast svg { flex-shrink: 0; }
.coach { position: fixed; z-index: 20; right: 25px; bottom: 24px; width: min(325px, calc(100vw - 32px)); background: white; border: 1px solid #c9b296; border-radius: 12px; box-shadow: 0 12px 48px #30201329; padding: 14px 16px 12px; font-size: 13px; }
.coach-heading { display: flex; align-items: center; gap: 10px; }
.coach-heading .icon-button { margin: -6px -5px -6px auto; width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
.coach-step { font-size: 11px; color: var(--accent); font-variant-numeric: tabular-nums; background: #f2e7dc; padding: 3px 5px; border-radius: 3px; }
.coach p { color: var(--muted); line-height: 1.8; margin-top: 9px; }
.coach-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.profile-identity { display: flex; gap: 16px; align-items: center; }
.profile-identity h3 { font-size: 21px; }
.profile-identity .muted { font-size: 12px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); padding: 22px 0; border-bottom: 1px solid var(--line); margin: 8px 0 12px; gap: 10px; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat strong { font-size: 24px; font-weight: 550; font-variant-numeric: tabular-nums; font-family: Bahnschrift, "PingFang SC", sans-serif; }
.stat span { font-size: 12px; color: var(--muted); }
.profile-menu-item { width: 100%; justify-content: flex-start; padding: 15px 0; border-bottom: 1px solid #e9e3d9; border-radius: 0; }
.profile-menu-item svg:first-child { color: #8a7760; margin-right: 7px; }
.profile-menu-item svg:last-child { margin-left: auto; color: #9b8e7a; }
.profile-logout { margin-top: 17px; }
.inventory-row { display: flex; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); padding: 15px 0; }
.inventory-row > strong { margin-left: auto; }
.chat-messages { max-height: 48dvh; overflow: auto; white-space: normal; font-size: 13px; color: #5f564c; line-height: 2.15; }
.chat-composer { display: flex; gap: 10px; margin-top: 22px; }
.chat-composer > input { min-width: 0; }
.chat-composer .icon-button { border-radius: 7px; width: 48px; height: 48px; }
.chat-composer .icon-button:hover { background: var(--accent-strong); }
.data-surface { padding: 25px 30px; background: white; border: 1px solid var(--line); border-radius: 12px; min-height: 330px; margin-top: 25px; }
.server-content { line-height: 2; font-size: 14px; overflow: auto; overflow-wrap: anywhere; }
.server-content table { width: 100%; border-collapse: collapse; }
.server-content td, .server-content th { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.record-row { padding: 18px 0; display: flex; gap: 24px; align-items: center; border-bottom: 1px solid var(--line); font-size: 13px; flex-wrap: wrap; }
.record-row > strong { margin-right: auto; }
.record-row > span { color: var(--muted); font-variant-numeric: tabular-nums; }
.fatal-error { padding: 80px 25px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100dvh; gap: 20px; text-align: center; }
.fatal-error h1 { font-size: 24px; }

/* Match table */
.play-page { min-height: 100dvh; background: #efede7; padding-bottom: env(safe-area-inset-bottom); }
.play-header { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #e2dbcf; padding: 0 max(25px, calc((100vw - 1100px) / 2)); background: #fff; }
.play-heading, .play-header-actions { display: flex; gap: 12px; align-items: center; }
.play-heading h1 { font-size: 20px; font-weight: 600; }
.play-brand { color: var(--accent); margin-right: 6px; }
.play-brand > svg { width: 27px; height: 27px; }
.preview-pill { font-size: 11px; color: #76503c; border: 1px solid #d9c8ad; padding: 3px 7px; border-radius: 4px; white-space: nowrap; }
.battle-area { max-width: 1100px; padding: 26px 24px 24px; margin: auto; }
.versus-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 25px; }
.player { display: flex; align-items: center; gap: 12px; width: 30%; min-width: 0; }
.player-avatar { width: 45px; height: 45px; border-radius: 50%; background: #eadecd; color: var(--accent); display: flex; align-items: center; justify-content: center; border: 3px solid transparent; flex-shrink: 0; }
.player.current .player-avatar { border-color: var(--accent); background: white; }
.player-name { display: flex; flex-direction: column; gap: 4px; overflow: hidden; }
.player-name strong { font-size: 14px; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.player-score { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.player.opponent { flex-direction: row-reverse; text-align: right; }
.opponent .player-avatar { background: #e0dcd6; color: var(--rose); }
.opponent.current .player-avatar { border-color: var(--rose); background: white; }
.versus-center { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.turn-status { color: var(--accent); font-size: 14px; font-weight: 650; }
.turn-status.waiting { color: var(--muted); }
.round-time { display: flex; gap: 13px; align-items: center; font-size: 12px; color: var(--muted); white-space: nowrap; }
.turn-timer { color: var(--ink); font-variant-numeric: tabular-nums; min-width: 30px; }
.battle-layout { display: grid; grid-template-columns: minmax(0, 1fr) 218px; gap: 25px; align-items: start; }
.board-stage { min-width: 0; border: 1px solid #ddd8ce; border-radius: 14px; background: #fff; overflow: hidden; }
.board-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 19px; min-height: 61px; border-bottom: 1px solid #e6dfd3; }
.board-tabs { display: flex; align-items: center; gap: 4px; }
.board-tab { color: var(--muted); border-radius: 5px; padding: 6px 11px; min-height: 34px; font-size: 13px; }
.board-tab.active { background: #f0e6df; color: var(--accent); }
.board-title { font-size: 14px; font-weight: 600; }
.board-counts { font-size: 12px; color: var(--muted); white-space: nowrap; }
.board-counts strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.maze-page .board-toolbar { flex-wrap: wrap; }
.maze-page .board-counts { display: flex; gap: 14px; align-items: center; margin-left: auto; }
.maze-page .board-counts .text-button { font-size: 12px; min-height: 34px; }
.board-content { display: flex; justify-content: center; align-items: center; min-height: 230px; padding: 25px; }
.maze-board { width: min(100%, calc(100dvh - 275px), 540px); height: auto; overflow: visible; user-select: none; }
.maze-cell { cursor: pointer; outline: none; }
.maze-cell:focus-visible > rect { stroke: var(--accent); stroke-width: 3px; }
.wall-target { cursor: crosshair; }
.wall-target:hover { fill: #9b3c2422; }
.battle-sidebar { padding-top: 3px; }
.game-controls { display: flex; flex-direction: column; gap: 12px; padding: 19px; border: 1px solid #ddd2c2; border-radius: 12px; background: #fbfaf7; }
.controls-title { color: var(--muted); font-size: 13px; margin-bottom: 3px; }
.game-controls .full-width { font-size: 14px; }
.direction-pad { display: grid; grid-template-columns: repeat(3, 48px); grid-template-rows: repeat(3, 48px); gap: 5px; justify-content: center; margin: 10px 0; }
.direction-key { border-radius: 9px; padding: 0; width: 48px; height: 48px; font-size: 23px; background: white; border: 1px solid #d5c7b3; color: #4c3a25; }
.direction-key:hover:not(:disabled) { background: #eee1d0; border-color: var(--accent); }
.direction-key.up { grid-area: 1 / 2; }
.direction-key.left { grid-area: 2 / 1; }
.direction-key.center { grid-area: 2 / 2; border-color: transparent; background: transparent; }
.direction-key.right { grid-area: 2 / 3; }
.direction-key.down { grid-area: 3 / 2; }
.pad-dot { width: 8px; height: 8px; background: #a68e6c; border-radius: 50%; }
.battle-utilities { display: flex; justify-content: center; margin-top: 12px; }
.battle-utilities .text-button { font-size: 12px; }
.watching-label { color: var(--muted); display: flex; align-items: center; gap: 10px; font-size: 14px; justify-content: center; padding: 20px 0; }
.treasure-board { display: grid; grid-template-columns: repeat(var(--board-size), minmax(0, 1fr)); gap: 5px; aspect-ratio: 1; width: min(100%, calc(100dvh - 275px), 530px); }
.treasure-cell { aspect-ratio: 1; width: 100%; min-height: 0; padding: 0; border-radius: 5px; background: #e5dfd5; border: 1px solid #d3c7b5; color: var(--number-color, var(--accent)); font-family: Bahnschrift, "PingFang SC", sans-serif; font-size: clamp(14px, 1.7vw, 23px); font-weight: 600; box-shadow: 0 3px 0 #c6b9a4; margin-bottom: 3px; }
.treasure-cell:hover { background: #e9decb; border-color: #bea782; }
.treasure-cell.revealed { background: #f8f5ee; border-color: #e3daca; box-shadow: none; }
.treasure-cell.found { color: #9b3c24; background: #efe1ce; border-color: #d7bc98; }
.treasure-cell.selected { border: 2px solid var(--accent); background: #e8d7bb; box-shadow: 0 3px 0 #b69b73; }
.treasure-cell.planted { background: #ead2b4; color: #9b3c24; }
.dig-selection { min-height: 46px; color: var(--accent); font-size: 32px; font-family: Bahnschrift, sans-serif; font-weight: 500; margin: 2px 0 5px; }
.result-content { display: flex; align-items: center; flex-direction: column; gap: 24px; padding: 18px 0; }
.result-content > svg { color: var(--gold); }
.result-content p { color: var(--muted); }
.game-history:empty { display: none; }

/* Cards */
.poker-page .board-content { padding: 0; }
.poker-table { display: flex; flex-direction: column; align-items: center; justify-content: space-between; width: 100%; min-height: 490px; padding: 26px 29px 36px; background: #211e19; background-image: radial-gradient(#ffffff09 .8px, transparent .8px); background-size: 5px 5px; overflow: hidden; }
.hand { display: flex; justify-content: center; gap: 9px; width: 100%; }
.playing-card { position: relative; display: block; padding: 0; flex: 1 1 0; max-width: 100px; aspect-ratio: .69; min-height: 0; border-radius: 7px; border: 1px solid #e8e1d6; background: #fff; color: #211e1a; box-shadow: 0 5px 0 #00000044; transition: transform .12s, box-shadow .12s; font-family: Georgia, "Times New Roman", serif; }
.playing-card:disabled { opacity: 1; cursor: default; }
.self-hand .playing-card:hover:not(:disabled) { transform: translateY(-5px); }
.self-hand .playing-card.picked { transform: translateY(-14px); box-shadow: 0 0 0 3px #bf8060, 0 8px 14px #00000044; }
.playing-card.red-suit { color: #9b3c24; }
.card-corner { position: absolute; top: 7px; left: 9px; display: flex; flex-direction: column; font-size: clamp(14px, 1.9vw, 23px); align-items: center; line-height: 1.05; }
.card-corner b { font-weight: 500; }
.card-corner > span { font-size: .8em; margin-top: 2px; }
.card-corner.inverted { transform: rotate(180deg); top: auto; left: auto; right: 9px; bottom: 7px; }
.card-suit { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -48%); font-size: clamp(22px, 4.3vw, 49px); }
.card-choice { position: absolute; top: -9px; right: -7px; background: #bf8060; color: #211e1a; border-radius: 50%; width: 23px; height: 23px; display: grid; place-items: center; }
.card-back { background: #302a21; border: 5px solid #ebe2d5; background-image: repeating-linear-gradient(45deg, transparent, transparent 5px, #ffffff17 5px, #ffffff17 6px); }
.card-back-mark { position: absolute; inset: 0; display: flex; justify-content: center; align-items: center; color: #ebdfca; }
.card-back-mark > svg { width: 35%; height: auto; }
.card-back-mark > svg.original-mark { width: 56%; height: auto; }
.opponent-hand { width: 80%; }
.opponent-hand .playing-card { max-width: 77px; }
.poker-center { display: flex; align-items: center; gap: 24px; margin: 21px 0 34px; color: white; }
.poker-table-symbol { color: #ffffff1a; font-family: "Songti SC", SimSun, serif; font-size: 68px; font-weight: bold; line-height: 1; }
.poker-bets { display: flex; gap: 28px; }
.poker-bets > div { display: flex; flex-direction: column; gap: 7px; }
.poker-bets span { font-size: 11px; color: #c6b89f; }
.poker-bets strong { font-family: Bahnschrift, sans-serif; font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }
.change-count { margin: 4px 0 12px; }
.change-count strong { font-size: 35px; font-family: Bahnschrift, sans-serif; font-weight: 500; }
.change-count span { color: var(--muted); font-size: 13px; }
.bet-picker { display: flex; flex-direction: column; gap: 12px; }
.bet-value { font-size: 34px; color: var(--accent); font-family: Bahnschrift, sans-serif; font-variant-numeric: tabular-nums; }
input[type="range"] { width: 100%; min-height: 38px; accent-color: var(--accent); cursor: pointer; }
.discard-records { margin-top: 25px; font-size: 11px; }
.discard-records h3 { color: var(--muted); font-size: 12px; font-weight: 500; margin-bottom: 11px; }
.discard-row { display: grid; grid-template-columns: 42px 1fr 1fr; gap: 7px; padding: 13px 0; border-bottom: 1px solid #dacdb8; line-height: 1.7; }
.discard-row span:first-child { color: var(--muted); }
.poker-area, .poker-hand-block { width: 100%; min-width: 0; }
.poker-table { gap: 17px; }
.poker-hand-block .hand { margin: 0 auto; }
.poker-hand-caption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 12px; align-items: center; margin: 0 auto 14px; font-size: 12px; color: #c6b89f; }
.opponent-zone .poker-hand-caption { width: 80%; }
.poker-hand-caption strong { color: #ede5d8; font-size: 12px; font-weight: 500; }
.poker-hand-type { font-size: 12px; }
.poker-hand-caption .poker-hand-type { flex-basis: 100%; color: #e5d3bc; }
.poker-room-status { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; color: #c6b89f; font-size: 11px; }
.poker-center { flex-direction: column; gap: 13px; margin: 0; }
.poker-last-action { color: #efe7dc; font-size: 12px; line-height: 1.7; text-align: center; white-space: pre-line; margin: 0; }
.poker-last-settlement { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: #f4efe8; color: var(--accent); padding: 13px 17px; font-size: 12px; line-height: 1.6; cursor: pointer; }
.poker-last-settlement > span { min-width: 0; }
.poker-last-settlement > svg { flex-shrink: 0; }
.poker-page .game-history { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 25px; padding: 18px 21px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.poker-page .discard-records { margin: 0; }
.poker-discard-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 12px; text-align: left; }
.poker-discard-table th:first-child { width: 57px; }
.poker-discard-table th { color: var(--muted); font-weight: 500; }
.poker-discard-table th, .poker-discard-table td { padding: 9px 6px; vertical-align: top; border-bottom: 1px solid var(--line); }
.poker-discard-table tr.current { background: #f6eee7; }
.poker-card-labels { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.poker-card-label { display: inline-flex; align-items: center; justify-content: center; padding: 2px 5px; border: 1px solid #ddd6cb; background: #fff; border-radius: 3px; white-space: nowrap; font-size: 12px; line-height: 1.4; font-family: Georgia, "Times New Roman", serif; }
.poker-card-label.red-suit { color: var(--accent); }
.poker-action-history { min-width: 0; }
.poker-action-history > summary, .poker-history-round > summary { cursor: pointer; font-size: 13px; font-weight: 500; }
.poker-history-count { color: var(--muted); margin-left: 10px; font-variant-numeric: tabular-nums; }
.poker-history-round { margin-top: 13px; }
.poker-history-round > summary { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.poker-history-round > summary span { font-size: 11px; color: var(--muted); }
.poker-action-list { padding: 0; margin: 0; list-style: none; }
.poker-action { display: grid; grid-template-columns: 47px minmax(0, 1fr); gap: 9px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.poker-action-round, .poker-record-pending { color: var(--muted); }
.poker-action-body p { margin: 0; white-space: pre-line; line-height: 1.65; overflow-wrap: anywhere; }
.poker-action-discards { display: grid; gap: 5px; margin-top: 6px; }
.poker-action-player { display: inline-block; margin-right: 6px; color: var(--muted); }
.poker-showdown-link { padding: 4px 0; font-size: 12px; }
.poker-history-empty { color: var(--muted); font-size: 12px; margin-top: 12px; }
.poker-settlement-outcome, .poker-settlement-log { white-space: pre-line; line-height: 1.75; overflow-wrap: anywhere; }
.poker-settlement-outcome { color: var(--accent); font-weight: 500; }
.poker-showdown-hands { display: grid; gap: 15px; margin: 19px 0; }
.poker-showdown-hand { padding: 14px; border: 1px solid var(--line); border-radius: 8px; background: #f8f5f0; }
.poker-showdown-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.poker-showdown-hand .poker-card-label { min-width: 40px; padding: 9px; font-size: 19px; }
.poker-showdown-heading .poker-hand-type { color: var(--muted); }
.poker-settlement-log { font-size: 12px; color: var(--muted); }
.original-rule-section + .original-rule-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.original-rule-section h3 { margin-bottom: 12px; font-size: 15px; }
.original-rule-section summary { cursor: pointer; font-size: 14px; font-weight: 600; }
.original-rule-copy { margin-top: 12px; line-height: 1.9; font-size: 14px; overflow-wrap: anywhere; }
.original-rule-copy strong { color: var(--ink); font-weight: 600; }
@media (max-width: 640px) {
  .poker-page .game-history { display: block; margin-top: 16px; padding: 14px; }
  .poker-action-history { margin-top: 18px; }
  .poker-hand-caption { font-size: 11px; margin-bottom: 13px; }
  .poker-room-status { gap: 6px 12px; font-size: 10px; }
  .poker-showdown-hand .poker-card-label { min-width: 31px; padding: 6px; font-size: 17px; }
}

/* Tablet */
@media (max-width: 1150px) {
  .app-shell { grid-template-columns: 164px minmax(0, 1fr); }
  .sidebar { padding: 29px 13px 22px; }
  .sidebar .brand { gap: 8px; }
  .brand > span { font-size: 24px; }
  .brand > svg { width: 30px; height: 30px; }
  .topbar { padding: 0 27px; height: 80px; }
  .main-content { padding: 12px 27px 28px; }
  .game-collection { gap: 10px; }
  .game-tile-name { font-size: 13px; }
  .lobby-room-layout { grid-template-columns: minmax(0, 1fr) 254px; gap: 22px; }
  .room-detail-content { padding: 19px; }
  .room-tabs { gap: 17px; }
  .topbar-actions { gap: 10px; }
  .room-row { padding-left: 9px; gap: 11px; }
  .room-row-main strong { font-size: 13px; }
  .battle-layout { grid-template-columns: minmax(0, 1fr) 210px; gap: 20px; }
}
@media (min-width: 901px) and (max-height: 800px) {
  .topbar { height: 73px; }
  .main-content { padding-top: 4px; }
  .page-heading { margin-bottom: 23px; }
  .game-collection { margin-bottom: 25px; }
  .room-detail-top { height: 135px; }
  .room-detail-top .game-art { top: 8px; }
  .sidebar .brand { margin-bottom: 38px; }
}
@media (max-width: 900px) {
  .app-shell { display: block; }
  .sidebar, .topbar-label { display: none; }
  .mobile-brand { display: inline-flex; }
  .topbar { padding: 0 25px; height: 78px; border-bottom: 1px solid #e5ded3; background: #fff; }
  .main-content { padding: 27px 25px 95px; }
  .mobile-nav { position: fixed; z-index: 15; display: flex; align-items: center; justify-content: space-around; bottom: 0; left: 0; right: 0; background: #fffdf8f2; backdrop-filter: blur(12px); padding: 7px 10px calc(7px + env(safe-area-inset-bottom)); border-top: 1px solid #dfd5c5; }
  .mobile-nav .nav-link { flex-direction: column; gap: 4px; padding: 4px 12px; min-width: 80px; font-size: 10px; min-height: 48px; border-radius: 6px; background: none; }
  .mobile-nav .nav-link svg { width: 21px; height: 21px; }
  .mobile-nav .selected { color: var(--accent); }
  .lobby-room-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 25px; }
  .page-heading h1 { font-size: 28px; }
  .game-collection { margin-bottom: 31px; }
  .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }
  .play-page .toast { bottom: 20px; }
  .auth-page { grid-template-columns: minmax(0, 1fr) minmax(360px, 1fr); }
  .auth-form-area { padding: 40px 30px; }
  .auth-brand { left: 30px; }
  .auth-title { left: 34px; }
  .auth-title h1 { font-size: 74px; }
  .auth-board { top: 20%; left: 50%; width: min(110%, 55vh); }
}

/* Phone */
@media (max-width: 640px) {
  .topbar { padding: 0 17px; height: 68px; }
  .topbar-actions { gap: 4px; }
  .topbar .connection-status { display: none; }
  .topbar .connection-status.preview-status { display: inline-flex; font-size: 10px; gap: 5px; }
  .topbar .user-name, .topbar .user-balance { display: none; }
  .user-button { padding-left: 5px; }
  .brand { gap: 9px; }
  .brand > span { font-size: 23px; }
  .brand > svg { width: 28px; height: 28px; }
  .main-content { padding: 25px 18px 91px; }
  .page-heading { margin-bottom: 23px; gap: 8px; }
  .page-heading h1 { font-size: 26px; }
  .filter-tabs { gap: 0; }
  .filter-tab { padding: 5px 11px; min-height: 34px; font-size: 12px; }
  .game-collection { display: flex; overflow-x: auto; gap: 13px; margin: 0 -18px 23px; padding: 0 18px 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
  .game-collection::-webkit-scrollbar { display: none; }
  .game-tile { width: 126px; flex: 0 0 126px; gap: 13px; padding-bottom: 16px; scroll-snap-align: center; }
  .game-tile-name { font-size: 14px; }
  .game-tile-art { border-radius: 9px; }
  .game-tile-art .game-art { transform: scale(1.1); }
  .lobby-room-layout { display: flex; flex-direction: column; gap: 22px; }
  .rooms-panel { width: 100%; }
  .section-heading { margin-bottom: 8px; }
  .section-heading h2 { font-size: 20px; }
  .section-heading .text-button { font-size: 12px; }
  .room-tabs { gap: 26px; }
  .room-tab { min-height: 44px; font-size: 13px; }
  .room-list { min-height: 0; }
  .room-row { min-height: 79px; gap: 13px; padding: 14px 11px; }
  .room-row-main strong { font-size: 14px; }
  .room-symbol { width: 39px; height: 39px; }
  .room-detail { width: 100%; border-radius: 11px; }
  .room-detail-top { display: none; }
  .room-detail-content { padding: 18px; display: grid; grid-template-columns: 1fr auto; gap: 7px 10px; align-items: center; }
  .room-detail-content h3 { font-size: 14px; margin: 0; grid-column: 1 / -1; }
  .detail-facts { gap: 5px 14px; grid-template-columns: auto 1fr; font-size: 11px; }
  .detail-facts > strong { text-align: left; }
  .detail-link { margin: 0; grid-column: 2; grid-row: 2; }
  .room-detail .play-button { grid-column: 1 / -1; margin-top: 6px; min-height: 46px; }
  .lobby-footer { padding-top: 14px; margin-top: 23px; gap: 8px; }
  .footer-link { font-size: 11px; gap: 6px; }
  .footer-link > svg { width: 16px; }
  .auth-page { display: block; }
  .auth-visual { min-height: 220px; height: 28dvh; max-height: 280px; }
  .auth-brand { top: 23px; left: 25px; }
  .auth-brand > span { font-size: 21px; }
  .auth-title { left: 26px; bottom: 25px; }
  .auth-title h1 { font-size: 48px; margin-bottom: 0; letter-spacing: 4px; }
  .auth-game-names { display: none; }
  .auth-board { width: 255px; left: auto; right: -21px; top: 4px; transform: rotate(-3deg); }
  .auth-form-area { padding: 29px 26px 35px; }
  .auth-form-inner { max-width: 420px; }
  .auth-form-inner h2 { font-size: 27px; margin-bottom: 21px; }
  .auth-tabs { margin-bottom: 22px; }
  .auth-form, .form-stack { gap: 18px; }
  .auth-footnote { margin-top: 22px; }
  .auth-preview { margin-top: 13px; }
  .dialog { width: calc(100vw - 24px); max-height: 88dvh; border-radius: 12px; }
  .dialog-header { padding: 13px 13px 12px 20px; }
  .dialog-header h2 { font-size: 18px; }
  .dialog-body { padding: 21px 20px; }
  .dialog-footer { padding: 14px 18px; }
  .data-surface { padding: 20px 18px; border-radius: 9px; }
  .server-content { font-size: 13px; }
  .server-content td { padding: 8px; }
  .coach { right: 13px; bottom: 16px; padding: 13px 15px 10px; }
  .play-header { height: 60px; padding: 0 10px; gap: 8px; }
  .play-heading { gap: 7px; }
  .play-brand { display: none; }
  .play-heading h1 { font-size: 17px; }
  .play-header-actions { gap: 0; }
  .play-header-actions .icon-button { min-width: 37px; width: 37px; padding: 8px; }
  .preview-pill { font-size: 9px; padding: 3px 5px; }
  .battle-area { padding: 17px 12px 18px; }
  .versus-bar { gap: 7px; margin-bottom: 17px; }
  .player { gap: 7px; }
  .player-avatar { width: 33px; height: 33px; border-width: 2px; }
  .player-avatar > svg { width: 16px; }
  .player-name strong { font-size: 12px; }
  .player-score { font-size: 10px; }
  .versus-center { gap: 6px; }
  .turn-status { font-size: 12px; }
  .round-time { font-size: 10px; gap: 6px; }
  .battle-layout { display: block; }
  .board-stage { border-radius: 11px; }
  .board-toolbar { padding: 8px 11px; min-height: 48px; }
  .board-tab { min-height: 33px; font-size: 11px; padding: 5px 8px; }
  .board-counts { font-size: 10px; }
  .board-content { padding: 15px; }
  .maze-board, .treasure-board { width: min(100%, 440px); }
  .treasure-board { gap: 4px; }
  .treasure-cell { font-size: 19px; border-radius: 4px; }
  .battle-sidebar { padding-top: 17px; }
  .game-controls { padding: 14px 16px; gap: 10px; }
  .maze-page .game-controls { display: grid; grid-template-columns: minmax(0, 1fr) 154px; grid-auto-rows: min-content; gap: 11px 18px; min-height: 176px; align-content: center; }
  .maze-page .game-controls > :not(.direction-pad) { grid-column: 1; }
  .maze-page .direction-pad { grid-column: 2; grid-row: 1 / span 5; margin: 0; align-self: center; }
  .direction-pad { grid-template-columns: repeat(3, 46px); grid-template-rows: repeat(3, 46px); gap: 4px; }
  .direction-key { width: 46px; height: 46px; font-size: 23px; border-radius: 7px; }
  .game-controls .controls-title { font-size: 12px; }
  .game-controls .text-button { font-size: 12px; }
  .game-controls .full-width { font-size: 13px; min-height: 44px; padding: 9px 10px; }
  .battle-utilities { display: none; }
  .treasure-page .game-controls { display: grid; grid-template-columns: minmax(60px, .7fr) 1fr 1fr; align-items: center; }
  .treasure-page .controls-title { grid-column: 1 / -1; }
  .treasure-page .dig-selection { font-size: 27px; margin: 0; min-height: auto; }
  .poker-table { min-height: 385px; padding: 21px 16px 29px; }
  .poker-center { margin: 18px 0 25px; gap: 21px; }
  .poker-table-symbol { font-size: 55px; }
  .poker-bets { gap: 25px; }
  .poker-bets strong { font-size: 25px; }
  .hand { gap: 6px; }
  .playing-card { border-radius: 5px; }
  .card-corner { font-size: 18px; left: 6px; top: 6px; }
  .card-corner.inverted { right: 6px; bottom: 6px; }
  .card-suit { font-size: 33px; }
  .opponent-hand { width: 80%; }
  .opponent-hand .playing-card { max-width: 62px; }
  .card-back { border-width: 4px; }
  .poker-page .game-controls { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px; }
  .poker-page .controls-title { width: 100%; margin: 0; }
  .poker-page .change-count { margin: 0 12px 0 0; }
  .poker-page .change-count strong { font-size: 29px; }
  .poker-page .game-controls > .button { width: auto; flex: 1; white-space: nowrap; }
  .poker-page .bet-picker { flex-basis: 100%; flex-direction: row; align-items: center; gap: 20px; }
  .poker-page .bet-value { min-width: 44px; font-size: 27px; }
  .discard-records { margin: 18px 8px 0; }
  .discard-row { grid-template-columns: 50px 1fr 1fr; }
}
@media (max-width: 370px) {
  .main-content { padding-left: 14px; padding-right: 14px; }
  .game-collection { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
  .page-heading h1 { font-size: 24px; }
  .filter-tab { padding: 5px 9px; }
  .room-tabs { gap: 20px; }
  .room-row-main strong { font-size: 13px; }
  .play-heading { position: relative; padding-bottom: 8px; }
  .preview-pill { display: inline-block; position: absolute; left: 51px; bottom: -4px; padding: 0; border: 0; font-size: 10px; }
  .topbar-actions > .icon-button { display: none; }
  .maze-page .game-controls { gap: 10px; grid-template-columns: minmax(0, 1fr) 150px; padding: 12px; }
  .card-corner { font-size: 15px; }
  .card-suit { font-size: 27px; }
}
/* Short landscape screens keep controls beside the board. */
@media (max-height: 580px) and (min-width: 641px) {
  .play-header { height: 55px; }
  .battle-area { padding-top: 12px; padding-bottom: 12px; }
  .versus-bar { margin-bottom: 12px; }
  .player-avatar { width: 34px; height: 34px; }
  .board-toolbar { min-height: 44px; padding: 5px 13px; }
  .board-content { padding: 12px; }
  .maze-board, .treasure-board { width: min(100%, calc(100dvh - 195px)); }
  .game-controls { padding: 12px; gap: 8px; }
  .direction-pad { margin: 0; }
  .battle-utilities { margin-top: 2px; }
  .poker-table { min-height: 260px; padding: 15px 23px; }
  .opponent-hand { width: 48%; }
  .self-hand { width: 70%; }
  .poker-center { margin: 5px 0 17px; }
  .poker-table-symbol { font-size: 40px; }
  .poker-bets { flex-direction: row; }
  .poker-bets strong { font-size: 20px; }
  .playing-card { max-width: 66px; }
  .card-corner { font-size: 14px; }
  .card-suit { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
