@import url("./fonts.css");
:root {
  --cream: #f4f4ee;
  --paper: #fffffa;
  --ink: #1c3027;
  --green: #24553c;
  --green-dark: #153a29;
  --sage: #e8ecdf;
  --muted: #5c6a5f;
  --line: #dce0d4;
  --gold: #b58a36;
  --red: #a64232;
  --radius: 18px;
  --shadow: 0 8px 30px #183f3209;
  font-family: "Plus Jakarta Sans", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-size: 16px;
  line-height: 1.55;
}
button,
input,
select,
textarea {
  font: inherit;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button,
a.button,
select,
summary {
  cursor: pointer;
}
button,
.button {
  min-height: 48px;
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 12px 20px;
  background: var(--green);
  color: #fffdf7;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  transition:
    background 160ms,
    transform 160ms,
    box-shadow 160ms;
}
button:hover,
.button:hover {
  background: var(--green-dark);
}
button:active,
.button:active {
  transform: translateY(1px);
}
button:disabled {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
}
button.secondary,
.button.secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
button.secondary:hover,
.button.secondary:hover {
  background: var(--sage);
}
button.text-btn,
.text-btn {
  background: transparent;
  border: 0;
  color: var(--green);
  padding: 8px 0;
  min-height: 44px;
  gap: 8px;
  text-align: left;
  justify-content: flex-start;
  font-weight: 500;
}
.text-btn:hover {
  background: transparent;
  text-decoration: underline;
}
.icon-btn {
  padding: 10px;
  width: 46px;
  height: 46px;
  min-height: 46px;
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
}
.icon-btn:hover {
  background: var(--sage);
}
.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  vertical-align: middle;
}
.wide {
  width: 100%;
}
.danger {
  color: var(--red) !important;
}
.muted,
.helper {
  color: var(--muted);
}
.helper {
  font-size: 16px;
  line-height: 1.5;
}
.notice {
  background: var(--sage);
  padding: 14px 16px;
  border-radius: 10px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 12px 0;
}
.notice.error {
  background: #f5e4dc;
  color: #863c30;
}
.inline-error {
  color: var(--red);
  margin: 10px 0;
  min-height: 1px;
}
.inline-error:empty {
  display: none;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1,
h2 {
  font-size: 24px;
  line-height: 1.3;
  margin-bottom: 12px;
}
h1 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.18;
  margin-bottom: 12px;
}
h2 {
  font-size: 28px;
  line-height: 1.2;
  margin-bottom: 12px;
}
h3 {
  font-size: 18px;
  line-height: 1.4;
  margin-bottom: 12px;
}
p {
  margin-bottom: 16px;
}
label {
  display: block;
  font-weight: 500;
  margin-bottom: 20px;
}
input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  margin-top: 8px;
  padding: 11px 13px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #bdc9b9;
  border-radius: 8px;
  outline: 0;
}
input::placeholder {
  color: #788276;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #165c4215;
}
:focus-visible {
  outline: 3px solid #ac7a25;
  outline-offset: 4px;
}
.skip {
  position: fixed;
  top: -80px;
  left: 20px;
  background: var(--green);
  color: white;
  padding: 12px;
  z-index: 100;
}
.skip:focus {
  top: 10px;
}
.skip:not(:focus) {
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
}
[hidden] {
  display: none !important;
}
.eyebrow {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.5;
  color: var(--muted);
  margin-bottom: 8px;
}
.app-shell {
  min-height: 100vh;
}
.topbar {
  height: 80px;
  max-width: 1440px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: auto;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 16px;
  line-height: 1;
  min-width: 170px;
}
.brand-word {
  font-family: inherit;
  font-weight: 800;
  font-size: 40px;
  letter-spacing: -3px;
  line-height: 1;
}
.brand-dot {
  color: var(--gold);
}
.brand-caption {
  font-size: 11px;
  letter-spacing: .03em;
  line-height: 1.5;
  max-width: 66px;
  font-weight: 600;
  color: var(--muted);
  border-left: 1px solid var(--line);
  padding-left: 14px;
}
.desktop-nav {
  display: flex;
  gap: 30px;
  height: 100%;
  align-items: center;
}
.desktop-nav a {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  color: var(--muted);
}
.desktop-nav a.active {
  color: var(--green);
  font-weight: 600;
}
.desktop-nav a.active:after {
  content: "";
  height: 3px;
  background: var(--green);
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
}
.desktop-nav .icon {
  width: 20px;
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}
.connection {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  white-space: nowrap;
  color: var(--green);
}
.connection i {
  width: 7px;
  height: 7px;
  background: #429866;
  border-radius: 50%;
}
.connection.offline {
  color: var(--red);
}
.connection.offline i {
  background: var(--red);
}
.language {
  width: 66px;
  min-height: 44px;
  padding: 8px;
  background: transparent;
  margin: 0;
  border-color: transparent;
}
.bottom-nav {
  display: none;
}
.footer {
  max-width: 1328px;
  margin: 48px auto 0;
  border-top: 1px solid var(--line);
  padding: 24px 0;
  display: flex;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  color: var(--muted);
}
.footer a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
main {
  outline: none !important;
}
.page {
  max-width: 1220px;
  margin: auto;
  padding: 32px 32px 24px;
}
.page.narrow {
  max-width: 900px;
}
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin: 0 0 28px;
}
.page-heading p {
  margin-bottom: 0;
  max-width: 640px;
}
.page-heading.compact {
  margin-bottom: 26px;
}
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--muted);
  margin-bottom: 20px;
}
.entry-layout {
  max-width: 1080px;
  margin: 48px auto;
  display: grid;
  grid-template-columns: .9fr 1.1fr;
  align-items: stretch;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: var(--paper);
}
.entry-story {
  padding: 40px;
  background: var(--green-dark);
  color: var(--paper);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 500px;
}
.entry-story .entry-title {
  font-size: clamp(36px, 4vw, 54px);
  line-height: 1.08;
  letter-spacing: -.055em;
  margin: 0 0 20px;
  max-width: 340px;
}
.entry-story > p {
  color: #cad8c9;
  font-size: 16px;
  line-height: 1.65;
  max-width: 310px;
}
.entry-story .eyebrow {
  color: #c7d7b3;
  margin-bottom: 36px;
  font-size: 13px;
  letter-spacing: .04em;
}
.tile-still {
  height: 180px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 12px 0 28px;
}
.tile-still .tile {
  width: 82px;
  height: 108px;
  min-width: 82px;
  border-radius: 8px;
  box-shadow: 0 7px 0 #a9b99b, 0 16px 24px #071d2550;
  margin-right: 10px;
  transform: rotate(-8deg) translateY(3px);
  background: #fffdf3;
  border: 1px solid #cfdbc2;
}
.tile-still .tile:nth-child(2) {
  transform: translateY(-12px);
  z-index: 1;
}
.tile-still .tile:nth-child(3) {
  transform: rotate(8deg) translateY(3px);
}
.still-caption {
  position: absolute;
  bottom: 18px;
  left: 0;
  font-size: 12px;
  letter-spacing: 0.25em;
  color: var(--muted);
}
.entry-foot {
  display: flex;
  gap: 12px;
  color: #cad8c9;
  align-items: center;
  padding-top: 20px;
  border-top: 1px solid #ffffff24;
  font-size: 14px;
}
.entry-form {
  padding: 40px 44px;
  align-self: center;
  min-width: 0;
}
.entry-form h1 {
  font-size: 28px;
  letter-spacing: -.04em;
}
.entry-form .eyebrow {
  font-size: 13px;
  margin: 0 0 12px;
}
.form-symbol {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--sage);
  display: grid;
  place-items: center;
}
.form-symbol .icon {
  width: 26px;
  height: 26px;
}
.entry-form form {
  margin-top: 24px;
}
.code-input {
  font-size: 30px;
  letter-spacing: 0.25em;
  text-align: center;
  height: 74px;
  text-transform: uppercase;
}
.entry-extra {
  text-align: center;
  border-top: 1px solid var(--line);
  margin-top: 26px;
  padding-top: 18px;
}
.entry-extra a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  color: var(--muted);
}
.availability {
  display: flex;
  flex-direction: column;
  text-align: right;
  white-space: nowrap;
}
.availability strong {
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.availability strong span {
  font-size: 24px;
  color: #8e9c8e;
}
.availability > span {
  color: var(--muted);
  margin-top: 4px;
}
.section-line {
  display: flex;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-bottom: 18px;
}
.table-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.table-card {
  display: block;
  text-align: left;
  padding: 20px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  min-width: 0;
  transition: border-color 160ms, background 160ms;
}
.table-card:hover {
  background: #f0f3e7;
  border-color: #91a282;
}
.table-card.own {
  background: #e9efd6;
  border-color: #afbd8e;
}
.table-card-top,
.table-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.table-card-top {
  margin-bottom: 0;
  align-items: center;
}
.table-symbol {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #665d3d;
  background: #ede9da;
  font-size: 13px;
  padding: 5px 9px;
  border-radius: 5px;
  font-weight: 600;
}
.status:before {
  content: "";
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: currentColor;
}
.status.available {
  background: #e6eddf;
  color: var(--green);
}
.table-name {
  font-size: 24px;
  margin: 0;
  letter-spacing: -.035em;
}
.table-card p {
  font-weight: 400;
  color: var(--muted);
  margin: 8px 0 20px;
  font-size: 14px;
}
.table-card-bottom {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  font-size: 16px;
  font-weight: 500;
}
.table-card-bottom > span {
  display: flex;
  align-items: center;
  gap: 6px;
}
.table-card-bottom .icon {
  width: 18px;
}
.avatars {
  padding-left: 4px;
}
.avatars i {
  font-style: normal;
  width: 31px;
  height: 31px;
  margin-left: -4px;
  border: 2px solid var(--paper);
  background: #dae4ce;
  border-radius: 50%;
  display: grid;
  place-items: center;
}
.avatar {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--sage);
  color: var(--green);
  flex-shrink: 0;
  font-weight: 600;
}
.game-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 1fr);
  gap: 40px;
}
.felt-board {
  background: #183f2c;
  border-radius: 12px;
  padding: 24px;
  color: #f5f6ea;
  position: relative;
}
.round-bar {
  display: flex;
  justify-content: space-between;
  padding: 0 4px 24px;
  border-bottom: 1px solid #ffffff28;
  color: #d2dfca;
}
.round-bar b {
  font-weight: 500;
  margin-left: 8px;
  color: #fff;
}
.players-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 24px;
}
.player-panel {
  padding: 18px;
  background: #ffffff06;
  border: 1px solid #ffffff26;
  border-radius: 8px;
  min-width: 0;
}
.player-panel.dealer {
  background: #dfeab1;
  color: var(--ink);
  border-color: #dfeab1;
}
.player-panel-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.wind-medal {
  font-family: serif;
  font-size: 24px;
  border: 1px solid #ffffff30;
  border-radius: 50%;
  height: 40px;
  width: 40px;
  display: grid;
  place-items: center;
}
.dealer .wind-medal {
  border-color: #b8c5ad;
  color: var(--green);
}
.dealer-label {
  font-size: 12px;
  letter-spacing: 0.15em;
  color: var(--green);
  font-weight: 600;
}
.player-name {
  font-size: 18px;
  font-weight: 500;
  margin: 16px 0 0;
  overflow-wrap: anywhere;
}
.player-score {
  font-size: 52px;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -.055em;
}
.player-wind {
  opacity: 0.75;
  font-size: 16px;
}
.board-caption {
  text-align: center;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: #c7d4bd;
  margin-top: 25px;
}
.game-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}
.game-actions .button {
  flex: 1;
}
.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.section-title h2 {
  font-size: 26px;
  margin: 0;
}
.section-title a {
  font-size: 16px;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
}
.history-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}
.hand-no {
  font-family: inherit;
  color: #889780;
  font-size: 24px;
  min-width: 28px;
}
.history-row strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}
.history-row p {
  color: var(--muted);
  margin: 3px 0 0;
  font-size: 16px;
}
.history-score {
  margin-left: auto;
  text-align: right;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.history-score small {
  font-size: 16px;
  display: block;
  color: var(--muted);
}
.session-info {
  margin-top: 28px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.session-info dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 0 0 14px;
  font-size: 16px;
}
.session-info dt {
  color: var(--muted);
}
.session-info dd {
  text-align: right;
  margin: 0;
}
.session-info a {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
}
.secondary-actions {
  border-top: 1px solid var(--line);
  margin-top: 20px;
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.empty {
  padding: 46px 20px;
  text-align: center;
  color: var(--muted);
}
.empty-mark {
  display: inline-grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 1px solid var(--line);
  border-radius: 50%;
  margin-bottom: 20px;
}
.empty h2 {
  font-size: 28px;
  color: var(--ink);
}
.empty p {
  max-width: 420px;
  margin: 0 auto 20px;
}
.game-sidebar .empty {
  padding: 32px 10px;
}
.game-sidebar .empty h2 {
  font-size: 24px;
}
.game-sidebar .empty-mark {
  display: none;
}
.loading {
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
}
.loading.compact {
  min-height: 130px;
}
.loading p {
  margin: 0;
}
.spinner {
  width: 22px;
  height: 22px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  display: inline-block;
  animation: spin 0.8s linear infinite;
}
.spinner.small {
  width: 18px;
  height: 18px;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.two-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.record-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr);
  gap: 36px;
  align-items: start;
}
.record-step {
  padding: 0 0 30px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.step-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.step-title > span {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid #a7b69c;
  border-radius: 50%;
  font-size: 16px;
  flex-shrink: 0;
}
.step-title h2 {
  font-family: inherit;
  font-size: 20px;
  letter-spacing: -.03em;
  margin: 0;
  font-weight: 700;
}
.step-title > b {
  margin-left: auto;
  white-space: nowrap;
  font-size: 16px;
  color: var(--muted);
}
.winner-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
.winner-choice {
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-weight: 500;
  min-width: 0;
  overflow-wrap: anywhere;
}
.winner-choice > span:last-child {
  max-width: 100%;
}
.winner-choice:hover,
.winner-choice.selected {
  background: var(--sage);
  border-color: var(--green);
}
.winner-choice.selected .avatar {
  background: var(--green);
  color: white;
}
.hand-tray {
  background: #e8ecdf;
  border: 1px solid #d0d9c5;
  border-radius: 12px;
  padding: 15px;
  margin-bottom: 12px;
  min-height: 130px;
}
.selected-hand {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 70px;
  align-items: center;
}
.tray-placeholder {
  display: block;
  color: var(--muted);
  text-align: center;
  width: 100%;
  padding: 14px;
}
.tray-tools {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  border-top: 1px solid #cbd5be;
  padding-top: 5px;
}
.tile {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 64px;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid #c9d3bb;
  border-bottom: 4px solid #a9ba98;
  background: #fffdf5;
  color: var(--ink);
  padding: 0;
  border-radius: 6px;
  box-shadow: 0 2px 3px #25492a0c;
  flex-shrink: 0;
}
.tile svg {
  display: block;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.tile:hover {
  background: #edf2e1;
  border-color: #789265;
  transform: translateY(-2px);
}
.tile:disabled {
  opacity: 0.26;
}
.tile.winning {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
  background: #fff8dd;
}
.tile-number {
  text-anchor: middle;
  font-family: serif;
  font-size: 24px;
  fill: #234c3d;
}
.tile-character {
  text-anchor: middle;
  font-family: serif;
  font-size: 25px;
  fill: #b74336;
}
.tile-honor {
  text-anchor: middle;
  font-family: serif;
  font-size: 40px;
  fill: #1d5b42;
}
.tile-honor.red {
  fill: #b74336;
}
.tile-index {
  display: none;
}
.mode-field {
  max-width: 380px;
}
.tile-group {
  margin-bottom: 18px;
}
.tile-group-label {
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 16px;
}
.tile-row {
  display: grid;
  grid-template-columns: repeat(9, 1fr);
  gap: 5px;
}
.tile-row .tile {
  width: 100%;
  height: auto;
  aspect-ratio: 56/72;
}
.melds {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.meld {
  display: flex;
  gap: 3px;
  position: relative;
  padding-bottom: 28px;
}
.meld .tile {
  width: 36px;
  min-width: 36px;
  height: 49px;
}
.meld .icon-btn {
  width: 32px;
  padding: 4px;
  height: 49px;
  background: transparent;
  border: 0;
}
.meld small {
  position: absolute;
  left: 0;
  bottom: 0;
  font-size: 14px;
  color: var(--muted);
}
details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  min-height: 48px;
  font-weight: 500;
}
summary::-webkit-details-marker {
  display: none;
}
details[open] > summary > .icon:last-child {
  transform: rotate(180deg);
}
.extras {
  border-top: 1px solid var(--line);
  padding-top: 6px;
  margin-top: 16px;
}
.flower-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 14px 0;
}
.flower {
  background: var(--paper);
  border-color: var(--line);
  color: var(--ink);
  flex-direction: column;
  padding: 10px 4px;
  gap: 2px;
  font-size: 24px;
}
.flower span {
  font-size: 16px;
  color: var(--muted);
  font-weight: 400;
}
.flower.selected,
.flower:hover {
  background: var(--sage);
  border-color: var(--green);
}
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  margin: 0;
  cursor: pointer;
}
.check-row input {
  width: 22px;
  min-height: 22px;
  height: 22px;
  margin: 3px 0 0;
  accent-color: var(--green);
  flex-shrink: 0;
}
.check-row strong {
  font-weight: 500;
}
.check-row small {
  display: block;
  font-size: 16px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 400;
}
.score-preview {
  position: sticky;
  top: 24px;
  border: 1px solid #cad3bd;
  border-top: 4px solid var(--green);
  background: var(--paper);
  padding: 24px;
  border-radius: 10px;
}
.score-preview > .eyebrow {
  font-size: 14px;
}
.preview-total {
  font-size: 72px;
  line-height: 1.15;
  letter-spacing: -0.05em;
  font-weight: 500;
  margin: 20px 0 16px;
  font-variant-numeric: tabular-nums;
}
.preview-total small {
  font-size: 20px;
  letter-spacing: 0;
  margin-left: 8px;
  font-weight: 400;
  color: var(--muted);
}
.preview-empty {
  text-align: center;
  border-top: 1px solid var(--line);
  padding-top: 28px;
  margin-bottom: 26px;
  color: var(--muted);
}
.preview-empty > .icon {
  height: 34px;
  width: 34px;
  margin-bottom: 14px;
}
.preview-empty h3 {
  font-size: 18px;
  color: var(--ink);
}
.preview-empty p {
  font-size: 16px;
}
.score-line {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  padding: 10px 0;
  border-bottom: 1px solid #e7eadf;
}
.score-line b {
  white-space: nowrap;
  font-weight: 600;
}
.validity {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
}
.validity.valid {
  color: var(--green);
}
.validity.invalid {
  color: var(--red);
}
.payout-heading {
  font-weight: 600;
  margin-top: 24px;
}
.payout-list {
  margin: 10px 0 24px;
}
.payout-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
}
.payout-list b {
  font-variant-numeric: tabular-nums;
}
.winner-payout {
  color: var(--green);
}
.score-preview > .helper {
  font-size: 16px;
  margin: 14px 0 0;
  text-align: center;
}
.history-detail {
  border-bottom: 1px solid var(--line);
}
.history-detail > summary .history-row {
  flex: 1;
  border: 0;
}
.history-detail > summary > .icon {
  margin-left: 10px;
}
.history-content {
  padding: 0 0 20px 44px;
}
.history-content > p {
  color: var(--muted);
}
.history-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 20px;
}
.history-tiles .tile {
  width: 35px;
  min-width: 35px;
  height: 47px;
}
.undone {
  opacity: 0.55;
}
.filters {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin: 0 0 28px;
}
.filters label {
  margin: 0;
}
.filters select {
  min-width: 170px;
}
.rank-head,
.rank-row {
  display: grid;
  grid-template-columns: 55px minmax(0, 1fr) 100px 140px;
  align-items: center;
  gap: 20px;
}
.rank-head {
  padding: 16px 24px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}
