.online-page { overflow: auto; min-height: 100dvh; background: #063b2b url("assets/felt.png") center / cover fixed; }
.online-page.playing-view { overflow: hidden; }
.online-page button, .online-page input, .online-page select { font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }
.auth-screen {
  min-height: 100dvh;
  width: min(1120px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
  align-items: center;
  gap: clamp(32px, 5vw, 72px);
  margin-inline: auto;
  padding: clamp(24px, 4vw, 56px);
}
.auth-identity { min-width: 0; }
.auth-brand {
  color: #fff0c8;
  font: 700 clamp(58px, 7vw, 86px)/1.1 "KaiTi", "STKaiti", serif;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
  text-shadow: 0 4px 13px #00170f99;
}
.auth-identity p { margin: 10px 0 22px; color: #f0e4bf; font-size: clamp(15px, 1.7vw, 19px); font-weight: 700; letter-spacing: .04em; }
.auth-tiles { position: relative; height: 145px; width: 230px; margin-left: 10px; }
.auth-tiles .tile { position: absolute; width: 73px; height: 103px; top: 12px; border-radius: 8px; border-bottom-width: 6px; box-shadow: 0 6px 0 #53745d, 0 11px 16px #00170fa6; }
.auth-tiles .tile:nth-child(1) { left: 4px; transform: rotate(-16deg); }
.auth-tiles .tile:nth-child(2) { left: 75px; top: 0; transform: rotate(-1deg); z-index: 1; }
.auth-tiles .tile:nth-child(3) { left: 146px; transform: rotate(14deg); }
.auth-card, .lobby-entry, .room-panel, .profile-panel {
  border: 1px solid #d2b779;
  border-radius: 13px;
  background: #073729e9;
  box-shadow: 0 17px 38px #00180fa6, inset 0 1px #fff8d91a;
}
.auth-card { padding: clamp(24px, 3vw, 36px); }
.auth-card h1 { margin: 0 0 24px; color: #fff0c9; font: 700 clamp(32px, 3.6vw, 44px)/1.2 "KaiTi", "STKaiti", serif; text-align: center; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 25px; border: 1px solid #a2ac918a; border-radius: 6px; overflow: hidden; }
.auth-tabs button { min-height: 43px; border: 0; color: #f4e9c9; background: #062f25; font-size: 16px; font-weight: 700; }
.auth-tabs button.selected { color: #123a29; background: #eac67f; }
#authForm { display: flex; flex-direction: column; gap: 9px; }
#authForm label { color: #f5eacb; font-size: 14px; font-weight: 700; }
.auth-email-field { display: flex; flex-direction: column; gap: 9px; }
#authForm input, #resendForm input, .join-form input, .fixed-tile select, .flip-settings select {
  width: 100%; min-height: 47px; padding: 10px 13px;
  border: 1px solid #a9bea8; border-radius: 6px;
  outline: none; background: #0b4433; color: #fff5dc; font-size: 15px;
}
#authForm input::placeholder, #resendForm input::placeholder, .join-form input::placeholder { color: #bdc9b7; }
#authForm input:focus, #resendForm input:focus, .join-form input:focus, .fixed-tile select:focus, .flip-settings select:focus { border-color: #f1d38b; box-shadow: 0 0 0 3px #eac67f33; }
.password-field { position: relative; }
.password-field input { padding-right: 64px !important; }
.password-field button { position: absolute; right: 4px; top: 4px; min-width: 52px; min-height: 39px; border: 0; background: transparent; color: #f0dbab; font-size: 12px; font-weight: 700; }
.auth-submit { min-height: 49px; margin-top: 13px; font-size: 18px; }
.auth-footnote { margin: 11px 0 0; color: #d5d4b7; font-size: 12px; line-height: 1.5; text-align: center; }
.form-error { margin: 0; color: #ffb7a0; font-size: 13px; line-height: 1.4; }
.auth-verification { text-align: center; }
.auth-verification-mark { display: grid; place-items: center; width: 58px; height: 58px; margin: 2px auto 15px; border: 1px solid #e6c484; border-radius: 50%; background: #154b37; color: #ffe4a5; font-size: 28px; }
.auth-verification[data-state="verified"] .auth-verification-mark { background: #275f3d; }
.auth-verification h2 { margin: 0 0 9px; color: #fff0c9; font: 700 25px/1.25 "KaiTi", "STKaiti", serif; }
.auth-verification > p { margin: 0 auto 17px; max-width: 33ch; color: #dce7d2; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; }
#resendForm { display: flex; flex-direction: column; gap: 9px; padding-top: 17px; border-top: 1px solid #8eaa9070; text-align: left; }
#resendForm label { color: #f5eacb; font-size: 13px; font-weight: 700; }
#resendForm .subtle-button { width: 100%; margin-top: 5px; }
.auth-resend-status { margin: 0; color: #b8e7be; font-size: 13px; line-height: 1.45; }
.auth-return { min-height: 44px; margin-top: 12px; padding: 6px 14px; border: 0; background: transparent; color: #ffe0a0; font-size: 13px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }
.online-shell { min-height: 100dvh; }
.lobby-topbar { min-height: 61px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; padding: 8px clamp(17px, 3vw, 42px); background: #052d22; border-bottom: 1px solid #b79b64; }
.lobby-brand-wrap { display: flex; align-items: center; gap: 15px; min-width: 0; }
.lobby-brand { color: #f6e5b5; font: 700 30px/1 "KaiTi", serif; text-decoration: none; white-space: nowrap; }
.lobby-solo-link { display: inline-flex; align-items: center; min-height: 36px; color: #f1d693; font-size: 12px; font-weight: 700; text-decoration: underline; text-underline-offset: 4px; white-space: nowrap; }
.lobby-topbar > strong { color: #f7e7ba; font: 700 28px/1 "KaiTi", serif; letter-spacing: .08em; }
.lobby-account { display: flex; justify-content: flex-end; align-items: center; gap: 14px; color: #f4eacb; font-size: 12px; white-space: nowrap; }
.lobby-account b { color: #f0c979; font-size: 16px; }
.lobby-account button { min-height: 36px; padding: 5px 8px; border: 1px solid #9f9d76; border-radius: 5px; background: transparent; color: #f7e7c0; font-size: 12px; }
.lobby-admin-link { display: inline-flex; align-items: center; min-height: 36px; padding: 5px 8px; border: 1px solid #bda26c; border-radius: 5px; color: #ffe0a0; font-size: 12px; font-weight: 700; text-decoration: none; }
.lobby-admin-link:hover { background: #1b5440; }
.lobby-main { width: min(1180px, 100%); display: grid; grid-template-columns: minmax(0, 1fr) minmax(240px, 286px); align-items: start; gap: clamp(18px, 2.3vw, 27px); margin: 0 auto; padding: clamp(20px, 3vw, 34px); }
.lobby-entry, .room-panel { min-width: 0; padding: clamp(20px, 2.6vw, 30px); }
.lobby-entry h1, .room-panel h1 { margin: 0; color: #fff0c6; font: 700 clamp(31px, 3.6vw, 43px)/1.15 "KaiTi", serif; }
.panel-lead, .room-help, .room-mode-detail { color: #d9dfc9; font-size: 13px; line-height: 1.55; }
.panel-lead { margin: 7px 0 18px; }
.lobby-entry h2 { margin: 0 0 11px; color: #f3dfae; font: 700 22px/1.2 "KaiTi", serif; }
.online-modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.online-mode { min-height: 68px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 4px; padding: 10px 14px; border: 1px solid #8da596; border-radius: 8px; background: #0a4030; color: #f9edcd; text-align: left; }
.online-mode:last-child { grid-column: 1 / -1; min-height: 61px; display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; column-gap: 17px; }
.online-mode.selected { border: 2px solid #ecc67b; background: #154d37; box-shadow: 0 0 0 2px #edc77d23; }
.online-mode strong { font: 700 21px/1.1 "KaiTi", serif; }
.online-mode small { color: #dae1cd; font-size: 12px; line-height: 1.35; white-space: normal; }
.fixed-tile { display: flex; align-items: center; gap: 12px; width: max-content; max-width: 100%; margin-top: 16px; color: #f3e4bd; font-size: 13px; font-weight: 700; }
.fixed-tile select { width: 145px; min-height: 40px; }
.flip-settings { margin: 12px 0 0; padding: 12px 14px 13px; border: 1px solid #a6b297; border-radius: 8px; background: #0a3d2f; }
.flip-settings legend { padding: 0 6px; color: #f5d794; font-size: 14px; font-weight: 800; }
.flip-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.flip-settings-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.flip-settings-grid label { min-width: 0; color: #f2e6c2; font-size: 12px; font-weight: 700; }
.flip-settings select { display: block; min-height: 39px; margin-top: 5px; padding: 7px 9px; font-size: 12px; }
.flip-settings .ganzhou-check { display: flex; align-items: center; gap: 8px; min-height: 39px; }
.flip-settings .ganzhou-check input { width: 17px; height: 17px; accent-color: #eac67f; }
.flip-settings .ganzhou-advanced { margin-top: 12px; padding-top: 9px; border-top: 1px solid #b3c4a35c; }
.flip-settings .ganzhou-advanced summary { cursor: pointer; color: #f5d794; font-size: 12px; font-weight: 800; }
.flip-settings .ganzhou-advanced-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 9px 12px; margin-top: 11px; }
.flip-settings .ganzhou-advanced-grid h4 { grid-column: 1 / -1; margin: 7px 0 0; padding-top: 8px; border-top: 1px solid #b3c4a347; color: #ffe6a8; }
.flip-settings .ganzhou-advanced-grid h4:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.flip-settings .ganzhou-advanced-grid label { min-width: 0; color: #f2e6c2; font-size: 12px; font-weight: 700; }
.flip-settings .ganzhou-advanced-grid .ganzhou-check { line-height: 1.35; }
.flip-settings .ganzhou-advanced-grid h4 { font-size: 12px; }
.flip-settings p { margin: 10px 0 0; color: #d3dac1; font-size: 11px; line-height: 1.5; }
.create-button { min-width: 220px; min-height: 47px; margin-top: 16px; font-size: 17px; }
.match-entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 18px; margin-top: 19px; padding: 17px; border: 1px solid #d1b46f; border-radius: 9px; background: #15503b; }
.match-entry h2 { margin: 0 0 5px; }
.match-entry p { margin: 0; color: #e3dfc3; font-size: 12px; line-height: 1.5; }
.match-entry > .primary-button { min-height: 45px; padding-inline: 20px; white-space: nowrap; }
.match-status { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 11px; border-top: 1px solid #d3bd8066; color: #ffe3a2; font-size: 13px; }
.match-status[hidden] { display: none; }
.match-status .subtle-button { min-height: 38px; }
.lobby-entry .friends-heading { margin: 24px 0 6px; }
.join-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid #a8ad8563; }
.join-form label { display: block; margin-bottom: 8px; color: #f7e7c1; font-size: 14px; font-weight: 700; }
.join-form > div { display: flex; gap: 8px; }
.join-form input { min-width: 0; flex: 1; text-transform: uppercase; letter-spacing: .12em; }
.join-form button, .subtle-button, .room-code-line button { min-height: 45px; padding: 8px 15px; border: 1px solid #eac67f; border-radius: 6px; background: #114d38; color: #f8e6bd; font-size: 13px; font-weight: 700; white-space: nowrap; }
.join-form button:hover, .subtle-button:hover, .room-code-line button:hover { background: #1d6248; }
.profile-panel { position: sticky; top: 20px; padding: 23px 20px; }
.profile-panel h2 { margin: 0; color: #f8e7c0; font: 700 24px/1.2 "KaiTi", serif; }
.profile-points { display: block; margin: 9px 0 13px; color: #f5ce80; font: 700 48px/1 Georgia, serif; }
.profile-stats { display: flex; justify-content: space-between; gap: 8px; padding-bottom: 18px; border-bottom: 1px solid #a9ab805c; color: #e7e3c8; font-size: 12px; }
.profile-stats b { color: #fff0c4; }
.rank-card { display: flex; flex-direction: column; gap: 4px; margin-top: 16px; padding: 13px 15px; border: 1px solid #d5b875; border-radius: 8px; background: #15503b; color: #f6e5bd; }
.rank-card > span { font-size: 12px; }
.rank-card > strong { color: #ffe09c; font: 700 25px/1.2 "KaiTi", serif; }
.rank-card > small { color: #e7dfbf; font-size: 11px; }
.profile-panel h3 { margin: 19px 0 9px; color: #f7e8be; font: 700 18px/1.2 "KaiTi", serif; }
.leaderboard-tabs { display: flex; gap: 6px; margin: 17px 0 10px; }
.leaderboard-tabs button { flex: 1; min-height: 36px; border: 1px solid #9da88a; border-radius: 5px; background: #0a4030; color: #f3e6c1; font-size: 12px; font-weight: 700; }
.leaderboard-tabs button.selected { border-color: #e8c478; background: #e8c478; color: #153a2b; }
.profile-panel ol { min-height: 68px; margin: 0; padding-left: 22px; color: #f3e7c9; font-size: 12px; }
.profile-panel li { padding: 4px 0; }
.profile-panel li small { margin-left: 4px; color: #cad7be; font-size: 10px; }
.profile-panel li span { float: right; color: #f2cb7c; }
.profile-panel p { margin: 13px 0 0; color: #c7d3bb; font-size: 11px; line-height: 1.5; }
.room-heading, .room-code-line, .room-actions { display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.panel-kicker { margin: 0 0 5px; color: #ddc88f; font-size: 11px; font-weight: 700; letter-spacing: .14em; }
.room-status { padding: 6px 10px; border: 1px solid #a0ae8e; border-radius: 99px; color: #f1e6c2; font-size: 12px; white-space: nowrap; }
.room-code-line { margin-top: 24px; padding: 12px 17px; border: 1px solid #bdab76; border-radius: 9px; background: #0b3c2d; }
.room-code-line > div { display: flex; align-items: center; gap: 16px; }
.room-code-line span { color: #decda7; font-size: 12px; }
.room-code-line strong { color: #ffdf96; font: 700 clamp(24px, 3.2vw, 38px)/1 Georgia, serif; letter-spacing: .15em; }
.room-mode-detail { margin: 12px 0 18px; }
.room-house-rules { margin: -9px 0 17px; padding: 10px 12px; border-left: 3px solid #e5c17a; background: #14503b; color: #e9e5c8; font-size: 12px; line-height: 1.6; }
.room-seats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.room-seat { min-height: 76px; display: flex; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid #7b9d87; border-radius: 8px; background: #0b4634; }
.room-seat.self { border-color: #e8c478; }
.room-avatar { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border: 1px solid #d9b977; border-radius: 50%; background: #174f3b; color: #f8e4af; font: 700 21px/1 "KaiTi", serif; }
.room-seat.bot .room-avatar { color: #d1ddc7; }
.room-seat div:last-child { min-width: 0; }
.room-seat strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #fff0c6; font-size: 14px; }
.room-seat small { color: #cadbbf; font-size: 11px; }
.room-seat-points { display: block; margin-top: 3px; color: #f4d58e; font-size: 12px; font-weight: 700; }
.room-help { margin: 16px 0; }
.room-actions { justify-content: flex-start; flex-wrap: wrap; }
.room-actions .primary-button { min-height: 44px; }
.online-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 20; max-width: calc(100vw - 30px); padding: 10px 16px; border: 1px solid #e7c47c; border-radius: 7px; background: #073a2b; color: #fff1c9; font-size: 13px; box-shadow: 0 7px 22px #001c15aa; }
.online-rules-content { margin-top: 15px; color: #314e3d; font-size: 13px; line-height: 1.7; }
.online-rules-content p { margin: 0 0 9px; }
.online-page .result-modal { max-height: calc(100dvh - 34px); overflow: auto; }
.online-page .result-list { display: grid; gap: 7px; margin: 4px auto 15px; max-width: 430px; text-align: left; }
.online-page .result-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 9px 11px; border-radius: 6px; background: #e7e8d7; color: #365345; font-size: 12px; line-height: 1.5; }
.online-page .result-row span { min-width: 0; flex: 1; }
.online-page .result-row strong { min-width: 0; max-width: 55%; color: #14553f; text-align: right; overflow-wrap: anywhere; }
.online-page .result-row.account-change { flex-direction: column; gap: 3px; }
.online-page .result-row.account-change strong { max-width: 100%; text-align: left; }
.online-page .result-payments { padding: 5px 10px 10px; color: #3c5946; font-size: 12px; line-height: 1.5; text-align: left; }
.online-joker-marker { position: absolute; top: 44%; left: calc(50% + 82px); transform: translateY(-50%); z-index: 2; max-width: 155px; padding: 7px 10px; border: 1px solid #d8b672; border-radius: 6px; background: #063c2ded; color: #ffe8b3; font-size: 11px; font-weight: 700; line-height: 1.45; box-shadow: 0 3px 9px #00160e88; }
.online-joker-marker.ganzhou-marker { display: flex; align-items: center; gap: 8px; max-width: 205px; }
.online-joker-marker.ganzhou-marker .jing-indicator-face .tile { width: 33px; height: 46px; border-bottom-width: 3px; flex: 0 0 auto; }
.online-joker-marker.ganzhou-marker .jing-marker-legend { white-space: nowrap; }
@media (max-width: 800px) {
  .lobby-main { grid-template-columns: 1fr; }
  .profile-panel { position: static; display: grid; grid-template-columns: 1fr auto; gap: 5px 20px; }
  .profile-panel h2, .profile-panel h3, .profile-panel ol, .profile-panel p, .leaderboard-tabs { grid-column: 1 / -1; }
  .rank-card { grid-column: 1 / -1; }
  .profile-points { margin: 0; }
  .profile-stats { align-items: center; border: 0; padding: 0; }
}
@media (max-width: 700px) {
  .auth-screen { grid-template-columns: 1fr; align-content: center; gap: 12px; padding: 20px 18px; }
  .auth-identity { display: grid; grid-template-columns: 1fr 95px; align-items: center; gap: 3px 8px; }
  .auth-brand { grid-column: 1; font-size: clamp(43px, 11vw, 61px); }
  .auth-identity p { grid-column: 1; margin: 0; font-size: 12px; letter-spacing: 0; }
  .auth-tiles { grid-column: 2; grid-row: 1 / 3; width: 95px; height: 75px; margin: 0; }
  .auth-tiles .tile { width: 36px; height: 53px; top: 10px; border-bottom-width: 4px; border-radius: 4px; }
  .auth-tiles .tile:nth-child(1) { left: 1px; }
  .auth-tiles .tile:nth-child(2) { left: 28px; top: 3px; }
  .auth-tiles .tile:nth-child(3) { left: 55px; }
  .auth-card { padding: 24px 19px; }
  .auth-card h1 { margin-bottom: 18px; font-size: 31px; }
  .lobby-topbar { grid-template-columns: 1fr auto; gap: 7px; }
  .lobby-brand-wrap { flex-direction: column; align-items: flex-start; gap: 1px; }
  .lobby-brand { font-size: 24px; }
  .lobby-solo-link { min-height: 23px; font-size: 11px; }
  .lobby-topbar > strong { display: none; }
  .lobby-account { gap: 7px; font-size: 11px; }
  .lobby-account button { min-height: 42px; }
  .lobby-main { padding: 14px 12px 24px; gap: 13px; }
  .lobby-entry, .room-panel { padding: 19px 16px; }
  .lobby-entry h1, .room-panel h1 { font-size: 32px; }
  .panel-lead { margin-bottom: 15px; }
  .online-modes { gap: 8px; }
  .online-mode { min-height: 68px; padding: 9px 11px; }
  .online-mode:last-child { min-height: 60px; column-gap: 10px; }
  .online-mode strong { font-size: 18px; }
  .online-mode small { font-size: 11px; white-space: normal; }
  .flip-settings { padding: 11px; }
  .flip-settings-grid { gap: 10px; }
  .flip-settings .ganzhou-advanced-grid { grid-template-columns: 1fr; }
  .create-button { width: 100%; margin-top: 14px; }
  .match-entry { grid-template-columns: 1fr; padding: 14px; }
  .match-entry > .primary-button { width: 100%; }
  .join-form { margin-top: 14px; padding-top: 14px; }
  .profile-panel { padding: 18px 17px; }
  .room-code-line { padding: 10px; }
  .room-code-line > div { gap: 8px; }
  .room-code-line strong { font-size: 22px; }
  .room-code-line button { min-height: 44px; padding-inline: 9px; }
  .room-seat { padding: 8px; }
  .room-avatar { width: 34px; height: 34px; flex-basis: 34px; font-size: 16px; }
  .room-seat strong { font-size: 12px; }
  .online-page #playScreen .brand-mark { display: none; }
  .online-page #playScreen .topbar { grid-template-columns: 1fr auto; }
  .online-page #playScreen .top-button { min-height: 44px; }
  .online-joker-marker { top: calc(41% + 52px); left: 50%; transform: translateX(-50%); max-width: 220px; font-size: 10px; text-align: center; }
}
@media (max-width: 600px) and (orientation: portrait) {
  .online-page #playScreen .topbar { height: 48px; flex-basis: 48px; }
  .online-page #playScreen .round-meta { top: 52px; }
  .online-page #playScreen .action-button { min-height: 44px; }
}
@media (max-width: 420px) {
  .lobby-account #accountName { display: none; }
  .lobby-account #accountRank { display: none; }
  .room-seats { gap: 7px; }
  .room-seat { min-height: 68px; gap: 6px; }
}

/* The lobby and the table use the same jade, ivory and brass materials. */
.online-page {
  background-color: #062b22;
  background-image: radial-gradient(circle at 48% 4%, #1e654833, transparent 46%),
    url("assets/felt.png");
}
.online-page :is(button, a, input, select, summary):focus-visible {
  outline: 2px solid #ffe3a0;
  outline-offset: 3px;
}
.auth-screen { width: min(1160px, 100%); }
.auth-identity { position: relative; padding-left: clamp(0px, 2.5vw, 30px); }
.auth-brand { text-shadow: 0 3px 0 #021d16, 0 15px 32px #00170f99; }
.auth-identity p { color: #e9d8ac; }
.auth-card, .lobby-entry, .room-panel, .profile-panel {
  border-color: #b7a06d;
  background: #092f26f2;
  box-shadow: 0 18px 42px #00180f91, inset 0 1px #fff8d915;
}
.auth-card { border-top: 4px solid #d9b86f; }
.auth-tabs { border-radius: 8px; }
.auth-tabs button { transition: background .16s ease, color .16s ease; }
.auth-tabs button.selected { background: #f2d392; }
.auth-submit { width: 100%; }
.auth-footnote { color: #bbd0bd; }

.lobby-topbar {
  border-bottom-color: #9f895e;
  background: #041f19f5;
}
.lobby-main {
  width: min(1240px, 100%);
  grid-template-columns: minmax(0, 1fr) minmax(248px, 278px);
  gap: 20px;
  padding-top: 26px;
}
.lobby-entry, .room-panel { padding: clamp(22px, 2.5vw, 32px); }
.lobby-entry h1, .room-panel h1 { font-size: clamp(31px, 3vw, 39px); }
.lobby-entry > h2 { margin-top: 23px; }
.online-modes { gap: 8px; }
.online-mode {
  position: relative;
  min-height: 65px;
  border-color: #527c67;
  border-radius: 7px;
  background: #0b4031;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.online-mode:hover { transform: translateY(-2px); border-color: #d0b376; background: #12533d; }
.online-mode.selected {
  border-color: #f2d392;
  background: linear-gradient(110deg, #205a40, #124632);
  box-shadow: inset 4px 0 #f2d392, 0 0 0 1px #f2d39248;
}
.online-mode strong { font-size: 20px; }
.online-mode small { color: #ccddc9; }

.lobby-paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #a5a37a7a;
}
.match-entry, .friends-entry {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 246px;
  margin: 0;
  padding: 20px;
  border: 1px solid #627f6d;
  border-radius: 10px;
  background: #0c3d2f;
}
.match-entry { border-color: #a99868; background: #164735; }
.match-entry h2, .friends-entry h2 {
  margin: 0 0 7px;
  color: #ffe4aa;
  font: 700 24px/1.15 "KaiTi", "STKaiti", serif;
}
.match-entry p, .friends-entry p {
  margin: 0;
  color: #d6dfcc;
  font-size: 12px;
  line-height: 1.6;
}
.match-entry > .primary-button, .friends-entry > .primary-button {
  width: 100%;
  min-height: 45px;
  margin-top: auto;
  font-size: 15px;
}
.friends-entry .create-button { min-width: 0; }
.friends-entry .join-form {
  margin-top: 13px;
  padding-top: 12px;
  border-top-color: #7196827d;
}
.friends-entry .join-form label { margin-bottom: 6px; font-size: 12px; }
.friends-entry .join-form input { min-height: 44px; font-size: 13px; letter-spacing: .03em; }
.friends-entry .join-form button { min-height: 44px; }
.match-status {
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  margin-top: 13px;
  padding-top: 10px;
  font-size: 12px;
}
.match-status .subtle-button { min-height: 44px; }

.room-heading { align-items: flex-start; }
.room-status {
  border-color: #bda36d;
  background: #1d5840;
  color: #ffdf9e;
  font-weight: 700;
}
.room-panel[data-status="playing"] .room-status { border-color: #b4dbbb; background: #175d41; color: #ecffe9; }
.room-panel[data-status="over"] .room-status { border-color: #acbdac; background: #284b3d; color: #e5ecda; }
.room-summary {
  display: grid;
  grid-template-columns: minmax(180px, .7fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 22px;
}
.room-code-line {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 17px;
  min-width: 0;
  min-height: 145px;
  margin: 0;
  padding: 15px;
  border-color: #c9ac70;
  background: #174e39;
}
.room-code-line > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.room-code-line strong { max-width: 100%; overflow-wrap: anywhere; font-size: clamp(25px, 3vw, 36px); letter-spacing: .13em; }
.room-code-line button { width: 100%; min-height: 44px; background: #e7c17c; color: #123c2b; }
.room-code-line button:hover { background: #ffdf9d; }
.room-panel[data-ranked="true"] .room-code-line { border-color: #678673; background: #0e3c2f; }
.room-rules-summary {
  min-width: 0;
  padding: 15px 17px;
  border: 1px solid #5c7d67;
  border-radius: 9px;
  background: #0d3b2e;
}
.room-mode-detail { margin: 0; color: #f2e6c6; font-size: 13px; font-weight: 700; }
.room-house-rules { margin: 10px 0 0; padding: 8px 10px; border-left-color: #d8b677; font-size: 11px; }
.room-rules-link {
  min-height: 44px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #f4d596;
  font-size: 12px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.room-rules-link:hover { color: #ffe9b8; }
.room-seats-title { margin: 23px 0 12px; color: #f3dfae; font: 700 21px/1.2 "KaiTi", serif; }
.room-seats { gap: 10px; }
.room-seat {
  position: relative;
  min-height: 83px;
  padding: 12px 34px 12px 13px;
  border-color: #567e69;
  background: #0c3c2f;
}
.room-seat.self { border-color: #e6c076; background: #1b503b; }
.room-seat.ready { box-shadow: inset 0 0 0 1px #b1d3a04d; }
.room-seat.empty { border-style: dashed; background: #0b342a; }
.room-seat-number { position: absolute; top: 10px; right: 11px; color: #a8bea7; font: 700 11px/1 Georgia, serif; }
.room-seat.ready .room-seat-number { color: #f3d391; }
.room-seat .room-avatar { border-color: #bb9e68; background: #225f45; }
.room-seat.self .room-avatar { background: #d6b36e; color: #173c2b; }
.room-seat small { display: inline-block; margin-top: 3px; color: #e5d7ac; }
.room-seat.ready small { color: #bde1ad; }
.room-seat.empty small { color: #9cb5a3; }
.room-seat-points { font-size: 11px; }
.room-help { margin: 15px 0 13px; padding: 11px 13px; border-left: 3px solid #d4b675; background: #154635; }
.room-actions { gap: 9px; }
.room-actions .primary-button, .room-actions .subtle-button { min-height: 44px; }
.room-actions #readyBtn, .room-actions #startRoomBtn, .room-actions #returnTableBtn { min-width: 130px; }

.profile-panel { border-top: 3px solid #af9565; }
.profile-points { color: #f3d18c; }
.rank-card { background: #184a38; }

.online-page #playScreen .round-meta { min-width: 0; }
.online-page #playScreen .round-meta span { overflow: hidden; text-overflow: ellipsis; }
.online-page #playScreen .seat.active .seat-label { border-color: #f4d18b; }
.online-page #playScreen .river .tile.latest { outline: 2px solid #f5d38e; outline-offset: 2px; }

@media (max-width: 980px) {
  .lobby-main { grid-template-columns: minmax(0, 1fr); }
  .profile-panel { position: static; }
}
@media (max-width: 640px) {
  .lobby-main { padding: 14px 12px 24px; }
  .lobby-entry, .room-panel { padding: 20px 16px; }
  .lobby-paths { grid-template-columns: 1fr; }
  .match-entry, .friends-entry { min-height: 0; padding: 16px; }
  .match-entry > .primary-button, .friends-entry > .primary-button { margin-top: 16px; }
  .room-summary { grid-template-columns: 1fr; gap: 9px; }
  .room-code-line { min-height: 0; flex-direction: row; align-items: center; gap: 10px; }
  .room-code-line button { width: auto; flex: 0 0 auto; min-width: 86px; }
  .room-rules-summary { padding: 12px 14px; }
}
@media (max-width: 520px) {
  .auth-screen { padding: 18px 14px; }
  .auth-card { padding: 23px 18px; }
  .lobby-topbar { grid-template-columns: 1fr auto; gap: 7px 12px; padding: 9px 13px; }
  .lobby-topbar > strong { display: block; font-size: 19px; }
  .lobby-account { grid-column: 1 / -1; justify-content: space-between; min-width: 0; }
  .lobby-account #accountName { display: inline-block; max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  .online-modes { grid-template-columns: 1fr; }
  .online-mode, .online-mode:last-child { min-height: 56px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; grid-column: auto; }
  .online-mode strong { font-size: 18px; }
  .online-mode small { font-size: 11px; }
  .flip-settings-grid { grid-template-columns: 1fr; }
  .room-heading { gap: 8px; }
  .room-heading h1 { font-size: 28px; }
  .room-status { padding: 5px 8px; font-size: 11px; }
  .room-seat { min-height: 81px; padding: 11px 24px 11px 8px; gap: 6px; }
  .room-seat .room-avatar { flex-basis: 32px; width: 32px; height: 32px; font-size: 15px; }
  .room-seat-number { right: 7px; top: 8px; font-size: 10px; }
  .room-seat strong { font-size: 12px; }
  .room-seat small, .room-seat-points { font-size: 10px; }
  .room-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .room-actions .primary-button, .room-actions .subtle-button { min-width: 0 !important; width: 100%; }
  .room-actions #leaveRoomBtn { grid-column: 1 / -1; }
  .online-page #playScreen .topbar { gap: 4px; }
  .online-page #playScreen .top-actions { gap: 3px; }
  .online-page #playScreen .top-button { min-width: 41px; padding-inline: 6px; }
}
@media (prefers-reduced-motion: reduce) {
  .online-mode, .auth-tabs button { transition: none; }
}
