/* ============================================================
   Street Fighter II Turbo — 3rd Annual Tournament
   Shared by the public comp page and the ticket-holder entry page.
   Reference: the 1993 Super Famicom magazine ad, the arcade title
   screen and the Hyper Fighting marquee. Cobalt, logo pink-to-yellow,
   marquee orange. No pixel fonts on purpose.
   ============================================================ */
:root {
  --navy: #05062e;
  --navy-2: #0a0c45;
  --cobalt: #1c2fc0;
  --sky: #3d5bf0;
  --pink: #e5176a;
  --yellow: #ffe500;
  --orange: #f58220;
  --red: #f0291c;
  --white: #ffffff;
  --dim: rgba(255, 255, 255, 0.66);
  --line: rgba(255, 255, 255, 0.16);
  --logo-grad: linear-gradient(180deg, #e5176a 0%, #ef6a8a 38%, #ffe500 78%);
  --marquee: linear-gradient(180deg, #ffe500 0%, #ffc21a 45%, #f58220 100%);
  --display: 'Anton', 'Impact', sans-serif;
  --gothic: 'Dela Gothic One', 'Hiragino Kaku Gothic ProN', sans-serif;
  --body: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN', 'Helvetica Neue', sans-serif;
  --mono: 'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--navy); }

body {
  background: var(--navy);
  color: var(--white);
  font-family: var(--body);
  font-weight: 500;
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* print grain over everything */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 100;
  opacity: 0.09;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Top bar ---------- */
.topbar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem clamp(1rem, 4vw, 3rem);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.topbar .logo { height: 18px; display: block; }
.topbar nav { display: flex; align-items: center; gap: 1.4rem; }
.topbar a { text-decoration: none; color: var(--dim); transition: color 0.2s; }
.topbar a:hover { color: var(--white); }
.status { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--dim); }
.status .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 10px var(--yellow);
}
.status.error .dot { background: var(--red); box-shadow: 0 0 10px var(--red); }

/* ---------- Hero: the magazine ad ---------- */
.hero {
  position: relative;
  min-height: min(100svh, 1040px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 5.5rem clamp(1rem, 4vw, 3rem) 4.5rem;
  overflow: hidden;
  isolation: isolate;
  background:
    radial-gradient(70% 46% at 50% 30%, rgba(90, 120, 255, 0.55) 0%, transparent 70%),
    linear-gradient(180deg, #2a41d8 0%, #1a23a6 34%, #0b0d5c 70%, var(--navy) 100%);
}
.hero.compact { min-height: 0; padding-bottom: 3.5rem; }

/* halftone, as if printed */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: radial-gradient(rgba(255, 255, 255, 0.5) 1px, transparent 1.4px);
  background-size: 7px 7px;
  opacity: 0.16;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
          mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}

/* vertical Japanese copy down each edge */
.tategaki {
  position: absolute;
  top: 6rem;
  writing-mode: vertical-rl;
  font-family: var(--body);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.4vw, 1.05rem);
  letter-spacing: 0.5em;
  color: var(--white);
  white-space: nowrap;
}
.tategaki.right { right: clamp(1rem, 4vw, 3rem); }
.tategaki.left { left: clamp(1rem, 4vw, 3rem); color: var(--dim); }
.tategaki::after {
  content: '';
  display: block;
  width: 1px;
  height: 5rem;
  margin: 1.2rem auto 0;
  background: linear-gradient(180deg, currentColor, transparent);
}

.eyebrow {
  font-family: var(--mono);
  font-size: clamp(0.62rem, 1.4vw, 0.78rem);
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--white);
  padding-left: 0.42em;
}

.logo-main {
  display: block;
  width: min(94vw, 760px);
  height: auto;
  margin: -1.2% auto -4.5%;
  filter: drop-shadow(0 18px 40px rgba(3, 4, 40, 0.55));
}
.hero.compact .logo-main { width: min(84vw, 470px); }

.hyper {
  position: relative;
  font-family: var(--body);
  font-weight: 900;
  font-size: clamp(0.8rem, 2.2vw, 1.25rem);
  letter-spacing: 0.62em;
  padding-left: 0.62em;
  text-transform: uppercase;
  color: var(--red);
  text-shadow: 2px 2px 0 #02031c;
}

/* the title plate, lifted from the cabinet marquee */
.plate {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5em;
  margin-top: clamp(1.4rem, 3vw, 2.2rem);
  padding: 0.16em 0.9em 0.2em 0.8em;
  font-family: var(--display);
  font-size: clamp(1.9rem, 6.4vw, 4.4rem);
  line-height: 1.12;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  background: var(--marquee);
  transform: skewX(-10deg);
  box-shadow: 6px 6px 0 #02031c;
  white-space: nowrap;
}
.plate .a { color: #1a44d6; text-shadow: 2px 2px 0 rgba(2, 3, 28, 0.9); }
.plate .b { color: var(--white); text-shadow: 2px 2px 0 rgba(2, 3, 28, 0.9); }
.hero.compact .plate { font-size: clamp(1.6rem, 5vw, 3rem); }

/* the ad's launch line: ◀12·12 開催決定▶ */
.jp-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.3em 1em;
  margin-top: clamp(1.4rem, 3vw, 2rem);
  font-family: var(--gothic);
  font-size: clamp(1.05rem, 3vw, 1.9rem);
  line-height: 1.2;
  color: var(--white);
  text-shadow: 2px 2px 0 #02031c;
}
.jp-line .date::before, .jp-line .date::after {
  display: inline-block;
  font-size: 0.6em;
  color: var(--red);
  text-shadow: none;
  vertical-align: 0.12em;
}
.jp-line .date::before { content: '◀'; margin-right: 0.3em; }
.jp-line .date::after { content: '▶'; margin-left: 0.3em; }

.meta {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  margin-top: clamp(1.8rem, 3.6vw, 2.6rem);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: rgba(5, 6, 46, 0.5);
}
.meta div {
  padding: 0.9rem clamp(0.9rem, 2.6vw, 2rem);
  font-family: var(--mono);
  font-size: clamp(0.62rem, 1.3vw, 0.74rem);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--yellow);
}
.meta div + div { border-left: 1px solid var(--line); }
.meta strong {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--body);
  font-weight: 900;
  font-size: clamp(0.95rem, 2vw, 1.2rem);
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--white);
}

