/* Assault Gear II — 公式サイト
 *
 * 色はゲーム本体の UI と同じトークン（tools/ui/tokens.py）。
 * 面取り（chamfer）はゲーム画面の意匠なので、要所だけに残して多用はしない。
 */

:root {
  /* --- ゲーム UI と共通のトークン --- */
  --void:     #0c1018;
  --plate:    #161c27;
  --plate2:   #1e2634;
  --plate3:   #273140;
  --line:     #313d4f;
  --line2:    #46556b;
  --text:     #e8edf4;
  --dim:      #94a2b6;
  --faint:    #64728a;
  --signal:   #ff7a1a;
  --signal-d: #b8560f;
  --live:     #3dd68c;
  --warn:     #ffc043;
  --enemy:    #ff5a52;
  --on-signal:#1a0d02;

  /* --- 間隔（4px 刻み） --- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 24px; --s6: 32px; --s7: 48px; --s8: 72px; --s9: 112px;

  --radius: 10px;
  --chamfer: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);

  --ease: cubic-bezier(.2, .7, .3, 1);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);

  --font: "Inter", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  --mono: "SF Mono", "Cascadia Mono", Consolas, ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 地に薄く光を置いて、真っ黒の板に見えないようにする */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(90ch 60ch at 50% -20%, rgba(255,122,26,.10), transparent 60%),
    radial-gradient(70ch 50ch at 100% 0%, rgba(77,157,255,.07), transparent 55%);
}

body > * { position: relative; z-index: 1; }

a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------- ヘッダ */

header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(12, 16, 24, .72);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s3) var(--s5);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--s3) var(--s6);
}

.logo {
  font-weight: 800;
  font-size: 19px;
  letter-spacing: .16em;
  color: var(--text);
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo em { color: var(--signal); font-style: normal; }

nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1) var(--s5);
}
nav a {
  position: relative;
  color: var(--dim);
  font-size: 14.5px;
  font-weight: 500;
  padding: var(--s1) 0;
  transition: color .18s var(--ease);
}
nav a:hover { color: var(--text); text-decoration: none; }
nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transition: transform .22s var(--ease);
}
nav a.here { color: var(--text); }
nav a.here::after { transform: scaleX(1); }

/* ---------------------------------------------------------- レイアウト */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--s7) var(--s5) var(--s9);
}

section + section { margin-top: var(--s8); }

.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--signal);
  margin: 0 0 var(--s3);
}

h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 800;
  margin: 0 0 var(--s4);
}

h2 {
  font-size: clamp(21px, 2.6vw, 27px);
  line-height: 1.3;
  letter-spacing: -.01em;
  font-weight: 700;
  margin: 0 0 var(--s5);
}

h3 {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 var(--s2);
}

p { margin: 0 0 var(--s4); }

.lead {
  font-size: clamp(16px, 1.7vw, 18.5px);
  color: var(--dim);
  max-width: 62ch;
}

.muted { color: var(--dim); }
.small { font-size: 14px; }

/* ---------------------------------------------------------- ヒーロー */

.hero {
  padding: var(--s7) 0 var(--s8);
  border-bottom: 1px solid var(--line);
}
.hero h1 { max-width: 20ch; }
.hero .actions { margin-top: var(--s6); }

/* ---------------------------------------------------------- ボタン */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 13px 26px;
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  background: var(--plate2);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease),
              transform .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover {
  background: var(--plate3);
  border-color: var(--faint);
  text-decoration: none;
  transform: translateY(-1px);
}
.btn:active { transform: translateY(0); }

.btn.primary {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--on-signal);
  box-shadow: 0 6px 22px -8px rgba(255,122,26,.75);
}
.btn.primary:hover {
  background: #ff8a33;
  border-color: #ff8a33;
  box-shadow: 0 10px 28px -8px rgba(255,122,26,.9);
}

/* Discord の招待。ブランド色を使うと一目で分かるが、主導線は
   「Discord ではじめる」なので primary より一段控えめにする。 */
.btn.discord {
  background: #5865f2;
  border-color: #5865f2;
  color: #fff;
}
.btn.discord:hover {
  background: #6774f4;
  border-color: #6774f4;
}
.btn.discord svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s3);
}

/* ---------------------------------------------------------- カード */

.grid {
  display: grid;
  gap: var(--s4);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card {
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s5);
  box-shadow: var(--shadow);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.card:hover { border-color: var(--line2); transform: translateY(-2px); }
.card p:last-child { margin-bottom: 0; }

/* 手順カードは番号を大きく置く */
.card .step-no {
  display: block;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--signal);
  margin-bottom: var(--s3);
}

