/* ==========================================================
   第一屆 智崴 i-Throw 盃 — Backyard cornhole party style
   ========================================================== */
:root {
  --red: #d7263d;
  --red-dark: #a3182b;
  --navy: #1d2a5b;
  --blue: #2f5fd0;
  --mustard: #f4b400;
  --cream: #fff6e5;
  --paper: #fffaf0;
  --wood: #e9c88f;
  --wood-dark: #8a5a2b;
  --grass: #2f6b3a;
  --grass-dark: #1f4a28;
  --ink: #1f1a17;
  --muted: #6b5d52;
  --radius: 18px;
  --shadow: 0 6px 0 rgba(31, 26, 23, .18), 0 18px 40px rgba(31, 26, 23, .12);
  --font-zh: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --font-display: "Bungee", var(--font-zh);
  --font-hand: "Permanent Marker", var(--font-zh);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--font-zh);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img, video { max-width: 100%; display: block; }
a { color: inherit; }
b { font-weight: 900; }

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.wrap--narrow { max-width: 720px; }
section { padding: 88px 0; position: relative; }

/* ---------- Buttons ---------- */
.btn {
  --bg: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  padding: .8em 1.4em;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: var(--bg);
  color: #fff;
  font: 900 1rem/1 var(--font-zh);
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 5px 0 var(--ink);
  transition: transform .12s, box-shadow .12s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--ink); }
.btn:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
.btn--red { --bg: var(--red); }
.btn--mustard { --bg: var(--mustard); color: var(--ink); }
.btn--ghost { --bg: rgba(255, 255, 255, .92); color: var(--ink); }
.btn--big { font-size: 1.15rem; padding: .95em 1.8em; }
.btn--small { font-size: .9rem; padding: .55em 1.1em; box-shadow: 0 3px 0 var(--ink); }
.btn--block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }

/* ---------- Headings ---------- */
.h2 {
  margin: 0 0 40px;
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
}
.h2__en {
  display: block;
  font-family: var(--font-hand);
  font-weight: 400;
  color: var(--red);
  font-size: .62em;
  letter-spacing: .04em;
  transform: rotate(-2deg);
  margin-bottom: 4px;
}
.h2--light { color: #fff; }
.h2--light .h2__en { color: var(--mustard); }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px;
  background: rgba(255, 250, 240, .94);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid var(--ink);
}
.nav__brand { display: flex; align-items: baseline; gap: 4px; text-decoration: none; }
.nav__logo { font-family: var(--font-display); font-size: 1.35rem; color: var(--red); }
.nav__cup { font-weight: 900; font-size: 1.2rem; }
.nav__links { display: flex; gap: 6px; align-items: center; }
.nav__links a {
  text-decoration: none; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  transition: background .15s;
}
.nav__links a:hover { background: var(--cream); }
.nav__links .nav__cta { background: var(--red); color: #fff; border: 2px solid var(--ink); }
.nav__links .nav__cta:hover { background: var(--red-dark); }
.nav__toggle { display: none; background: none; border: 0; padding: 8px; cursor: pointer; }
.nav__toggle span { display: block; width: 24px; height: 3px; background: var(--ink); margin: 4px 0; border-radius: 2px; }

@media (max-width: 860px) {
  .nav__toggle { display: block; }
  .nav__links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--paper); border-bottom: 3px solid var(--ink);
    padding: 10px 16px 16px;
    display: none;
  }
  .nav__links.is-open { display: flex; }
  .nav__links a { padding: 10px 14px; }
}

/* Instagram links */
.ig-icon { width: 1.15em; height: 1.15em; flex: none; }
.nav__links .nav__ig { display: inline-flex; align-items: center; gap: 5px; }
.ig-more { text-align: center; margin: -22px 0 34px; }
.ig-more a {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  padding: 8px 18px; border: 3px solid var(--ink); border-radius: 999px; background: #fff;
  font-weight: 700; box-shadow: 0 4px 0 var(--ink); transition: transform .12s, box-shadow .12s;
}
.ig-more a:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--ink); }
.ig-more .ig-icon { color: #d62976; }
.ig-more b { color: var(--red); }
.footer__ig .ig-icon { vertical-align: -0.2em; margin-right: 4px; }
.footer__ig { color: var(--mustard); font-weight: 700; text-decoration: none; }
.footer__ig:hover { text-decoration: underline; }

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - 60px);
  min-height: calc(100svh - 60px);
  display: grid; place-items: center;
  padding: 90px 0 110px;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
