:root {
  --paper: #f6f0e5;
  --ink: #263e4a;
  --muted: #797a71;
  --red: #b72c38;
  --line: #ded7c9;
  --gold: #c2a16a;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Cpath fill='%23827457' opacity='.045' filter='url(%23n)' d='M0 0h100v100H0z'/%3E%3C/svg%3E");
}
button,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 4px;
}
a {
  color: inherit;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
.topbar {
  max-width: 1120px;
  padding: 26px 40px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 2px;
}
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 3px;
  color: var(--muted);
  margin-top: 3px;
}
.brand-seal {
  width: 40px;
  height: 40px;
  background: var(--red);
  color: #f7e5b7;
  display: grid;
  place-items: center;
  font-family: KaiTi, STKaiti, serif;
  font-size: 30px;
  transform: rotate(-5deg);
  border-radius: 3px;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 10px 0;
}
.text-button:hover {
  color: var(--red);
}
main {
  max-width: 960px;
  margin: auto;
  display: grid;
  grid-template-columns: 1fr 390px;
  column-gap: 88px;
  padding: 48px 32px 24px;
}
.intro {
  padding-top: 66px;
}
.eyebrow {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--red);
}
h1 {
  font-family: STKaiti, KaiTi, "Songti SC", SimSun, serif;
  font-size: 62px;
  line-height: 1.35;
  font-weight: 600;
  margin: 24px 0 20px;
  letter-spacing: 4px;
}
.intro > p {
  font-size: 14px;
  letter-spacing: 2px;
  color: var(--muted);
}
.intro-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 30px;
  font-size: 11px;
  color: var(--muted);
}
.intro-meta i {
  height: 3px;
  width: 3px;
  background: var(--gold);
  border-radius: 50%;
}
.desktop-note {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 100px;
}
.outline-seal {
  font-family: KaiTi, serif;
  font-size: 44px;
  color: var(--gold);
  border: 1px solid var(--gold);
  padding: 2px 8px;
  transform: rotate(-8deg);
}
.desktop-note p {
  font-size: 12px;
  line-height: 2;
  color: var(--muted);
  letter-spacing: 2px;
}
.play {
  width: 100%;
  max-width: 390px;
  margin: auto;
}
.ticket-top {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--muted);
  margin-bottom: 12px;
}
.ticket {
  position: relative;
  box-shadow: 0 16px 28px -17px #49392666;
  user-select: none;
  -webkit-user-select: none;
}
.ticket > img {
  display: block;
  width: 100%;
  height: auto;
  pointer-events: none;
}
.scratch-area {
  position: absolute;
  left: 16%;
  width: 68%;
  top: 48.3%;
  height: 21.7%;
  overflow: hidden;
  background: #ef0029;
}
.symbols {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-template-rows: repeat(2, 1fr);
  padding: 3px 1px;
  gap: 2px;
  align-items: center;
}
.cell {
  display: flex;
  align-items: center;
  flex-direction: column;
  color: #ffdfa0;
  gap: 3px;
  font-size: 10px;
  white-space: nowrap;
}
.cell-symbol {
  font-family: STKaiti, KaiTi, serif;
  border: 1px solid #ffe4a4;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  font-size: 27px;
  line-height: 1;
}
.cell.win .cell-symbol {
  background: #ffdfa0;
  color: #b62433;
  border: 3px double #b62433;
}
.cell-amount {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: crosshair;
}
.simulation-mark {
  position: absolute;
  bottom: 3%;
  left: 8%;
  background: #143f8e;
  color: #ffedbe;
  font-size: 11px;
  padding: 7px 12px;
  letter-spacing: 1px;
}
.scratch-status {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin: 20px 0 8px;
}
.progress-track {
  height: 3px;
  background: var(--line);
}
#progress-fill {
  width: 0;
  height: 100%;
  background: var(--red);
  transition: width 0.15s;
}
.result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0 18px;
  gap: 8px;
}
.result-label {
  font-size: 11px;
  color: var(--muted);
}
.result strong {
  font-size: 14px;
  font-weight: 500;
}
.result.is-win strong {
  color: var(--red);
  font-weight: 700;
}
.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.actions button {
  min-height: 48px;
  border-radius: 4px;
  font-size: 14px;
  letter-spacing: 1px;
}
.primary {
  background: var(--red);
  color: #fff6de;
  border: 1px solid var(--red);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
}
.primary span {
  font-size: 22px;
}
.primary:hover {
  background: #a32531;
}
.secondary {
  background: transparent;
  border: 1px solid #c8bda9;
  color: var(--ink);
}
.secondary:hover {
  background: #ede4d5;
}
.action-note {
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  margin-top: 14px;
  letter-spacing: 0.5px;
}
.stats {
  grid-column: 1/-1;
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 44px;
}
.section-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-label h2 {
  font-size: 14px;
  letter-spacing: 2px;
  font-weight: 500;
  margin: 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 24px 0 20px;
}
.stats-grid > div {
  border-right: 1px solid var(--line);
  padding-left: 28px;
}
.stats-grid > div:first-child {
  padding-left: 0;
}
.stats-grid > div:last-child {
  border: 0;
}
.stats-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 10px;
}
.stats-grid strong {
  font-size: 28px;
  font-family: Georgia, serif;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}