.panel {
  background: var(--plate);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s6);
  box-shadow: var(--shadow);
}
.panel.narrow {
  max-width: 460px;
  margin: var(--s8) auto;
  clip-path: var(--chamfer);
}
.panel > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------- 注意書き */

.note {
  border: 1px solid var(--line);
  border-left: 3px solid var(--warn);
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255,192,67,.07), transparent 40%);
  padding: var(--s4) var(--s5);
  color: var(--dim);
  font-size: 14.5px;
}
.note.danger {
  border-left-color: var(--enemy);
  background: linear-gradient(90deg, rgba(255,90,82,.09), transparent 40%);
}
.note strong, .note b { color: var(--text); }
.note > :last-child { margin-bottom: 0; }

/* ---------------------------------------------------------- 定義リスト（表の代わり） */

.spec {
  display: grid;
  grid-template-columns: minmax(120px, max-content) 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.spec dt, .spec dd {
  background: var(--plate);
  margin: 0;
  padding: var(--s3) var(--s5);
  font-size: 15px;
}
.spec dt { color: var(--dim); font-weight: 500; white-space: nowrap; }
.spec dd { color: var(--text); }

/* ---------------------------------------------------------- フォーム */

.field { margin-bottom: var(--s5); }
.field:last-of-type { margin-bottom: var(--s6); }

/* 数値欄の説明。ラベルの直下、入力欄の上に置く */
.field .hint {
  display: block;
  margin: -2px 0 6px;
  line-height: 1.5;
}

/* ------------------------------------------------ 階級アイコン・成績 */

/* levels.png は 30x30 を 22 個並べた帯。tools/ui/build_levelicons.py が
   ゲームの res\ImageLevel.bmp から作るので、絵を差し替えても揃う */
.lv {
  display: inline-block;
  width: 30px;
  height: 30px;
  vertical-align: middle;
  background-image: url(/levels.png);
  background-repeat: no-repeat;
  /* ドット絵なので拡大縮小で滑らかにしない */
  image-rendering: pixelated;
}
.lv-none {
  background-image: none;
  border: 1px dashed var(--line2);
  border-radius: 4px;
  box-sizing: border-box;
}

/* アイコンと数値を1行に並べる。折り返しても縦位置が揃うように */
.stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2) var(--s4);
}

label {
  display: block;
  margin-bottom: var(--s2);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--dim);
  letter-spacing: .02em;
}

input[type=text], input[type=password] {
  width: 100%;
  padding: 12px 14px;
  background: var(--void);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
input::placeholder { color: var(--faint); }
input:hover { border-color: var(--line2); }
input:focus {
  outline: none;
  border-color: var(--signal);
  box-shadow: 0 0 0 3px rgba(255,122,26,.16);
}

.hint {
  margin-top: 6px;
  font-size: 12.5px;
  color: var(--faint);
}

/* ---------------------------------------------------------- お知らせ */

.news-item {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: var(--s5);
  padding: var(--s4) 0;
  border-bottom: 1px solid var(--line);
}
.news-item time {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--faint);
  padding-top: 3px;
  white-space: nowrap;
}

/* ---------------------------------------------------------- コード */

code {
  font-family: var(--mono);
  font-size: .9em;
  background: var(--plate2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 7px;
  color: var(--text);
  white-space: nowrap;
}
.spec dd code { background: var(--void); }

/* ---------------------------------------------------------- FAQ */

.faq { border-top: 1px solid var(--line); }
.faq details {
  border-bottom: 1px solid var(--line);
}
.faq summary {
  padding: var(--s4) var(--s5) var(--s4) 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: var(--s4);
  transition: color .18s var(--ease);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--signal); }
.faq summary::after {
  content: "+";
  font-family: var(--mono);
  color: var(--signal);
  flex: none;
}
.faq details[open] summary::after { content: "\2212"; }
.faq details > p {
  color: var(--dim);
  padding-bottom: var(--s4);
  max-width: 68ch;
}

/* ---------------------------------------------------------- フッタ */

footer {
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-size: 13px;
  text-align: center;
  padding: var(--s6) var(--s5);
}

/* ---------------------------------------------------------- 狭い画面 */

@media (max-width: 620px) {
  main { padding: var(--s6) var(--s4) var(--s8); }
  .header-inner { padding: var(--s3) var(--s4); }
  .panel { padding: var(--s5); }
  .spec { grid-template-columns: 1fr; }
  .spec dt { padding-bottom: 0; }
  .spec dd { padding-top: var(--s1); }
  .news-item { grid-template-columns: 1fr; gap: var(--s1); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto; }
}
