:root {
  font-family:
    system-ui,
    -apple-system,
    "PingFang SC",
    sans-serif;
  color: #e8eee9;
  background: #10191c;
  color-scheme: dark;
  --muted: #98aaa8;
  --accent: #cfdaa5;
  --line: #314044;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
header,
main,
footer {
  width: min(1050px, calc(100% - 40px));
  margin: auto;
}
header {
  height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
a {
  color: inherit;
}
.brand {
  text-decoration: none;
  font-size: 24px;
  letter-spacing: 3px;
  font-weight: 700;
}
.brand span {
  color: var(--accent);
  margin-left: 6px;
}
.caption,
.eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--muted);
}
.hero {
  padding: 56px 0 36px;
}
.hero h1 {
  font-size: clamp(34px, 6vw, 62px);
  line-height: 1.2;
  font-weight: 450;
  letter-spacing: -2px;
  margin: 20px 0;
}
.hero > p:last-child {
  color: var(--muted);
  font-size: 14px;
}
nav {
  display: flex;
  border-bottom: 1px solid var(--line);
  gap: 16px;
  margin-bottom: 24px;
}
button,
input,
select {
  font: inherit;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 18px;
  background: #223034;
  color: inherit;
  min-height: 46px;
  transition:
    background 0.18s,
    transform 0.18s;
}
button:hover {
  background: #34464a;
}
button:active {
  transform: scale(0.98);
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
.primary,
button.selected {
  color: #152022;
  background: var(--accent);
  border-color: var(--accent);
}
nav button {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 15px 4px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
}
nav .active {
  color: var(--accent);
  border-color: var(--accent);
}
.card {
  background: linear-gradient(130deg, #1b282b, #162124);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 20px;
  margin: 18px 0;
}
.card h2 {
  font-weight: 500;
  margin: 0 0 20px;
  font-size: 22px;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}
.row > * {
  flex: 1;
}
.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 22px;
}
.choice-row button {
  min-width: 58px;
  padding: 10px 14px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}
input,
select {
  background: #101c1f;
  border: 1px solid #425359;
  border-radius: 10px;
  color: #f1f4ed;
  padding: 12px;
  min-height: 46px;
  width: 100%;
}
input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  accent-color: var(--accent);
}
.check {
  flex-direction: row;
  align-items: center;
  min-height: 44px;
  gap: 10px;
}
.result {
  border-radius: 14px;
  background: #cfdaa5;
  color: #132022;
  padding: 22px;
  margin-top: 22px;
}
.result strong {
  font-size: 40px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.result p {
  margin: 8px 0;
}
.muted,
small {
  color: var(--muted);
  line-height: 1.7;
  font-size: 13px;
}
.scroll {
  overflow: auto;
}
table {
  border-collapse: collapse;
  width: 100%;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
td,
th {
  text-align: right;
  padding: 15px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
th:first-child,
td:first-child {
  text-align: left;
}
th {
  color: var(--muted);
  font-weight: 400;
}
.score-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.seat {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}
.seat.dealer {
  border-color: var(--accent);
}
.seat p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.seat strong {
  display: block;
  margin: 12px 0 4px;
  font-size: 32px;
  font-weight: 500;
}
.positive {
  color: #cfdaa5;
}
.negative {
  color: #e9a294;
}
.badge {
  padding: 3px 6px;
  border-radius: 4px;
  background: #40503c;
  color: #dce7c1;
  margin-left: 6px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 20px 0;
}
.actions button {
  flex: 1;
}
dialog {
  border: 1px solid #53635f;
  background: #162326;
  color: #e8eee9;
  border-radius: 22px;
  padding: 26px;
  width: min(640px, calc(100vw - 24px));
  max-height: 90dvh;
  overflow: auto;
}
dialog::backdrop {
  background: #05090bbb;
  backdrop-filter: blur(6px);
}
.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}
.modal-head h2 {
  font-size: 22px;
  font-weight: 500;
}
.modal-head button {
  flex: 0;
}
#notice {
  color: #e9c8a6;
  min-height: 24px;
  font-size: 14px;
}
.qr {
  display: block;
  width: min(250px, 100%);
  margin: 20px auto;
  border-radius: 16px;
  background: white;
  padding: 12px;
}
.share-url {
  font-size: 12px;
  word-break: break-all;
}
.divider {
  border-top: 1px solid var(--line);
  margin: 20px 0;
  padding-top: 20px;
}
footer {
  padding: 38px 0;
  color: var(--muted);
  font-size: 12px;
}
summary {
  cursor: pointer;
  padding: 12px 0;
  min-height: 44px;
}
details p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
@media (min-width: 800px) {
  #quick > .grid {
    grid-template-columns: 1.15fr 0.85fr;
  }
  .score-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (max-width: 500px) {
  header,
  main,
  footer {
    width: calc(100% - 28px);
  }
  header {
    height: 68px;
  }
  .caption {
    font-size: 9px;
    letter-spacing: 1px;
  }
  .hero {
    padding: 20px 0 12px;
  }
  .hero h1 {
    font-size: 28px;
    letter-spacing: -1px;
    margin: 12px 0;
  }
  .hero .eyebrow {
    margin: 4px 0;
  }
  .card {
    padding: 18px;
    border-radius: 16px;
  }
  .result strong {
    font-size: 34px;
  }
  .grid {
    grid-template-columns: 1fr;
  }
  .row > * {
    min-width: 110px;
  }
  .choice-row button {
    min-width: 48px;
    padding: 10px;
  }
  .seat strong {
    font-size: 28px;
  }
  td,
  th {
    padding: 12px 9px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

#quick .result {
  position: sticky;
  top: 8px;
  z-index: 2;
  margin: 0 0 22px;
  box-shadow: 0 8px 28px #0b131544;
}
.result small {
  color: #384e3d;
}
#quick .result strong {
  font-size: 36px;
}

/* 水墨牌谱：墨色山景与浅色纸页，朱砂标记操作。 */
:root {
  --font-ink: "Songti SC", "STSong", "Noto Serif CJK SC", "SimSun", serif;
  --muted: #62665d;
  --accent: #993e31;
  --line: #bcb5a580;
  color: #292d2b;
  background: #171b1b;
  color-scheme: light;
}
body {
  background:
    radial-gradient(ellipse at 80% 0, #746c5220, transparent 50%),
    repeating-linear-gradient(90deg, #ffffff02 0 1px, transparent 1px 5px);
}
header {
  color: #eee6d8;
  border-color: #a3947040;
}
.brand {
  font-family: var(--font-ink);
  display: flex;
  align-items: center;
  font-weight: 500;
}
.brand > span:last-child {
  color: #c7af83;
}
.brand .brand-seal {
  background: #963e33;
  color: #f6e7d3;
  border: 1px solid #d9927166;
  outline: 1px solid #8a4438;
  outline-offset: 3px;
  width: 28px;
  height: 32px;
  margin: 0 17px 0 4px;
  font-size: 20px;
  display: grid;
  place-items: center;
  letter-spacing: 0;
  transform: rotate(-4deg);
}
.caption,
.hero .eyebrow {
  color: #c0b499;
}
.hero {
  position: relative;
  padding: 44px 0 30px;
  color: #eee6d8;
  background: url("./art/ink-landscape.svg") right center / auto 100% no-repeat;
}
.hero h1 {
  font-family: var(--font-ink);
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: 5px;
  margin: 18px 0;
}
.hero > p:last-child {
  color: #c0b8a9;
  line-height: 1.8;
}
.hero-inscription {
  position: absolute;
  right: 24px;
  top: 42px;
  writing-mode: vertical-rl;
  font-family: var(--font-ink);
  font-size: 16px;
  letter-spacing: 5px;
  color: #c7b794;
  border-left: 1px solid #c7b79440;
  padding-left: 14px;
  pointer-events: none;
}
nav {
  border-color: #a3947040;
  gap: 28px;
}
nav button {
  font-family: var(--font-ink);
  color: #bfb5a1;
  font-size: 18px;
  letter-spacing: 2px;
}
nav button:hover {
  background: #ffffff08;
}
nav button.active {
  color: #efe4cd;
  border-bottom-color: #bc6451;
}
.card {
  position: relative;
  background-color: #ede6d7;
  background-image:
    repeating-linear-gradient(0deg, #796c5003 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 0 0, #fffaf0, transparent 80%);
  border-color: #c0b297;
  border-radius: 3px;
  box-shadow:
    0 12px 32px #080b0b25,
    inset 0 0 0 5px #ffffff30;
}
.card::before,
.card::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  pointer-events: none;
  border-color: #9a3c3060;
  border-style: solid;
}
.card::before {
  left: 8px;
  top: 8px;
  border-width: 1px 0 0 1px;
}
.card::after {
  right: 8px;
  bottom: 8px;
  border-width: 0 1px 1px 0;
}
.card h2,
.modal-head h2 {
  font-family: var(--font-ink);
  font-weight: 500;
  letter-spacing: 2px;
}
.card h2::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 17px;
  background: var(--accent);
  margin-right: 10px;
  vertical-align: -1px;
}
button {
  background: #f8f3e8;
  border-color: var(--line);
  border-radius: 3px;
  color: #292d2b;
}
button:hover {
  background: #e2d8c4;
  border-color: #9c8a6c;
}
button:active {
  transform: translateY(1px);
}
.primary,
button.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff5e6;
}
.primary:hover,
button.selected:hover {
  background: #7e2d24;
}
input,
select {
  background: #faf6ed;
  border-color: #a59d8a;
  border-radius: 3px;
  color: #292d2b;
}
#quick .result {
  border: 1px solid #a8997c;
  border-radius: 3px;
  background: linear-gradient(120deg, #293632, #1d2827);
  color: #f5eddb;
  box-shadow:
    inset 0 0 0 4px #d6bb7b10,
    0 6px 18px #19201c20;
}
#quick .result strong {
  font-family: var(--font-ink);
  font-size: 42px;
  letter-spacing: 1px;
}
.result small {
  color: #d0c2a7;
}
.seat {
  border-radius: 3px;
  background: #fffaf055;
}
.seat.dealer {
  border-color: var(--accent);
  box-shadow: inset 0 0 0 3px #9a3c3008;
}
.seat strong {
  font-family: var(--font-ink);
  font-variant-numeric: tabular-nums;
}
.positive {
  color: #386450;
}
.negative {
  color: #9a3c30;
}
.badge {
  background: var(--accent);
  color: #fff0df;
  border-radius: 2px;
  font-family: var(--font-ink);
}
dialog {
  background: #ede6d7;
  color: #292d2b;
  border-color: #b19b76;
  border-radius: 4px;
  box-shadow: 0 24px 70px #00000060;
}
dialog::backdrop {
  background: #0b1212bb;
}
.qr {
  border-radius: 3px;
}
#notice {
  color: #efb29b;
}
footer {
  color: #b7ad99;
  border-top: 1px solid #a3947030;
  margin-top: 35px;
  letter-spacing: 1px;
}
:focus-visible {
  outline-color: #b65340;
}
@media (max-width: 500px) {
  .brand {
    font-size: 21px;
    letter-spacing: 2px;
  }
  .caption {
    font-size: 10px;
    letter-spacing: 0;
  }
  .hero {
    padding: 22px 0 14px;
    background-position: 55% center;
  }
  .hero h1 {
    font-size: 32px;
    line-height: 1.45;
    letter-spacing: 3px;
    margin: 12px 0;
  }
  .hero .eyebrow {
    font-size: 10px;
    letter-spacing: 3px;
  }
  .hero > p:last-child {
    max-width: 285px;
    font-size: 13px;
  }
  .hero-inscription {
    right: 6px;
    top: 28px;
    font-size: 12px;
    letter-spacing: 3px;
    padding-left: 8px;
  }
  .card {
    border-radius: 3px;
  }
  #quick .result strong {
    font-size: 36px;
  }
}