.hero__bg {
  position: absolute; inset: 0; z-index: -2;
  background-size: cover; background-position: center 40%;
  transform: scale(1.05);
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(29, 42, 91, .35), rgba(20, 16, 12, .85) 75%),
    linear-gradient(180deg, rgba(20, 16, 12, .2), rgba(20, 16, 12, .75));
}
.hero__inner { text-align: center; padding: 0 20px; max-width: 960px; }
.hero__kicker {
  display: inline-block; margin: 0 0 18px;
  font-family: var(--font-hand); font-size: clamp(.9rem, 2.2vw, 1.15rem);
  color: var(--mustard); transform: rotate(-2deg);
}
.hero__title { margin: 0; line-height: 1; display: grid; justify-items: center; gap: 6px; }
.hero__edition {
  font-size: clamp(1.1rem, 3vw, 1.6rem); font-weight: 900; letter-spacing: .4em;
  background: var(--red); padding: 6px 10px 6px 18px; border: 3px solid #fff; border-radius: 8px;
  transform: rotate(-3deg);
}
.hero__brand { font-size: clamp(2.6rem, 9vw, 5.6rem); font-weight: 900; letter-spacing: .12em; text-shadow: 0 5px 0 rgba(0, 0, 0, .35); }
.hero__name {
  font-family: "Bungee Shade", var(--font-display);
  font-size: clamp(3rem, 12vw, 7.6rem);
  color: var(--mustard);
  text-shadow: 0 6px 0 var(--red-dark);
  letter-spacing: .02em;
}
.hero__name em { font-family: var(--font-zh); font-style: normal; font-weight: 900; color: #fff; text-shadow: 0 6px 0 var(--red-dark); }
.hero__sub { font-size: clamp(1rem, 2.6vw, 1.35rem); font-weight: 700; margin: 18px 0 26px; opacity: .95; }
.hero__meta { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 30px; }
.tag {
  display: grid; justify-items: center; line-height: 1.25;
  padding: 12px 22px; border-radius: 14px;
  background: var(--cream); color: var(--ink);
  border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink);
}
.tag small { font-size: .8rem; color: var(--muted); font-weight: 700; }
.tag b { font-family: var(--font-display); font-weight: 400; font-size: 1.5rem; }
.tag span { font-size: .9rem; font-weight: 700; }
.tag--deadline b { font-family: var(--font-zh); font-weight: 900; font-size: 1.3rem; }
.tag--deadline span { color: var(--red); }
.tag--date { transform: rotate(-2deg); }
.tag--deadline { transform: rotate(1.5deg); }
.hero__actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.sticker {
  position: absolute; right: max(4vw, 16px); bottom: 70px;
  width: 132px; height: 132px; border-radius: 50%;
  display: grid; place-content: center; text-align: center;
  background: var(--mustard); color: var(--ink);
  border: 4px dashed var(--ink);
  font-weight: 900; line-height: 1.1; font-size: .95rem;
  transform: rotate(12deg);
  box-shadow: 0 8px 0 rgba(0, 0, 0, .3);
  animation: wobble 3.5s ease-in-out infinite;
}
.sticker b { font-family: var(--font-display); font-weight: 400; font-size: 1.9rem; color: var(--red); }
@keyframes wobble { 0%, 100% { transform: rotate(12deg) scale(1); } 50% { transform: rotate(4deg) scale(1.06); } }
@media (max-width: 640px) { .sticker { width: 104px; height: 104px; font-size: .8rem; bottom: 18px; right: 12px; } .sticker b { font-size: 1.45rem; } }

