/* ==========================================================
   ハッカー VS ホワイトハッカー
   ホワイト側: 白・青・シアン / ハッカー側: 黒・紫・赤
   ========================================================== */

:root {
  --bg: #04050b;
  --bg-2: #080a16;
  --panel: rgba(13, 17, 33, 0.78);
  --panel-2: rgba(20, 26, 48, 0.72);
  --line: rgba(150, 180, 255, 0.14);
  --line-strong: rgba(150, 190, 255, 0.28);

  --ink: #eef4ff;
  --muted: #95a1bf;
  --dim: #5f6a89;

  --white: #f5f9ff;
  --cyan: #3ee6ff;
  --blue: #3a7bff;
  --blue-deep: #1a3fa8;

  --red: #ff3d61;
  --purple: #a052ff;
  --violet-deep: #3a1166;
  --black: #08060f;

  --ok: var(--cyan);
  --ng: var(--red);

  --font: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans CJK JP",
          "Yu Gothic UI", "YuGothic", "Meiryo", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SFMono-Regular", "SF Mono", Menlo, Consolas, "Roboto Mono", "Liberation Mono", monospace;

  --radius: 18px;
  --radius-sm: 12px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --ease-in: cubic-bezier(.5, 0, .75, 0);
  --gutter: 16px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);

  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-feature-settings: "palt" 1;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

button, input { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
h1, h2, p, dl, dd, ol { margin: 0; padding: 0; }
ol { list-style: none; }

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

/* ---------- 背景 ---------- */
.bg { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; background: radial-gradient(120% 80% at 50% 50%, var(--bg-2), var(--bg)); }
.bg-glow { position: absolute; width: 90vmax; height: 90vmax; border-radius: 50%; filter: blur(40px); opacity: .55; }
.bg-glow--white {
  left: -45vmax; bottom: -40vmax;
  background: radial-gradient(closest-side, rgba(58, 123, 255, .55), rgba(62, 230, 255, .14) 55%, transparent 72%);
  animation: drift-a 22s ease-in-out infinite alternate;
}
.bg-glow--black {
  right: -45vmax; top: -42vmax;
  background: radial-gradient(closest-side, rgba(160, 82, 255, .5), rgba(255, 61, 97, .16) 55%, transparent 72%);
  animation: drift-b 26s ease-in-out infinite alternate;
}
.bg-grid {
  position: absolute; inset: -2px;
  background-image:
    linear-gradient(rgba(140, 170, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(140, 170, 255, .055) 1px, transparent 1px);
  background-size: 32px 32px;
  -webkit-mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 80%);
          mask-image: radial-gradient(ellipse 70% 60% at 50% 45%, #000 30%, transparent 80%);
}
@keyframes drift-a { to { transform: translate(6vmax, -4vmax); } }
@keyframes drift-b { to { transform: translate(-5vmax, 5vmax); } }

/* ---------- アプリ枠 ---------- */
.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  overflow: hidden;
}
@media (min-width: 720px) {
  .app {
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
    background: rgba(4, 5, 11, .35);
    box-shadow: 0 0 120px rgba(0, 0, 0, .6);
  }
}

.screen {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  padding: calc(20px + var(--safe-t)) var(--gutter) calc(20px + var(--safe-b));
  overflow-x: hidden; overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  opacity: 0; visibility: hidden;
  transform: translateY(14px);
  transition: opacity .45s var(--ease), transform .45s var(--ease), visibility 0s linear .45s;
}
.screen.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .45s var(--ease), transform .45s var(--ease), visibility 0s;
}

