@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 400; font-style: normal; font-display: swap; src: url(/fonts/atkinson-400-latin.woff2) format("woff2"); }
@font-face { font-family: "Atkinson Hyperlegible"; font-weight: 700; font-style: normal; font-display: swap; src: url(/fonts/atkinson-700-latin.woff2) format("woff2"); }
@font-face { font-family: "Chakra Petch"; font-weight: 600; font-style: normal; font-display: swap; src: url(/fonts/chakra-600-latin.woff2) format("woff2"); }

/* Dark by design: no light mode. */
:root {
  --night: #161A3A;
  --panel: #20264F;
  --field: #161A3A;
  --line: #747CC0;      /* field borders, >= 3:1 on panel */
  --signal: #FF5D8F;
  --signal-deep: #B8345F;
  --wave: #4FE3E0;
  --gold: #FFB23E;
  --text: #F2F3FF;
  --muted: #A9AEDB;
  --error: #FFA3BD;
  --radius: 12px;
  --display: "Chakra Petch", "Segoe UI", system-ui, sans-serif;
  --body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --cjk: "Hiragino Sans", "Yu Gothic UI", "Meiryo", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans CJK JP", "Noto Sans CJK KR", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night);
  background-image:
    radial-gradient(900px 600px at 15% 0%, rgba(79, 227, 224, .07), transparent 60%),
    radial-gradient(700px 500px at 100% 30%, rgba(255, 93, 143, .06), transparent 60%);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
  min-height: 100vh;
}
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
a { color: var(--wave); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--wave); outline-offset: 2px; }

.preview-banner {
  position: sticky; top: 0; z-index: 50; padding: 10px 16px; text-align: center; font-weight: 700;
  background: var(--gold); color: var(--night);
}

/* Header */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  max-width: 1240px; margin: 0 auto; padding: 14px 16px;
}
.brand img { display: block; height: 28px; width: auto; }
.switcher { position: relative; }
.switcher summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 0 12px; border: 1px solid #3A4280; border-radius: 10px;
  color: var(--text); font-size: 15px; background: rgba(32, 38, 79, .6);
}
.switcher summary::-webkit-details-marker { display: none; }
.switcher[open] .chev { transform: rotate(180deg); }
.switcher ul {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; margin: 0; padding: 6px;
  list-style: none; background: var(--panel); border: 1px solid #3A4280; border-radius: 10px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .35); min-width: 160px;
}
.switcher li a {
  display: block; padding: 10px 12px; border-radius: 7px; color: var(--text); text-decoration: none;
}
.switcher li a:hover { background: #2C3366; }
.switcher li a[aria-current="true"] { color: var(--wave); }

/* Layout */
.layout {
  max-width: 1240px; margin: 0 auto; padding: 8px 16px 48px;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 48px; align-items: start;
}
.hero { position: sticky; top: 24px; }
.stage { position: relative; width: 100%; aspect-ratio: 640 / 560; }
.stage svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }

h1 {
  font-family: var(--display); font-weight: 600; font-size: clamp(30px, 3.4vw, 42px);
  line-height: 1.12; margin: 8px 0 12px; letter-spacing: 0; text-wrap: balance;
}
h1:focus { outline: none; }
.intro { color: var(--muted); margin: 0 0 24px; max-width: 60ch; }
.footer-note { color: var(--muted); font-size: 15px; margin: 16px 2px 0; }

/* Panel: stream overlay look */
.panel {
  background: var(--panel); border-radius: var(--radius); border-top: 4px solid var(--signal);
  padding: 24px; box-shadow: 0 18px 50px rgba(5, 6, 25, .45), inset 0 0 0 1px rgba(169, 174, 219, .08);
}

/* Form */
.field { margin: 0 0 20px; border: 0; padding: 0; min-width: 0; }
label, legend { display: block; font-weight: 700; margin: 0 0 6px; padding: 0; }
.opt { font-weight: 400; color: var(--muted); font-size: 15px; }
.opt::before { content: "("; } .opt::after { content: ")"; }
.help { color: var(--muted); margin: -2px 0 8px; font-size: 15px; }
input[type="text"], input[type="email"], select {
  width: 100%; min-height: 48px; padding: 10px 14px; font: inherit; color: var(--text);
  background: var(--field); border: 1.5px solid var(--line); border-radius: 9px; appearance: none;
}
input::placeholder { color: #8C92C4; }
input[type="text"]:focus-visible, input[type="email"]:focus-visible, select:focus-visible {
  outline: 3px solid var(--wave); outline-offset: 1px; border-color: var(--wave);
}
.select-wrap { position: relative; }
.select-wrap::after {
  content: ""; position: absolute; right: 16px; top: 50%; width: 9px; height: 9px; pointer-events: none;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg);
}
select { padding-right: 40px; cursor: pointer; }
select option { background: var(--panel); color: var(--text); }
.field.invalid input[type="text"], .field.invalid input[type="email"], .field.invalid select { border-color: var(--error); }
.err { color: var(--error); font-size: 15px; margin: 6px 0 0; min-height: 0; }
.err:empty { display: none; }
.err::before { content: "! "; font-weight: 700; }
.err:empty::before { content: none; }

.checks { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.check {
  display: flex; align-items: center; gap: 10px; font-weight: 400; margin: 0; min-height: 44px;
  padding: 8px 12px; border: 1.5px solid #3A4280; border-radius: 9px; cursor: pointer;
}
.check input { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--wave); }
.check:has(input:checked) { border-color: var(--wave); background: rgba(79, 227, 224, .08); }
.check:has(input:focus-visible) { outline: 3px solid var(--wave); outline-offset: 2px; }
.check input:focus-visible { outline: none; }
.consent { align-items: flex-start; border: 0; padding: 4px 0; }
.consent input { margin-top: 2px; }
.field.invalid .consent span { color: var(--text); }

