:root {
  --bg: #04070d;
  --emerald: #10b981;
  --cyan: #06b6d4;
  --gold: #e5c158;
  --ink: #e7f4ef;
  --muted: #93a39c;
  --card: rgba(10, 16, 26, 0.72);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { background: var(--bg); }
html:not(.ready) body { visibility: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font: 16px/1.55 "Segoe UI", "PingFang SC", "Hiragino Sans", "Noto Sans SC", "Noto Sans JP", "Noto Sans KR", "Malgun Gothic", sans-serif;
}
button, a { font: inherit; color: inherit; }
a { text-decoration: none; }
button { cursor: pointer; }
#field {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}
.warp {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at 50% 45%, rgba(16, 185, 129, 0.45), transparent 28%),
    radial-gradient(circle at 50% 50%, rgba(6, 182, 212, 0.28), transparent 42%),
    #04070d;
  transition: opacity 0.3s linear;
}
body.leaving .warp { opacity: 1; }
.nav, main, footer { position: relative; z-index: 1; }
.nav {
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 8px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand b { display: block; letter-spacing: 0.22em; font-size: 14px; }
.brand small { color: var(--muted); letter-spacing: 0.08em; }
.mark {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(16, 185, 129, 0.7);
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, transparent 0 8px, var(--emerald) 9px 10px, transparent 11px),
    conic-gradient(from 20deg, var(--emerald), var(--cyan), var(--gold), var(--emerald));
  box-shadow: 0 0 18px rgba(16, 185, 129, 0.35);
}
.nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.lang { position: relative; }
#lang-btn, #bgm, .nav-cta, .go, #replay {
  border: 1px solid rgba(229, 193, 88, 0.35);
  background: rgba(8, 14, 22, 0.8);
  border-radius: 999px;
}
#lang-btn, #bgm {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
}
#lang-btn svg { width: 16px; height: 16px; fill: none; stroke: var(--cyan); stroke-width: 1.6; }
#lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 5;
  min-width: 160px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: rgba(8, 14, 22, 0.94);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 14px;
  backdrop-filter: blur(18px);
}
#lang-menu button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 9px;
  padding: 8px 10px;
}
#lang-menu button[aria-selected="true"], #lang-menu button:hover { background: rgba(16, 185, 129, 0.16); }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i {
  display: block;
  width: 2px;
  height: 5px;
  background: var(--emerald);
  transform-origin: bottom;
}
#bgm[data-state="playing"] .eq i { animation: eq 0.9s ease-in-out infinite; }
#bgm[data-state="playing"] .eq i:nth-child(2) { animation-delay: 0.15s; }
#bgm[data-state="playing"] .eq i:nth-child(3) { animation-delay: 0.3s; }
@keyframes eq {
  0%, 100% { height: 4px; }
  50% { height: 12px; }
}
.nav-cta, .go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  color: #06110c;
  background:
    linear-gradient(#d9ffe9, #d9ffe9) padding-box,
    linear-gradient(120deg, var(--emerald), var(--gold)) border-box;
  border: 1px solid transparent;
  font-weight: 700;
}
.nav-cta { position: relative; overflow: hidden; }
main { width: min(1120px, calc(100% - 28px)); margin: 0 auto; padding-bottom: 48px; }
.stage { position: relative; margin-top: 12px; }
.feed {
  margin: 0 0 10px;
  color: var(--cyan);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 12px;
}
.aura {
  position: absolute;
  z-index: 0;
  left: 4%;
  right: 4%;
  top: 42px;
  bottom: 92px;
  background:
    radial-gradient(closest-side at 18% 40%, rgba(16, 185, 129, 0.55), transparent 72%),
    radial-gradient(closest-side at 82% 32%, rgba(6, 182, 212, 0.42), transparent 70%),
    radial-gradient(closest-side at 50% 88%, rgba(229, 193, 88, 0.28), transparent 72%);
  filter: blur(26px);
  pointer-events: none;
  animation: aura 8s ease-in-out infinite alternate;
}
@keyframes aura { from { transform: scale(0.96); } to { transform: scale(1.04); } }
.hud { position: relative; z-index: 1; padding: 18px; }
.corner {
  position: absolute;
  width: 16px;
  height: 16px;
  border: 1px solid rgba(16, 185, 129, 0.85);
  pointer-events: none;
}
.tl { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.tr { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.bl { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.br { bottom: 0; right: 0; border-left: 0; border-top: 0; }
.rail {
  position: absolute;
  top: 50%;
  color: rgba(229, 193, 88, 0.8);
  font-size: 10px;
  letter-spacing: 0.14em;
  writing-mode: vertical-rl;
  pointer-events: none;
}
.rail.left { left: 0; transform: translateY(-50%); }
.rail.right { right: 0; transform: translateY(-50%) rotate(180deg); }
.screen {
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: visible;
}
#promo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  background: #000;
  border: 0;
  border-radius: 0;
}
.finale {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 10px;
  margin-top: 18px;
  opacity: 0.42;
  filter: saturate(0.55);
  transition: opacity 0.45s ease, filter 0.45s ease;
}
.finale p { margin: 0; color: var(--gold); letter-spacing: 0.08em; font-size: 13px; }
.finale.is-settled { opacity: 1; filter: none; }
.go {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 52px;
  padding: 0 22px;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 0 0 rgba(16, 185, 129, 0);
}
.finale.is-settled .go {
  box-shadow: 0 0 22px rgba(16, 185, 129, 0.45), 0 0 36px rgba(229, 193, 88, 0.18);
}
.go::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, 0.55) 48%, transparent 62%);
  transform: translateX(-130%);
  animation: shimmer 2.8s ease-in-out infinite;
}
@keyframes shimmer { to { transform: translateX(130%); } }
#replay {
  min-height: 32px;
  padding: 0 12px;
  color: var(--muted);
  background: transparent;
  border-color: rgba(147, 163, 156, 0.35);
}
.telemetry {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 16px;
}
.telemetry span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(6, 182, 212, 0.28);
  border-radius: 999px;
  background: rgba(6, 16, 24, 0.72);
  color: #c9ebe4;
  font-size: 13px;
  letter-spacing: 0.03em;
}
.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}
.bento { display: grid; grid-template-columns: 1fr; gap: 14px; }
.card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 180px;
  padding: 20px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.card:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3) { animation-delay: 0.12s; }
.card:nth-child(4) { animation-delay: 0.18s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(16px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: radial-gradient(420px circle at var(--x, 50%) var(--y, 0%), rgba(229, 193, 88, 0.95), rgba(16, 185, 129, 0.15) 28%, transparent 46%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  pointer-events: none;
}
.card small { color: var(--gold); letter-spacing: 0.18em; }
.card h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.card p { margin: 0; color: var(--muted); }
.more { margin-top: auto; color: var(--emerald); font-weight: 700; }
footer { position: relative; z-index: 1; width: min(1120px, calc(100% - 28px)); margin: 0 auto 28px; color: var(--muted); font-size: 13px; }
@media (min-width: 840px) {
  .bento { grid-template-columns: 1.35fr 1fr; }
  .card-a { grid-row: span 2; min-height: 320px; }
  .card-d { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .nav { align-items: flex-start; }
  .nav-tools { flex-wrap: wrap; justify-content: flex-end; }
  .rail { display: none; }
  .card h2 { font-size: 19px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
