:root {
  color-scheme: dark;
  --bg: #0a0d12;
  --panel: #121820;
  --cyan: #3de8ff;
  --lime: #8dff6a;
  --amber: #ffb347;
  --red: #ff5f5f;
  --text: #e6edf5;
  --muted: #8a9aad;
  --accent: #3de8ff;
  font-family: "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  line-height: 1.45;
}

.shell {
  max-width: 520px;
  margin: 0 auto;
  padding: 0.6rem 0.75rem 1.5rem;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.back {
  color: var(--cyan);
  text-decoration: none;
}

.brand strong {
  color: var(--text);
}

.header-actions {
  margin-left: auto;
  display: flex;
  gap: 0.35rem;
}

.ghost-button {
  background: transparent;
  border: 1px solid #2a3545;
  color: var(--muted);
  padding: 0.35rem 0.55rem;
  border-radius: 4px;
  font-size: 0.65rem;
  cursor: pointer;
}

.ghost-button[aria-pressed="true"] {
  border-color: var(--cyan);
  color: var(--cyan);
}

.hero h1 {
  font-size: 1.35rem;
  margin: 0.2rem 0;
  font-weight: 700;
}

.hero h1 span {
  display: block;
  font-size: 0.95rem;
  color: var(--muted);
  font-weight: 500;
}

.kicker {
  font-size: 0.68rem;
  color: var(--muted);
  margin: 0;
}

.catch {
  color: var(--muted);
  font-size: 0.88rem;
}

.console {
  background: linear-gradient(180deg, #0d1118 0%, #0a0d12 100%);
  border: 1px solid #1f2a3a;
  border-radius: 10px;
  padding: 0.65rem;
}

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

.play-intro {
  margin: 0 0 0.55rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid #243247;
  border-radius: 8px;
  background: #0e131b;
  font-size: 0.82rem;
  line-height: 1.5;
}

.play-intro-lead {
  margin: 0 0 0.4rem;
  color: var(--text);
}

.play-intro-goal {
  margin: 0 0 0.45rem;
  color: var(--muted);
}

.goal-word {
  color: var(--lime);
  font-weight: 600;
}

.danger-word {
  color: var(--red);
  font-weight: 600;
}

.play-legend {
  list-style: none;
  margin: 0 0 0.5rem;
  padding: 0;
  display: grid;
  gap: 0.28rem;
  font-size: 0.76rem;
  color: var(--muted);
}

.play-legend li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.legend-swatch {
  flex-shrink: 0;
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 3px;
  border: 1px solid #3a4a5f;
}

.legend-lens {
  background: radial-gradient(circle at 50% 50%, #4ec8ff 0%, #1a6a8a 70%);
  box-shadow: 0 0 6px color-mix(in srgb, var(--cyan) 60%, transparent);
}

.legend-beam {
  background: linear-gradient(90deg, #1a4a5a, var(--cyan));
}

.legend-goal {
  background: transparent;
  border: 2px solid var(--lime);
  border-radius: 50%;
  width: 1.05rem;
  height: 1.05rem;
}

.legend-danger {
  background: #5a2020;
  border-color: var(--red);
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--red) 45%, transparent);
}

.play-first-action {
  margin: 0 0 0.35rem;
  padding: 0.4rem 0.45rem;
  border-left: 3px solid var(--cyan);
  background: #121a24;
  color: var(--text);
}

.first-action-badge {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.1rem 0.35rem;
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bg);
  background: var(--cyan);
  border-radius: 3px;
  vertical-align: 0.05em;
}

.play-intro-alt {
  margin: 0;
  font-size: 0.74rem;
  color: var(--muted);
}

.rule-hint {
  text-align: center;
  font-size: 0.82rem;
  color: var(--cyan);
  margin: 0 0 0.45rem;
}

.hud {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.hud span {
  display: block;
  color: var(--muted);
}

.hud strong {
  font-size: 0.95rem;
  color: var(--lime);
}

.viewport-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid #253245;
  border-radius: 8px;
  overflow: hidden;
  background: #050608;
}

#stage-canvas,
#feed-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#feed-canvas {
  opacity: 0.55;
  object-fit: cover;
}

#stage-canvas {
  z-index: 2;
  touch-action: none;
}

.camera-guide {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  display: grid;
  place-items: center;
}

.camera-guide::before {
  content: "";
  width: 24%;
  height: 32%;
  border: 2px dashed color-mix(in srgb, var(--accent) 70%, transparent);
  border-radius: 6px;
  box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.15) inset;
}

.operator-badge {
  position: absolute;
  right: 6px;
  bottom: 6px;
  z-index: 4;
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  color: #6a7688;
  text-transform: uppercase;
}

.live-msg {
  text-align: center;
  font-size: 0.78rem;
  min-height: 1.2em;
  color: var(--muted);
  margin: 0.45rem 0;
}

.start-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
  margin: 0.5rem 0;
}

.btn-primary,
.btn-ghost,
.btn-text {
  font: inherit;
  cursor: pointer;
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, #1a4a5a, #163845);
  border: 1px solid var(--cyan);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border: 1px solid #334155;
  color: var(--muted);
}

.btn-text {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 0.75rem;
  text-decoration: underline;
}

.cv-inspector {
  margin-top: 0.45rem;
  font-size: 0.72rem;
  color: var(--muted);
}

.cv-inspector summary {
  cursor: pointer;
  color: var(--cyan);
}

.details-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.2rem 0.65rem;
  margin-top: 0.35rem;
}

.summary-panel {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border: 1px solid #2b3b52;
  border-radius: 8px;
  background: #10151e;
}

.summary-panel h2 {
  margin: 0 0 0.35rem;
  color: var(--lime);
}

.cta-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.65rem;
}

.disclaimer,
.records,
.privacy {
  font-size: 0.68rem;
  color: var(--muted);
}

.privacy {
  margin-top: 0.35rem;
}

html[data-capture="1"] .capture-hide {
  display: none !important;
}

html[data-capture="1"] .shell {
  max-width: 440px;
  padding: 0.35rem;
}

html[data-capture="1"] .viewport-wrap {
  aspect-ratio: 9 / 14;
  max-height: 72vh;
}

html[data-promo-shot="1"] .capture-hide,
html[data-promo-og="1"] .capture-hide {
  display: none !important;
}

html[data-promo-og="1"] .shell {
  max-width: 1200px;
  padding: 1.5rem;
}

html[data-promo-og="1"] .viewport-wrap {
  aspect-ratio: 16 / 9;
  height: 420px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}