.stats-grid small {
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 10px;
  margin-left: 6px;
  color: var(--muted);
}
.stats > p {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
  margin: 4px 0 0;
}
footer {
  max-width: 960px;
  margin: 20px auto 0;
  padding: 26px 32px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
footer span {
  font-family: KaiTi, STKaiti, serif;
  font-size: 17px;
  letter-spacing: 2px;
}
footer p {
  font-size: 10px;
}
dialog {
  width: min(480px, calc(100% - 32px));
  max-height: 85dvh;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 26px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 20px 80px #16232d33;
}
dialog::backdrop {
  background: #17292f88;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.close {
  border: 0;
  background: transparent;
  font-size: 28px;
  color: var(--ink);
  width: 36px;
  height: 36px;
}
dialog h2 {
  font-family: KaiTi, STKaiti, serif;
  font-size: 27px;
  margin: 16px 0;
}
dialog h3 {
  font-size: 15px;
  margin-top: 24px;
}
dialog p,
dialog li {
  font-size: 13px;
  line-height: 1.9;
}
dialog ol {
  padding-left: 22px;
}
dialog li {
  padding-left: 5px;
  margin: 8px 0;
}
dialog b {
  color: var(--red);
}
dialog summary {
  font-size: 13px;
  cursor: pointer;
  padding: 12px 0;
}
dialog table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
dialog td,
dialog th {
  padding: 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
dialog td:last-child,
dialog th:last-child {
  text-align: right;
}
.muted {
  color: var(--muted);
}
@media (max-width: 767px) {
  .topbar {
    padding: 16px 22px;
  }
  .brand {
    font-size: 16px;
  }
  .brand-seal {
    width: 34px;
    height: 34px;
    font-size: 26px;
  }
  main {
    display: block;
    padding: 26px 24px 0;
    max-width: 450px;
  }
  .intro {
    padding: 0;
    text-align: center;
  }
  .intro .eyebrow {
    font-size: 10px;
    letter-spacing: 2px;
  }
  h1 {
    font-size: 34px;
    letter-spacing: 2px;
    margin: 12px 0 8px;
    white-space: nowrap;
  }
  .desktop-break,
  .desktop-note {
    display: none;
  }
  .intro > p {
    font-size: 11px;
    margin: 8px 0;
    letter-spacing: 1px;
  }
  .intro-meta {
    justify-content: center;
    margin: 16px 0 24px;
    font-size: 10px;
  }
  .ticket-top {
    font-size: 9px;
    margin-bottom: 10px;
  }
  .scratch-status {
    margin-top: 17px;
  }
  .stats {
    margin-top: 28px;
    padding-top: 16px;
  }
  .stats-grid {
    padding: 18px 0;
  }
  .stats-grid > div {
    padding-left: 13px;
  }
  .stats-grid strong {
    font-size: 23px;
  }
  .stats-grid small {
    margin-left: 3px;
  }
  .stats-grid span {
    font-size: 10px;
  }
  .stats > p {
    font-size: 10px;
  }
  footer {
    max-width: 450px;
    margin-top: 22px;
    padding: 20px 24px 28px;
    padding-bottom: max(28px, env(safe-area-inset-bottom));
    display: block;
    text-align: center;
  }
  footer span {
    font-size: 16px;
  }
  footer p {
    font-size: 9px;
    margin-top: 10px;
  }
  .result {
    padding: 17px 0;
  }
  .cell-symbol {
    width: 30px;
    height: 30px;
    font-size: 24px;
  }
  .cell-amount {
    font-size: 9px;
  }
  .simulation-mark {
    font-size: 9px;
    padding: 6px 9px;
  }
}
@media (max-width: 360px) {
  main {
    padding-inline: 18px;
  }
  h1 {
    font-size: 30px;
  }
  .cell-symbol {
    width: 25px;
    height: 25px;
    font-size: 21px;
  }
  .cell-amount {
    font-size: 8px;
  }
  .stats-grid strong {
    font-size: 20px;
  }
  .stats-grid > div {
    padding-left: 9px;
  }
  .simulation-mark {
    font-size: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
@media (max-width: 767px) {
  .topbar {
    padding: 12px 20px;
  }
  main {
    padding-top: 16px;
  }
  .intro .eyebrow,
  .intro > p {
    display: none;
  }
  h1 {
    font-size: 32px;
    margin: 8px 0;
  }
  .intro-meta {
    margin: 10px 0 18px;
  }
  .scratch-status {
    margin-top: 12px;
  }
}
@media(max-width:767px){h1{font-size:clamp(24px,8.2vw,32px)}}