.segmented { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.segmented label { margin: 0; font-weight: 400; }
.segmented input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segmented span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border-radius: 9px;
  border: 1.5px solid var(--line); cursor: pointer; text-align: center; padding: 6px;
}
.segmented input:checked + span { border-color: var(--wave); background: rgba(79, 227, 224, .12); font-weight: 700; }
.segmented input:focus-visible + span { outline: 3px solid var(--wave); outline-offset: 2px; }
.field.invalid .segmented span { border-color: var(--error); }

.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { min-height: 65px; }

/* Game action button */
.action {
  width: 100%; min-height: 56px; margin-top: 4px; border: 0; border-radius: 10px; cursor: pointer;
  font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--night);
  background: linear-gradient(180deg, #FF77A2 0%, var(--signal) 100%);
  box-shadow: 0 5px 0 var(--signal-deep), 0 10px 22px rgba(255, 93, 143, .25);
  transform: translateY(0); transition: transform .08s ease, box-shadow .08s ease, filter .15s;
}
.action:hover { filter: brightness(1.05); }
.action:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--signal-deep), 0 4px 10px rgba(255, 93, 143, .2); }
.action:focus-visible { outline: 3px solid var(--wave); outline-offset: 4px; }
.action[disabled] { cursor: progress; filter: saturate(.6) brightness(.9); }
.form-err { margin-top: 14px; }

/* Thank-you view */
.toast {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px; margin: 8px 0 18px;
  background: #2A2A4F; border: 1.5px solid var(--gold); border-radius: 12px;
  font-family: var(--display); font-weight: 600; font-size: 20px; color: var(--gold);
  box-shadow: 0 0 0 4px rgba(255, 178, 62, .08), 0 14px 30px rgba(0, 0, 0, .35);
  animation: toast-in .55s cubic-bezier(.2, .9, .3, 1.2) both;
}
@keyframes toast-in { from { transform: translateY(-36px); opacity: 0; } to { transform: none; opacity: 1; } }
.steps { list-style: none; margin: 0; padding: 22px 24px; display: grid; gap: 18px; }
.steps li { display: grid; grid-template-columns: 36px 1fr; gap: 14px; align-items: start; }
.steps p { margin: 4px 0 0; }
.num {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 8px;
  border: 2px solid var(--wave); color: var(--wave); font-family: var(--display); font-weight: 600;
}
.steps a { word-break: break-word; }
.thanks-in .steps { animation: steps-in .5s .35s ease both; }
@keyframes steps-in { from { opacity: 0; } to { opacity: 1; } }

/* Hero bubbles */
.bubbles { position: absolute; inset: 0; pointer-events: none; }
.bubble {
  position: absolute; max-width: 46%; padding: 8px 12px 9px; border-radius: 12px 12px 12px 4px;
  background: rgba(15, 18, 44, .92); border: 1.5px solid rgba(79, 227, 224, .55);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .35); font-size: 15px; line-height: 1.3; white-space: nowrap;
  transform: translate(-12px, calc(-100% - 12px)); opacity: 0; transition: opacity .45s ease, transform .45s ease;
}
.bubble.flip { border-radius: 12px 12px 4px 12px; transform: translate(calc(-100% + 12px), calc(-100% - 12px)); }
.bubble.center { border-radius: 12px; transform: translate(-50%, calc(-100% - 12px)); }
.bubble.on { opacity: 1; }
.bubble.pop { animation: pop .42s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes pop { 0% { scale: .6; } 100% { scale: 1; } }
.bubble .who { display: block; font-size: 12.5px; font-weight: 700; color: var(--wave); margin-bottom: 2px; }
.bubble .msg { color: var(--text); }
.bubble [lang="ja"], .bubble [lang="ko"] { font-family: var(--body), var(--cjk); }

#live-dot { animation: live 1.6s ease-in-out infinite; transform-origin: 52px 60px; }
@keyframes live { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
#wave rect { transform-box: fill-box; transform-origin: center; animation: wave 1.1s ease-in-out infinite; animation-play-state: paused; }
#wave rect:nth-child(2) { animation-delay: -.2s; } #wave rect:nth-child(3) { animation-delay: -.45s; }
#wave rect:nth-child(4) { animation-delay: -.7s; } #wave rect:nth-child(5) { animation-delay: -.9s; }
.playing #wave rect { animation-play-state: running; }
@keyframes wave { 0%, 100% { transform: scaleY(.45); } 50% { transform: scaleY(1.15); } }
.arc { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.arc.go { transition: stroke-dashoffset 1.1s cubic-bezier(.45, .05, .35, 1); stroke-dashoffset: 0; }
.arc.fade { transition: opacity 1.2s ease; opacity: 0; }
.pin { transform-box: fill-box; transform-origin: center; }
.pin.on { animation: ping 1.4s ease-out; }
@keyframes ping { 0% { scale: .2; opacity: 1; } 100% { scale: 1.8; opacity: .0; } }

/* Mobile */
@media (max-width: 860px) {
  body { font-size: 16.5px; }
  .layout { grid-template-columns: 1fr; gap: 6px; padding-top: 0; }
  .hero { position: relative; top: 0; }
  .stage { aspect-ratio: 640 / 250; margin: 0 -16px; width: calc(100% + 32px); overflow: hidden; }
  .stage svg { overflow: hidden; }
  .bubble { font-size: 14px; max-width: 62%; }
  .bubble.center { transform: translate(-50%, calc(-100% - 10px)); }
  h1 { font-size: 28px; margin-top: 4px; }
  .intro { margin-bottom: 18px; }
  .panel { padding: 18px 16px; }
  .checks { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .row2 { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .arc { stroke-dashoffset: 0; }
}
