:root {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  color: #f4ead5;
  background: #091c1a;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 1100px; }
button, select, input { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
.eyebrow { color: #d4ab65; font-size: 11px; font-weight: 800; letter-spacing: .2em; }
.lobby { min-height: 100vh; padding: 46px max(45px, calc((100vw - 1360px)/2)); background:
  radial-gradient(circle at 55% 4%, #285046 0, transparent 38%),
  linear-gradient(135deg, #0c2725, #0b191a 60%, #102a28); }
.lobby-header { display: flex; gap: 20px; align-items: center; padding: 10px 0 56px; }
.brand-mark { width: 72px; height: 72px; display: grid; place-items: center; background: #f1e9d6;
  border-radius: 15px; color: #12604c; font: 800 45px serif; box-shadow: 0 8px 0 #aa9c7b; }
.lobby h1 { margin: 4px 0 2px; font-size: 35px; letter-spacing: .07em; }
.lobby h1 small { font-size: 16px; font-weight: 400; color: #d4ab65; }
.lobby-header p { margin: 8px 0 0; color: #9db7ae; font-size: 14px; }
.offline-badge { margin-left: auto; color: #a6d8b3; border: 1px solid #507b68; border-radius: 30px;
  padding: 10px 16px; font-size: 12px; }
.lobby-content { display: grid; grid-template-columns: minmax(620px, 1fr) 320px; gap: 28px; }
.section-heading { display: flex; justify-content: space-between; color: #e8d9b9;
  font-size: 14px; font-weight: bold; border-bottom: 1px solid #456258; padding-bottom: 17px; margin-bottom: 20px; }
.section-heading span:last-child { color: #78998d; font-size: 12px; }
.room-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.room-card { display: flex; flex-direction: column; text-align: left; min-height: 211px;
  padding: 24px; border: 1px solid #4e7969; border-radius: 12px; color: #eee6d4;
  background: linear-gradient(135deg, #245a4a, #163d37); transition: transform .2s, border-color .2s, box-shadow .2s; }
.room-card:hover, .hidden-room:hover { transform: translateY(-4px); border-color: #e0bd78;
  box-shadow: 0 14px 26px #050c0b77; }
.room-intermediate { background: linear-gradient(135deg, #2e665d, #1b4541); }
.room-advanced { background: linear-gradient(135deg, #365a65, #1c3c47); }
.room-smart { background: linear-gradient(135deg, #685343, #3d3533); }
.room-number { font-size: 10px; font-weight: 700; letter-spacing: .18em; color: #ddbf83; }
.room-card strong { font-size: 28px; margin: 16px 0 8px; letter-spacing: .08em; }
.room-desc { font-size: 12px; color: #b3c9bd; }
.room-footer { display: flex; justify-content: space-between; align-items: center; margin-top: auto;
  font-size: 11px; color: #c1cdbb; }
.room-footer b { color: #ffde9b; font-size: 12px; }
.locked-room, .hidden-room { width: 100%; padding: 20px; margin-top: 16px; border: 1px dashed #507265;
  background: #1c3832; color: #afc4b7; border-radius: 10px; text-align: center; font-size: 13px; }
.hidden-room { border-style: solid; color: #f2d398; transition: .2s; }
.settings-panel { background: #f2ecdf; border-radius: 13px; padding: 28px; color: #244338; align-self: start;
  box-shadow: 0 12px 32px #03120f55; }
.settings-panel .eyebrow { color: #a67941; }
.settings-panel h2 { font-size: 24px; margin: 8px 0 36px; }
.settings-panel label { display: flex; justify-content: space-between; font-size: 14px; }
.settings-panel input { width: 100%; accent-color: #176b51; margin: 24px 0 5px; }
.range-labels { display: flex; justify-content: space-between; font-size: 11px; color: #758b7e; margin-bottom: 35px; }
.setting-line { display: flex; justify-content: space-between; padding: 15px 0; border-top: 1px solid #d9d8c9;
  font-size: 12px; color: #66786a; }
.setting-line strong { color: #214d3c; }
.settings-tip { margin-top: 23px; border-radius: 7px; background: #e5e8d9; line-height: 1.7;
  padding: 13px; color: #6c786b; font-size: 11px; }
.lobby-footer { margin-top: 45px; text-align: center; color: #688779; font-size: 11px; letter-spacing: .1em; }
.setup-overlay { position: fixed; inset: 0; display: grid; place-items: center; background: #091715e8; z-index: 20; }
.setup-dialog { background: #f1ead9; color: #214b3e; padding: 34px; border-radius: 14px; width: 460px; }
.setup-dialog h2 { margin: 9px 0; font-size: 30px; }
.setup-dialog p { color: #63786d; font-size: 13px; margin-bottom: 26px; }
.setup-dialog label { display: flex; align-items: center; justify-content: space-between; padding: 13px 0; border-top: 1px solid #d7d6c7; }
.setup-dialog select { padding: 7px 20px; border: 1px solid #b9c7b4; border-radius: 6px; color: #214b3e; background: white; }
.setup-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.setup-actions button { border: 0; border-radius: 7px; padding: 11px 16px; color: #3f594b; }
.primary-button { border: 0; border-radius: 8px; background: #d7a752; color: #1d2e25 !important;
  font-weight: 800; padding: 13px 26px; box-shadow: 0 4px 0 #a77734; }
.primary-button:hover { background: #edc478; }

.game-shell { height: 100vh; min-height: 720px; display: flex; flex-direction: column; background: #101e1b; }
.game-header { height: 70px; flex: none; display: flex; align-items: center; gap: 22px; padding: 0 28px;
  border-bottom: 1px solid #446953; background: #112c28; }
.exit-button { border: 1px solid #54715e; border-radius: 6px; background: #21493c; color: #f2e5cc; padding: 8px 15px; }
.exit-button:hover { background: #386a53; }
.game-title { display: flex; align-items: baseline; gap: 17px; }
.game-title strong { font-size: 21px; letter-spacing: .13em; }
.game-title span, .header-right { color: #adc4af; font-size: 12px; }
.header-right { margin-left: auto; display: flex; gap: 25px; }
.header-right b { color: #f3ca75; }
.table-frame { position: relative; flex: 1; overflow: hidden; min-height: 650px;
  background: radial-gradient(ellipse at center, #31785c 0, #216348 60%, #124532 100%);
  border: 13px solid #503927; box-shadow: inset 0 0 0 7px #c18a4d, inset 0 0 90px #091b14; }
.felt-texture { pointer-events: none; position: absolute; inset: 7px; opacity: .13;
  background-image: repeating-linear-gradient(26deg, transparent 0 3px, #c7ddae 4px, transparent 5px 8px); }
.seat { position: absolute; z-index: 2; min-width: 160px; }
.seat-2 { top: 9px; left: 50%; transform: translateX(-50%); text-align: center; }
.seat-3 { left: 16px; top: 19%; }
.seat-1 { right: 16px; top: 19%; }
.seat-0 { bottom: 125px; left: 27%; }
.identity { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: #08271fc9;
  border: 1px solid #6d9271; border-radius: 9px; position: relative; white-space: nowrap; }
.seat-active .identity { box-shadow: 0 0 0 2px #e9c36b, 0 0 18px #efd78977; }
.avatar { width: 45px; height: 45px; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 3px solid #e6c48a; background: linear-gradient(140deg, #f5d8a1, #9b633e);
  color: #5f2e1e; font-size: 19px; font-weight: 900; }
.avatar-1 { background: linear-gradient(140deg, #f9c9b6, #a85048); }
.avatar-2 { background: linear-gradient(140deg, #edc69e, #528578); }
.avatar-3 { background: linear-gradient(140deg, #ddc5b2, #625981); }
.player-meta { display: grid; gap: 2px; text-align: left; font-size: 11px; color: #a9c6ae; }
.player-meta strong { color: #f8e8c8; font-size: 13px; }
.player-meta b { color: #f3d389; font-size: 15px; }
.player-meta small { font-size: 10px; }
.dealer { position: absolute; right: -8px; top: -12px; background: #dd6744; padding: 4px 6px;
  border-radius: 5px; font-weight: 800; font-size: 12px; }
.opponent-hand { display: flex; justify-content: center; margin: 7px 0; }
.seat-1 .opponent-hand, .seat-3 .opponent-hand { flex-wrap: wrap; width: 150px; }
.tile-back { display: inline-grid; place-items: center; width: 19px; height: 28px; margin-right: -2px;
  border: 2px solid #c9d1ae; border-radius: 3px; color: #8aa88f; font-size: 10px;
  background: repeating-linear-gradient(45deg, #224f46 0 4px, #34685a 4px 8px);
  box-shadow: 1px 2px 0 #102920; }
.tile-back.vertical { width: 19px; height: 26px; }
.melds { display: flex; justify-content: center; flex-wrap: wrap; gap: 5px; max-width: 320px; margin: 4px auto; }
.meld { display: flex; align-items: center; padding: 3px; gap: 1px; background: #123a2caa;
  border-radius: 4px; }
.meld-label { color: #ffdf93; font-size: 9px; padding: 0 4px; }
.center-board { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%);
  width: min(51%, 660px); height: 56%; min-height: 330px; border: 1px solid #bbd5a460;
  background: #0a493733; border-radius: 24px; padding: 14px 20px; }
.wall-heading, .discard-heading { font-size: 12px; font-weight: 800; letter-spacing: .12em; color: #f5e3b3;
  display: flex; justify-content: space-between; }
.wall-heading span, .discard-heading span { color: #c0d4b9; font-weight: 400; letter-spacing: 0; }
.wall-grid { display: grid; grid-template-columns: repeat(19, 1fr); grid-template-rows: repeat(4, 1fr);
  gap: 2px; margin: 9px auto 7px; max-width: 490px; }
.wall-stack { height: 10px; border-radius: 2px; border-top: 2px solid #a8c8ae;
  background: #285e4c; box-shadow: 0 2px 0 #102c28; }
.wall-empty { opacity: .16; }
.indicator-area { display: flex; gap: 10px; align-items: center; justify-content: center; color: #f3e2b9;
  font-size: 11px; border-block: 1px solid #cfe5b848; padding: 7px; margin: 8px 0; }
.indicator-empty { border: 1px dashed #cbd8b6; padding: 9px; }
.wild-info { margin-left: 12px; }
.wild-info b { color: #ffe298; font-size: 16px; }
.discard-grid { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 3px;
  height: calc(100% - 157px); overflow: auto; margin-top: 8px; }
.flower-panel { position: absolute; left: 16px; bottom: 146px; width: 220px; max-height: 29%;
  overflow: auto; border: 1px solid #acc59c66; border-radius: 10px; padding: 12px;
  background: #0a352ac7; }
.flower-panel > strong { font-size: 13px; color: #f1d393; }
.flower-panel > span { display: block; color: #abc9ac; font-size: 10px; margin: 3px 0 9px; }
.flower-row { border-top: 1px solid #bcd6b64d; padding: 5px 0; }
.flower-row b { display: block; font-size: 10px; margin-bottom: 3px; }
.flower-row > div { display: flex; flex-wrap: wrap; gap: 2px; }
.no-flowers { font-size: 10px; color: #a0baa2; }
.human-hand { position: absolute; bottom: 58px; left: 50%; transform: translateX(-50%);
  display: flex; justify-content: center; gap: 3px; white-space: nowrap; max-width: calc(100% - 60px); }
.tile { flex: none; display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative; width: 45px; height: 62px; border: 2px solid #efebd9; border-bottom: 5px solid #a4b1a2;
  border-radius: 5px; color: #182c27; background: linear-gradient(#fffdf1, #e2e3d5);
  box-shadow: 2px 3px 0 #164333, 2px 5px 6px #041b1488; padding: 1px; }
.tile:disabled { opacity: 1; }
.tile-clickable:hover { transform: translateY(-12px); box-shadow: 2px 14px 8px #041b1466; }
.tile-face { display: flex; flex-direction: column; align-items: center; font-size: 25px; font-weight: 900; line-height: 1; }
.tile-number { font-size: 23px; }
.tile-icon { font-size: 21px; font-family: serif; line-height: 1; }
.tile-wan { color: #b7473c; }
.tile-tong { color: #1b6383; }
.tile-tiao { color: #22805b; }
.tile-zi { color: #324d46; }
.tile-hua { color: #ac6b39; }
.tile-wild { background: linear-gradient(#ffefbd, #f5c974); border: 2px solid #e38432;
  border-bottom: 5px solid #b8722f; box-shadow: 0 0 12px #ffe887, 2px 4px 0 #925425; }
.wild-tag { position: absolute; top: 1px; right: 1px; padding: 0 2px; border-radius: 2px;
  background: #ad4234; color: white; font-size: 8px; }
.tile-small { width: 25px; height: 34px; border-width: 1px; border-bottom-width: 3px; border-radius: 3px; box-shadow: 1px 2px 0 #184130; }
.tile-small .tile-face { font-size: 15px; }
.tile-small .tile-number { font-size: 13px; }
.tile-small .tile-icon { font-size: 11px; }
.tile-small .wild-tag { font-size: 5px; }
.blank-face { width: 27px; height: 41px; background: #fbf9ed; border-radius: 2px; }
.double-wild { color: #c53c2d; font-size: 10px; line-height: 1.2; letter-spacing: -.04em; }
.tile-small .blank-face { width: 15px; height: 23px; }
.tile-small .double-wild { font-size: 6px; }
.action-bar { position: absolute; right: 17px; bottom: 124px; display: flex; align-items: center; gap: 5px;
  border-radius: 9px; padding: 7px; background: #0a352bdc; border: 1px solid #9bbf99; }
.action-title { font-size: 11px; color: #b3c5a6; padding: 0 7px; }
.action-bar button { border: 1px solid #dfc78d; border-radius: 5px; background: #ebdbb9;
  color: #224435; padding: 8px 11px; font-weight: 800; font-size: 12px; }
.action-bar button:not(:disabled):hover { background: #fff4d8; transform: translateY(-2px); }
.action-bar button:disabled { opacity: .43; }
.action-bar .hu-button:not(:disabled) { background: #db623d; border-color: #f5aa73; color: white; }
.turn-countdown { display: inline-flex; align-items: baseline; gap: 2px; flex: none;
  padding: 6px 9px; border: 1px solid #e8b34b; border-radius: 999px;
  background: #0a231bd4; color: #ffd98a; font-weight: 900; font-size: 13px;
  box-shadow: 0 0 8px #e8b34b44; white-space: nowrap; }
.turn-countdown b { font-size: 16px; }
.turn-countdown-low { border-color: #ff6b5e; color: #ff9b90;
  box-shadow: 0 0 12px #ff6b5e88; animation: countdown-pulse .5s ease-in-out infinite; }
@keyframes countdown-pulse { 50% { transform: scale(1.12); } }
.status-line { position: absolute; bottom: 9px; left: 50%; transform: translateX(-50%);
  width: min(780px, 90%); text-align: center; border-radius: 5px; background: #062b229c;
  color: #e3ecd7; padding: 7px 10px; font-size: 12px; }
.status-dot { display: inline-block; height: 7px; width: 7px; background: #e8bb6d; border-radius: 50%; margin-right: 8px; }
.status-hint { margin-left: 14px; color: #d5ba78; }
.warning-toast { position: absolute; z-index: 5; bottom: 158px; left: 50%; transform: translateX(-50%);
  padding: 13px 24px; border: 2px solid #ffd78c; border-radius: 9px; background: #803f2d;
  box-shadow: 0 9px 24px #102116a9; color: #fff2d2; font-size: 15px; font-weight: 800;
  pointer-events: none; animation: toast-out 3s forwards; }
@keyframes toast-out { 0%, 65% { opacity: 1; } 100% { opacity: 0; } }
.event-overlay { position: absolute; inset: 0; z-index: 6; display: flex; align-items: center;
  justify-content: center; flex-direction: column; gap: 14px; background: #09251fce; }
.event-overlay > strong { font-size: 43px; color: #ffe1a0; text-shadow: 0 4px 8px #0d3025; }
.event-overlay > span:not(.eyebrow) { color: #e9e2c7; font-size: 14px; }
.result-overlay { justify-content: flex-start; gap: 8px; padding: 16px;
  overflow-y: auto; text-align: center; }
.result-overlay > * { flex: none; }
.result-overlay > strong { font-size: 30px; }
.settlement-detail { display: grid; gap: 8px; width: min(780px, 100%); text-align: left; }
.settlement-detail section { padding: 9px 12px; border: 1px solid #d4bc846b;
  border-radius: 8px; background: #103b30e8; }
.settlement-detail h3 { margin: 0 0 7px; color: #ffe1a0; font-size: 14px; }
.settlement-hand, .settlement-melds, .settlement-melds > div { display: flex;
  flex-wrap: wrap; align-items: center; gap: 4px; }
.settlement-hand > span { position: relative; display: inline-flex; }
.settlement-win-tile { outline: 2px solid #ffd172; border-radius: 4px; }
.settlement-win-tile small { position: absolute; bottom: -10px; left: 0;
  color: #ffe1a0; font-size: 9px; }
.settlement-melds { margin-top: 9px; gap: 7px; }
.settlement-melds > div { padding: 3px; border: 1px solid #b9ad7a73; border-radius: 5px; }
.settlement-melds b { color: #ffe4a2; font-size: 11px; padding: 0 4px; }
.settlement-groups { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.settlement-groups span { padding: 3px 6px; border-radius: 4px;
  background: #9e84423d; color: #f5e9d2; font-size: 11px; }
.settlement-line, .settlement-total { display: flex; justify-content: space-between; gap: 10px;
  padding: 3px 0; color: #eee2c9; font-size: 12px; }
.settlement-line b { color: #ffe3a1; }
.settlement-total { margin-top: 3px; border-top: 1px solid #d9bd78;
  color: #ffdf94; font-weight: bold; }
.settlement-detail .settlement-hint { margin: 5px 0 0; font-size: 11px; color: #e9e2c7; }
.result-scores { display: flex; gap: 10px; margin: 16px 0; }
.result-overlay .result-scores { flex-wrap: wrap; justify-content: center; margin: 5px 0; }
.result-scores div { display: grid; gap: 9px; text-align: center; min-width: 110px;
  padding: 15px; background: #276046; border: 1px solid #729d77; border-radius: 8px; font-size: 12px; }
.result-scores b { font-size: 20px; color: #ffdc98; }
.round-verdict { color: #fbe0a8; font-weight: 800; }
@media (max-width: 1250px) {
  .center-board { width: 47%; }
  .human-hand .tile { width: 39px; height: 57px; }
  .seat-0 { left: 23%; }
  .action-bar { bottom: 132px; }
}