.line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.fu-result {
  background: #293632;
  color: #f5eddb;
  border-radius: 3px;
}
#add-meld {
  margin-top: 16px;
}
@media (max-width: 500px) {
  nav {
    gap: 12px;
  }
  nav button {
    font-size: 15px;
    letter-spacing: 1px;
  }
}

/* 四个功能固定在底部，兼容手机安全区；对话框保持原生顶层。 */
body {
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}
.bottom-nav {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  width: min(620px, 100%);
  margin: 0 auto;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom, 0px));
  background: #f3eddf;
  border: 1px solid #b9ad96;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -8px 28px #00000025;
}
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 62px;
  border: 0;
  color: #756b5b;
  padding: 5px 2px;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0;
  background: transparent;
}
.bottom-nav button span:first-child {
  font-family: var(--font-ink);
  font-size: 23px;
  line-height: 1.1;
  padding: 3px 10px;
  border-radius: 3px;
}
.bottom-nav button.active {
  color: #993e31;
  border: 0;
}
.bottom-nav button.active span:first-child {
  background: #993e31;
  color: #fff4df;
}
.bottom-nav button:hover {
  background: #993e310a;
}
:root {
  scroll-padding-bottom: 100px;
}

/* 查点以交叉表为主体，选中项与支付结果保持在同一张纸页。 */
#quick {
  max-width: 740px;
  margin: 0 auto;
}
.lookup-card {
  padding: 22px;
}
.lookup-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.lookup-heading h2 {
  margin: 0;
}
.lookup-mark {
  font-family: var(--font-ink);
  color: #993e31;
  border: 1px solid #993e31;
  padding: 4px 6px;
  font-size: 14px;
}
.lookup-switches {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.lookup-switches .choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
}
.lookup-switches button {
  min-width: 0;
  padding: 10px 6px;
  border-radius: 0;
}
#quick .lookup-result {
  margin: 16px 0;
  padding: 16px 20px;
  background: #293632;
  color: #f5eddb;
  border: 0;
}
#quick .lookup-result strong {
  font-size: 38px;
  line-height: 1.2;
  display: block;
  margin: 6px 0;
  font-family: system-ui, sans-serif;
  font-weight: 650;
  letter-spacing: 0;
}
#quick .lookup-result p {
  margin: 4px 0 0;
  font-size: 13px;
  color: #ede4d2;
}
.selection-label {
  font-size: 14px;
  letter-spacing: 1px;
}
.table-caption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: #736b5d;
  margin: 16px 0 8px;
}
.point-matrix {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.point-matrix th,
.point-matrix td {
  padding: 0;
  border: 1px solid #c3b9a7;
  text-align: center;
}
.point-matrix th:first-child {
  width: 48px;
}
.point-matrix th {
  height: 36px;
  font-size: 13px;
  color: #62594c;
  background: #e3dbcb;
  font-weight: 600;
}
.point-matrix td {
  background: #f6f0e5;
}
.point-matrix .axis-selected {
  background: #ead4c5;
  color: #993e31;
}
.point-matrix .axis-tint {
  background: #efe1d3;
}
#quick .point-cell {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  border: 0;
  border-radius: 0;
  padding: 7px 2px;
  color: #292d2b;
  background: transparent;
  letter-spacing: 0;
  font-family: system-ui, sans-serif;
}
#quick .point-cell:hover {
  background: #993e3114;
}
#quick .point-cell.chosen {
  background: #993e31;
  color: #fff5e6;
  box-shadow: inset 0 0 0 2px #b87660;
}
#quick .point-cell:disabled {
  opacity: 1;
  color: #aca293;
  cursor: default;
}
.cell-main {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}
.cell-sub {
  font-size: 12px;
  line-height: 1.2;
  opacity: 0.75;
}
.limit-heading {
  font-size: 15px;
  font-weight: 600;
  margin: 24px 0 10px;
}
.limit-matrix {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}
.limit-matrix th,
.limit-matrix td {
  padding: 0 8px;
  border-bottom: 1px solid #c3b9a7;
  font-size: 13px;
  background: transparent;
}
.limit-matrix th {
  text-align: left;
  width: 34%;
  font-weight: 500;
}
.limit-matrix td:last-child {
  padding: 0;
  width: 32%;
}
.limit-matrix .limit-selected {
  background: #efe1d3;
  color: #993e31;
}
.lookup-more {
  border-top: 1px solid #c3b9a7;
  margin-top: 16px;
  font-size: 13px;
}
@media (max-width: 500px) {
  .lookup-card {
    padding: 14px 10px;
    margin-top: 14px;
  }
  .lookup-heading {
    padding: 0 4px;
    margin-bottom: 14px;
  }
  .lookup-switches {
    gap: 12px;
  }
  #quick .lookup-result {
    padding: 14px;
  }
  .point-matrix th:first-child {
    width: 44px;
  }
  .cell-main {
    font-size: 13px;
  }
  .cell-sub {
    font-size: 11px;
  }
  .limit-matrix th,
  .limit-matrix td {
    padding: 0 4px;
    font-size: 12px;
  }
}