/* string lights */
.lights {
  position: absolute; top: 0; left: -5%; right: -5%; height: 90px; z-index: 0;
  background:
    radial-gradient(circle at 50% 100%, transparent 0 0) no-repeat;
}
.lights::before {
  content: ""; position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='90' viewBox='0 0 240 90'%3E%3Cpath d='M0 8 Q120 70 240 8' fill='none' stroke='%23222' stroke-width='2'/%3E%3Cg%3E%3Ccircle cx='30' cy='30' r='6' fill='%23ffd76a'/%3E%3Ccircle cx='75' cy='46' r='6' fill='%23ff8a5c'/%3E%3Ccircle cx='120' cy='51' r='6' fill='%23ffd76a'/%3E%3Ccircle cx='165' cy='46' r='6' fill='%2382d3ff'/%3E%3Ccircle cx='210' cy='30' r='6' fill='%23ffd76a'/%3E%3C/g%3E%3C/svg%3E") repeat-x;
  filter: drop-shadow(0 0 6px rgba(255, 215, 106, .9));
  animation: twinkle 2.4s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .75; } to { opacity: 1; } }

/* ---------- Perks ---------- */
.perks { background: var(--cream); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.perks::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: repeating-linear-gradient(45deg, transparent 0 22px, rgba(215, 38, 61, .06) 22px 44px);
}
.perks__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px; position: relative; }
.ticket {
  display: grid; grid-template-columns: 74px 1fr;
  background: #fff; border: 3px solid var(--ink); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform .2s;
}
.ticket:hover { transform: rotate(-1deg) translateY(-4px); }
.ticket__stub {
  display: grid; place-content: center; text-align: center;
  writing-mode: horizontal-tb;
  font-weight: 900; font-size: 1.1rem; line-height: 1.3; color: #fff;
  border-right: 3px dashed var(--ink);
}
.ticket--red .ticket__stub { background: var(--red); }
.ticket--mustard .ticket__stub { background: var(--mustard); color: var(--ink); }
.ticket__body { padding: 22px 24px 24px; }
.ticket__label { margin: 0; font-weight: 700; color: var(--muted); font-size: .9rem; }
.ticket__value { margin: 2px 0 6px; display: flex; align-items: baseline; gap: 8px; }
.ticket__value span { font-weight: 700; }
.ticket__value b { font-family: var(--font-display); font-weight: 400; font-size: clamp(2.2rem, 5vw, 3rem); color: var(--red); line-height: 1.1; }
.ticket--mustard .ticket__value b { font-family: var(--font-zh); font-weight: 900; color: var(--ink); background: linear-gradient(transparent 60%, var(--mustard) 60%); }
.ticket h3 { margin: 0 0 8px; font-size: 1.25rem; }
.ticket p:last-child { margin: 0; color: var(--muted); }
.perks__note { text-align: center; margin: 28px 0 0; color: var(--muted); font-size: .92rem; position: relative; }

/* ---------- Info ---------- */
.info__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; }
.info__card {
  background: #fff; border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 5px 0 var(--ink);
}
.info__card:nth-child(odd) { transform: rotate(-.8deg); }
.info__card:nth-child(even) { transform: rotate(.8deg); }
.info__icon { font-size: 2rem; }
.info__card h3 { margin: 6px 0 4px; font-size: 1.05rem; color: var(--red); }
.info__card p { margin: 0; }

/* try-out callout */
.tryout {
  margin-top: 32px; display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center;
  background: var(--grass); color: #fff; border: 3px solid var(--ink); border-radius: var(--radius);
  padding: 22px 26px; box-shadow: 0 6px 0 var(--ink);
  background-image: repeating-linear-gradient(90deg, rgba(255, 255, 255, .05) 0 40px, transparent 40px 80px);
}
.tryout__badge {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-content: center; text-align: center;
  background: var(--mustard); color: var(--ink); border: 3px dashed var(--ink);
  font-weight: 900; font-size: 1.05rem; line-height: 1.2; transform: rotate(-8deg);
}
.tryout h3 { margin: 0 0 6px; font-size: 1.25rem; }
.tryout p { margin: 0; }
.tryout b { color: var(--mustard); }
.tryout__contact { margin-top: 8px !important; display: inline-block; background: rgba(0, 0, 0, .22); padding: 6px 14px; border-radius: 999px; }
@media (max-width: 640px) {
  .tryout { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 18px; }
  .tryout__badge { width: 80px; height: 80px; font-size: .95rem; }
  .tryout__contact { border-radius: 12px; }
}