/* ---------- Capacity gauge: slots left are health, taken ones are damage ---------- */
.gauge {
  width: min(100%, 760px);
  margin: clamp(1.8rem, 3.6vw, 2.6rem) auto 0;
}
.gauge-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(0.5rem, 1.6vw, 1rem);
}
.pips { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; height: clamp(14px, 2.4vw, 20px); padding: 2px; border: 2px solid var(--white); background: #02031c; }
.pips i { background: #d2161a; transition: background 0.4s; }
.pips i.on { background: linear-gradient(180deg, #fff8a0, #ffe500 50%, #f5b400); }
.pips.left { direction: rtl; }
.clock {
  min-width: 2.3em;
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 3.4rem);
  line-height: 1;
  color: var(--white);
  text-shadow: 3px 3px 0 #02031c;
}
.gauge-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 0.6rem;
  font-family: var(--mono);
  font-size: clamp(0.58rem, 1.3vw, 0.7rem);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--dim);
}
.gauge-labels b { color: var(--yellow); font-weight: 500; }

/* ---------- Buttons ---------- */
.cta-wrap { margin-top: clamp(1.8rem, 3.6vw, 2.6rem); display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.9em;
  padding: 1.05em 2em 1.05em 2.2em;
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.82rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  text-decoration: none;
  color: #05062e;
  background: var(--yellow);
  border: 0;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.2s;
  clip-path: polygon(0.8em 0, 100% 0, calc(100% - 0.8em) 100%, 0 100%);
}
.btn:hover { background: var(--pink); color: var(--white); transform: translateY(-2px); }
.btn:focus-visible { outline: 2px solid var(--white); outline-offset: 4px; }
.btn .jp { font-family: var(--body); font-weight: 900; letter-spacing: 0.1em; font-size: 1.15em; }
.fineprint { max-width: 34rem; font-size: 0.95rem; color: var(--white); opacity: 0.9; }

/* ---------- Sections ---------- */
main { position: relative; }
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(3.5rem, 8vw, 6.5rem) clamp(1rem, 4vw, 3rem) 0;
}
.section:last-of-type { padding-bottom: clamp(4rem, 8vw, 7rem); }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 1.1rem;
  margin-bottom: clamp(1.6rem, 3vw, 2.4rem);
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}
.section-head .kanji {
  font-family: var(--gothic);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  line-height: 1.1;
  color: var(--white);
}
.section-head .en {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--yellow);
}
.section-head .aside {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
  text-align: right;
}