.rank-row {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.rank-row.first {
  background: var(--green);
  color: var(--cream);
  border-radius: 16px;
  margin-top: 10px;
  border: 0;
}
.rank-player {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}
.rank-player strong {
  font-size: 20px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.rank-player p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 16px;
}
.first .rank-player p {
  color: #d3dfc9;
}
.first .avatar {
  background: #f2f4e71c;
  color: var(--cream);
}
.rank-number {
  font-family: inherit;
  font-size: 26px;
}
.rank-number .icon {
  color: #d7bd76;
  width: 30px;
  height: 30px;
}
.rank-value {
  text-align: right;
  font-size: 30px;
  letter-spacing: -0.03em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.rank-head > span:last-child {
  text-align: right;
}
.table-highlights-title {
  margin-top: 42px;
}
.highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.highlights article {
  border-top: 2px solid #a8ba9d;
  padding-top: 18px;
}
.highlights article > span {
  font-weight: 600;
}
.highlights strong {
  display: block;
  font-size: 32px;
  font-weight: 500;
  margin-top: 10px;
}
.highlights small {
  font-size: 16px;
  font-weight: 400;
  margin-left: 10px;
  color: var(--muted);
}
.highlights p {
  color: var(--muted);
  margin-top: 8px;
}
.rules-tabs {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 28px;
  margin-bottom: 28px;
}
.rules-tabs a {
  padding: 14px 0;
  min-height: 48px;
  color: var(--muted);
  border-bottom: 3px solid transparent;
}
.rules-tabs a.selected {
  color: var(--green);
  border-color: var(--green);
  font-weight: 600;
}
.rules-intro {
  padding: 24px;
  background: var(--sage);
  border-radius: 14px;
  margin-bottom: 28px;
}
.rules-intro p {
  margin: 0;
  line-height: 1.8;
}
.rule-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  gap: 20px;
}
.rule-row b {
  font-size: 23px;
  font-weight: 500;
  white-space: nowrap;
}
.rule-row small {
  font-size: 16px;
  margin-left: 8px;
  color: var(--muted);
  font-weight: 400;
}
.host-overview {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 36px;
}
.access-card {
  background: var(--green);
  color: var(--cream);
  border-radius: 18px;
  padding: 28px;
}
.access-card .eyebrow {
  font-size: 14px;
}
.daily-code {
  font-size: 36px;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.4;
  margin: 20px 0;
  overflow-wrap: anywhere;
}
.access-card p {
  color: #d7e3cc;
  max-width: 440px;
}
.access-card button {
  background: var(--cream);
  color: var(--green);
  border-color: var(--cream);
}
.access-card #code-date {
  margin: 12px 0 0;
}
.qr-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}
.qr-card > div {
  min-width: 0;
}
.qr-card img {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
  border-radius: 10px;
}
.qr-card p {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.host-layout {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  align-items: start;
}
.settings-panel {
  padding: 26px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  margin-bottom: 24px;
}
.settings-subtitle {
  margin-top: 28px;
}
.rule-settings {
  border: 1px solid var(--line);
  border-radius: 10px;
  margin: 16px 0;
  background: var(--cream);
}
.rule-settings > summary {
  padding: 14px 16px;
}
.rule-settings > summary > span {
  margin-left: auto;
  color: var(--muted);
}
.rule-settings-body {
  padding: 10px 16px 16px;
}
.rule-settings-body > label:last-child {
  margin: 0;
}
.host-table {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.host-table p {
  margin: 3px 0 0;
  color: var(--muted);
}
.host-table > div:last-child {
  display: flex;
  gap: 14px;
}
.settings-panel form {
  margin-top: 24px;
}
.audit-panel p {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  margin: 0;
}
.audit-panel small {
  display: block;
  font-size: 16px;
  color: var(--muted);
}
.tv-page {
  max-width: 1600px;
  padding: 50px 60px;
}
.tv-page .rank-player strong {
  font-size: 28px;
}
.tv-page .rank-value {
  font-size: 42px;
}
.tv-page .rank-row {
  padding: 24px 30px;
}
.tv-page .rank-row .avatar {
  width: 54px;
  height: 54px;
}
.tv-page .filters {
  justify-content: flex-end;
}
.tv-page .rank-head {
  font-size: 20px;
}
.tv-page .rank-head,
.tv-page .rank-row {
  grid-template-columns: 70px 1fr 140px 200px;
}
.tv-page .highlights {
  grid-template-columns: repeat(4, 1fr);
}
dialog {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  color: var(--ink);
  padding: 30px;
  max-width: min(560px, calc(100vw - 28px));
  width: 560px;
  max-height: calc(100dvh - 40px);
  overflow: auto;
  box-shadow: 0 24px 100px #102d3133;
}
dialog::backdrop {
  background: #10271f80;
  backdrop-filter: blur(3px);
}
.dialog-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 18px;
}
.dialog-title h2 {
  margin: 0;
}
.dialog-title .eyebrow {
  font-size: 14px;
  margin-bottom: 8px;
}
.players-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 18px;
}
.seat-number {
  font-size: 14px;
  background: var(--sage);
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  margin-right: 8px;
}
.rule-summary {
  background: var(--sage);
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--muted);
  margin: 0 0 24px;
  font-size: 16px;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 26px;
}
#toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 20px);
  background: var(--green-dark);
  color: var(--paper);
  padding: 14px 22px;
  border-radius: 10px;
  max-width: calc(100vw - 32px);
  width: max-content;
  box-shadow: 0 8px 30px #0002;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms,
    transform 180ms;
  z-index: 1000;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (min-width: 1500px) {
  .footer {
    padding-left: 32px;
    padding-right: 32px;
  }
}
@media (max-width: 1100px) {
  .topbar {
    padding: 0 32px;
    gap: 20px;
  }
  .desktop-nav {
    gap: 20px;
  }
  .footer {
    margin-left: 32px;
    margin-right: 32px;
  }
  .table-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .game-layout {
    gap: 28px;
    grid-template-columns: 1.2fr 1fr;
  }
  .player-panel {
    padding: 16px;
  }
  .record-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(280px, 1fr);
    gap: 24px;
  }
  .tile-row {
    grid-template-columns: repeat(7, 1fr);
  }
  .qr-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .qr-card img {
    width: 130px;
    height: 130px;
  }
  .host-layout {
    grid-template-columns: 1.2fr 1fr;
    gap: 24px;
  }
  .highlights {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 800px) {
  .topbar {
    height: 90px;
    padding: 0 24px;
  }
  .brand {
    min-width: 130px;
  }
  .brand-word {
    font-size: 42px;
  }
  .brand-caption {
    font-size: 9px;
    letter-spacing: 2.5px;
  }
  .desktop-nav {
    gap: 18px;
  }
  .desktop-nav .icon {
    display: none;
  }
  .top-actions {
    gap: 8px;
  }
  .connection > span {
    display: none;
  }
  .page {
    padding: 36px 24px 24px;
  }
  .game-layout {
    grid-template-columns: 1fr;
  }
  .game-sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 26px;
  }
  .game-sidebar .section-title,
  .game-sidebar .history-row,
  .game-sidebar .empty {
    grid-column: 1;
  }
  .session-info {
    grid-column: 2;
    grid-row: 1 / span 4;
    margin-top: 0;
  }
  .secondary-actions {
    grid-column: 1/-1;
  }
  .record-layout {
    grid-template-columns: 1fr;
  }
  .score-preview {
    position: static;
  }
  .record-page .tile-row {
    grid-template-columns: repeat(9, 1fr);
  }
  .host-layout {
    grid-template-columns: 1fr;
  }
  .host-overview {
    gap: 18px;
  }
  .qr-card {
    padding: 24px;
  }
  .rank-head,
  .rank-row {
    grid-template-columns: 40px minmax(0, 1fr) 60px 90px;
    gap: 12px;
    padding-left: 16px;
    padding-right: 16px;
  }
  .rank-value {
    font-size: 26px;
  }
  .filters {
    flex-wrap: wrap;
  }
  .footer {
    margin-left: 24px;
    margin-right: 24px;
  }
  .footer > span:nth-child(2) {
    display: none;
  }
  .tv-page {
    padding: 30px;
  }
  .tv-page .rank-head,
  .tv-page .rank-row {
    grid-template-columns: 45px 1fr 70px 100px;
  }
  .tv-page .rank-player strong {
    font-size: 22px;
  }
  .tv-page .rank-value {
    font-size: 30px;
  }
}
@media (max-width: 600px) {
  .topbar {
    height: 88px;
    padding: 0 20px;
  }
  .brand-word {
    font-size: 40px;
  }
  .brand-caption {
    font-size: 9px;
  }
  .desktop-nav {
    display: none;
  }
  .top-actions {
    gap: 7px;
  }
  .language {
    width: 58px;
  }
  .top-actions .icon-btn {
    width: 42px;
    height: 44px;
    padding: 9px;
  }
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 30;
    background: #fbf9f0f5;
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--line);
    display: flex;
    justify-content: space-around;
    padding: 7px 12px max(7px, env(safe-area-inset-bottom));
  }
  .bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 55px;
    padding: 2px 20px;
    color: var(--muted);
    font-size: 16px;
  }
  .bottom-nav a.active {
    color: var(--green);
    font-weight: 600;
  }
  .bottom-nav .icon {
    width: 21px;
    height: 21px;
  }
  .app-shell {
    padding-bottom: 76px;
  }
  .page {
    padding: 28px 20px 20px;
  }
  .page-heading {
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 28px;
  }
  .page-heading .eyebrow {
    font-size: 13px;
    letter-spacing: 0;
    margin-bottom: 12px;
  }
  .page-heading h1 {
    font-size: 30px;
  }
  .page-heading p {
    font-size: 16px;
  }
  .page-heading > .button {
    font-size: 0;
    padding: 12px;
    width: 48px;
    flex-shrink: 0;
    gap: 0;
  }
  .page-heading > .button .icon {
    width: 22px;
  }
  .entry-extra {
    margin-top: 20px;
    padding-top: 12px;
  }
  .code-input {
    height: 65px;
    font-size: 28px;
  }
  .availability {
    margin-top: 4px;
  }
  .availability strong {
    font-size: 30px;
  }
  .availability strong span {
    font-size: 20px;
  }
  .availability > span {
    font-size: 14px;
  }
  .section-line {
    font-size: 16px;
    padding-top: 18px;
    margin-bottom: 18px;
  }
  .section-line .muted {
    font-size: 14px;
  }
  .table-grid {
    gap: 12px;
  }
  .table-card {
    padding: 16px 14px;
    border-radius: 12px;
  }
  .table-card-top {
    margin-bottom: 16px;
    gap: 4px;
  }
  .table-symbol {
    width: 34px;
    height: 34px;
    border: 0;
  }
  .table-symbol .icon {
    width: 26px;
    height: 26px;
  }
  .table-card .status {
    font-size: 12px;
    padding: 4px 6px;
    gap: 4px;
  }
  .table-name {
    font-size: 26px;
  }
  .table-card p {
    font-size: 16px;
    margin-bottom: 16px;
    line-height: 1.4;
  }
  .table-card-bottom {
    display: block;
    padding-top: 12px;
  }
  .table-card-bottom > span {
    font-size: 14px;
    min-height: 28px;
  }
  .table-card-bottom > span:first-child:not(.avatars) {
    display: none;
  }
  .table-card-bottom .avatars {
    margin-bottom: 6px;
  }
  .table-card-bottom .avatars i {
    width: 27px;
    height: 27px;
  }
  .table-card-bottom > span:last-child {
    justify-content: space-between;
  }
  .felt-board {
    padding: 18px;
    border-radius: 18px;
  }
  .round-bar {
    font-size: 16px;
    padding: 2px 0 18px;
  }
  .players-board {
    gap: 12px;
    margin-top: 18px;
  }
  .player-panel {
    padding: 14px 12px;
    border-radius: 10px;
  }
  .player-name {
    font-size: 18px;
    margin-top: 12px;
  }
  .player-score {
    font-size: 40px;
  }
  .player-wind {
    font-size: 16px;
  }
  .wind-medal {
    width: 34px;
    height: 34px;
    font-size: 22px;
  }
  .dealer-label {
    font-size: 10px;
    letter-spacing: 0.1em;
  }
  .board-caption {
    font-size: 9px;
    margin-top: 18px;
  }
  .game-actions {
    gap: 10px;
  }
  .game-actions .button {
    padding: 12px;
    font-size: 16px;
  }
  .game-actions button {
    padding: 12px 16px;
  }
  .game-sidebar {
    display: block;
  }
  .game-sidebar .section-title {
    margin-top: 10px;
  }
  .session-info {
    margin-top: 26px;
  }
  .back-link {
    margin-bottom: 16px;
  }
  .footer {
    font-size: 14px;
    margin: 24px 20px 0;
    padding: 20px 0;
  }
  .footer > span {
    font-size: 14px;
  }
  .footer a,
  .footer button {
    font-size: 16px;
  }
  dialog {
    padding: 24px 20px;
    border-radius: 16px;
  }
  .players-form {
    gap: 0 12px;
  }
  .players-form label {
    font-size: 16px;
  }
  .seat-number {
    display: none;
  }
  .record-page {
    padding: 24px 16px;
  }
  .record-page .page-heading h1 {
    font-size: 28px;
  }
  .step-title h2 {
    font-size: 18px;
  }
  .step-title > span {
    width: 27px;
    height: 27px;
  }
  .step-title {
    gap: 8px;
  }
  .winner-grid {
    gap: 7px;
  }
  .winner-choice {
    padding: 12px 5px;
    font-size: 16px;
  }
  .winner-choice .avatar {
    width: 36px;
    height: 36px;
  }
  .winner-choice > span:last-child {
    font-size: 16px;
  }
  .two-fields {
    gap: 12px;
  }
  .two-fields label {
    font-size: 16px;
  }
  .record-page .tile-row {
    grid-template-columns: repeat(5, 1fr);
    gap: 7px;
  }
  .record-page .tile-row .tile {
    max-height: 78px;
  }
  .tile-group {
    margin-bottom: 20px;
  }
  .tile-group:last-child .tile-row {
    grid-template-columns: repeat(4, 1fr);
  }
  .hand-tray {
    padding: 12px;
  }
  .selected-hand {
    gap: 5px;
  }
  .selected-hand .tile {
    width: 44px;
    height: 59px;
  }
  .tray-tools .text-btn {
    font-size: 16px;
  }
  .tray-tools {
    align-items: flex-start;
  }
  .record-step {
    padding-bottom: 22px;
    margin-bottom: 20px;
  }
  .record-layout {
    gap: 8px;
  }
  .score-preview {
    padding: 24px 22px;
  }
  .score-preview .preview-total {
    font-size: 64px;
  }
  .flower-grid {
    gap: 8px;
  }
  .flower span {
    font-size: 14px;
  }
  .history-content {
    padding-left: 0;
  }
  .history-row {
    gap: 12px;
  }
  .history-score {
    font-size: 24px;
  }
  .filters {
    gap: 12px;
    align-items: flex-end;
  }
  .filters label {
    flex: 1;
    min-width: 130px;
    font-size: 16px;
  }
  .filters select {
    min-width: 0;
  }
  .filters button {
    min-height: 44px;
    padding: 10px 18px;
  }
  .rank-head {
    font-size: 14px;
  }
  .rank-head,
  .rank-row {
    grid-template-columns: 27px minmax(0, 1fr) 42px 70px;
    gap: 8px;
    padding: 18px 10px;
  }
  .rank-player {
    gap: 10px;
  }
  .rank-player .avatar {
    display: none;
  }
  .rank-player strong {
    font-size: 18px;
  }
  .rank-player p {
    font-size: 14px;
  }
  .rank-number {
    font-size: 22px;
  }
  .rank-number .icon {
    width: 24px;
    height: 24px;
  }
  .rank-value {
    font-size: 25px;
  }
  .highlights {
    gap: 20px;
  }
  .highlights strong {
    font-size: 30px;
  }
  .highlights small {
    font-size: 14px;
    display: block;
    margin: 4px 0 0;
  }
  .highlights p {
    font-size: 14px;
  }
  .rules-tabs {
    gap: 20px;
  }
  .rules-tabs a {
    font-size: 16px;
  }
  .rules-intro {
    padding: 20px;
  }
  .rules-intro h2 {
    font-size: 27px;
  }
  .host-overview {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .access-card {
    padding: 24px;
  }
  .daily-code {
    font-size: 32px;
    letter-spacing: 0.17em;
  }
  .qr-card {
    flex-direction: row;
    padding: 22px;
    gap: 12px;
  }
  .qr-card h2 {
    font-size: 26px;
  }
  .qr-card img {
    width: 100px;
    height: 100px;
  }
  .qr-card p {
    font-size: 16px;
  }
  .settings-panel {
    padding: 22px 18px;
  }
  .host-layout {
    gap: 0;
  }
  .rule-settings-body {
    padding: 10px 12px 14px;
  }
  .rule-settings > summary {
    padding: 12px;
  }
  .host-table {
    gap: 8px;
  }
  .host-table .text-btn {
    font-size: 16px;
  }
  .host-table > div:last-child {
    gap: 10px;
  }
  .tv-shell {
    padding-bottom: 0;
  }
  .tv-page .rank-head,
  .tv-page .rank-row {
    grid-template-columns: 30px 1fr 42px 70px;
    padding: 18px 10px;
    gap: 8px;
  }
  .tv-page .rank-player strong {
    font-size: 18px;
  }
  .tv-page .rank-value {
    font-size: 26px;
  }
  .tv-page .rank-head {
    font-size: 14px;
  }
  .tv-page .highlights {
    grid-template-columns: repeat(2, 1fr);
  }
  #toast {
    bottom: 90px;
  }
  .topbar .connection.offline > span {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* Responsive composition for the unified entry panel and compact table directory. */
.entry-form .helper { line-height: 1.6; }
.entry-form label { font-weight: 600; }
.entry-form input, .entry-form select { font-weight: 400; }
.entry-form .rule-summary { margin-bottom: 14px; }
.preview-total, .rank-value, .daily-code { font-weight: 700; }
.preview-total { font-size: 64px; }
.rank-player strong { font-weight: 600; }
.table-card-bottom .icon { width: 18px; }
.table-card .status { white-space: nowrap; }
.table-card .avatars i { width: 28px; height: 28px; font-size: 12px; }
.table-card .table-card-bottom > span:last-child { margin-left: auto; }
.player-name { font-weight: 600; }
.board-caption { display: none; }
.connection { font-size: 13px; }
.footer { margin-top: 32px; max-width: 1156px; padding: 16px 0; font-size: 13px; }
.footer > span { font-size: 13px; }
.settings-panel, .access-card, .qr-card, .rules-intro, .rank-row.first { border-radius: 10px; }
.back-link { margin-bottom: 12px; font-size: 14px; }
.record-step { padding-bottom: 24px; margin-bottom: 24px; }
.record-page .page-heading { margin-bottom: 24px; }
.top-actions .icon-btn.selected { background: var(--sage); }
@media (max-width: 1100px) {
  .entry-layout { margin: 32px; }
  .entry-story { padding: 32px; }
  .entry-form { padding: 32px; }
  .tile-still .tile { width: 66px; min-width: 66px; height: 88px; }
}
@media (max-width: 800px) {
  .topbar { height: 76px; }
  .brand { min-width: 115px; gap: 10px; }
  .brand-word { font-size: 36px; }
  .brand-caption { font-size: 9px; letter-spacing: .02em; padding-left: 10px; max-width: 60px; }
  .entry-layout { grid-template-columns: .85fr 1.15fr; margin: 32px 24px; }
  .entry-story { padding: 28px; }
  .entry-story .entry-title { font-size: 36px; }
  .entry-form { padding: 28px; }
  .tile-still { justify-content: flex-start; height: 150px; }
  .tile-still .tile { width: 54px; min-width: 54px; height: 74px; margin-right: 6px; }
  .entry-foot { font-size: 13px; }
}
@media (max-width: 600px) {
  .topbar { height: 72px; padding: 0 20px; }
  .page { padding-top: 24px; }
  .entry-layout { display: flex; flex-direction: column; margin: 20px 16px; border-radius: 12px; }
  .entry-story { min-height: 0; padding: 24px; display: block; }
  .entry-story .eyebrow { margin-bottom: 12px; font-size: 12px; }
  .entry-story .entry-title { font-size: 32px; margin-bottom: 12px; max-width: none; }
  .entry-story > p { font-size: 16px; margin: 0; max-width: none; }
  .tile-still, .entry-foot { display: none; }
  .entry-form { padding: 26px 24px; align-self: stretch; }
  .entry-form h1 { font-size: 25px; }
  .entry-form .eyebrow { margin: 0 0 8px; }
  .page-heading .eyebrow { font-size: 13px; letter-spacing: 0; margin-bottom: 6px; }
  .page-heading h1, .record-page .page-heading h1 { font-size: 30px; }
  .table-grid { grid-template-columns: 1fr; gap: 12px; }
  .table-card { padding: 18px; }
  .table-name { font-size: 23px; }
  .table-card p { font-size: 14px; margin: 6px 0 12px; }
  .table-card-top { margin: 0; }
  .table-card .status { font-size: 12px; padding: 5px 8px; }
  .table-card-bottom { display: flex; padding-top: 10px; }
  .table-card-bottom > span:first-child:not(.avatars) { display: flex; }
  .table-card-bottom .avatars { margin: 0; }
  .availability { padding-top: 4px; }
  .availability strong { font-size: 30px; }
  .availability > span { font-size: 12px; }
  .player-score { font-size: 42px; }
  .player-name { font-size: 16px; }
  .player-wind { font-size: 14px; }
  .felt-board { border-radius: 10px; padding: 16px; }
  .players-board { gap: 10px; }
  .player-panel { padding: 14px 12px; }
  .bottom-nav { background: #fafbf4; }
  .bottom-nav a { font-size: 13px; }
  .bottom-nav a.active { background: #e8edda; border-radius: 8px; }
  .record-page .tile-row { grid-template-columns: repeat(6, minmax(0,1fr)); gap: 6px; }
  .record-page .tile-row .tile { min-width: 44px; aspect-ratio: 48/64; }
  .record-page .tile-group:last-child .tile-row { grid-template-columns: repeat(6, minmax(0,1fr)); }
  .winner-choice { font-size: 14px; }
  .winner-choice > span:last-child { font-size: 14px; }
  .footer { margin: 24px 20px 0; }
}
@media (max-width: 359px) {
  .record-page .tile-row, .record-page .tile-group:last-child .tile-row { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .entry-form { padding: 24px 20px; }
  .brand-caption { display: none; }
}

/* Final task-first hierarchy: semantic table labels and mobile setup first. */
.table-name { display: block; font-weight: 700; line-height: 1.3; }
.brand { min-height: 44px; }
.entry-story .entry-title { font-weight: 700; }
.entry-form h1 { line-height: 1.25; margin-bottom: 12px; }
.table-card-bottom { display: flex; }
@media (max-width: 600px) {
  .entry-setup .entry-story { display: none; }
  .entry-layout { margin-top: 20px; }
  .entry-story .entry-title { font-size: 26px; }
  .entry-story > p { display: none; }
  .entry-story .eyebrow { display: none; }
  .entry-story { padding: 20px 24px; }
  .entry-story .entry-title { margin: 0; }
  .entry-story .entry-title br { display: none; }
  .entry-story .entry-title br::after { content: " "; }
  .entry-form h1 { font-size: 25px; }
  .entry-setup .entry-form { padding-top: 24px; }
  .page:has(.felt-board) .back-link { margin-bottom: 4px; }
  .page:has(.felt-board) .page-heading { margin-bottom: 18px; }
  .round-bar { padding-bottom: 14px; }
  .players-board { margin-top: 14px; }
  .player-panel { padding: 12px; }
  .player-name { margin-top: 8px; }
  .player-score { font-size: 40px; line-height: 1.2; }
  .game-actions { margin-top: 14px; }
  .game-actions .button { padding-left: 8px; padding-right: 8px; }
  .page:has(.felt-board) { padding-top: 16px; }
}

/* Ranking controls share one row instead of an extra introduction/header. */
.rank-page #rank-filter{flex-wrap:wrap;align-items:flex-end}
.rank-page .rank-tv-link{margin-left:auto;white-space:nowrap}
@media(max-width:600px){
 .rank-page #rank-filter{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
 .rank-page #rank-filter label,.rank-page #rank-filter :is(select,input,button,a){min-width:0;width:100%;max-width:100%}
 .rank-page #rank-filter :is(button,a){justify-content:center;margin:0}
}

@media(max-width:380px){.rank-page #rank-filter input[type="date"]{padding-left:6px;padding-right:6px}.rank-page #rank-filter :is(button,a){padding-left:6px;padding-right:6px;gap:6px}}

/* Customer rankings have one immediate score-system filter. */
.rank-page #rank-filter.customer-rank-filter{display:block;margin-bottom:24px}
.rank-page .customer-rank-filter label{width:100%;max-width:320px}
.rank-page .customer-rank-filter select{width:100%}
@media(max-width:600px){.rank-page .customer-rank-filter label{max-width:none}}