/* ---------- ボタン ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--panel-2);
  font-weight: 700; font-size: 16px; letter-spacing: .04em;
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, box-shadow .2s;
  user-select: none; -webkit-user-select: none;
}
.btn:active { transform: scale(.98); }
.btn-icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  border-color: rgba(62, 230, 255, .6);
  background: linear-gradient(135deg, #e9fbff 0%, #8eeaff 45%, #3a7bff 100%);
  color: #04102a;
  box-shadow: 0 10px 30px -10px rgba(62, 200, 255, .65), inset 0 1px 0 rgba(255, 255, 255, .7);
}
.btn-primary:hover { box-shadow: 0 14px 38px -10px rgba(62, 200, 255, .85), inset 0 1px 0 rgba(255, 255, 255, .7); }

.btn-ghost { background: rgba(255, 255, 255, .04); }
.btn-ghost:hover { border-color: rgba(62, 230, 255, .5); background: rgba(62, 230, 255, .07); }

.btn-x {
  background: #f5f7fb; color: #05060a; border-color: #fff;
  box-shadow: 0 10px 30px -12px rgba(255, 255, 255, .45);
}
.btn-x:hover { background: #fff; }
.x-logo { width: 18px; height: 18px; fill: currentColor; }

.btn-row { display: flex; gap: 10px; }
.btn-row .btn { flex: 1; font-size: 15px; padding-inline: 12px; }

.link-btn {
  display: block; margin: 4px auto 0; padding: 12px 16px; min-height: 44px;
  border: 0; background: none; color: var(--muted); font-size: 14px;
  text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--dim);
}
.link-btn:hover { color: var(--ink); }

/* ==========================================================
   タイトル
   ========================================================== */
.screen-title { justify-content: center; gap: 36px; }
.title-hero { text-align: center; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  margin-bottom: 22px; padding: 6px 12px;
  border: 1px solid var(--line); border-radius: 999px;
  font-family: var(--mono); font-size: 11px; letter-spacing: .22em; color: var(--muted);
  background: rgba(255, 255, 255, .03);
}
.eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }

.logo { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 900; line-height: 1.05; letter-spacing: .02em; }
.logo-hacker {
  position: relative;
  font-size: clamp(44px, 14vw, 62px);
  background: linear-gradient(100deg, #ff6b86 0%, var(--red) 35%, var(--purple) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(255, 61, 97, .35));
}
/* 静的な色ずれ（点滅させない） */
.logo-hacker::after {
  content: attr(data-text);
  position: absolute; left: 0; top: 0;
  transform: translate(3px, 0);
  color: transparent;
  -webkit-text-stroke: 1px rgba(160, 82, 255, .45);
  clip-path: polygon(0 58%, 100% 58%, 100% 72%, 0 72%);
}
.logo-vs { display: flex; align-items: center; gap: 14px; width: 100%; max-width: 280px; margin: 10px 0 12px; }
.logo-vs::before, .logo-vs::after { content: ""; flex: 1; height: 1px; }
.logo-vs::before { background: linear-gradient(90deg, transparent, var(--cyan)); }
.logo-vs::after { background: linear-gradient(90deg, var(--red), transparent); }
.logo-vs span {
  font-family: var(--mono); font-size: 20px; font-weight: 800; letter-spacing: .2em; padding-left: .2em;
  color: var(--white);
}
.logo-white {
  font-size: clamp(34px, 10.4vw, 48px);
  background: linear-gradient(100deg, #ffffff 0%, #c6f6ff 45%, var(--cyan) 75%, var(--blue) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 22px rgba(62, 230, 255, .3));
}
.lead { margin-top: 24px; color: var(--muted); font-size: 15px; line-height: 1.85; }
.lead strong { color: var(--ink); font-weight: 700; }

.start-form {
  display: flex; flex-direction: column; gap: 10px;
  padding: 20px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(20, 28, 52, .7), rgba(10, 13, 26, .75));
  box-shadow: 0 20px 60px -30px rgba(0, 0, 0, .8);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.field-label { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .08em; }
.field {
  width: 100%; min-height: 54px; padding: 12px 16px;
  border: 1px solid var(--line-strong); border-radius: 12px;
  background: rgba(3, 6, 16, .7);
  font-size: 17px; font-weight: 600;
  transition: border-color .2s, box-shadow .2s;
}
.field::placeholder { color: var(--dim); font-weight: 500; }
.field:focus { outline: none; border-color: var(--cyan); box-shadow: 0 0 0 4px rgba(62, 230, 255, .14); }
.field-note { font-size: 12px; color: var(--dim); }
.btn-start { margin-top: 8px; min-height: 60px; font-size: 18px; letter-spacing: .12em; }
.title-best { text-align: center; font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.title-best b { color: var(--cyan); }

/* ==========================================================
   VS
   ========================================================== */
.screen-vs { justify-content: center; align-items: center; gap: 28px; text-align: center; }
.vs-mission { font-size: 15px; color: var(--muted); }
.vs-mission span { display: block; margin-bottom: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: .3em; color: var(--dim); }
.vs-mission strong { color: var(--ink); font-size: 18px; margin-right: 2px; }
.vs-stage { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; width: 100%; }
.vs-side { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.vs-avatar { width: 112px; height: 112px; }
.vs-avatar svg { width: 100%; height: 100%; display: block; }
.vs-side--white .vs-avatar svg { filter: drop-shadow(0 0 18px rgba(62, 230, 255, .45)); }
.vs-side--black .vs-avatar svg { filter: drop-shadow(0 0 18px rgba(255, 61, 97, .4)); }
.vs-role { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; color: var(--dim); margin-top: 6px; }
.vs-name { font-size: 17px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.vs-side--white .vs-name { color: var(--white); }
.vs-side--black .vs-name { color: #ff8aa1; }
.vs-bio { font-size: 12px; color: var(--muted); }
.vs-mark {
  font-family: var(--mono); font-weight: 900; font-size: 26px; letter-spacing: .08em;
  background: linear-gradient(90deg, var(--cyan), var(--white) 50%, var(--red));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.vs-hint { font-size: 13px; color: var(--muted); letter-spacing: .06em; }

.screen-vs.is-active .vs-side--white { animation: from-left .7s var(--ease) both; }
.screen-vs.is-active .vs-side--black { animation: from-right .7s var(--ease) both; }
.screen-vs.is-active .vs-mark { animation: pop .6s .35s var(--ease) both; }
.screen-vs.is-active .vs-hint { animation: rise .5s .7s var(--ease) both; }
@keyframes from-left { from { opacity: 0; transform: translateX(-40px); } }
@keyframes from-right { from { opacity: 0; transform: translateX(40px); } }
@keyframes pop { from { opacity: 0; transform: scale(.4); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ==========================================================
   プレイ
   ========================================================== */
.screen-play { padding-top: calc(12px + var(--safe-t)); padding-bottom: calc(14px + var(--safe-b)); gap: 12px; overflow-y: auto; }

.hud { display: flex; flex-direction: column; gap: 8px; }
.hud-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; }
.hud-side { display: flex; align-items: center; gap: 8px; min-width: 0; }
.hud-side--black { justify-content: flex-end; }
.hud-avatar { width: 30px; height: 30px; flex: none; }
.hud-avatar svg { width: 100%; height: 100%; display: block; }
.hud-name { min-width: 0; font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hud-side--white .hud-name { color: var(--white); }
.hud-side--black .hud-name { color: #ff8aa1; text-align: right; }
.hud-round {
  font-family: var(--mono); font-weight: 800; font-size: 18px; letter-spacing: .04em;
  padding: 2px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, .04);
}
.hud-round small { font-size: 12px; color: var(--dim); }

.frontline {
  position: relative; height: 6px; border-radius: 99px; overflow: hidden;
  background: linear-gradient(90deg, #6d1b4a, var(--red) 60%, var(--purple));
}
.frontline-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 50%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width .7s var(--ease);
}
.frontline-mark {
  position: absolute; top: -2px; bottom: -2px; left: 50%; width: 3px; margin-left: -1.5px;
  background: #fff; border-radius: 2px; box-shadow: 0 0 10px #fff;
  transition: left .7s var(--ease);
}

.hud-stats { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 8px; }
.stat {
  display: flex; flex-direction: column; align-items: center; gap: 0;
  padding: 6px 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
}
.stat dt { font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--dim); }
.stat dd { font-family: var(--mono); font-weight: 800; font-size: 20px; line-height: 1.25; font-variant-numeric: tabular-nums; }
.stat dd small { font-family: var(--font); font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat--time dd { color: var(--cyan); }
.stat--time.is-low dd { color: var(--red); }

.timer { height: 4px; border-radius: 99px; background: rgba(255, 255, 255, .07); overflow: hidden; }
.timer-bar {
  height: 100%; width: 100%; transform-origin: left center;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 12px rgba(62, 230, 255, .6);
}
.timer-bar.is-low { background: linear-gradient(90deg, var(--purple), var(--red)); box-shadow: 0 0 12px rgba(255, 61, 97, .6); }

.stage { flex: 1; display: flex; flex-direction: column; gap: 10px; min-height: 0; }

.taunt {
  display: flex; align-items: baseline; gap: 8px; min-height: 22px;
  font-size: 13px; color: #ffb3c2; line-height: 1.5;
}
.taunt-who {
  flex: none; font-family: var(--mono); font-size: 10px; letter-spacing: .14em; color: var(--red);
  padding: 2px 6px; border: 1px solid rgba(255, 61, 97, .4); border-radius: 6px;
}

.incident {
  position: relative; overflow: hidden;
  padding: 16px 16px 18px;
  border: 1px solid rgba(255, 61, 97, .35);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(58, 17, 102, .55), rgba(12, 10, 24, .9) 55%),
    var(--black);
  box-shadow: 0 18px 50px -24px rgba(255, 61, 97, .45), inset 0 1px 0 rgba(255, 255, 255, .05);
  transition: border-color .35s, box-shadow .35s, background .35s;
}
.incident::before {
  /* 一度だけ走るスキャンライン */
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 40%;
  background: linear-gradient(180deg, transparent, rgba(255, 61, 97, .14), transparent);
  transform: translateY(-110%); pointer-events: none;
}
.incident.is-enter { animation: incident-in .5s var(--ease) both; }
.incident.is-enter::before { animation: scan 1.1s .15s var(--ease) both; }
@keyframes incident-in { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes scan { to { transform: translateY(260%); } }

.incident-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.incident-icon {
  display: grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 11px; background: rgba(255, 61, 97, .14); color: #ff8aa1;
  border: 1px solid rgba(255, 61, 97, .3);
}
.incident-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.incident-tag { font-size: 14px; font-weight: 800; color: #ffd0d9; }
.incident-level {
  margin-left: auto; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: .2em;
  color: var(--red); padding: 3px 7px; border-radius: 6px; background: rgba(255, 61, 97, .12);
}
.incident-title { font-size: 19px; font-weight: 800; line-height: 1.45; letter-spacing: .01em; }
.incident-text { margin-top: 6px; font-size: 14px; line-height: 1.7; color: #c8cde0; }

.incident-stamp {
  position: absolute; right: 14px; top: 16px;
  background: rgba(5, 6, 14, .9);
  font-family: var(--mono); font-size: 13px; font-weight: 900; letter-spacing: .24em;
  padding: 4px 10px; border-radius: 8px; border: 2px solid currentColor;
  opacity: 0; transform: scale(1.4) rotate(-6deg);
}
.incident.is-defended {
  border-color: rgba(62, 230, 255, .7);
  background: linear-gradient(135deg, rgba(26, 63, 168, .55), rgba(8, 16, 34, .92) 60%), #050a18;
  box-shadow: 0 0 0 1px rgba(62, 230, 255, .25), 0 18px 60px -20px rgba(62, 230, 255, .55);
}
.incident.is-defended .incident-icon { background: rgba(62, 230, 255, .14); border-color: rgba(62, 230, 255, .4); color: var(--cyan); }
.incident.is-defended .incident-level { color: var(--cyan); background: rgba(62, 230, 255, .12); }
.incident.is-defended .incident-stamp { color: var(--cyan); animation: stamp .45s var(--ease) both; }
.incident.is-defended .incident-level, .incident.is-breached .incident-level { visibility: hidden; }
.incident.is-defended::after {
  /* 防御リング */
  content: ""; position: absolute; left: 50%; top: 50%; width: 120px; height: 120px; margin: -60px 0 0 -60px;
  border-radius: 50%; border: 2px solid var(--cyan); pointer-events: none;
  animation: ring .8s var(--ease) both;
}
.incident.is-breached { border-color: rgba(255, 61, 97, .8); animation: shake .42s ease-in-out both; }
.incident.is-breached .incident-stamp { color: var(--red); animation: stamp .45s var(--ease) both; }
@keyframes stamp { to { opacity: 1; transform: none; } }
@keyframes ring { from { opacity: .9; transform: scale(.3); } to { opacity: 0; transform: scale(3.4); } }
@keyframes shake {
  20% { transform: translateX(-5px); } 40% { transform: translateX(4px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); }
}

.prompt { font-size: 13px; font-weight: 700; color: var(--muted); letter-spacing: .1em; margin-top: 4px; }

.choices { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.choice {
  display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 62px; padding: 12px 14px;
  text-align: left; font-size: 15.5px; font-weight: 700; line-height: 1.45;
  border: 1px solid rgba(120, 170, 255, .28); border-radius: 14px;
  background: linear-gradient(180deg, rgba(26, 40, 78, .78), rgba(14, 20, 42, .85));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  transition: transform .12s var(--ease), border-color .2s, background .25s, opacity .3s, box-shadow .2s;
  animation: rise .4s var(--ease) both;
}
.choice:nth-child(2) { animation-delay: .06s; }
.choice:nth-child(3) { animation-delay: .12s; }
.choice:hover:not(:disabled) { border-color: rgba(62, 230, 255, .6); box-shadow: 0 0 0 3px rgba(62, 230, 255, .08), inset 0 1px 0 rgba(255, 255, 255, .06); }
.choice:active:not(:disabled) { transform: scale(.985); }
.choice:disabled { cursor: default; }
.choice-key {
  display: grid; place-items: center; width: 30px; height: 30px; flex: none;
  border-radius: 9px; border: 1px solid rgba(62, 230, 255, .35);
  font-family: var(--mono); font-size: 13px; font-weight: 800; color: var(--cyan);
  background: rgba(62, 230, 255, .07);
}
.choice-text { min-width: 0; overflow-wrap: anywhere; }
.choices.is-locked .choice { opacity: .42; }
.choices.is-locked .choice.is-correct,
.choices.is-locked .choice.is-picked { opacity: 1; }
.choice.is-correct { border-color: var(--cyan); background: linear-gradient(180deg, rgba(30, 90, 170, .7), rgba(12, 34, 70, .85)); }
.choice.is-correct .choice-key { background: var(--cyan); color: #03121f; border-color: var(--cyan); }
.choice.is-picked.is-wrong { border-color: var(--red); background: linear-gradient(180deg, rgba(110, 20, 60, .6), rgba(36, 10, 26, .85)); }
.choice.is-picked.is-wrong .choice-key { background: var(--red); color: #1a0309; border-color: var(--red); }

/* ---------- フィードバック（ボトムシート） ---------- */
.feedback {
  position: absolute; inset: 0; z-index: 5;
  display: flex; align-items: flex-end;
  padding: 0 var(--gutter) calc(14px + var(--safe-b));
  background: linear-gradient(180deg, rgba(3, 4, 10, 0) 25%, rgba(3, 4, 10, .82) 60%);
  animation: fade .3s ease both;
}
.feedback-sheet {
  width: 100%;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0f1428, #0a0d1c);
  box-shadow: 0 -10px 60px -20px rgba(0, 0, 0, .9);
  animation: sheet-up .45s var(--ease) both;
}
.feedback.is-ok .feedback-sheet { border-color: rgba(62, 230, 255, .55); box-shadow: 0 -10px 60px -24px rgba(62, 230, 255, .5); }
.feedback.is-ng .feedback-sheet { border-color: rgba(255, 61, 97, .55); box-shadow: 0 -10px 60px -24px rgba(255, 61, 97, .45); }
.feedback-status { font-family: var(--mono); font-size: 12px; font-weight: 800; letter-spacing: .24em; }
.feedback.is-ok .feedback-status { color: var(--cyan); }
.feedback.is-ng .feedback-status { color: var(--red); }
.feedback-title { margin-top: 4px; font-size: 20px; font-weight: 800; line-height: 1.4; }
.feedback-tip {
  margin-top: 10px; padding: 10px 12px; border-radius: 10px;
  font-size: 14px; line-height: 1.65; color: #d8def0;
  background: rgba(62, 230, 255, .07); border-left: 3px solid var(--cyan);
}
.feedback-tip b { color: var(--cyan); margin-right: 4px; }
.feedback-answer { display: inline-block; margin: 2px 0 4px; font-weight: 800; color: var(--white); }
.feedback-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.feedback-meta span {
  font-family: var(--mono); font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
  background: rgba(255, 255, 255, .06); color: var(--muted);
}
.feedback-meta span.plus { color: var(--cyan); background: rgba(62, 230, 255, .1); }
.btn-next { margin-top: 14px; overflow: hidden; background: rgba(255, 255, 255, .06); }
.btn-next-progress {
  position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--cyan); transform-origin: left center; transform: scaleX(0);
}
.btn-next-progress.is-running { animation: progress var(--dur, 4s) linear both; }
.feedback.is-ng .btn-next-progress { background: var(--red); }
@keyframes progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes fade { from { opacity: 0; } }
@keyframes sheet-up { from { opacity: 0; transform: translateY(30px); } }

/* ==========================================================
   結果
   ========================================================== */
.screen-result { gap: 18px; padding-top: calc(18px + var(--safe-t)); padding-bottom: calc(28px + var(--safe-b)); }

.result-card {
  position: relative; flex: none;
  padding: 18px 18px 16px;
  border-radius: 22px;
  /* グラデーション枠：左上＝ホワイト側、右下＝ハッカー側 */
  border: 1.5px solid transparent;
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(58, 123, 255, .28), transparent 55%) padding-box,
    radial-gradient(120% 80% at 100% 100%, rgba(160, 82, 255, .26), transparent 55%) padding-box,
    linear-gradient(180deg, #0c1124, #080914) padding-box,
    linear-gradient(120deg, var(--cyan), var(--blue) 40%, var(--purple) 65%, var(--red)) border-box;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}
.screen-result.is-active .result-card { animation: card-in .6s var(--ease) both; }
@keyframes card-in { from { opacity: 0; transform: translateY(18px) scale(.98); } }

.rc-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-bottom: 12px; border-bottom: 1px dashed var(--line); }
.rc-logo { font-size: 12px; font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.rc-logo i { font-style: normal; font-family: var(--mono); font-size: 10px; color: var(--muted); margin: 0 2px; }
.c-red { color: #ff6b86; }
.c-cyan { color: var(--cyan); }
.rc-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; color: var(--dim); white-space: nowrap; }

.rc-player { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.rc-avatar { width: 40px; height: 40px; flex: none; }
.rc-avatar svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 0 10px rgba(62, 230, 255, .4)); }
.rc-label { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .18em; color: var(--dim); }
.rc-name { display: block; font-size: 19px; font-weight: 800; line-height: 1.3; overflow-wrap: anywhere; }
.rc-newbest {
  margin-left: auto; flex: none; font-size: 11px; font-weight: 800; letter-spacing: .06em;
  padding: 4px 8px; border-radius: 999px; color: #03121f; background: var(--cyan);
}

.rc-rank { display: flex; align-items: center; gap: 14px; margin-top: 14px; }
.rc-rank-letter {
  display: grid; place-items: center; flex: none;
  width: 76px; height: 76px; border-radius: 20px;
  font-family: var(--mono); font-size: 50px; font-weight: 900; line-height: 1;
  color: #fff;
  background: linear-gradient(145deg, rgba(62, 230, 255, .25), rgba(58, 123, 255, .12));
  border: 1px solid rgba(62, 230, 255, .5);
  text-shadow: 0 0 22px rgba(62, 230, 255, .8);
}
.rc-rank-letter[data-rank="S"] { background: linear-gradient(145deg, rgba(255, 255, 255, .3), rgba(62, 230, 255, .3)); border-color: #fff; }
.rc-rank-letter[data-rank="D"], .rc-rank-letter[data-rank="C"] {
  background: linear-gradient(145deg, rgba(160, 82, 255, .22), rgba(255, 61, 97, .12));
  border-color: rgba(160, 82, 255, .5); text-shadow: 0 0 22px rgba(160, 82, 255, .8);
}
.rc-rank-body { min-width: 0; }
.rc-rank-title { display: block; font-size: 20px; font-weight: 900; line-height: 1.35; overflow-wrap: anywhere; }

.rc-defended { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--line); }
.rc-defended p { display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.rc-big { font-family: var(--mono); font-size: 38px; font-weight: 900; line-height: 1; color: var(--cyan); }
.rc-of { font-size: 14px; font-weight: 700; color: var(--muted); }
.pips { display: flex; gap: 5px; }
.pips li { width: 16px; height: 22px; border-radius: 4px; border: 1.5px solid rgba(255, 61, 97, .7); background: rgba(255, 61, 97, .12); }
.pips li.ok { border-color: var(--cyan); background: var(--cyan); box-shadow: 0 0 10px rgba(62, 230, 255, .6); }

.rc-stats { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 8px; margin-top: 10px; }
.rc-stats > div { padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .025); min-width: 0; }
.rc-stats dt { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-stats dd { font-family: var(--mono); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
#rc-vs { font-family: var(--font); font-size: 14px; line-height: 1.6; white-space: nowrap; }
.rc-vs-name { display: block; font-size: 10.5px; font-weight: 600; color: var(--muted); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#rc-vs.win { color: var(--cyan); }
#rc-vs.lose { color: #ff8aa1; }

.rc-comment { margin-top: 14px; font-size: 15px; font-weight: 700; line-height: 1.7; }
.rc-comment::before { content: "“"; color: var(--cyan); font-size: 22px; line-height: 0; margin-right: 2px; vertical-align: -6px; }
.rc-url { margin-top: 10px; font-family: var(--mono); font-size: 10.5px; letter-spacing: .06em; color: var(--dim); text-align: right; overflow-wrap: anywhere; }

.result-actions { display: flex; flex-direction: column; gap: 10px; }

.review { padding-top: 6px; }
.review-heading { font-size: 14px; font-weight: 800; letter-spacing: .08em; color: var(--muted); margin-bottom: 10px; }
.review-list { display: flex; flex-direction: column; gap: 8px; }
.review-item { display: grid; grid-template-columns: 28px 1fr; gap: 10px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--panel); }
.review-mark { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; font-family: var(--mono); font-weight: 900; font-size: 14px; }
.review-item.ok .review-mark { background: rgba(62, 230, 255, .14); color: var(--cyan); }
.review-item.ng .review-mark { background: rgba(255, 61, 97, .14); color: var(--red); }
.review-tag { font-size: 11px; font-weight: 700; color: var(--dim); }
.review-title { font-size: 14px; font-weight: 800; line-height: 1.5; }
.review-note { margin-top: 4px; font-size: 13px; line-height: 1.65; color: var(--muted); }
.review-item.ng .review-note b { color: var(--cyan); }
.disclaimer { margin-top: 18px; font-size: 11px; line-height: 1.7; color: var(--dim); text-align: center; }

/* ---------- トースト ---------- */
.toast {
  position: absolute; left: 50%; bottom: calc(24px + var(--safe-b)); z-index: 20;
  transform: translateX(-50%);
  max-width: calc(100% - 32px);
  padding: 10px 16px; border-radius: 999px;
  background: rgba(240, 248, 255, .96); color: #05070f;
  font-size: 14px; font-weight: 700; white-space: nowrap;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .5);
  animation: rise .3s var(--ease) both;
}

.noscript { position: fixed; inset: auto 16px 16px; z-index: 50; padding: 12px; border-radius: 12px; background: #fff; color: #000; text-align: center; }

/* ---------- 画面の高さが低い端末（X内ブラウザなど） ---------- */
@media (max-height: 680px) {
  .screen-title { gap: 22px; }
  .eyebrow { margin-bottom: 14px; }
  .lead { margin-top: 14px; font-size: 14px; }
  .start-form { padding: 16px; }
  .screen-play { gap: 8px; }
  .hud-stats .stat { padding: 4px; }
  .stat dd { font-size: 18px; }
  .incident { padding: 12px 14px 14px; }
  .incident-head { margin-bottom: 6px; }
  .incident-title { font-size: 17px; }
  .incident-text { font-size: 13px; line-height: 1.6; }
  .choice { min-height: 54px; padding: 10px 12px; font-size: 15px; }
  .choices { gap: 8px; }
  .prompt { display: none; }
}
@media (max-width: 350px) {
  :root { --gutter: 12px; }
  .vs-avatar { width: 88px; height: 88px; }
  .rc-rank-letter { width: 64px; height: 64px; font-size: 42px; }
  .rc-rank-title { font-size: 17px; }
  .rc-big { font-size: 32px; }
  .pips li { width: 13px; }
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  .bg-glow { animation: none !important; }
  .incident.is-defended::after { display: none; }
  .btn-next-progress { display: none; }
}