#quick .lookup-result {
  position: sticky;
  top: 8px;
  z-index: 2;
  box-shadow: 0 4px 14px #292d2b26;
}
.counter {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px 0;
}
.counter button {
  width: 54px;
  font-size: 24px;
  padding: 8px;
}
.counter strong {
  font-size: 20px;
  min-width: 90px;
  text-align: center;
}
.round-status {
  display: flex;
  align-items: center;
  gap: 26px;
  background: #293632;
  color: #f5eddb;
  padding: 18px 22px;
  margin: 14px 0 18px;
  border-left: 4px solid #ac6951;
}
.round-status > strong {
  font-size: 44px;
  line-height: 1;
  font-family: system-ui, sans-serif;
}
.round-status small {
  font-size: 16px;
  font-weight: 400;
}
.round-status b {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}
.round-status span {
  font-size: 13px;
  opacity: 0.8;
}
.record-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 14px;
  background: #293632;
  color: #f5eddb;
  margin: 8px 0 20px;
}
.record-status b {
  font-size: 24px;
}
.record-status span {
  font-size: 13px;
}
.payment-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.payment-table th,
.payment-table td {
  padding: 10px 4px;
  text-align: right;
  font-size: 12px;
  white-space: normal;
}
.payment-table th:first-child {
  text-align: left;
  width: 28%;
  overflow-wrap: anywhere;
}
.payment-transfer {
  font-size: 12px;
  color: #756b5b;
  line-height: 1.5;
}
.next-round {
  background: #e3dbcb;
  border-left: 3px solid #993e31;
  padding: 14px;
  margin-top: 18px;
  font-size: 14px;
  line-height: 1.7;
}
.quick-context {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 0 0 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #c3b9a7;
}
.context-label {
  display: block;
  color: #736b5d;
  font-size: 12px;
  margin-bottom: 8px;
}
.quick-context .choice-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 0;
}
.quick-context .choice-row button {
  min-width: 0;
  border-radius: 0;
  padding: 8px 4px;
}
.quick-context .counter {
  gap: 0;
  padding: 0;
}
.quick-context .counter button {
  width: 42px;
  min-height: 46px;
  font-size: 22px;
  padding: 6px;
}
.quick-context .counter strong {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  white-space: nowrap;
}
.record-label {
  font-size: 14px;
  color: #756b5b;
  margin: 16px 0 8px;
}
.record-counter {
  justify-content: flex-start;
  padding: 0;
  margin: 0 0 16px;
}
.record-counter output {
  font-size: 24px;
  min-width: 90px;
  text-align: center;
  font-weight: 600;
}
.fu-choices {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 20px;
}
.fu-choices button {
  padding: 8px 2px;
  font-size: 13px;
  min-width: 0;
  min-height: 46px;
}
.fu-choices button:disabled {
  opacity: 0.35;
  cursor: default;
}
@media (max-width: 500px) {
  .fu-choices {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .quick-context {
    gap: 12px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  .quick-context .counter button {
    width: 36px;
  }
}

/* 手机信息密度：统一卡片、表单、牌桌与统计页；保留 44px 触控高度。 */
body {
  font-size: 14px;
}
header {
  min-height: 54px;
}
.card {
  padding: 18px;
  margin-bottom: 12px;
}
.card h2,
.modal-head h2 {
  font-size: 20px;
  margin: 0 0 12px;
  letter-spacing: 1px;
}
h3 {
  font-size: 15px;
  margin: 16px 0 8px;
}
.grid {
  gap: 12px;
}
.row {
  gap: 8px;
}
button {
  min-height: 44px;
  padding: 9px 12px;
  font-size: 14px;
}
input,
select {
  min-height: 44px;
  padding: 10px;
}
label {
  gap: 5px;
}
.choice-row {
  gap: 6px;
  margin: 8px 0 12px;
}
.choice-row button {
  min-height: 44px;
  padding: 8px 10px;
}
.line {
  padding: 9px 0;
}
.result {
  padding: 14px;
  margin-top: 12px;
}
.result strong {
  font-size: 32px;
}
.seat {
  padding: 10px;
}
.seat strong {
  font-size: 26px;
}
.round-status {
  padding: 12px 14px;
  margin: 10px 0 12px;
  gap: 18px;
}
.honba-number {
  font-size: 34px;
}
.repeat-label {
  font-size: 16px;
  margin-bottom: 6px;
}
.record-status {
  padding: 10px 12px;
  margin: 6px 0 12px;
}
.record-status b {
  font-size: 20px;
}
.record-label {
  margin: 10px 0 6px;
}
.record-counter {
  margin-bottom: 10px;
}
.fu-choices {
  gap: 6px;
  margin: 8px 0 12px;
}
.fu-choices button {
  min-height: 44px;
}
.next-round {
  padding: 10px;
  margin-top: 12px;
  line-height: 1.5;
}
#add-meld {
  margin-top: 8px;
}
#quick .lookup-card {
  padding: 16px;
}
.lookup-heading {
  margin-bottom: 12px;
}
.lookup-heading h2 {
  font-size: 20px;
}
.quick-context {
  margin-bottom: 10px;
  padding-bottom: 10px;
  gap: 10px;
}
.context-label {
  margin-bottom: 5px;
}
#quick .lookup-result {
  padding: 10px 14px;
  margin: 10px 0;
}
#quick .lookup-result strong {
  font-size: 30px;
  margin: 3px 0;
}
.lookup-switches {
  gap: 10px;
}
.limit-heading {
  margin: 16px 0 8px;
}
.fu-summary {
  position: sticky;
  top: 8px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin: 0 0 12px;
  box-shadow: 0 4px 16px #0003;
}
.fu-summary strong {
  font-size: 30px;
  line-height: 1.1;
}
.fu-summary p {
  font-size: 12px;
  margin: 4px 0 0;
  color: #eee6d8;
}
.fu-summary button {
  flex-shrink: 0;
}
@media (max-width: 600px) {
  header,
  main,
  footer {
    width: calc(100% - 24px);
  }
  header {
    height: 52px;
    padding: 8px 0;
  }
  .card {
    padding: 14px;
  }
  #quick .lookup-card {
    padding: 14px 10px;
  }
  input,
  select {
    font-size: 16px;
  }
  .bottom-nav button {
    min-height: 54px;
    gap: 3px;
  }
  .bottom-nav button span:first-child {
    font-size: 20px;
    padding: 2px 8px;
  }
  body {
    padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  }
  .fu-summary {
    position: fixed;
    top: auto;
    bottom: calc(75px + env(safe-area-inset-bottom, 0px));
    left: 12px;
    right: 12px;
    margin: 0;
    padding: 10px 12px;
  }
  #fu {
    padding-bottom: 90px;
  }
  dialog {
    padding: 14px;
  }
  td,
  th {
    padding: 9px 6px;
  }
}
.card {
  margin: 12px 0;
}
#notice:empty {
  display: none;
}
#notice:not(:empty) {
  padding-top: 10px;
}
.actions {
  margin: 12px 0;
  gap: 6px;
}
.divider {
  margin: 12px 0;
  padding-top: 12px;
}
.seat strong {
  margin: 8px 0 4px;
}
.round-status > strong {
  font-size: 34px;
}
.round-status b {
  font-size: 16px;
  margin-bottom: 6px;
}
footer {
  padding: 22px 0;
}
.player-checks,
.fortune-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.fortune-grid > div {
  background: #fffaf055;
  border: 1px solid #bcb5a5;
  padding: 10px;
}
.fortune-grid h3 {
  margin-top: 0;
}
.monthly-summary {
  font-size: 13px;
  line-height: 1.6;
  color: #65685f;
}
.winner-picker button:disabled {
  opacity: 0.4;
}
.yaku-item {
  padding: 12px 0;
  border-bottom: 1px solid #bcb5a560;
}
.yaku-item > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.yaku-item h3 {
  margin: 0;
  font-size: 15px;
}
.yaku-item span {
  font-size: 12px;
  color: #65685f;
  text-align: right;
}
.yaku-item p {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.5;
}
.winner-picker button {
  transition: transform 0.18s;
}