/* ---------- How to enter ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1px solid var(--line); background: rgba(28, 47, 192, 0.12); }
.step { padding: clamp(1.4rem, 3vw, 2.2rem); position: relative; }
.step + .step { border-left: 1px solid var(--line); }
.step .num {
  display: inline-block;
  font-family: var(--gothic);
  font-size: clamp(2.6rem, 6vw, 4rem);
  line-height: 1.1;
  margin-bottom: 0.9rem;
  background: var(--logo-grad);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.step h3 { font-weight: 900; font-size: 1.25rem; line-height: 1.25; margin-bottom: 0.5rem; }
.step p { color: var(--dim); font-size: 0.98rem; }
.step a { color: var(--yellow); text-underline-offset: 3px; }

/* ---------- Roster: the select screen ---------- */
.select {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
}
.slot {
  position: relative;
  aspect-ratio: 5 / 6;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0.55rem;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--line);
  min-width: 0;
}
.slot .no {
  position: absolute;
  top: 0.45rem; left: 0.55rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  color: var(--dim);
}
.slot .glyph {
  position: absolute;
  right: -0.08em; top: -0.16em;
  font-family: var(--gothic);
  font-size: clamp(3rem, 7.4vw, 5.6rem);
  line-height: 1;
  color: rgba(255, 255, 255, 0.04);
  pointer-events: none;
}
.slot .tag {
  position: relative;
  font-family: var(--display);
  font-size: clamp(0.95rem, 1.75vw, 1.4rem);
  line-height: 1.04;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.slot .who {
  position: relative;
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.slot.filled {
  background: linear-gradient(165deg, #3350ea 0%, #1c2fc0 45%, #10156e 100%);
  border-color: rgba(255, 255, 255, 0.4);
}
.slot.filled .no { color: var(--yellow); }
.slot.filled .glyph { color: rgba(255, 255, 255, 0.13); }
.slot.filled .tag { color: var(--yellow); text-shadow: 2px 2px 0 #02031c; }
.slot.open .tag { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.24em; color: rgba(255, 255, 255, 0.3); }
.slot.next { border-color: var(--white); }
.slot.next .tag { color: var(--white); }
.slot.next::before {
  content: '1P';
  position: absolute;
  top: 0; right: 0;
  padding: 0.2rem 0.4rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  color: var(--white);
  background: var(--red);
  z-index: 1;
}
.slot.next::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 2px solid var(--yellow);
  animation: cursor 1s steps(2, jump-none) infinite;
  pointer-events: none;
}
@keyframes cursor { 50% { opacity: 0; } }

.first-run .slot { animation: deal 0.5s cubic-bezier(.2,.8,.2,1) both; animation-delay: calc(var(--i) * 22ms); }
@keyframes deal { from { opacity: 0; transform: translateY(10px); } }

.roster-note { margin-top: 1.4rem; color: var(--dim); font-size: 0.98rem; max-width: 46rem; }

/* reserve */
.reserve { margin-top: 2.4rem; padding: 1.4rem; border: 1px solid rgba(255, 229, 0, 0.45); }
.reserve h4 { font-family: var(--mono); font-weight: 500; font-size: 0.72rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--yellow); margin-bottom: 0.4rem; }
.reserve p { color: var(--dim); font-size: 0.95rem; margin-bottom: 1rem; }
.reserve ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.reserve li { padding: 0.45rem 0.8rem; border: 1px solid var(--line); font-family: var(--display); font-size: 1rem; letter-spacing: 0.03em; text-transform: uppercase; }
.reserve li span { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.14em; color: var(--yellow); margin-right: 0.6rem; }

/* ---------- Bracket ---------- */
.scroll-hint { display: none; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); margin-bottom: 0.8rem; }
.demo-note { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 0.12em; color: var(--yellow); margin-bottom: 1rem; }
.bracket-wrap { overflow-x: auto; padding-bottom: 1rem; -webkit-overflow-scrolling: touch; }
.bracket { display: flex; gap: 1.2rem; min-width: max-content; align-items: stretch; }
.b-round { display: flex; flex-direction: column; width: 210px; }
.b-round-label { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--yellow); margin-bottom: 0.9rem; }
.b-matches { flex: 1; display: flex; flex-direction: column; justify-content: space-around; gap: 0.7rem; }
.b-match { background: var(--navy-2); border: 1px solid var(--line); border-left: 3px solid var(--sky); padding: 0.5rem 0.7rem 0.6rem; }
.b-match.playing { border-left-color: var(--yellow); box-shadow: 0 0 24px rgba(255, 229, 0, 0.16); }
.b-match.done { border-left-color: var(--pink); }
.b-match.ghost { opacity: 0.45; }
.b-tag { display: block; font-family: var(--mono); font-size: 0.56rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--dim); margin-bottom: 0.35rem; }
.b-tag.live { color: var(--yellow); }
.b-player { display: flex; justify-content: space-between; gap: 0.6rem; font-family: var(--display); font-size: 1.05rem; letter-spacing: 0.03em; text-transform: uppercase; line-height: 1.35; }
.b-player .b-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.b-player.tbd { color: rgba(255, 255, 255, 0.28); }
.b-player.loser { color: rgba(255, 255, 255, 0.4); text-decoration: line-through; text-decoration-thickness: 1px; }
.b-player.winner { color: var(--yellow); }