/* ---------- About ---------- */
.about {
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .03) 0 60px, transparent 60px 120px),
    linear-gradient(180deg, var(--grass), var(--grass-dark));
  color: #fff;
}
.about__lead {
  max-width: 820px; margin: 0 auto 50px; font-size: 1.08rem;
  background: rgba(0, 0, 0, .18); padding: 26px 30px; border-radius: var(--radius);
  border: 2px dashed rgba(255, 246, 229, .45);
}
.about__lead p { margin: 0 0 12px; }
.about__lead p:last-child { margin: 0; }
.about__lead b { color: var(--mustard); }

.timeline {
  list-style: none; padding: 0; margin: 0 0 60px;
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px;
  position: relative;
}
.timeline::before {
  content: ""; position: absolute; left: 0; right: 0; top: 26px; height: 4px;
  background: repeating-linear-gradient(90deg, var(--mustard) 0 14px, transparent 14px 24px);
}
.timeline li { position: relative; padding-top: 4px; }
.timeline__year {
  position: relative; display: inline-block; z-index: 1;
  font-family: var(--font-display); background: var(--wood); color: var(--ink);
  padding: 8px 14px; border: 3px solid var(--ink); border-radius: 10px; font-size: 1rem;
}
.timeline li:nth-child(even) .timeline__year { background: var(--mustard); }
.timeline p { margin: 14px 0 0; font-size: .95rem; opacity: .95; }
@media (max-width: 860px) {
  .timeline { grid-template-columns: 1fr; gap: 22px; padding-left: 10px; }
  .timeline::before { left: 34px; right: auto; top: 0; bottom: 0; width: 4px; height: auto;
    background: repeating-linear-gradient(180deg, var(--mustard) 0 14px, transparent 14px 24px); }
  .timeline li { display: grid; grid-template-columns: 90px 1fr; gap: 14px; align-items: start; }
  .timeline p { margin: 4px 0 0; }
}