/* Compact rule switches on the paper page; the whole row stays tappable. */
.rule-options { margin: 10px 0; }
.rule-option { position: relative; display: flex; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 0; border-bottom: 1px solid #c0b29766; color: #292d2b; cursor: pointer; }
.rule-option:last-child { border-bottom: 0; }
.rule-copy { display: flex; flex-direction: column; gap: 2px; }
.rule-name { font-size: 14px; font-weight: 500; }
.rule-note { font-size: 11px; color: #817463; }
.rule-switch { display: flex; align-items: center; gap: 8px; flex-shrink: 0; font-size: 11px; color: #817463; }
.rule-option input[type="checkbox"] { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 44px; margin: 0; padding: 0; opacity: 0; cursor: pointer; z-index: 1; }
.switch-track { display: inline-block; position: relative; width: 36px; height: 22px; border-radius: 12px; background: #c2b8a7; transition: background 160ms ease; }
.switch-track::before { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #faf5ea; box-shadow: 0 1px 3px #292d2b26; transition: transform 160ms ease; }
.rule-on { display: none; }
.rule-option input:checked ~ .rule-switch .rule-on { display: inline; color: #993e31; }
.rule-option input:checked ~ .rule-switch .rule-off { display: none; }
.rule-option input:checked ~ .rule-switch .switch-track { background: #993e31; }
.rule-option input:checked ~ .rule-switch .switch-track::before { transform: translateX(14px); }
.rule-option input:focus-visible ~ .rule-switch .switch-track { outline: 2px solid #993e31; outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .switch-track, .switch-track::before { transition: none; } }