/* ---------- Entry page: the form ---------- */
.form-frame {
  max-width: 760px;
  margin: 0 auto;
  background: var(--white);
  position: relative;
  box-shadow: 8px 8px 0 var(--cobalt);
}
.form-frame iframe { display: block; width: 100%; height: 800px; border: 0; background: transparent; }
.form-pending { padding: 3rem 1.5rem; text-align: center; color: var(--navy); font-size: 1.1rem; font-weight: 700; }
.rules { max-width: 760px; margin: 0 auto 2.4rem; display: grid; gap: 0.9rem; }
.rules p { padding-left: 1.5rem; position: relative; }
.rules p::before { content: '▶'; position: absolute; left: 0; top: 0.42em; font-size: 0.6em; color: var(--red); }

/* ---------- Footer / states ---------- */
footer {
  padding: 2.2rem clamp(1rem, 4vw, 3rem) 3rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--dim);
}
footer a { text-decoration: none; }
footer a:hover { color: var(--white); }
.loader, .error { padding: 40vh 1.5rem; text-align: center; font-family: var(--mono); font-size: 0.74rem; letter-spacing: 0.3em; text-transform: uppercase; color: var(--dim); }
.error { color: var(--red); }

/* ---------- Responsive ---------- */
@media (max-width: 1040px) {
  .tategaki { display: none; }
}
@media (max-width: 900px) {
  .select { grid-template-columns: repeat(4, 1fr); }
  .slot .tag { font-size: clamp(0.95rem, 4.2vw, 1.5rem); }
  .slot .glyph { font-size: clamp(3.4rem, 17vw, 6rem); }
  .steps { grid-template-columns: 1fr; }
  .step + .step { border-left: 0; border-top: 1px solid var(--line); }
  .scroll-hint { display: block; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .tategaki { display: none; }
  .topbar { font-size: 0.6rem; letter-spacing: 0.14em; }
  .topbar nav { gap: 0.9rem; }
  .hero { padding-top: 5rem; padding-bottom: 3.5rem; }
  .eyebrow { letter-spacing: 0.26em; padding-left: 0.26em; }
  .hyper { letter-spacing: 0.42em; padding-left: 0.42em; }
  .plate { box-shadow: 4px 4px 0 #02031c; }
  .meta { width: 100%; }
  .meta div { flex: 1 1 50%; padding: 0.8rem 0.6rem; }
  .meta div:nth-child(3) { flex-basis: 100%; border-left: 0; border-top: 1px solid var(--line); }
  .section-head { flex-wrap: wrap; }
  .section-head .aside { margin-left: 0; width: 100%; text-align: left; }
  .slot { padding: 0.45rem; }
  .form-frame iframe { height: 1000px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
