@charset "UTF-8";
:root {
  color-scheme: dark;
  --night: #1b1027;
  --night-soft: #2b173d;
  --grape: #a35bd2;
  --grape-bright: #cf8df4;
  --lilac: #ecd8fa;
  --paper: #fff8f0;
  --paper-deep: #eee3da;
  --ink: #2d2038;
  --muted: #9a8ca1;
  --felt: #137562;
  --felt-light: #278c74;
  --felt-dark: #0b5149;
  --gold: #f2cc74;
  --rose: #ef8da7;
  --mint: #a9e4bf;
  --line: rgb(255 255 255 / 15%);
  font-family: "Trebuchet MS", "Aptos", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; background: var(--night); }
body { min-width: 320px; min-height: 100vh; margin: 0; color: #fff7ff; background: var(--night); }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
button:disabled { cursor: not-allowed; }
#app { min-height: 100vh; }
.start-screen, .game-screen { min-height: 100vh; position: relative; overflow: hidden; isolation: isolate; }
.start-screen::before, .game-screen::before { position: absolute; z-index: -1; inset: 0; content: ""; pointer-events: none; background: radial-gradient(ellipse at 13% 9%, rgb(135 66 163 / 27%), transparent 36%), radial-gradient(ellipse at 92% 90%, rgb(41 109 99 / 18%), transparent 34%), repeating-linear-gradient(135deg, transparent 0 33px, rgb(255 255 255 / 1.5%) 34px, transparent 35px); }
.sitebar, .gamebar { width: min(1400px, calc(100% - 56px)); min-height: 76px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-bottom: 1px solid rgb(255 255 255 / 9%); }
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border: 1px solid rgb(244 213 255 / 70%); border-radius: 13px 13px 13px 4px; color: #fff4ff; background: linear-gradient(145deg, #b765dc, #67338e); font: 800 13px/1 "Trebuchet MS", sans-serif; box-shadow: inset 0 1px rgb(255 255 255 / 30%), 0 4px 18px rgb(180 93 223 / 30%); }
.brand-lockup b, .brand-lockup small { display: block; }
.brand-lockup b { font-size: 12px; letter-spacing: 0; }
.brand-lockup small { margin-top: 3px; color: #bcaac8; font-size: 9px; letter-spacing: 0; }
.icon-button { width: 40px; height: 40px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgb(255 255 255 / 18%); border-radius: 50%; color: #f9eaff; background: rgb(255 255 255 / 5%); cursor: pointer; transition: background .18s, border-color .18s, transform .18s; }
.icon-button:hover { transform: translateY(-2px); border-color: rgb(255 255 255 / 46%); background: rgb(255 255 255 / 12%); }
.start-layout { width: min(1320px, calc(100% - 56px)); min-height: calc(100vh - 77px); margin: auto; padding: 42px 0 58px; display: grid; grid-template-columns: minmax(330px, .82fr) minmax(520px, 1.18fr); align-items: center; gap: clamp(38px, 6vw, 88px); }
.welcome-panel { position: relative; min-height: 520px; padding: 34px 14px 20px 2px; display: flex; flex-direction: column; justify-content: center; overflow: hidden; animation: appear .7s both; }
.welcome-panel::after { position: absolute; top: 7%; right: 1px; bottom: 7%; width: 1px; content: ""; background: linear-gradient(transparent, rgb(226 188 245 / 30%), transparent); }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; color: #c9a9d9; font-size: 10px; font-weight: 800; letter-spacing: 0; }
.eyebrow i, .round-dot { width: 5px; height: 5px; display: inline-block; border-radius: 50%; background: var(--gold); box-shadow: 0 0 12px rgb(242 204 116 / 65%); }
.welcome-panel h1 { position: relative; z-index: 1; margin: 24px 0 12px; color: #fff9ff; font: 500 clamp(40px, 5vw, 70px)/.98 Georgia, "Microsoft YaHei", serif; }
.welcome-panel h1 em { color: #e5b6ff; font-size: .94em; font-style: normal; }
.welcome-line { margin: 3px 0 0; color: #ccbbd4; font-size: 15px; }
.welcome-tiles { position: relative; z-index: 1; height: 154px; margin: 27px 0 18px; display: flex; align-items: center; gap: 9px; }
.welcome-tiles > span { transform: rotate(calc((var(--tile-index) - 2) * 6deg)); animation: tile-arrive .7s both; animation-delay: calc(var(--tile-index) * 80ms); }
.welcome-tiles > span:nth-child(2n) { margin-top: 17px; }
.welcome-meta { display: flex; gap: 22px; color: #b8a6c3; font-size: 11px; }
.welcome-meta b { color: #f3dbff; font-size: 14px; }
.ornament { position: absolute; pointer-events: none; opacity: .32; }
.ornament-a { width: 170px; height: 170px; right: 36px; top: 43px; border: 1px solid #e1b9f4; border-radius: 50%; box-shadow: 0 0 0 22px rgb(218 167 244 / 4%), 0 0 0 44px rgb(218 167 244 / 3%); }
.ornament-b { width: 13px; height: 13px; right: 55px; top: 89px; transform: rotate(45deg); background: var(--gold); box-shadow: 0 0 0 8px rgb(242 204 116 / 12%); }
.setup-panel { min-width: 0; padding: 16px 0 5px; animation: appear .65s .1s both; }
.setup-heading { margin-bottom: 18px; display: flex; align-items: end; justify-content: space-between; }
.setup-heading h2 { margin: 7px 0 0; color: #fff8ff; font: 500 26px/1.2 Georgia, "Microsoft YaHei", serif; }
.character-count { color: #f5d9ff; font: 700 14px Georgia, serif; }
.character-count i { color: #897897; font-style: normal; }
.character-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
.character-card { min-width: 0; min-height: 143px; padding: 9px 5px 8px; display: flex; flex-direction: column; align-items: center; border: 1px solid rgb(255 255 255 / 11%); border-radius: 6px; color: #f4eafa; background: rgb(255 255 255 / 4%); cursor: pointer; transition: transform .18s, border-color .18s, background .18s; animation: appear .38s both; }
.character-card:nth-child(2) { animation-delay: 35ms; }.character-card:nth-child(3) { animation-delay: 70ms; }.character-card:nth-child(4) { animation-delay: 105ms; }.character-card:nth-child(5) { animation-delay: 140ms; }.character-card:nth-child(6) { animation-delay: 175ms; }.character-card:nth-child(7) { animation-delay: 210ms; }
.character-card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--character-color), white 24%); background: rgb(255 255 255 / 8%); }
.character-card.is-selected { border-color: var(--character-color); background: color-mix(in srgb, var(--character-color), transparent 88%); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--character-color), transparent 54%), 0 7px 20px color-mix(in srgb, var(--character-color), transparent 84%); }
.character-art { width: 65px; height: 70px; display: block; overflow: hidden; border-radius: 30px 30px 8px 8px; background: var(--character-color); }
.character-art img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 20%; }
.character-name { max-width: 100%; margin-top: 7px; overflow: hidden; color: #fff9ff; font-size: 12px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.character-style { max-width: 100%; margin-top: 2px; overflow: hidden; color: #b8a9c0; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.difficulty-row { min-height: 49px; margin-top: 13px; display: flex; align-items: center; justify-content: space-between; color: #c8b6d0; font-size: 12px; }
.segmented { padding: 3px; display: inline-flex; gap: 3px; border: 1px solid rgb(255 255 255 / 12%); border-radius: 7px; background: rgb(0 0 0 / 13%); }
.segmented button { min-width: 54px; min-height: 30px; padding: 4px 10px; border: 0; border-radius: 5px; color: #c6b7cc; background: transparent; font-size: 11px; cursor: pointer; }
.segmented button.is-active { color: #fff9ff; background: #74418f; box-shadow: inset 0 1px rgb(255 255 255 / 19%); }
.primary-button { min-height: 46px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: space-between; gap: 30px; border: 1px solid #e0b3fa; border-radius: 6px; color: #2d173c; background: linear-gradient(110deg, #f5d8ff, #d89aef 62%, #f6cce8); box-shadow: inset 0 1px rgb(255 255 255 / 65%), 0 9px 24px rgb(168 92 205 / 17%); font-size: 13px; font-weight: 900; cursor: pointer; transition: transform .18s, filter .18s, box-shadow .18s; }
.primary-button:hover { transform: translateY(-2px); filter: brightness(1.06); box-shadow: inset 0 1px rgb(255 255 255 / 65%), 0 12px 30px rgb(168 92 205 / 30%); }
.primary-button i { font-size: 18px; font-style: normal; }
.start-button { width: 100%; min-height: 51px; }
.setup-footer { min-height: 43px; display: flex; align-items: end; justify-content: space-between; gap: 9px; color: #ab98b5; font-size: 10px; }
.setup-footer > span:first-child { display: inline-flex; align-items: center; gap: 6px; }
.setup-footer button, .quiet-button, .text-button { padding: 7px 2px; border: 0; color: #dac7e3; background: transparent; font-size: 11px; cursor: pointer; }
.setup-footer button:hover, .text-button:hover { color: white; text-decoration: underline; }
.setup-footer .record { white-space: nowrap; }
.portrait { width: 54px; height: 54px; flex: 0 0 auto; position: relative; display: inline-block; overflow: hidden; border: 2px solid rgb(255 255 255 / 80%); border-radius: 50%; background: var(--portrait-color); box-shadow: 0 3px 12px rgb(0 0 0 / 24%); }
.portrait img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: 50% 20%; }
.portrait--tiny { width: 24px; height: 24px; border-width: 1px; }

.game-screen { min-height: 100vh; display: flex; flex-direction: column; }
.gamebar { width: min(1500px, calc(100% - 40px)); min-height: 61px; }
.round-readout { display: flex; align-items: center; gap: 9px; color: #d7c7df; font-size: 11px; }
.round-readout b { color: #fff5ff; }
.game-tools { display: flex; align-items: center; gap: 7px; }
.game-tools .icon-button { width: 35px; height: 35px; font-size: 14px; }
.quiet-button { min-height: 35px; padding: 0 12px; border: 1px solid rgb(255 255 255 / 20%); border-radius: 5px; color: #f1e4f6; }
.quiet-button:hover { background: rgb(255 255 255 / 8%); }
.game-layout { width: min(1500px, calc(100% - 40px)); flex: 1; margin: 0 auto; padding: 15px 0 19px; display: grid; grid-template-rows: minmax(410px, 1fr) auto; align-content: start; gap: 13px; }
.game-table { min-height: 435px; max-height: 740px; position: relative; overflow: hidden; border: 8px solid #5b332e; border-radius: 36px; background: radial-gradient(ellipse at 48% 43%, #238d73, #0e6b59 67%, #0a5148); box-shadow: inset 0 0 0 2px #e7c078, inset 0 0 0 8px rgb(57 29 28 / 70%), inset 0 0 62px rgb(0 29 33 / 24%), 0 16px 40px rgb(0 0 0 / 32%); }
.game-table::before { position: absolute; inset: 13px; border: 1px solid rgb(236 204 128 / 38%); border-radius: 25px; content: ""; pointer-events: none; }
.game-table::after { position: absolute; inset: 24px; border: 1px solid rgb(255 255 255 / 7%); border-radius: 18px; content: ""; pointer-events: none; }
.table-center { position: absolute; inset: 24% 20% 24%; z-index: 1; }
.rivers { position: absolute; inset: 0; display: grid; grid-template-columns: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 6px; }
.river { min-width: 0; min-height: 0; padding: 3px; display: grid; grid-template-columns: repeat(6, minmax(23px, 1fr)); grid-auto-rows: minmax(31px, 1fr); align-content: start; justify-content: center; gap: 3px; overflow: auto; scrollbar-width: thin; scrollbar-color: rgb(255 255 255 / 25%) transparent; }
.river--2 { grid-area: 1 / 1; padding-right: 36px; }.river--1 { grid-area: 1 / 2; padding-left: 36px; }.river--3 { grid-area: 2 / 1; padding-right: 36px; }.river--0 { grid-area: 2 / 2; padding-left: 36px; }
.river-tile { min-width: 0; min-height: 0; display: grid; place-items: center; animation: tile-arrive .22s both; }
.river-tile.is-claimed { opacity: .43; filter: saturate(.55); }
.tile-face { width: 48px; height: 67px; flex: 0 0 auto; position: relative; display: flex; align-items: center; justify-content: center; overflow: hidden; border: 1px solid #c5b9a8; border-bottom: 4px solid #c4b7a4; border-radius: 5px 5px 7px 7px; color: #332438; background: linear-gradient(115deg, #fffdf5, #eee8db); box-shadow: 0 3px 4px rgb(0 0 0 / 22%), inset 0 1px #fff; }
.tile--character { flex-direction: column; gap: 0; color: #c52e48; }
.tile--character b { font: 800 24px/1 Georgia, "Microsoft YaHei", serif; }
.tile--character small { color: #bc334e; font: 800 15px/1 "Microsoft YaHei", sans-serif; }
.tile--circle, .tile--bamboo { align-items: stretch; }
.tile-rank { position: absolute; top: 2px; left: 4px; z-index: 1; color: #60576a; font: 800 9px/1 "Trebuchet MS", sans-serif; }
.pips, .bamboos { position: absolute; inset: 9px 4px 5px; }
.pip { width: 10px; height: 10px; position: absolute; top: var(--y); left: var(--x); transform: translate(-50%, -50%); border: 1px solid rgb(255 255 255 / 78%); border-radius: 50%; background: #246fc0; box-shadow: inset 0 -2px 0 rgb(15 41 89 / 27%); }
.pip-1 { background: #df4a4b; }.pip-2 { background: #248a69; }
.tile--circle .pip:first-child:last-child { width: 17px; height: 17px; border: 3px solid #d7444c; background: #326dc1; box-shadow: 0 0 0 1px #f7d69a; }
.bamboo { width: 8px; height: 20px; position: absolute; top: var(--y); left: var(--x); transform: translate(-50%, -50%) rotate(var(--angle)); border: 1px solid rgb(19 87 54 / 58%); border-radius: 7px 7px 3px 3px; background: linear-gradient(90deg, #86cc75, #398b55 42%, #b4dc74 49%, #3b8c57 60%, #79ba67); box-shadow: 0 1px 1px rgb(13 59 43 / 22%); }
.bamboo::after { width: 9px; height: 1px; position: absolute; top: 5px; left: -1px; content: ""; background: #d9ed9d; }
.bamboo-1 { background: linear-gradient(90deg, #ffb6ae, #e05558 42%, #ffe0b5 50%, #d84b5e 63%, #f49a83); border-color: #ad4651; }
.bamboo-2 { background: linear-gradient(90deg, #91d6ed, #4b94c9 42%, #d1f2df 50%, #4a88ba 63%, #90cde5); border-color: #507ca7; }
.tile--honor b { color: #7240a4; font: 800 25px/1 "Microsoft YaHei", sans-serif; }
.tile--red b { color: #dc354a; font-size: 30px; }.tile--green b { color: #168557; font-size: 25px; }
.white-frame { position: absolute; inset: 11px 8px 9px; border: 1px solid #d9d5c9; border-radius: 2px; }
.white-frame::before, .white-frame::after { width: 6px; height: 6px; position: absolute; border-color: #63a989; border-style: solid; content: ""; }
.white-frame::before { top: 3px; left: 3px; border-width: 1px 0 0 1px; }.white-frame::after { right: 3px; bottom: 3px; border-width: 0 1px 1px 0; }
.tile--river { width: 100%; min-width: 23px; max-width: 34px; height: 43px; border-width: 1px; border-bottom-width: 2px; border-radius: 3px; box-shadow: 0 2px 2px rgb(0 0 0 / 14%); }
.tile--river .tile--character b { font-size: 15px; }.tile--river .tile--character small { font-size: 9px; }.tile--river .tile-rank { top: 1px; left: 2px; font-size: 6px; }.tile--river .pips, .tile--river .bamboos { inset: 7px 2px 3px; }.tile--river .pip { width: 6px; height: 6px; }.tile--river .tile--circle .pip:first-child:last-child { width: 10px; height: 10px; border-width: 2px; }.tile--river .bamboo { width: 5px; height: 13px; }.tile--river .bamboo::after { top: 3px; width: 6px; }.tile--river.tile--honor b, .tile--river.tile--green b { font-size: 15px; }.tile--river.tile--red b { font-size: 18px; }
.table-seal { width: 76px; height: 81px; position: absolute; top: 50%; left: 50%; z-index: 2; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid rgb(244 209 139 / 53%); border-radius: 40px 40px 25px 25px; color: #f8e1a6; background: linear-gradient(160deg, rgb(21 79 68 / 88%), rgb(8 65 59 / 94%)); box-shadow: 0 5px 16px rgb(0 0 0 / 15%), inset 0 0 0 4px rgb(241 209 137 / 7%); }
.table-seal span { font: 700 17px/1 Georgia, serif; letter-spacing: 0; }.table-seal b { margin-top: 6px; color: #f9edcf; font-size: 12px; }.table-seal small { margin-top: 3px; color: #b4d5c3; font-size: 8px; }
.table-message { max-width: min(78%, 310px); position: absolute; top: 50%; left: 50%; z-index: 3; transform: translate(-50%, -50%); padding: 9px 16px; border: 1px solid rgb(255 255 255 / 32%); border-radius: 6px; color: #fff9e8; background: rgb(48 27 54 / 92%); box-shadow: 0 8px 25px rgb(0 0 0 / 30%); font-size: 12px; text-align: center; animation: toast-in .26s both; }
.seat { min-width: 128px; position: absolute; z-index: 2; display: grid; grid-template-columns: 49px auto; grid-template-rows: auto auto; align-items: center; gap: 2px 8px; padding: 5px 9px; border: 1px solid transparent; border-radius: 7px; transition: border-color .2s, background .2s, box-shadow .2s; }
.seat.is-active { border-color: rgb(247 219 145 / 80%); background: rgb(12 61 54 / 56%); box-shadow: 0 0 0 2px rgb(244 211 121 / 12%), 0 5px 20px rgb(0 0 0 / 15%); }
.seat-avatar { width: 49px; height: 49px; position: relative; grid-row: 1 / 3; }
.seat-avatar .portrait { width: 47px; height: 47px; }
.wind-tag { min-width: 20px; height: 20px; position: absolute; right: -5px; bottom: -2px; display: grid; place-items: center; border: 2px solid #f4d587; border-radius: 50%; color: #4a3151; background: #fff0be; font-size: 9px; font-weight: 900; }
.seat-copy { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.seat-copy b { overflow: hidden; color: #fff8ed; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.seat-copy > span { color: #bdd7c9; font-size: 9px; }
.seat--2 { top: 16px; left: 50%; transform: translateX(-50%); grid-template-columns: 43px auto; }
.seat--2 .seat-avatar { width: 43px; height: 43px; }.seat--2 .portrait { width: 42px; height: 42px; }
.seat--1 { top: 48%; right: 19px; transform: translateY(-50%); }.seat--3 { top: 48%; left: 19px; transform: translateY(-50%); }
.seat--0 { bottom: 15px; left: 50%; transform: translateX(-50%); min-width: 174px; grid-template-columns: 41px auto; padding: 3px 9px; }
.seat--0 .seat-avatar, .seat--0 .portrait { width: 40px; height: 40px; }
.back-row { height: 19px; grid-column: 1 / 3; margin: 0 auto; display: flex; justify-content: center; }
.back-row i { width: 14px; height: 18px; margin-left: -4px; border: 1px solid #f3e7fa; border-radius: 3px 3px 4px 4px; background: repeating-linear-gradient(135deg, #cdb5e5 0 2px, #9478b7 3px 4px); box-shadow: inset 0 0 0 2px rgb(255 255 255 / 28%); }
.back-row i:first-child { margin-left: 0; }
.meld-row { max-width: 180px; grid-column: 1 / 3; display: flex; gap: 3px; overflow-x: auto; scrollbar-width: none; }
.meld-row:empty { display: none; }
.meld { display: inline-flex; flex: 0 0 auto; }
.meld .tile--river { width: 20px; min-width: 20px; height: 29px; margin-left: -1px; }
.meld--concealedKong { opacity: .7; }

.player-console { min-width: 0; padding: 9px 14px 8px; border: 1px solid rgb(255 255 255 / 13%); border-radius: 8px; background: linear-gradient(115deg, rgb(58 31 72 / 94%), rgb(38 25 47 / 96%) 58%, rgb(31 45 48 / 94%)); box-shadow: 0 9px 25px rgb(0 0 0 / 19%); }
.hand-heading { min-height: 24px; margin: 0 1px 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hand-heading > div:first-child { display: flex; align-items: center; gap: 10px; }
.hand-heading .eyebrow { font-size: 8px; }.hand-heading b { font-size: 11px; }.hand-heading b i { color: #dcb7f1; font-style: normal; }
.turn-caption { overflow: hidden; color: #beaac8; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.hand-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; scrollbar-color: rgb(227 199 244 / 35%) transparent; }
.player-hand { width: max-content; min-width: 100%; min-height: 78px; padding: 3px 3px 7px; display: flex; align-items: end; justify-content: center; gap: 4px; }
.tile-button { width: 48px; height: 68px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 6px; background: transparent; cursor: pointer; transition: transform .14s, filter .14s; }
.tile-button.is-drawn { margin-left: 7px; }
.tile-button .tile-face { width: 100%; height: 100%; }
.tile-button:hover:not(:disabled), .tile-button:focus-visible:not(:disabled) { z-index: 1; transform: translateY(-9px); filter: brightness(1.04); }
.tile-button.is-drawn .tile-face { border-color: #efcf78; box-shadow: 0 0 0 2px #efcf78, 0 4px 8px rgb(0 0 0 / 25%), inset 0 1px #fff; }
.tile-button:disabled { cursor: not-allowed; }
.tile-button:disabled .tile-face { filter: saturate(.87); }
.console-footer { min-height: 38px; padding-top: 4px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-top: 1px solid rgb(255 255 255 / 8%); }
.action-area { min-width: 0; min-height: 34px; display: flex; align-items: center; }
.action-list { display: flex; flex-wrap: wrap; gap: 6px; }
.action-button { min-height: 32px; padding: 0 13px; border: 1px solid rgb(224 199 241 / 48%); border-radius: 5px; color: #f6eafd; background: rgb(172 117 198 / 18%); font-size: 12px; font-weight: 800; cursor: pointer; animation: action-in .22s both; }
.action-button:hover { border-color: #f4d17c; background: rgb(232 190 247 / 22%); }
.action-button--win { border-color: #f5cf75; color: #422a32; background: linear-gradient(110deg, #ffe4a0, #f2b15f); }
.action-button--pass { border-color: rgb(255 255 255 / 16%); color: #d2c1d8; background: rgb(255 255 255 / 5%); }
.action-hint { color: #b8aac1; font-size: 10px; }
.console-tools { display: flex; align-items: center; gap: 13px; }
.text-button { color: #d1bcdb; font-size: 10px; }
.text-button:disabled { opacity: .42; }
.result-banner { width: min(460px, calc(100% - 32px)); position: fixed; top: 50%; left: 50%; z-index: 8; transform: translate(-50%, -50%); padding: 26px 28px 22px; display: flex; flex-direction: column; align-items: center; gap: 7px; border: 1px solid rgb(246 213 135 / 55%); border-radius: 8px; color: #f8e8d6; background: linear-gradient(150deg, #362244, #1c1930); box-shadow: 0 22px 80px rgb(0 0 0 / 55%), inset 0 0 0 4px rgb(255 255 255 / 3%); animation: toast-in .3s both; }
.result-banner > span { color: var(--gold); font-size: 11px; font-weight: 900; }.result-banner > b { margin-bottom: 13px; font: 500 19px/1.4 Georgia, "Microsoft YaHei", serif; text-align: center; }.result-banner--win { border-color: #ebce81; }
.result-banner .primary-button { align-self: stretch; }

.modal-scrim { position: fixed; inset: 0; z-index: 10; padding: 20px; display: grid; place-items: center; background: rgb(12 6 20 / 72%); backdrop-filter: blur(7px); animation: appear .18s both; }
.modal { width: min(430px, 100%); position: relative; padding: 29px; border: 1px solid rgb(226 191 242 / 27%); border-radius: 8px; color: #f9f0fd; background: linear-gradient(150deg, #362244, #21182b 75%); box-shadow: 0 20px 70px rgb(0 0 0 / 45%); }
.modal h2 { margin: 8px 0 23px; font: 500 25px Georgia, "Microsoft YaHei", serif; }
.modal-close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; font-size: 20px; }
.setting-row { min-height: 51px; display: flex; align-items: center; justify-content: space-between; gap: 20px; border-top: 1px solid rgb(255 255 255 / 9%); color: #e9dff0; font-size: 12px; }
.switch { min-width: 71px; min-height: 30px; padding: 0 7px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid rgb(255 255 255 / 18%); border-radius: 17px; color: #d8cadf; background: rgb(0 0 0 / 15%); font-size: 10px; cursor: pointer; }
.switch i { width: 14px; height: 14px; border-radius: 50%; background: #a599ad; transition: transform .18s, background .18s; }
.switch[aria-pressed="true"] { border-color: #c28cdf; color: #fff; }.switch[aria-pressed="true"] i { transform: translateX(2px); background: #dda6fa; box-shadow: 0 0 10px rgb(210 143 242 / 55%); }
.volume-row input { width: 125px; accent-color: #cf91ef; }
.modal-done { width: 100%; justify-content: center; margin-top: 22px; }
.help-list { display: grid; gap: 9px; }
.help-list p { margin: 0; padding: 10px 12px; display: grid; grid-template-columns: 76px 1fr; gap: 12px; border-left: 2px solid #bb7ddd; color: #cbbbd4; background: rgb(255 255 255 / 4%); font-size: 11px; line-height: 1.6; }
.help-list b { color: #fae8ff; }

@keyframes appear { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: translateY(0); } }
@keyframes tile-arrive { from { opacity: 0; transform: translateY(-8px) scale(.92); } to { opacity: 1; } }
@keyframes action-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, calc(-50% + 9px)) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

@media (max-width: 1050px) {
  .start-layout { grid-template-columns: minmax(280px, .7fr) minmax(470px, 1.3fr); gap: 34px; }
  .character-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  .character-card { min-height: 133px; }
  .character-art { width: 58px; height: 62px; }
  .game-layout { grid-template-rows: minmax(400px, 1fr) auto; }
  .table-center { inset-inline: 18%; }
}

@media (max-width: 800px) {
  .sitebar { width: calc(100% - 32px); min-height: 61px; }
  .start-layout { width: min(620px, calc(100% - 34px)); min-height: auto; padding: 20px 0 35px; grid-template-columns: 1fr; gap: 17px; }
  .welcome-panel { min-height: 208px; padding: 12px 0 5px; }
  .welcome-panel::after { display: none; }
  .welcome-panel h1 { margin: 12px 0 4px; font-size: 43px; }
  .welcome-line { font-size: 12px; }
  .welcome-tiles { height: 88px; position: absolute; top: 44px; right: 2px; gap: 4px; opacity: .96; }
  .welcome-tiles .tile-face { width: 34px; height: 49px; }
  .welcome-tiles .tile--character b { font-size: 17px; }.welcome-tiles .tile--character small { font-size: 10px; }
  .welcome-tiles .tile-rank { font-size: 7px; }.welcome-tiles .pips, .welcome-tiles .bamboos { inset: 7px 3px 3px; }.welcome-tiles .pip { width: 7px; height: 7px; }.welcome-tiles .bamboo { width: 6px; height: 15px; }
  .welcome-meta { gap: 14px; font-size: 9px; }
  .ornament-a { width: 100px; height: 100px; top: 1px; right: 48px; }
  .ornament-b { top: 24px; right: 70px; }
  .setup-panel { padding-top: 6px; }
  .setup-heading { margin-bottom: 11px; }.setup-heading h2 { font-size: 21px; }
  .character-card { min-height: 124px; }
  .character-art { width: 56px; height: 59px; }
  .gamebar { width: calc(100% - 24px); min-height: 54px; gap: 9px; }
  .gamebar .brand-lockup { gap: 7px; }.gamebar .brand-mark { width: 33px; height: 33px; }.gamebar .brand-lockup b { font-size: 10px; }.gamebar .brand-lockup small { font-size: 8px; }
  .round-readout { gap: 5px; font-size: 9px; }
  .game-tools { gap: 4px; }.game-tools .icon-button { width: 32px; height: 32px; }.quiet-button { min-height: 32px; padding: 0 8px; font-size: 10px; }
  .game-layout { width: calc(100% - 18px); padding: 9px 0 11px; grid-template-rows: minmax(350px, 56vh) auto; gap: 8px; }
  .game-table { min-height: 350px; max-height: none; border-width: 6px; border-radius: 25px; }
  .game-table::before { inset: 9px; border-radius: 18px; }.game-table::after { inset: 16px; border-radius: 14px; }
  .table-center { inset: 23% 16% 22%; }
  .river { grid-template-columns: repeat(5, minmax(20px, 1fr)); grid-auto-rows: 30px; gap: 2px; padding: 1px; }
  .river--2 { padding-right: 30px; }.river--1 { padding-left: 30px; }.river--3 { padding-right: 30px; }.river--0 { padding-left: 30px; }
  .tile--river { min-width: 20px; max-width: 29px; height: 38px; }
  .seat { min-width: 106px; grid-template-columns: 40px auto; gap: 2px 5px; padding: 4px; }
  .seat-avatar, .seat-avatar .portrait { width: 39px; height: 39px; }.wind-tag { min-width: 18px; height: 18px; font-size: 8px; }
  .seat-copy b { font-size: 10px; }.seat-copy > span { font-size: 8px; }
  .seat--2 { top: 7px; grid-template-columns: 37px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 36px; height: 36px; }
  .seat--1 { right: 7px; top: 44%; }.seat--3 { left: 7px; top: 44%; }
  .seat--0 { min-width: 150px; bottom: 5px; grid-template-columns: 34px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 33px; height: 33px; }
  .back-row { height: 14px; }.back-row i { width: 11px; height: 13px; }
  .table-seal { width: 58px; height: 64px; }.table-seal span { font-size: 14px; }.table-seal b { margin-top: 4px; font-size: 10px; }.table-seal small { font-size: 7px; }
  .player-console { padding: 7px 8px 6px; }
  .player-hand { justify-content: flex-start; gap: 3px; min-height: 67px; }
  .tile-button { width: 42px; height: 59px; }.tile-button.is-drawn { margin-left: 5px; }
  .tile-face { width: 42px; height: 59px; }
  .tile--character b { font-size: 22px; }.tile--character small { font-size: 13px; }
  .console-footer { min-height: 35px; }.action-button { min-height: 31px; padding: 0 10px; }.console-tools { gap: 8px; }
}

@media (max-width: 520px) {
  .sitebar { min-height: 55px; }
  .start-layout { width: calc(100% - 28px); padding-top: 16px; gap: 11px; }
  .welcome-panel { min-height: 184px; }
  .welcome-panel .eyebrow { font-size: 8px; gap: 6px; }
  .welcome-panel h1 { margin-top: 10px; font-size: 36px; }
  .welcome-line { max-width: 230px; font-size: 11px; }
  .welcome-tiles { right: 0; top: 44px; gap: 2px; }
  .welcome-tiles > span:nth-child(1), .welcome-tiles > span:nth-child(5) { display: none; }
  .welcome-tiles .tile-face { width: 31px; height: 46px; }
  .welcome-meta { gap: 10px; font-size: 8px; }.welcome-meta b { font-size: 11px; }
  .setup-heading h2 { font-size: 19px; }
  .character-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
  .character-card { min-height: 100px; padding: 5px 2px 4px; }
  .character-art { width: 43px; height: 46px; border-radius: 23px 23px 6px 6px; }
  .character-name { margin-top: 4px; font-size: 10px; }.character-style { font-size: 7px; }
  .difficulty-row { min-height: 40px; margin-top: 7px; font-size: 10px; }
  .segmented button { min-height: 27px; font-size: 10px; }
  .start-button { min-height: 44px; }
  .setup-footer { min-height: 36px; font-size: 9px; }
  .gamebar { min-height: 49px; width: calc(100% - 16px); gap: 5px; }
  .gamebar .brand-lockup b { font-size: 9px; }.gamebar .brand-lockup small { font-size: 7px; }
  .round-readout { gap: 4px; font-size: 8px; }.round-readout > span:nth-of-type(2), .round-readout > span:nth-of-type(3) { display: none; }
  .game-tools .icon-button { width: 29px; height: 29px; }.quiet-button { min-height: 29px; padding: 0 6px; font-size: 9px; }
  .game-layout { width: calc(100% - 10px); padding-top: 5px; grid-template-rows: minmax(315px, 62vh) auto; gap: 6px; }
  .game-table { min-height: 315px; border-width: 5px; border-radius: 20px; }
  .game-table::before { inset: 7px; border-radius: 14px; }.game-table::after { inset: 13px; border-radius: 10px; }
  .table-center { inset: 22% 33% 22%; }
  .river { grid-template-columns: repeat(3, minmax(18px, 1fr)); grid-auto-rows: 27px; gap: 1px; }
  .river--2 { padding-right: 20px; }.river--1 { padding-left: 20px; }.river--3 { padding-right: 20px; }.river--0 { padding-left: 20px; }
  .tile--river { min-width: 18px; max-width: 25px; height: 34px; }
  .seat { min-width: 90px; grid-template-columns: 32px auto; gap: 2px 4px; padding: 3px; }
  .seat-avatar, .seat-avatar .portrait { width: 31px; height: 31px; border-width: 1px; }.wind-tag { min-width: 15px; height: 15px; right: -4px; bottom: -3px; border-width: 1px; font-size: 7px; }
  .seat-copy b { max-width: 66px; font-size: 9px; }.seat-copy > span { font-size: 7px; }
  .seat--2 { top: 5px; grid-template-columns: 30px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 29px; height: 29px; }
  .seat--1 { right: 3px; top: 41%; }.seat--3 { left: 3px; top: 41%; }
  .seat--0 { bottom: 3px; min-width: 135px; grid-template-columns: 28px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 27px; height: 27px; }
  .back-row { height: 11px; }.back-row i { width: 9px; height: 10px; margin-left: -5px; }
  .table-seal { width: 48px; height: 53px; }.table-seal span { font-size: 11px; }.table-seal b { font-size: 8px; }.table-seal small { font-size: 6px; }
  .player-console { padding: 5px 5px 4px; border-radius: 6px; }
  .hand-heading { min-height: 21px; }.hand-heading > div:first-child { gap: 5px; }.hand-heading .eyebrow { font-size: 7px; }.hand-heading b { font-size: 10px; }.turn-caption { max-width: 48%; font-size: 8px; }
  .player-hand { min-height: 59px; padding: 2px 1px 5px; gap: 2px; }
  .tile-button { width: clamp(24px, 6.8vw, 35px); height: clamp(38px, 10.8vw, 53px); }.tile-button.is-drawn { margin-left: 4px; }
  .tile-face { width: 100%; height: 100%; border-radius: 4px 4px 5px 5px; border-bottom-width: 3px; }
  .tile--character b { font-size: clamp(13px, 4.7vw, 18px); }.tile--character small { font-size: clamp(8px, 2.9vw, 11px); }
  .tile-rank { top: 1px; left: 2px; font-size: 7px; }.pips, .bamboos { inset: 7px 2px 3px; }.pip { width: clamp(5px, 1.75vw, 7px); height: clamp(5px, 1.75vw, 7px); }.tile--circle .pip:first-child:last-child { width: 11px; height: 11px; border-width: 2px; }.bamboo { width: clamp(4px, 1.6vw, 6px); height: clamp(12px, 3.5vw, 16px); }.bamboo::after { top: 3px; width: 5px; }
  .tile--honor b { font-size: clamp(15px, 5vw, 19px); }.tile--red b { font-size: clamp(18px, 6.2vw, 24px); }.tile--green b { font-size: clamp(15px, 5vw, 19px); }
  .console-footer { min-height: 33px; padding-top: 3px; gap: 4px; }.action-area { min-height: 29px; }.action-list { gap: 4px; }.action-button { min-height: 29px; padding: 0 8px; font-size: 10px; }.action-hint { font-size: 8px; }.console-tools { gap: 6px; }.text-button { padding: 5px 0; font-size: 8px; }
  .modal { padding: 24px 20px 19px; }.modal h2 { font-size: 21px; }.help-list p { grid-template-columns: 59px 1fr; gap: 7px; padding: 9px; font-size: 10px; }
}

@media (max-height: 760px) and (min-width: 801px) {
  .game-layout { grid-template-rows: minmax(360px, 1fr) auto; }
  .player-console { padding-top: 5px; padding-bottom: 4px; }
  .player-hand { min-height: 70px; }.tile-button { height: 60px; }
}

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

@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
  .gamebar { min-height: 42px; }
  .game-layout { padding: 4px 0 5px; grid-template-rows: minmax(210px, 1fr) auto; gap: 5px; }
  .game-table { min-height: 210px; border-width: 5px; border-radius: 18px; }
  .game-table::before { inset: 7px; border-radius: 13px; }.game-table::after { inset: 12px; border-radius: 9px; }
  .table-center { inset: 22% 26% 22%; }
  .river { grid-template-columns: repeat(5, minmax(18px, 1fr)); grid-auto-rows: 22px; gap: 1px; }
  .river--2, .river--3 { padding-right: 25px; }.river--1, .river--0 { padding-left: 25px; }
  .seat { min-width: 98px; grid-template-columns: 36px auto; gap: 2px 5px; padding: 3px; }
  .seat-avatar, .seat-avatar .portrait { width: 35px; height: 35px; }.seat--2 { top: 3px; }.seat--1, .seat--3 { top: 48%; }
  .seat--0 { bottom: 3px; min-width: 138px; grid-template-columns: 30px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 29px; height: 29px; }
  .back-row { height: 12px; }.back-row i { width: 9px; height: 11px; }
  .player-console { padding: 4px 8px 3px; }
  .hand-heading { min-height: 18px; margin-bottom: 2px; }.hand-heading .eyebrow { font-size: 7px; }.hand-heading b { font-size: 10px; }
  .player-hand { min-height: 48px; padding: 1px 2px 3px; gap: 3px; }
  .tile-button { width: 34px; height: 44px; }.tile-face { width: 100%; height: 100%; }
  .tile--character b { font-size: 16px; }.tile--character small { font-size: 10px; }
  .tile-rank { font-size: 7px; }.pips, .bamboos { inset: 7px 2px 3px; }.pip { width: 6px; height: 6px; }.bamboo { width: 5px; height: 14px; }
  .tile--honor b { font-size: 17px; }.tile--red b { font-size: 20px; }.tile--green b { font-size: 16px; }
  .console-footer { min-height: 27px; padding-top: 2px; }.action-area { min-height: 25px; }.action-button { min-height: 25px; padding: 0 8px; font-size: 10px; }
}

@media (max-width: 340px) {
  .river { grid-template-columns: repeat(2, minmax(18px, 1fr)); }
}

/* Purple Grapes table and character treatment */
.cast-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cast-card { min-height: 157px; cursor: default; }
.cast-card:hover { transform: none; border-color: rgb(255 255 255 / 18%); background: rgb(255 255 255 / 5%); }
.cast-card--hero { border-color: rgb(210 146 245 / 72%); background: linear-gradient(155deg, rgb(177 105 217 / 22%), rgb(255 255 255 / 4%)); box-shadow: inset 0 0 0 1px rgb(215 164 245 / 16%), 0 9px 25px rgb(166 93 206 / 16%); }
.cast-card--violet { border-color: rgb(158 145 230 / 60%); background: linear-gradient(155deg, rgb(138 121 218 / 18%), rgb(255 255 255 / 4%)); }
.cast-card .character-art { width: 78px; height: 82px; border-radius: 36px 36px 10px 10px; }
.cast-card--hero .character-art, .cast-card--violet .character-art { width: 84px; height: 88px; }
.game-layout { grid-template-rows: minmax(480px, min(67vh, 700px)) auto; gap: 10px; }
.game-table { min-height: 480px; border-width: 10px; border-radius: 42px; background: radial-gradient(ellipse at 50% 48%, #377e87 0, #286a79 34%, #1b5367 70%, #183c59 100%); box-shadow: inset 0 0 0 2px #f0d08a, inset 0 0 0 9px rgb(71 40 62 / 68%), inset 0 0 90px rgb(5 27 49 / 37%), 0 18px 48px rgb(0 0 0 / 37%); }
.game-table::before { inset: 12px; border-color: rgb(246 216 147 / 63%); border-radius: 31px; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 5%); }
.game-table::after { inset: 24px; border-color: rgb(240 222 255 / 15%); border-radius: 23px; background: radial-gradient(ellipse at 50% 48%, transparent 18%, rgb(11 37 58 / 10%) 68%, rgb(9 29 51 / 23%)); }
.table-center { inset: 20% 10% 19%; z-index: 1; }
.rivers { grid-template-columns: minmax(0, 1fr) minmax(100px, .4fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(82px, .48fr) minmax(0, 1fr); gap: 7px; }
.river { padding: 5px; grid-template-columns: repeat(6, minmax(23px, 1fr)); grid-auto-rows: 39px; align-content: start; justify-content: center; gap: 3px; border: 1px solid rgb(233 218 255 / 11%); border-radius: 11px; background: linear-gradient(145deg, rgb(17 48 70 / 43%), rgb(21 58 73 / 26%)); box-shadow: inset 0 1px rgb(255 255 255 / 5%); }
.river--2 { grid-area: 1 / 1 / 2 / 4; padding: 5px 15% 34px; grid-template-columns: repeat(10, minmax(24px, 1fr)); align-content: end; }
.river--0 { grid-area: 3 / 1 / 4 / 4; padding: 34px 15% 5px; grid-template-columns: repeat(10, minmax(24px, 1fr)); align-content: start; }
.river--3 { grid-area: 2 / 1; grid-template-columns: repeat(3, minmax(18px, 1fr)); align-content: center; }
.river--1 { grid-area: 2 / 3; grid-template-columns: repeat(3, minmax(18px, 1fr)); align-content: center; }
.river-tile { min-height: 0; }
.tile--river { width: 100%; min-width: 20px; max-width: 38px; height: 49px; border-radius: 4px 4px 6px 6px; }
.tile--river .tile--character b { font-size: 18px; }.tile--river .tile--character small { font-size: 10px; }.tile--river .tile-rank { font-size: 7px; }.tile--river .pips, .tile--river .bamboos { inset: 8px 3px 4px; }.tile--river .pip { width: 7px; height: 7px; }.tile--river .bamboo { width: 6px; height: 15px; }.tile--river .tile--honor b, .tile--river.tile--green b { font-size: 17px; }.tile--river.tile--red b { font-size: 20px; }
.table-seal { width: clamp(94px, 10vw, 132px); height: clamp(112px, 14vh, 144px); z-index: 4; border-color: rgb(249 215 150 / 83%); border-radius: 20px 20px 16px 16px; color: #fff5d9; background: radial-gradient(ellipse at 50% 4%, rgb(196 124 215 / 35%), transparent 43%), linear-gradient(155deg, #51305f, #302543 63%, #233c59); box-shadow: 0 9px 24px rgb(5 20 40 / 38%), inset 0 0 0 4px rgb(255 255 255 / 5%), inset 0 0 0 5px rgb(247 215 150 / 12%); }
.seal-mark { color: #f3d18d; font: 800 11px/1 Georgia, serif; letter-spacing: 0; }
.seal-wall, .seal-wind { display: flex; flex-direction: column; align-items: center; }
.seal-wall small, .seal-wind small, .seal-turns { color: #cbb6d5; font-size: 8px; }
.seal-wall b { margin-top: 1px; color: #fff5dc; font: 700 23px/1 Georgia, serif; }
.seal-divider { width: 58%; height: 1px; margin: 5px 0 4px; background: linear-gradient(90deg, transparent, rgb(244 213 154 / 63%), transparent); }
.seal-wind strong { color: #f3d18d; font: 700 21px/1.05 "Microsoft YaHei", sans-serif; }
.seal-actor { max-width: 100%; margin-top: 5px; overflow: hidden; color: #fff2ff; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.seal-status { margin-top: 3px; color: #d8c6df; font-size: 8px; }
.seal-turns { margin-top: 3px; }
.table-message { top: 5%; left: 50%; z-index: 5; transform: translate(-50%, 0); border-color: rgb(255 224 164 / 56%); background: linear-gradient(110deg, rgb(45 28 65 / 96%), rgb(24 42 62 / 96%)); }
.seat { min-width: 174px; grid-template-columns: 67px auto; gap: 4px 9px; padding: 8px 11px; border-radius: 12px; background: linear-gradient(145deg, rgb(44 35 68 / 91%), rgb(30 37 60 / 89%)); box-shadow: 0 9px 24px rgb(7 19 39 / 30%), inset 0 1px rgb(255 255 255 / 14%); }
.seat.is-active { border-color: #f1d488; background: linear-gradient(145deg, rgb(118 68 144 / 95%), rgb(53 58 92 / 95%)); box-shadow: 0 0 0 3px rgb(243 210 132 / 17%), 0 0 27px rgb(229 187 255 / 32%), 0 9px 26px rgb(7 19 39 / 38%), inset 0 1px rgb(255 255 255 / 28%); }
.seat-avatar, .seat-avatar .portrait { width: 66px; height: 66px; }
.seat-avatar .portrait { border: 3px solid rgb(255 255 255 / 88%); box-shadow: 0 0 0 3px color-mix(in srgb, var(--portrait-color), transparent 31%), 0 5px 15px rgb(0 0 0 / 28%); }
.seat.is-active .seat-avatar .portrait { border-color: #fff4c9; box-shadow: 0 0 0 4px rgb(249 218 141 / 52%), 0 0 24px rgb(244 212 151 / 54%); }
.seat-copy b { font-size: 13px; }.seat-copy > span { font-size: 10px; }
.wind-tag { min-width: 23px; height: 23px; right: -4px; bottom: -2px; font-size: 10px; }
.seat--2 { top: 8px; min-width: 190px; grid-template-columns: 63px auto; padding: 7px 12px; }
.seat--2 .seat-avatar, .seat--2 .portrait { width: 62px; height: 62px; }
.seat--1 { top: 49%; right: 18px; }.seat--3 { top: 49%; left: 18px; }
.seat--0 { bottom: 7px; min-width: 206px; grid-template-columns: 66px auto; padding: 7px 12px; }
.seat--0 .seat-avatar, .seat--0 .portrait { width: 65px; height: 65px; }
.back-row { height: 21px; }.back-row i { width: 15px; height: 20px; border-color: #fff0ff; background: repeating-linear-gradient(135deg, #e2c1fa 0 2px, #845da8 3px 5px); }
.player-console { padding: 11px 15px 9px; border-color: rgb(239 202 255 / 27%); border-radius: 12px; background: linear-gradient(110deg, rgb(61 36 77 / 98%), rgb(37 34 60 / 98%) 54%, rgb(28 56 72 / 98%)); box-shadow: 0 12px 34px rgb(0 0 0 / 26%), inset 0 1px rgb(255 255 255 / 10%); }
.hand-heading b { font-size: 13px; }.turn-caption { font-size: 11px; }
.tile-button { width: 51px; height: 72px; }.tile-face { width: 51px; height: 72px; border-color: #d3c5b4; border-bottom-width: 5px; border-radius: 6px 6px 8px 8px; box-shadow: 0 4px 7px rgb(0 0 0 / 23%), inset 0 1px #fff; }
.tile--character b { font-size: 27px; }.tile--character small { font-size: 16px; }.tile--honor b { font-size: 28px; }.tile--red b { font-size: 33px; }.tile--green b { font-size: 27px; }
.console-footer { min-height: 42px; }.action-area { min-height: 38px; }.action-button { min-height: 36px; border-radius: 8px; }
.cast-grid .character-art img, .seat-avatar .portrait img { object-position: 50% 19%; }

@media (max-width: 1050px) {
  .game-layout { grid-template-rows: minmax(420px, 61vh) auto; }
  .game-table { min-height: 420px; }
  .table-center { inset-inline: 12%; }
  .seat { min-width: 151px; grid-template-columns: 58px auto; padding: 6px 8px; }
  .seat-avatar, .seat-avatar .portrait { width: 57px; height: 57px; }
  .seat--2 { min-width: 172px; grid-template-columns: 55px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 54px; height: 54px; }
  .seat--0 { min-width: 182px; grid-template-columns: 57px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 56px; height: 56px; }
  .river--2, .river--0 { grid-template-columns: repeat(8, minmax(22px, 1fr)); padding-left: 11%; padding-right: 11%; }
  .tile-button { width: 47px; height: 65px; }.tile-face { width: 47px; height: 65px; }
}

@media (max-width: 800px) {
  .game-layout { width: calc(100% - 18px); padding: 8px 0 10px; grid-template-rows: minmax(360px, 62vh) auto; gap: 8px; }
  .game-table { min-height: 360px; border-width: 7px; border-radius: 27px; }
  .game-table::before { inset: 9px; border-radius: 19px; }.game-table::after { inset: 17px; border-radius: 13px; }
  .table-center { inset: 20% 18% 18%; }
  .rivers { grid-template-columns: minmax(0, 1fr) minmax(76px, .42fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(66px, .45fr) minmax(0, 1fr); gap: 4px; }
  .river { padding: 3px; grid-auto-rows: 32px; grid-template-columns: repeat(5, minmax(18px, 1fr)); gap: 2px; border-radius: 8px; }
  .river--2 { grid-template-columns: repeat(8, minmax(19px, 1fr)); padding: 3px 12% 25px; }.river--0 { grid-template-columns: repeat(8, minmax(19px, 1fr)); padding: 25px 12% 3px; }
  .river--1, .river--3 { grid-template-columns: repeat(2, minmax(17px, 1fr)); }
  .tile--river { min-width: 18px; max-width: 31px; height: 40px; }
  .table-seal { width: 90px; height: 110px; }.seal-mark { font-size: 9px; }.seal-wall b { font-size: 20px; }.seal-wind strong { font-size: 18px; }
  .seat { min-width: 112px; grid-template-columns: 48px auto; gap: 3px 5px; padding: 5px; border-radius: 9px; }
  .seat-avatar, .seat-avatar .portrait { width: 47px; height: 47px; }.seat-copy b { max-width: 74px; font-size: 11px; }.seat-copy > span { font-size: 8px; }
  .seat--2 { top: 5px; min-width: 152px; grid-template-columns: 48px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 47px; height: 47px; }
  .seat--1 { right: 4px; top: 49%; }.seat--3 { left: 4px; top: 49%; }
  .seat--0 { min-width: 160px; bottom: 4px; grid-template-columns: 49px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 48px; height: 48px; }
  .back-row { height: 16px; }.back-row i { width: 12px; height: 15px; }
  .player-console { padding: 7px 9px 6px; border-radius: 8px; }
  .tile-button { width: 42px; height: 59px; }.tile-face { width: 42px; height: 59px; }
  .tile--character b { font-size: 22px; }.tile--character small { font-size: 13px; }.tile--honor b { font-size: 23px; }.tile--red b { font-size: 27px; }.tile--green b { font-size: 22px; }
  .cast-card { min-height: 121px; }.cast-card .character-art { width: 58px; height: 61px; }.cast-card--hero .character-art, .cast-card--violet .character-art { width: 63px; height: 66px; }
}

@media (max-width: 520px) {
  .gamebar { width: calc(100% - 16px); min-height: 49px; gap: 5px; }
  .game-layout { width: calc(100% - 10px); padding: 5px 0 7px; grid-template-rows: minmax(315px, 62svh) auto; gap: 6px; }
  .game-table { min-height: 315px; border-width: 5px; border-radius: 20px; }
  .game-table::before { inset: 7px; border-radius: 14px; }.game-table::after { inset: 13px; border-radius: 10px; }
  .table-center { inset: 21% 29% 21%; }
  .rivers { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 3px; }
  .river { padding: 2px; grid-template-columns: repeat(2, minmax(16px, 1fr)); grid-auto-rows: 26px; gap: 1px; border-radius: 6px; }
  .river--2 { grid-area: 1 / 1; padding: 2px; grid-template-columns: repeat(2, minmax(16px, 1fr)); align-content: start; }
  .river--3 { grid-area: 1 / 2; grid-template-columns: repeat(2, minmax(16px, 1fr)); }
  .river--1 { grid-area: 2 / 1; grid-template-columns: repeat(2, minmax(16px, 1fr)); }
  .river--0 { grid-area: 2 / 2; padding: 2px; grid-template-columns: repeat(2, minmax(16px, 1fr)); align-content: start; }
  .tile--river { min-width: 16px; max-width: 27px; height: 34px; }
  .tile--river .tile--character b { font-size: 13px; }.tile--river .tile--character small { font-size: 8px; }.tile--river .tile-rank { font-size: 5px; }.tile--river .pips, .tile--river .bamboos { inset: 6px 2px 2px; }.tile--river .pip { width: 5px; height: 5px; }.tile--river .bamboo { width: 4px; height: 11px; }.tile--river .tile--honor b, .tile--river.tile--green b { font-size: 13px; }.tile--river.tile--red b { font-size: 15px; }
  .table-seal { width: 79px; height: 94px; border-radius: 14px; }.seal-mark { font-size: 8px; }.seal-wall small, .seal-wind small, .seal-turns { font-size: 6px; }.seal-wall b { font-size: 17px; }.seal-wind strong { font-size: 16px; }.seal-actor { font-size: 8px; }.seal-status { font-size: 7px; }
  .table-message { top: 3%; max-width: 90%; padding: 6px 10px; font-size: 9px; }
  .seat { min-width: 101px; grid-template-columns: 43px auto; gap: 2px 4px; padding: 4px; }
  .seat-avatar, .seat-avatar .portrait { width: 42px; height: 42px; }.seat-copy b { max-width: 63px; font-size: 9px; }.seat-copy > span { font-size: 7px; }
  .seat--2 { top: 3px; min-width: 136px; grid-template-columns: 42px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 41px; height: 41px; }
  .seat--1 { top: 49%; right: 2px; }.seat--3 { top: 49%; left: 2px; }
  .seat--0 { bottom: 2px; min-width: 148px; grid-template-columns: 43px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 42px; height: 42px; }
  .wind-tag { min-width: 17px; height: 17px; border-width: 1px; font-size: 7px; }
  .player-console { padding: 5px 5px 4px; }
  .hand-heading { min-height: 21px; }.hand-heading .eyebrow { font-size: 7px; }.hand-heading b { font-size: 10px; }.turn-caption { max-width: 48%; font-size: 8px; }
  .player-hand { min-height: 59px; padding: 2px 1px 5px; gap: 2px; }.tile-button { width: clamp(24px, 6.8vw, 35px); height: clamp(38px, 10.8vw, 53px); }.tile-button.is-drawn { margin-left: 4px; }
  .tile--character b { font-size: clamp(13px, 4.7vw, 18px); }.tile--character small { font-size: clamp(8px, 2.9vw, 11px); }.tile--honor b { font-size: clamp(15px, 5vw, 19px); }.tile--red b { font-size: clamp(18px, 6.2vw, 24px); }.tile--green b { font-size: clamp(15px, 5vw, 19px); }
  .cast-grid { gap: 4px; }.cast-card { min-height: 96px; padding: 4px 2px; }.cast-card .character-art { width: 43px; height: 45px; }.cast-card--hero .character-art, .cast-card--violet .character-art { width: 47px; height: 49px; }.cast-card .character-name { font-size: 10px; }.cast-card .character-style { font-size: 7px; }
  .modal { max-height: 90svh; overflow-y: auto; }
}

@media (max-width: 340px) {
  .table-center { inset-inline: 35%; }
  .seat { min-width: 96px; grid-template-columns: 39px auto; }
  .seat-avatar, .seat-avatar .portrait { width: 38px; height: 38px; }
  .seat--2 { min-width: 128px; grid-template-columns: 39px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 38px; height: 38px; }
  .seat--0 { min-width: 140px; grid-template-columns: 39px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 38px; height: 38px; }
  .seat-copy b { max-width: 58px; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
  .gamebar { min-height: 40px; }
  .game-layout { padding: 4px 0 5px; grid-template-rows: minmax(210px, 1fr) auto; gap: 5px; }
  .game-table { min-height: 210px; border-radius: 18px; }
  .table-center { inset: 20% 19% 18%; }
  .rivers { grid-template-columns: minmax(0, 1fr) minmax(68px, .35fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) minmax(55px, .38fr) minmax(0, 1fr); }
  .seat { min-width: 98px; grid-template-columns: 38px auto; padding: 3px; }.seat-avatar, .seat-avatar .portrait { width: 37px; height: 37px; }
  .seat--2 { top: 2px; min-width: 126px; grid-template-columns: 36px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 35px; height: 35px; }
  .seat--0 { bottom: 2px; min-width: 130px; grid-template-columns: 37px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 36px; height: 36px; }
  .player-console { padding: 4px 8px 3px; }.player-hand { min-height: 47px; padding: 1px 2px 3px; }.tile-button { width: 34px; height: 44px; }.tile-face { width: 100%; height: 100%; }
  .tile--character b { font-size: 16px; }.tile--character small { font-size: 10px; }.tile--honor b { font-size: 16px; }.tile--red b { font-size: 19px; }.tile--green b { font-size: 16px; }
  .console-footer { min-height: 27px; }.action-area { min-height: 25px; }.action-button { min-height: 25px; padding: 0 8px; font-size: 10px; }
}

.game-layout { align-content: stretch; grid-template-rows: minmax(420px, 1fr) auto; }
.river { border-color: transparent; background: transparent; box-shadow: none; }
.river:not(:empty) { border-color: rgb(233 218 255 / 17%); background: linear-gradient(145deg, rgb(17 48 70 / 52%), rgb(21 58 73 / 32%)); box-shadow: inset 0 1px rgb(255 255 255 / 6%); }
.river:empty { overflow: hidden; }

@media (max-width: 800px) {
  .game-layout { grid-template-rows: minmax(360px, 1fr) auto; }
}

@media (max-width: 520px) {
  .game-layout { grid-template-rows: minmax(315px, 1fr) auto; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
  .game-layout { grid-template-rows: minmax(210px, 1fr) auto; }
}

.river:empty { overflow: hidden; border-color: rgb(242 224 255 / 11%); background: repeating-linear-gradient(135deg, rgb(255 255 255 / 1.2%) 0 1px, transparent 1px 9px); }
.river:empty::after { grid-column: 1 / -1; align-self: center; justify-self: center; padding: 4px 8px; border: 1px solid rgb(239 216 255 / 12%); border-radius: 999px; color: rgb(244 225 255 / 48%); background: rgb(20 39 61 / 35%); content: attr(aria-label); font-size: 8px; white-space: nowrap; }
.table-center::before { position: absolute; inset: -7px; z-index: 0; border: 1px solid rgb(241 219 173 / 10%); border-radius: 14px; content: ""; pointer-events: none; background: repeating-linear-gradient(0deg, transparent 0 31px, rgb(244 226 255 / 1.3%) 32px, transparent 33px), repeating-linear-gradient(90deg, transparent 0 31px, rgb(244 226 255 / 1.1%) 32px, transparent 33px); }
.rivers { z-index: 1; }.table-seal { z-index: 4; }
.seat-avatar, .seat-avatar .portrait { width: 72px; height: 72px; }
.seat--2 .seat-avatar, .seat--2 .portrait { width: 68px; height: 68px; }
.seat--0 .seat-avatar, .seat--0 .portrait { width: 70px; height: 70px; }

@media (max-width: 1050px) {
  .seat-avatar, .seat-avatar .portrait { width: 62px; height: 62px; }
  .seat--2 { grid-template-columns: 59px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 58px; height: 58px; }
  .seat--0 { grid-template-columns: 61px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 60px; height: 60px; }
}

@media (max-width: 800px) {
  .seat-avatar, .seat-avatar .portrait { width: 52px; height: 52px; }
  .seat--2 { grid-template-columns: 52px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 51px; height: 51px; }
  .seat--0 { grid-template-columns: 52px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 51px; height: 51px; }
}

@media (max-width: 340px) {
  .seat-avatar, .seat-avatar .portrait { width: 43px; height: 43px; }
  .seat--2 { min-width: 132px; grid-template-columns: 42px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 41px; height: 41px; }
  .seat--0 { min-width: 140px; grid-template-columns: 43px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 42px; height: 42px; }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
  .seat-avatar, .seat-avatar .portrait { width: 43px; height: 43px; }
  .seat--2 { grid-template-columns: 42px auto; }.seat--2 .seat-avatar, .seat--2 .portrait { width: 41px; height: 41px; }
  .seat--0 { grid-template-columns: 43px auto; }.seat--0 .seat-avatar, .seat--0 .portrait { width: 42px; height: 42px; }
}

.character-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.character-picker .character-card { min-height: 132px; }
.companion-callout { min-height: 60px; margin-top: 12px; padding: 6px 11px; display: flex; align-items: center; gap: 10px; border: 1px solid rgb(203 146 232 / 35%); border-radius: 8px; background: linear-gradient(105deg, rgb(149 83 181 / 19%), rgb(255 255 255 / 4%)); }
.portrait--companion { width: 48px; height: 48px; border-color: #e0b6f7; box-shadow: 0 0 0 3px rgb(185 113 222 / 19%), 0 4px 12px rgb(0 0 0 / 25%); }
.companion-callout > span:not(.portrait) { display: flex; flex-direction: column; gap: 3px; }.companion-callout b { color: #f4d9ff; font-size: 12px; }.companion-callout small { color: #bda9c7; font-size: 9px; }
.companion-callout > i { margin-left: auto; color: #e9c9fa; font: 700 12px Georgia, serif; font-style: normal; }.cast-note { margin: 7px 0 0; color: #b9a9c3; font-size: 10px; text-align: right; }
.result-banner { width: min(650px, calc(100% - 32px)); max-height: min(90svh, 760px); overflow-y: auto; }
.result-banner--draw { width: min(430px, calc(100% - 32px)); }
.winning-hand-panel { width: 100%; min-width: 0; margin: 2px 0 9px; padding: 10px 10px 8px; border: 1px solid rgb(244 216 157 / 20%); border-radius: 7px; background: rgb(0 0 0 / 14%); }
.winning-hand-panel > small { display: block; margin-bottom: 8px; color: #e7d3f0; font-size: 10px; }
.winning-hand { width: 100%; padding: 2px 2px 8px; display: flex; gap: 3px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: rgb(227 199 244 / 35%) transparent; }
.winning-tile { flex: 0 0 auto; }.winning-tile .tile-face { width: 38px; height: 53px; }.winning-melds { display: flex; gap: 8px; overflow-x: auto; }

@media (max-width: 800px) {
  .character-picker { grid-template-columns: repeat(4, minmax(0, 1fr)); }.character-picker .character-card { min-height: 113px; }
}
@media (max-width: 520px) {
  .character-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }.character-picker .character-card { min-height: 96px; padding: 5px 2px 4px; }.character-picker .character-art { width: 43px; height: 46px; }.character-picker .character-name { margin-top: 4px; font-size: 10px; }.character-picker .character-style { font-size: 7px; }
  .companion-callout { min-height: 51px; margin-top: 8px; }.portrait--companion { width: 40px; height: 40px; }.companion-callout b { font-size: 10px; }.companion-callout small { font-size: 8px; }.cast-note { font-size: 8px; }
  .result-banner { max-height: 88svh; padding: 18px 13px 14px; }.result-banner > b { font-size: 16px; }.winning-hand-panel { padding: 8px 6px 6px; }.winning-tile .tile-face { width: 29px; height: 42px; }
}

.table-center { inset-inline: 16%; }
@media (max-width: 1050px) { .table-center { inset: 23% 20% 20%; } }
@media (max-width: 520px) {
  .table-center { inset-inline: 30%; }
  .rivers { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .river--2 { grid-area: 1 / 1; }.river--3 { grid-area: 1 / 2; }.river--1 { grid-area: 2 / 1; }.river--0 { grid-area: 2 / 2; }
}
@media (max-width: 340px) { .table-center { inset-inline: 40%; } }

@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) {
  .table-center { inset: 30% 25% 29%; }
  .rivers { grid-template-columns: minmax(0, 1fr) 64px minmax(0, 1fr); grid-template-rows: minmax(20px, 1fr) minmax(26px, 1.1fr) minmax(20px, 1fr); gap: 2px; }
  .river--2 { grid-area: 1 / 1 / 2 / 4; grid-template-columns: repeat(8, minmax(18px, 1fr)); padding: 2px; }
  .river--3 { grid-area: 2 / 1; grid-template-columns: repeat(4, minmax(16px, 1fr)); }
  .river--1 { grid-area: 2 / 3; grid-template-columns: repeat(4, minmax(16px, 1fr)); }
  .river--0 { grid-area: 3 / 1 / 4 / 4; grid-template-columns: repeat(8, minmax(18px, 1fr)); padding: 2px; }
  .seat--2 { top: 2px; min-width: 120px; grid-template-columns: 34px auto; padding: 2px 4px; }
  .seat--2 .seat-avatar, .seat--2 .portrait { width: 33px; height: 33px; }
  .seat--3, .seat--1 { min-width: 91px; grid-template-columns: 32px auto; padding: 2px 3px; }
  .seat--3 .seat-avatar, .seat--3 .portrait, .seat--1 .seat-avatar, .seat--1 .portrait { width: 31px; height: 31px; }
  .seat--0 { bottom: 2px; min-width: 128px; grid-template-columns: 34px auto; padding: 2px 4px; }
  .seat--0 .seat-avatar, .seat--0 .portrait { width: 33px; height: 33px; }
  .back-row { height: 8px; }.back-row i { width: 7px; height: 8px; }
}

.player-name-field { margin: 0 0 14px; display: grid; grid-template-columns: 1fr; gap: 6px; }
.player-name-field label { color: #f2dfff; font: 500 18px/1.2 Georgia, "Microsoft YaHei", serif; }
.player-name-field input { width: 100%; min-height: 43px; padding: 0 12px; border: 1px solid rgb(235 211 250 / 25%); border-radius: 6px; color: #fff7ff; background: rgb(255 255 255 / 6%); font-size: 13px; }
.player-name-field input::placeholder { color: #9d89a9; }
.player-name-field input[aria-invalid="true"] { border-color: #f39aa6; }
.name-error { min-height: 13px; color: #ffabb7; font-size: 9px; }
.player-name-stamp { display: inline-flex; align-items: center; gap: 6px; color: #ecd8f5; }
.player-name-stamp i { width: 24px; height: 24px; display: grid; place-items: center; border: 1px solid rgb(223 186 248 / 58%); border-radius: 50%; color: #fff4ff; background: linear-gradient(145deg, #754994, #3a345a); font-size: 11px; font-style: normal; }
.player-seat-avatar { overflow: visible; display: grid; place-items: center; border-radius: 50%; background: transparent; }
.player-monogram { width: 100%; height: 100%; display: grid; place-items: center; border: 2px solid #f4dfaa; border-radius: 50%; color: #fff4d6; background: radial-gradient(circle at 35% 28%, #9663ae, #443454 65%, #263e5c); box-shadow: 0 0 0 4px rgb(245 217 159 / 20%), 0 7px 20px rgb(0 0 0 / 28%), inset 0 1px rgb(255 255 255 / 25%); font: 700 24px Georgia, "Microsoft YaHei", serif; }
@media (max-width: 520px) {
  .player-name-field { margin-bottom: 9px; gap: 4px; }.player-name-field label { font-size: 15px; }.player-name-field input { min-height: 39px; font-size: 12px; }
  .player-monogram { font-size: 18px; }
}

/* Art pack: independent 120 × 150 canvases, never stretch the face. */
.tile-art.tile-face { --tile-width: 51px; width: var(--tile-width); height: auto; aspect-ratio: 4 / 5; min-width: 0; max-width: none; position: relative; padding: 0; border: 0; border-radius: 5px; background: transparent; overflow: visible; box-shadow: none; }
.tile-art-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; opacity: 0; pointer-events: none; user-select: none; }
.tile-fallback { position: absolute; inset: 0; display: block; pointer-events: none; }
.tile-fallback > .tile-face { width: 100%; height: 100%; min-width: 0; max-width: none; }
.tile-art[data-art-loaded="true"] > .tile-art-image { opacity: 1; }
.tile-art[data-art-loaded="true"] > .tile-fallback { visibility: hidden; }
.tile-button { width: 51px; height: auto; aspect-ratio: 4 / 5; }
.tile-button > .tile-art { --tile-width: 100%; height: auto; }
.tile-button.is-drawn > .tile-art { outline: 2px solid #efcf78; outline-offset: 1px; }
.tile-art.tile--river { --tile-width: 34px; }
.river-tile { width: 100%; display: flex; justify-content: center; }
.river-tile > .tile-art { width: min(100%, var(--tile-width)); }
.meld > .tile-art { --tile-width: 20px; margin-left: 0; }
.winning-tile > .tile-art { --tile-width: 38px; height: auto; }
.welcome-tiles .tile-art { --tile-width: 34px; height: auto; }
.back-row { height: auto; min-height: 25px; gap: 1px; }
.back-row > .tile-back { --tile-width: 20px; margin-left: -5px; }
.back-row > .tile-back:first-child { margin-left: 0; }
.tile-back-fallback { display: block; width: 100%; height: 100%; border: 1px solid #f3e7fa; border-radius: 3px; background: repeating-linear-gradient(135deg, #cdb5e5 0 2px, #9478b7 3px 4px); box-shadow: inset 0 0 0 2px rgb(255 255 255 / 28%); }
@media (max-width: 1050px) { .tile-button { width: 47px; height: auto; } .river-tile > .tile-art { --tile-width: 31px; } }
@media (max-width: 800px) { .tile-button { width: 42px; height: auto; } .back-row { min-height: 20px; } .back-row > .tile-back { --tile-width: 16px; } }
@media (max-width: 520px) { .tile-button { width: clamp(24px, 6.8vw, 35px); height: auto; } .river-tile > .tile-art { --tile-width: 27px; } .meld > .tile-art { --tile-width: 18px; } .winning-tile > .tile-art { --tile-width: 29px; height: auto; } .welcome-tiles .tile-art { --tile-width: 31px; } .back-row { min-height: 17.5px; } .back-row > .tile-back { --tile-width: 14px; } }
@media (orientation: landscape) and (max-height: 520px) and (max-width: 900px) { .tile-button { width: 34px; height: auto; } .back-row { min-height: 15px; } .back-row > .tile-back { --tile-width: 12px; } }
