:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #5f6b72;
  --line: #d8dfe3;
  --paper: #f4f1ea;
  --surface: #fffdf8;
  --accent: #c8352c;
  --accent-dark: #a42620;
  --gold: #d99a26;
  --focus: #185a85;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  line-height: 1.5;
}

.app {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: clamp(24px, 6vw, 56px) 20px 64px;
}

.app-header {
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: clamp(32px, 7vw, 48px);
  font-weight: 800;
}

h2 {
  font-size: 20px;
}

.question {
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.question-heading {
  display: flex;
  gap: 14px;
  margin-bottom: 18px;
}

.question-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.question-number,
.field span {
  font-variant-numeric: tabular-nums;
}

.question-number {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid var(--ink);
  border-radius: 50%;
  font-size: 15px;
  font-weight: 700;
}

.field {
  display: grid;
  gap: 7px;
  color: #35434b;
  font-size: 14px;
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid #b9c1c6;
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  outline: none;
}

.mark-six {
  text-align: center;
  padding: 0 6px;
}

.mark-six-board {
  border: 1px solid #c8ced2;
  border-radius: 7px;
  background: #fff;
  padding: 14px;
}

.board-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  color: #35434b;
  font-size: 14px;
  font-weight: 700;
}

.board-heading span:last-child {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.mark-six-card {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 8px;
}

.mark-six-number {
  width: auto;
  min-height: 0;
  padding: 0;
  aspect-ratio: 1;
  border: 1px solid #cfd6da;
  border-radius: 50%;
  background: var(--surface);
  color: #222;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.07);
}

.mark-six-number:hover:not(:disabled) {
  background: #f4f4f4;
  color: #222;
}

.mark-six-number[aria-pressed="true"] {
  border-color: #d0021b;
  background: #d0021b;
  color: #fff;
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.18);
}

.mark-six-number[aria-pressed="true"]:hover:not(:disabled) {
  background: #b80018;
  color: #fff;
}

.actions {
  padding: 24px 0 30px;
  border-top: 1px solid var(--line);
}

button {
  width: 100%;
  min-height: 54px;
  padding: 0 20px;
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
}

button:hover:not(:disabled) {
  background: var(--accent-dark);
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.result-shell {
  margin-bottom: 26px;
  padding: 20px;
  border: 1px solid var(--ink);
  background: var(--surface);
  box-shadow: 5px 5px 0 var(--gold);
}

.result-shell h2 {
  margin-bottom: 14px;
}

.results {
  display: grid;
  gap: 14px;
  margin: 0;
}

.results div {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.results dt {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.results dd {
  margin: 5px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.results small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

.results strong {
  color: var(--accent);
}

.status {
  min-height: 24px;
  margin: 0 0 30px;
  color: var(--accent-dark);
  font-weight: 700;
}

.privacy {
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.privacy p {
  margin: 10px 0 16px;
  color: var(--muted);
  font-size: 15px;
}

.secondary {
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
}

.secondary:hover:not(:disabled) {
  background: #e6e0d5;
}

.hidden {
  display: none;
}

@media (max-width: 480px) {
  .question-heading {
    align-items: flex-start;
  }

  .mark-six-card {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .result-shell {
    box-shadow: 4px 4px 0 var(--gold);
  }
}