.about__h3 { text-align: center; font-size: 1.35rem; margin: 0 0 22px; }
.lingo { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.lingo__card {
  background: var(--cream); color: var(--ink); border-radius: 14px; border: 3px solid var(--ink);
  padding: 14px 16px; display: grid; gap: 2px; box-shadow: 0 4px 0 rgba(0, 0, 0, .35);
  transition: transform .15s;
}
.lingo__card:hover { transform: translateY(-3px) rotate(-1deg); }
.lingo__card b { font-family: var(--font-hand); font-weight: 400; font-size: 1.3rem; color: var(--red); }
.lingo__card span { font-size: .92rem; }

/* ---------- Gallery ---------- */
.gallery { background: var(--paper); }
.gallery__grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; grid-template-rows: auto auto; gap: 26px; align-items: start; }
.polaroid {
  margin: 0; background: #fff; padding: 12px 12px 8px; border-radius: 6px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, .18); transition: transform .25s;
}
.polaroid img, .polaroid video { width: 100%; object-fit: cover; border-radius: 3px; background: #ddd; }
.polaroid figcaption { font-family: var(--font-hand), var(--font-zh); text-align: center; padding: 8px 4px 2px; font-size: 1rem; }
.polaroid:hover { transform: rotate(0) scale(1.03); z-index: 2; }
.p1 { grid-column: 1 / 3; transform: rotate(-1.5deg); }
.p1 img { aspect-ratio: 3 / 2; }
.p2 { grid-column: 3; grid-row: 1 / 3; transform: rotate(2deg); }
.p2 img { aspect-ratio: 3 / 4; }
.p3 { grid-column: 1; transform: rotate(1.5deg); }
.p3 img { aspect-ratio: 3 / 2; }
.p4 { grid-column: 2; transform: rotate(-2deg); }
.p4 video { aspect-ratio: 9 / 16; max-height: 420px; }
@media (max-width: 760px) {
  .gallery__grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .p1 { grid-column: 1 / 3; }
  .p2 { grid-column: 1; grid-row: auto; }
  .p3 { grid-column: 1 / 3; }
  .p4 { grid-column: 2; grid-row: 2; }
  .p4 video { max-height: none; aspect-ratio: 3 / 4; }
}

/* ---------- Rules ---------- */
.rules { background: var(--cream); border-top: 3px solid var(--ink); }
.rules__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: start; }
@media (max-width: 900px) { .rules__grid { grid-template-columns: 1fr; } }
.rules__court svg { width: 100%; height: auto; border: 3px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); }
.specs { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.specs li { background: #fff; border: 2px solid var(--ink); border-radius: 12px; padding: 10px 14px; }
.specs b { display: inline-block; min-width: 3.5em; color: var(--red); margin-right: 6px; }

.pts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 22px; }
.pts__item {
  border: 3px solid var(--ink); border-radius: var(--radius); padding: 14px 10px; text-align: center;
  display: grid; gap: 4px; box-shadow: 0 5px 0 var(--ink); background: #fff;
}
.pts__item b { font-family: var(--font-display); font-weight: 400; font-size: 3rem; line-height: 1; }
.pts__item span { font-weight: 700; line-height: 1.35; }
.pts__item small { display: block; font-weight: 500; font-size: .78rem; color: var(--muted); }
.pts__item--3 { background: var(--red); color: #fff; }
.pts__item--3 small { color: #ffe1e5; }
.pts__item--1 { background: var(--wood); }

.cancel { background: #fff; border: 3px solid var(--ink); border-radius: var(--radius); padding: 22px 24px; box-shadow: var(--shadow); }
.cancel h3 { margin: 0 0 6px; font-size: 1.2rem; }
.cancel p { margin: 0 0 12px; }
.cancel__eg { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin: 12px 0; }
.cancel__side { border-radius: 14px; padding: 12px; text-align: center; color: #fff; }
.cancel__side small { font-weight: 700; opacity: .85; }
.cancel__side p { margin: 2px 0; font-size: .9rem; }
.cancel__side b { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; }
.cancel__side--red { background: var(--red); }
.cancel__side--blue { background: var(--blue); }
.cancel__vs { font-family: var(--font-display); font-size: 1.2rem; }
.cancel__result { text-align: center; font-size: 1.1rem; background: var(--cream); border-radius: 12px; padding: 10px; }
.cancel__result b { color: var(--red); }
.cancel__tip { margin: 0 !important; font-size: .95rem; color: var(--muted); }

/* ---------- Game ---------- */
.game {
  background:
    radial-gradient(ellipse at top, rgba(244, 180, 0, .18), transparent 60%),
    linear-gradient(180deg, #1c2340, #12172b);
  color: #fff;
}
.game__intro { max-width: 760px; margin: -18px auto 30px; text-align: center; opacity: .9; }
.game__intro b { color: var(--mustard); }
.game__panel {
  background: #fffaf0; color: var(--ink); border: 4px solid var(--ink); border-radius: 22px;
  padding: 16px; box-shadow: 0 10px 0 #000, 0 30px 60px rgba(0, 0, 0, .4);
}
.game__controls { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; margin-bottom: 14px; }
.seg { display: inline-flex; border: 3px solid var(--ink); border-radius: 999px; overflow: hidden; }
.seg__btn { border: 0; background: #fff; padding: 8px 16px; font: 700 .95rem var(--font-zh); cursor: pointer; }
.seg__btn + .seg__btn { border-left: 3px solid var(--ink); }
.seg__btn.is-active { background: var(--ink); color: #fff; }
.sel { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .95rem; }
.sel select { font: 500 .95rem var(--font-zh); padding: 6px 10px; border: 2px solid var(--ink); border-radius: 10px; background: #fff; }
#g-restart { margin-left: auto; }

.board-score {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: stretch; margin-bottom: 12px;
}
.bs { border-radius: 14px; color: #fff; padding: 8px 14px; display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 12px; border: 3px solid var(--ink); }
.bs--red { background: var(--red); }
.bs--blue { background: var(--blue); }
.bs__name { font-weight: 900; }
.bs__total { font-family: var(--font-display); font-weight: 400; font-size: 2.3rem; line-height: 1; grid-row: 1 / 3; grid-column: 2; text-align: right; }
.bs__bags { display: flex; gap: 4px; min-height: 14px; }
.bs__bags i { width: 14px; height: 14px; border-radius: 4px; background: rgba(255, 255, 255, .95); border: 2px solid rgba(0, 0, 0, .35); }
.bs__bags i.used { background: transparent; border-color: rgba(255, 255, 255, .45); }
.bs.is-turn { box-shadow: 0 0 0 4px var(--mustard); }
.bs__mid { display: grid; place-content: center; text-align: center; font-weight: 900; padding: 0 6px; line-height: 1.3; white-space: nowrap; }
.bs__mid small { font-weight: 700; color: var(--muted); }

.stage { position: relative; border-radius: 14px; overflow: hidden; border: 3px solid var(--ink); background: #7ec4ef; }
#g-canvas { display: block; width: 100%; aspect-ratio: 16 / 10; touch-action: none; cursor: grab; }
#g-canvas.is-aiming { cursor: grabbing; }
@media (max-width: 640px) { #g-canvas { aspect-ratio: 3 / 4; } }
.overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18, 23, 43, .55); padding: 16px; }
.overlay[hidden] { display: none; }
.overlay__card {
  max-height: 100%; overflow-y: auto;
  background: var(--paper); border: 4px solid var(--ink); border-radius: 18px; padding: 20px 22px;
  max-width: 440px; width: 100%; text-align: center; box-shadow: 0 8px 0 var(--ink);
  animation: pop .25s ease-out;
}
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.overlay__card h3 { margin: 0 0 8px; font-size: 1.4rem; }
.overlay__card p { margin: 6px 0; }
.ov-tbl { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: .95rem; }
.ov-tbl th, .ov-tbl td { padding: 6px; border-bottom: 2px dashed #e3d6c3; }
.ov-tbl th { text-align: left; }
.ov-red { color: var(--red); }
.ov-blue { color: var(--blue); }
.ov-big { font-size: 1.15rem; font-weight: 900; background: var(--cream); border-radius: 10px; padding: 8px; }
.overlay__card .btn { margin-top: 10px; }

.game__log { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; min-height: 30px; }
.game__log li { font-size: .85rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; border: 2px solid var(--ink); background: #fff; }
.game__log li.p0 { border-color: var(--red); color: var(--red); }
.game__log li.p1 { border-color: var(--blue); color: var(--blue); }

@media (max-width: 640px) {
  .game__panel { padding: 10px; }
  .overlay { padding: 8px; }
  .overlay__card { padding: 14px 14px; font-size: .9rem; }
  .overlay__card h3 { font-size: 1.15rem; margin-bottom: 4px; }
  .overlay__card p { margin: 4px 0; }
  .ov-tbl { margin: 6px 0; font-size: .85rem; }
  .ov-tbl th, .ov-tbl td { padding: 4px; }
  .ov-big { font-size: 1rem; padding: 6px; }
  .bs__mid { font-size: .85rem; padding: 0 2px; }
  #g-restart { margin-left: 0; }
  .bs { padding: 6px 10px; }
  .bs__total { font-size: 1.8rem; }
}

/* ---------- Register ---------- */
.register {
  background:
    linear-gradient(rgba(255, 250, 240, .93), rgba(255, 250, 240, .93)),
    repeating-linear-gradient(0deg, var(--wood) 0 38px, #dfb979 38px 40px);
}
.register__lead { text-align: center; margin: -22px 0 28px; }
.register__lead b { color: var(--red); }
#countdown2 { font-weight: 900; }
.form {
  background: #fff; border: 4px solid var(--ink); border-radius: 22px; padding: 30px;
  box-shadow: var(--shadow);
  position: relative;
}
.form::before {
  content: "ENTRY FORM"; position: absolute; top: -18px; left: 24px;
  font-family: var(--font-display); background: var(--mustard); padding: 4px 12px;
  border: 3px solid var(--ink); border-radius: 8px; font-size: .9rem; transform: rotate(-3deg);
}
.field { margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 900; margin-bottom: 8px; padding: 0; }
.field i { color: var(--red); font-style: normal; }
.field .opt { color: var(--muted); font-weight: 500; font-size: .9rem; }
.field input[type=text], .field textarea {
  width: 100%; font: 500 1rem var(--font-zh); padding: 12px 14px;
  border: 3px solid var(--ink); border-radius: 12px; background: var(--paper);
  transition: box-shadow .15s, background .15s;
}
.field input:focus, .field textarea:focus { outline: none; background: #fff; box-shadow: 0 0 0 4px rgba(244, 180, 0, .55); }
.field textarea { resize: vertical; min-height: 110px; }
.field.has-error input, .field.has-error textarea, .field.has-error .choice__opt span { border-color: var(--red); }
.field__err { margin: 6px 0 0; color: var(--red); font-weight: 700; font-size: .9rem; min-height: 0; }
.field__err:empty { display: none; }
.field__hint { margin: 4px 0 0; text-align: right; color: var(--muted); font-size: .85rem; }
.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice__opt { position: relative; margin: 0 !important; cursor: pointer; }
.choice__opt input { position: absolute; opacity: 0; pointer-events: none; }
.choice__opt span {
  display: block; text-align: center; padding: 14px; font-weight: 900; font-size: 1.1rem;
  border: 3px solid var(--ink); border-radius: 14px; background: var(--paper);
  transition: background .15s, transform .15s;
}
.choice__opt:hover span { transform: translateY(-2px); }
.choice__opt input:checked + span { background: var(--mustard); box-shadow: 0 4px 0 var(--ink); }
.choice__opt input:focus-visible + span { box-shadow: 0 0 0 4px rgba(215, 38, 61, .45); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form__small { text-align: center; color: var(--muted); font-size: .88rem; margin: 12px 0 0; }
.form__msg { margin-top: 18px; padding: 16px 18px; border-radius: 14px; border: 3px solid var(--ink); font-weight: 700; }
.form__msg.ok { background: #e7f6e3; }
.form__msg.err { background: #ffe7ea; }
.form__msg.warn { background: #fff4d1; }
.form.is-closed { opacity: .65; }

/* ---------- Slogan ---------- */
.slogan {
  text-align: center; color: #fff; overflow: hidden; padding: 120px 0 100px;
  background:
    radial-gradient(ellipse at 50% 120%, rgba(244, 180, 0, .35), transparent 60%),
    linear-gradient(180deg, var(--red), var(--red-dark));
  border-top: 4px solid var(--ink);
}
.slogan__pre { margin: 0 0 10px; font-weight: 700; letter-spacing: .08em; opacity: .9; }
.slogan__title {
  margin: 0 0 34px; font-weight: 900; line-height: 1.15;
  font-size: clamp(2.6rem, 9vw, 6rem); text-shadow: 0 6px 0 rgba(0, 0, 0, .3);
}
.slogan__come {
  font-family: var(--font-hand); font-weight: 400; color: var(--mustard);
  display: inline-block; transform: rotate(-6deg); margin-right: .12em; font-size: 1.15em;
}
.slogan__zh { background: linear-gradient(transparent 72%, rgba(244, 180, 0, .45) 72%); padding: 0 .08em; }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--cream); text-align: center; padding: 34px 20px; }
.footer p { margin: 4px 0; }
.footer__small { opacity: .7; font-size: .9rem; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

@media (max-width: 640px) {
  section { padding: 64px 0; }
  .form { padding: 24px 18px; }
  .ticket { grid-template-columns: 58px 1fr; }
  .ticket__body { padding: 18px; }
  .pts__item b { font-size: 2.3rem; }
  .wrap { padding: 0 16px; }
}
