/* ============================================================
   ダイアレクト・エニグマ — 意匠
   深い夜の青と、古い金。石に刻まれた文字の質感。
   ============================================================ */

:root {
  --bg: #05070d;
  --bg-soft: #0a0f1b;
  --panel: rgba(13, 19, 32, 0.74);
  --panel-solid: #0d1320;
  --panel-raised: rgba(20, 28, 45, 0.82);

  --line: rgba(197, 164, 94, 0.16);
  --line-soft: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(197, 164, 94, 0.4);

  --gold: #d3ae63;
  --gold-lt: #f2dfa8;
  --gold-dp: #8d6a2c;
  --ink: #e9e4d6;
  --ink-dim: #a6a191;
  --ink-faint: #6c685e;

  --emerald: #63d3ab;
  --emerald-dp: #1d4a3b;
  --crimson: #d9736a;
  --crimson-dp: #4a2320;

  --radius: 14px;
  --radius-sm: 10px;

  --serif: "Cormorant Garamond", "Noto Serif JP", "Times New Roman", serif;
  --jp: "Noto Serif JP", "Hiragino Mincho ProN", "Yu Mincho", serif;

  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.35);

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--jp);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: 0.02em;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: rgba(211, 174, 99, 0.28);
  color: #fff;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  letter-spacing: inherit;
}

button:disabled {
  cursor: not-allowed;
}

input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

:focus-visible {
  outline: 1.5px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.45;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ── 背景レイヤー ─────────────────────────────── */

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.glow-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 44% at 50% -6%, rgba(74, 100, 160, 0.24) 0%, transparent 68%),
    radial-gradient(40% 30% at 88% 12%, rgba(151, 114, 48, 0.12) 0%, transparent 70%),
    radial-gradient(46% 40% at 8% 82%, rgba(46, 84, 92, 0.14) 0%, transparent 72%),
    linear-gradient(180deg, #05070d 0%, #060a12 42%, #04060b 100%);
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

.app {
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.noscript {
  padding: 80px 24px;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

/* ── 共通ボタン ───────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6em;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 13.5px;
  letter-spacing: 0.1em;
  border: 1px solid var(--line-strong);
  color: var(--gold-lt);
  background: linear-gradient(180deg, rgba(211, 174, 99, 0.1), rgba(211, 174, 99, 0.02));
  transition:
    transform 0.18s var(--ease),
    background 0.25s var(--ease),
    border-color 0.25s var(--ease),
    color 0.25s var(--ease),
    box-shadow 0.3s var(--ease);
  position: relative;
  overflow: hidden;
}

.btn:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(211, 174, 99, 0.2), rgba(211, 174, 99, 0.06));
  border-color: rgba(211, 174, 99, 0.65);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(140, 106, 44, 0.22);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.32;
  border-color: var(--line);
  color: var(--ink-faint);
  background: transparent;
}

.btn--primary {
  background: linear-gradient(180deg, #e7cd8c, #c39a49 55%, #a37c33);
  border-color: rgba(242, 223, 168, 0.6);
  color: #191307;
  font-weight: 500;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 10px 30px rgba(163, 124, 51, 0.28);
}

.btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #f4e0a6, #d3ae63 55%, #b28a3c);
  color: #12100a;
  box-shadow: 0 14px 38px rgba(180, 137, 58, 0.4);
}

.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink-dim);
}

.btn--ghost:hover:not(:disabled) {
  color: var(--gold-lt);
  border-color: var(--line-strong);
}

.btn--lg {
  padding: 15px 38px;
  font-size: 15px;
}

.btn--sm {
  padding: 7px 16px;
  font-size: 11.5px;
}

.btn--hint {
  border-style: dashed;
}

.hintcount {
  font-size: 10.5px;
  opacity: 0.7;
  letter-spacing: 0.05em;
}

.iconbtn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  color: var(--ink-dim);
  font-size: 15px;
  transition: all 0.22s var(--ease);
}

.iconbtn:hover {
  color: var(--gold-lt);
  border-color: var(--line-strong);
  background: rgba(211, 174, 99, 0.08);
}

/* ── HUD ──────────────────────────────────────── */

.hud {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 12px 26px;
  background: linear-gradient(180deg, rgba(6, 9, 16, 0.99), rgba(6, 9, 16, 0.96));
  border-bottom: 1px solid var(--line-soft);
}

.hud__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  flex-shrink: 0;
}

.hud__sigil {
  font-size: 18px;
  color: var(--gold);
  text-shadow: 0 0 18px rgba(211, 174, 99, 0.55);
  animation: breathe 5s ease-in-out infinite;
}

.hud__brandtext {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.hud__name {
  font-family: var(--jp);
  font-size: 13px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.hud__sub {
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  text-transform: uppercase;
}

.hud__progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: 4px;
}

.hud__ring {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  position: relative;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 360deg), rgba(255, 255, 255, 0.07) 0);
  transition: background 0.6s var(--ease);
}

.hud__ring::before {
  content: "";
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  background: #070b13;
}

.hud__ring > span {
  position: relative;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--gold-lt);
  letter-spacing: 0.02em;
}

.hud__ring small {
  font-size: 8px;
  opacity: 0.7;
}

.hud__progresstext {
  display: flex;
  flex-direction: column;
  line-height: 1.35;
}

.hud__progresslabel {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--ink-faint);
}

.hud__progresscount {
  font-size: 11.5px;
  color: var(--ink-dim);
  font-variant-numeric: tabular-nums;
}

.hud__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chipbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--ink-dim);
  transition: all 0.2s var(--ease);
  white-space: nowrap;
}

.chipbtn:hover {
  color: var(--gold-lt);
  border-color: var(--line-strong);
  background: rgba(211, 174, 99, 0.08);
}

.chipbtn__badge {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--gold);
  opacity: 0.85;
}

.chipbtn--accent {
  border-color: rgba(99, 211, 171, 0.24);
  color: rgba(99, 211, 171, 0.82);
}

.chipbtn--accent:hover {
  color: var(--emerald);
  border-color: rgba(99, 211, 171, 0.5);
  background: rgba(99, 211, 171, 0.08);
}

/* ── レイアウト ───────────────────────────────── */

.layout {
  display: grid;
  grid-template-columns: 268px minmax(0, 1fr);
  gap: 30px;
  max-width: 1260px;
  margin: 0 auto;
  padding: 26px 26px 100px;
  align-items: start;
}

.stage {
  min-width: 0;
  animation: fadeUp 0.5s var(--ease) both;
}

/* ── サイドバー ───────────────────────────────── */

.sidebar {
  position: sticky;
  top: 84px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(211, 174, 99, 0.2) transparent;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(211, 174, 99, 0.2);
  border-radius: 4px;
}

.phase {
  margin-bottom: 26px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.phase.is-locked {
  opacity: 0.44;
}

.phase--final {
  border-left-color: rgba(99, 211, 171, 0.24);
}

.phase__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.phase__name {
  font-size: 10px;
  letter-spacing: 0.28em;
  color: var(--gold);
  opacity: 0.8;
}

.phase__count {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.phase__title {
  font-size: 15px;
  letter-spacing: 0.1em;
  color: var(--ink);
  margin-top: 2px;
}

.phase__sub {
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  margin-bottom: 10px;
}

.missionlist {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mission {
  width: 100%;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 7px 9px;
  border-radius: 8px;
  text-align: left;
  border: 1px solid transparent;
  transition: all 0.18s var(--ease);
}

.mission:hover:not(:disabled) {
  background: rgba(211, 174, 99, 0.06);
  border-color: var(--line);
}

.mission.is-active {
  background: linear-gradient(90deg, rgba(211, 174, 99, 0.13), rgba(211, 174, 99, 0.02));
  border-color: var(--line-strong);
}

.mission.is-locked {
  opacity: 0.35;
}

.mission__dot {
  width: 16px;
  flex-shrink: 0;
  font-size: 10px;
  line-height: 1.9;
  color: var(--ink-faint);
  text-align: center;
}

.mission.is-solved .mission__dot {
  color: var(--emerald);
}

.mission.is-active .mission__dot {
  color: var(--gold);
}

.mission__body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.mission__title {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-dim);
  letter-spacing: 0.04em;
}

.mission.is-solved .mission__title {
  color: var(--ink);
}

.mission.is-active .mission__title {
  color: var(--gold-lt);
}

.mission__meta {
  display: flex;
  gap: 4px;
}

.pip {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: inline-block;
}

.pip.is-on {
  background: var(--emerald);
  box-shadow: 0 0 7px rgba(99, 211, 171, 0.65);
}

/* ── タイトル画面 ─────────────────────────────── */

[data-screen="title"] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.title {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding: 9vh 26px 70px;
  text-align: center;
  animation: fadeUp 0.9s var(--ease) both;
}

.title__aura {
  position: absolute;
  top: 4vh;
  left: 50%;
  transform: translateX(-50%);
  width: 560px;
  height: 560px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(211, 174, 99, 0.13), transparent 62%);
  filter: blur(20px);
  pointer-events: none;
  animation: pulseAura 9s ease-in-out infinite;
}

.title__kicker {
  position: relative;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.55em;
  color: var(--gold);
  opacity: 0.75;
  margin-bottom: 22px;
}

.title__main {
  position: relative;
  margin-bottom: 26px;
}

.title__line1 {
  display: block;
  font-family: var(--jp);
  font-weight: 300;
  font-size: clamp(30px, 5.6vw, 54px);
  letter-spacing: 0.12em;
  line-height: 1.3;
  background: linear-gradient(170deg, #fff8e4 0%, #f0dca6 32%, #c9a45a 66%, #9c7933 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 6px 30px rgba(180, 140, 60, 0.22));
}

.title__line2 {
  display: block;
  font-size: clamp(13px, 1.9vw, 16px);
  letter-spacing: 0.42em;
  color: var(--ink-dim);
  margin-top: 12px;
  padding-left: 0.42em;
}

.title__glyphs {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin: 30px 0 28px;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 0.16em;
  color: rgba(211, 174, 99, 0.55);
}

.title__glyphs i {
  color: rgba(211, 174, 99, 0.28);
  font-style: normal;
  font-size: 11px;
}

.title__glyphs span {
  animation: glyphGlow 6s ease-in-out infinite;
}

.title__glyphs span:nth-of-type(2) {
  animation-delay: 0.6s;
}
.title__glyphs span:nth-of-type(3) {
  animation-delay: 1.2s;
}
.title__glyphs span:nth-of-type(4) {
  animation-delay: 1.8s;
}
.title__glyphs span:nth-of-type(5) {
  animation-delay: 2.4s;
}

.title__lede {
  position: relative;
  font-size: 14.5px;
  line-height: 2.15;
  color: var(--ink-dim);
  margin-bottom: 38px;
}

.em {
  color: var(--gold-lt);
  border-bottom: 1px solid rgba(211, 174, 99, 0.4);
  padding-bottom: 1px;
}

.title__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 44px;
}

.title__stats {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 34px;
  padding: 22px 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 30px;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat__k {
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--ink-faint);
}

.stat__v {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--gold-lt);
  letter-spacing: 0.04em;
}

.title__foot {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

.title__footdim {
  opacity: 0.6;
}

/* ── パズルカード ─────────────────────────────── */

.puzzle {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.72), rgba(9, 13, 22, 0.86));
  box-shadow: var(--shadow-lg);
  padding: 30px 32px 34px;
  position: relative;
  overflow: hidden;
}

.puzzle::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 44% at 50% 0%, rgba(211, 174, 99, 0.09), transparent 70%);
  pointer-events: none;
}

.puzzle__head {
  position: relative;
  margin-bottom: 22px;
}

.puzzle__kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 10px;
}

.puzzle__pips {
  display: flex;
  gap: 5px;
  margin-left: auto;
}

.puzzle__title {
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: 0.08em;
  color: var(--ink);
  margin-bottom: 12px;
}

.puzzle__intro {
  font-size: 13.5px;
  line-height: 2;
  color: var(--ink-dim);
  max-width: 66ch;
}

/* ── 対訳の断片 ───────────────────────────────── */

.fragbox {
  margin: 22px 0 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(6, 10, 18, 0.5);
  overflow: hidden;
}

.fragbox > summary {
  cursor: pointer;
  padding: 11px 16px;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  transition: background 0.2s var(--ease);
}

.fragbox > summary::-webkit-details-marker {
  display: none;
}

.fragbox > summary::before {
  content: "▸";
  font-size: 9px;
  transition: transform 0.2s var(--ease);
}

.fragbox[open] > summary::before {
  transform: rotate(90deg);
}

.fragbox > summary:hover {
  background: rgba(211, 174, 99, 0.06);
}

.fragbox__count {
  margin-left: auto;
  font-family: var(--serif);
  color: var(--ink-faint);
  letter-spacing: 0.06em;
}

.fragbox__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 1px;
  background: var(--line-soft);
  border-top: 1px solid var(--line-soft);
}

.frag {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 8px 14px;
  background: #080c15;
  font-size: 12.5px;
}

.frag__stem {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--gold-lt);
  letter-spacing: 0.05em;
}

.frag__eq {
  color: var(--ink-faint);
  font-size: 10px;
}

.frag__jp {
  color: var(--ink);
}

.frag__pos {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.frag__new {
  font-size: 8.5px;
  letter-spacing: 0.12em;
  color: #10170f;
  background: var(--emerald);
  border-radius: 3px;
  padding: 1px 4px;
  align-self: center;
}

.frag.is-new {
  background: linear-gradient(90deg, rgba(99, 211, 171, 0.07), #080c15 60%);
}

/* ── タスク ───────────────────────────────────── */

/* タイルを押すたびに差し替わるので、ここには入場アニメーションを置かない */
.task {
  position: relative;
}

.task__label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--ink-dim);
  margin-bottom: 14px;
}

.task__step {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--gold);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  padding: 2px 7px;
}

/* 石版 */

.tablet {
  position: relative;
  border-radius: var(--radius-sm);
  padding: 1px;
  background: linear-gradient(160deg, rgba(211, 174, 99, 0.28), rgba(211, 174, 99, 0.05) 40%, rgba(255, 255, 255, 0.04));
  margin-bottom: 18px;
}

.tablet__inner {
  border-radius: calc(var(--radius-sm) - 1px);
  background:
    radial-gradient(120% 90% at 20% 0%, rgba(38, 50, 74, 0.6), transparent 60%),
    linear-gradient(180deg, #0b1120, #070b13);
  padding: 26px 24px;
  min-height: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), inset 0 -20px 40px rgba(0, 0, 0, 0.35);
}

.tablet--jp .tablet__inner {
  flex-direction: column;
  gap: 8px;
  background:
    radial-gradient(120% 90% at 80% 0%, rgba(60, 52, 30, 0.42), transparent 60%),
    linear-gradient(180deg, #100f0b, #08090d);
}

.vline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px 18px;
  font-family: var(--serif);
  font-size: clamp(20px, 2.9vw, 30px);
  letter-spacing: 0.08em;
  line-height: 1.7;
}

.vword {
  position: relative;
  color: rgba(233, 228, 214, 0.45);
  transition: color 0.3s var(--ease), text-shadow 0.3s var(--ease);
  cursor: help;
  padding: 0 2px;
}

.vword.is-known {
  color: var(--gold-lt);
  text-shadow: 0 0 24px rgba(211, 174, 99, 0.24);
}

.vword:hover {
  color: #fff8e4;
  text-shadow: 0 0 30px rgba(242, 223, 168, 0.5);
}

.jpline {
  font-size: clamp(16px, 2.1vw, 20px);
  letter-spacing: 0.1em;
  color: var(--ink);
  text-align: center;
  line-height: 1.9;
}

.jpline__note {
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

/* 解答欄 */

.answerbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 62px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(211, 174, 99, 0.26);
  background: rgba(5, 8, 14, 0.6);
  margin-bottom: 16px;
  transition: border-color 0.25s var(--ease);
}

.answerbox__hint {
  font-size: 11.5px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
}

.answerbox.is-shaking {
  animation: shake 0.45s var(--ease);
  border-color: rgba(217, 115, 106, 0.6);
}

.slot {
  width: 62px;
  height: 38px;
  border-radius: 7px;
  border: 1px dashed rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.015);
}

/* タイル */

.tilepool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.tile {
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid rgba(211, 174, 99, 0.2);
  background: linear-gradient(180deg, rgba(30, 40, 60, 0.72), rgba(16, 22, 35, 0.9));
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 0.05em;
  transition:
    transform 0.16s var(--ease),
    border-color 0.2s var(--ease),
    background 0.2s var(--ease),
    opacity 0.2s var(--ease);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.tile:hover:not(:disabled) {
  border-color: rgba(211, 174, 99, 0.55);
  background: linear-gradient(180deg, rgba(44, 56, 82, 0.85), rgba(22, 30, 46, 0.95));
  transform: translateY(-2px);
}

.tile:active:not(:disabled) {
  transform: translateY(0);
}

.tile.is-used {
  opacity: 0.16;
  pointer-events: none;
}

.tile--velaan {
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 0.06em;
  color: var(--gold-lt);
}

.tile--placed {
  background: linear-gradient(180deg, rgba(211, 174, 99, 0.2), rgba(140, 106, 44, 0.14));
  border-color: rgba(211, 174, 99, 0.5);
  color: #fff6dd;
  animation: popIn 0.22s var(--ease);
}

.tile--placed::after {
  content: "×";
  font-size: 9px;
  opacity: 0;
  margin-left: 5px;
  vertical-align: super;
  color: var(--gold);
  transition: opacity 0.15s;
}

.tile--placed:hover::after {
  opacity: 0.8;
}

/* 操作 */

.task__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* 洞察 */

.insight__q {
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--ink);
  margin-bottom: 16px;
  line-height: 1.9;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  text-align: left;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(10, 15, 25, 0.6);
  color: var(--ink-dim);
  font-size: 13.5px;
  line-height: 1.7;
  transition: all 0.2s var(--ease);
}

.option:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: rgba(211, 174, 99, 0.07);
  color: var(--ink);
  transform: translateX(3px);
}

.option__key {
  font-family: var(--serif);
  font-size: 12px;
  color: var(--gold);
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.option.is-correct {
  border-color: rgba(99, 211, 171, 0.55);
  background: rgba(99, 211, 171, 0.09);
  color: #d9fff0;
}

.option.is-correct .option__key {
  color: var(--emerald);
  border-color: rgba(99, 211, 171, 0.6);
}

.option.is-wrong {
  border-color: rgba(217, 115, 106, 0.5);
  background: rgba(217, 115, 106, 0.08);
  color: #ffd8d3;
}

.option.is-wrong .option__key {
  color: var(--crimson);
  border-color: rgba(217, 115, 106, 0.55);
}

.option.is-shaking {
  animation: shake 0.42s var(--ease);
}

/* ── 解読成功 ─────────────────────────────────── */

.solved {
  border: 1px solid rgba(99, 211, 171, 0.3);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(24, 52, 44, 0.42), rgba(8, 14, 18, 0.72));
  padding: 24px 26px 26px;
  animation: fadeUp 0.5s var(--ease) both;
}

.solved__head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}

.solved__mark {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 35% 30%, #9df0d1, #3aa383);
  color: #05130e;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: 0 0 26px rgba(99, 211, 171, 0.45);
  animation: popIn 0.4s var(--ease);
}

.solved__kicker {
  font-size: 9.5px;
  letter-spacing: 0.28em;
  color: var(--emerald);
}

.solved__title {
  font-family: var(--serif);
  font-size: clamp(19px, 2.3vw, 24px);
  letter-spacing: 0.07em;
  color: #eafff7;
}

.solved__jp {
  font-size: 15px;
  color: var(--gold-lt);
  letter-spacing: 0.08em;
  padding-left: 54px;
  margin-bottom: 18px;
}

.solved__explain {
  font-size: 13.5px;
  line-height: 2;
  color: var(--ink-dim);
  border-left: 2px solid rgba(99, 211, 171, 0.35);
  padding-left: 16px;
  margin-bottom: 20px;
}

.analysis {
  display: flex;
  flex-direction: column;
  gap: 1px;
  margin-bottom: 22px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--line-soft);
}

.analysis__row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 14px;
  padding: 10px 14px;
  background: rgba(7, 12, 18, 0.82);
  align-items: baseline;
}

.analysis__surface {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--gold-lt);
  letter-spacing: 0.05em;
}

.analysis__jp {
  font-size: 12.5px;
  color: var(--ink-dim);
}

.analysis__morph {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.morph {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 1px 7px;
}

.morph b {
  font-family: var(--serif);
  font-weight: 400;
  color: var(--gold);
  font-size: 12.5px;
}

.morph em {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
}

.morph__plus {
  color: var(--ink-faint);
  font-size: 9px;
}

/* ── 解読完了パネル ───────────────────────────── */

.done {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 26px;
  background: linear-gradient(180deg, rgba(20, 28, 45, 0.5), rgba(8, 12, 20, 0.7));
  animation: fadeUp 0.5s var(--ease) both;
}

.done__kicker {
  font-size: 9.5px;
  letter-spacing: 0.3em;
  color: var(--emerald);
  margin-bottom: 6px;
}

.done__title {
  font-size: 20px;
  letter-spacing: 0.08em;
  margin-bottom: 20px;
}

.done__block {
  margin-bottom: 20px;
}

.done__block h4 {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 10px;
}

.done__words {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.wordcard {
  display: flex;
  align-items: baseline;
  gap: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.02);
}

.wordcard b {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 14px;
  color: var(--gold-lt);
}

.wordcard i {
  font-style: normal;
  font-size: 11px;
  color: var(--ink-dim);
}

.done__rules li {
  font-size: 12.5px;
  color: var(--ink-dim);
  padding-left: 16px;
  position: relative;
  line-height: 1.9;
}

.done__rules li::before {
  content: "◆";
  position: absolute;
  left: 0;
  font-size: 6px;
  top: 0.7em;
  color: var(--gold);
}

.done__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* ── ドロワー ─────────────────────────────────── */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  justify-content: flex-end;
}

.drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 8, 0.78);
  animation: fadeIn 0.25s var(--ease);
}

.drawer__panel {
  position: relative;
  width: min(560px, 100%);
  height: 100%;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #0a1019, #060a11);
  border-left: 1px solid var(--line-strong);
  box-shadow: -30px 0 80px rgba(0, 0, 0, 0.6);
  animation: slideIn 0.32s var(--ease);
}

.drawer__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.drawer__tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  flex: 1;
  scrollbar-width: none;
}

.drawer__tabs::-webkit-scrollbar {
  display: none;
}

.drawer__tab {
  padding: 7px 13px;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  border-radius: 999px;
  white-space: nowrap;
  transition: all 0.2s var(--ease);
}

.drawer__tab:hover {
  color: var(--ink-dim);
}

.drawer__tab.is-active {
  color: var(--gold-lt);
  background: rgba(211, 174, 99, 0.12);
}

.drawer__search {
  padding: 12px 18px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}

.drawer__search input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--ink);
  font-size: 13px;
  letter-spacing: 0.05em;
}

.drawer__search input::placeholder {
  color: var(--ink-faint);
}

.drawer__scroll {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 60px;
  scrollbar-width: thin;
  scrollbar-color: rgba(211, 174, 99, 0.2) transparent;
}

.drawer__scroll::-webkit-scrollbar {
  width: 6px;
}

.drawer__scroll::-webkit-scrollbar-thumb {
  background: rgba(211, 174, 99, 0.2);
  border-radius: 4px;
}

.drawer__lede {
  font-size: 12px;
  color: var(--ink-faint);
  line-height: 1.9;
  margin-bottom: 16px;
  letter-spacing: 0.04em;
}

.drawer__dim {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 16px;
  text-align: center;
  letter-spacing: 0.1em;
}

.empty {
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: center;
  padding: 40px 10px;
  letter-spacing: 0.08em;
}

/* 辞書 */

.lexgroup {
  margin-bottom: 22px;
}

.lexgroup__title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 9.5px;
  letter-spacing: 0.26em;
  color: var(--gold);
  opacity: 0.75;
  padding-bottom: 6px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line);
}

.lexgroup__title span {
  font-family: var(--serif);
  color: var(--ink-faint);
  letter-spacing: 0.05em;
}

.lex-item {
  border-bottom: 1px solid var(--line-soft);
}

.lex-item > summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 6px;
  cursor: pointer;
  list-style: none;
  transition: background 0.18s var(--ease);
}

.lex-item > summary::-webkit-details-marker {
  display: none;
}

.lex-item > summary:hover {
  background: rgba(211, 174, 99, 0.05);
}

.lex-word {
  font-family: var(--serif);
  font-size: 15.5px;
  color: var(--gold-lt);
  letter-spacing: 0.05em;
  min-width: 88px;
}

.lex-gloss {
  font-size: 13px;
  color: var(--ink);
}

.lex-pos {
  margin-left: auto;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.lex-item.is-locked {
  opacity: 0.3;
}

.lex-item.is-locked > * {
  display: flex;
  gap: 10px;
  padding: 9px 6px;
  font-size: 12px;
  color: var(--ink-faint);
}

.lex-body {
  padding: 4px 6px 16px;
}

.lex-note {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.lex-invariant {
  font-size: 11.5px;
  color: var(--ink-dim);
}

.paradigm {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}

.paradigm th,
.paradigm td {
  text-align: left;
  padding: 5px 8px;
  border-bottom: 1px solid var(--line-soft);
  font-weight: 300;
}

.paradigm thead th {
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
}

.paradigm tbody th {
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  white-space: nowrap;
}

.paradigm td {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--gold-lt);
  letter-spacing: 0.04em;
}

.paradigm--verb td {
  font-size: 11.5px;
  padding: 4px 5px;
}

.paradigm--verb thead th {
  padding: 4px 5px;
  letter-spacing: 0.04em;
}

/* 文法ノート */

.rulecard {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 9px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.015);
}

.rulecard > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink);
  letter-spacing: 0.04em;
  list-style: none;
}

.rulecard > summary::-webkit-details-marker {
  display: none;
}

.rulecard > summary:hover {
  background: rgba(211, 174, 99, 0.05);
}

.rulecard__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  box-shadow: 0 0 8px rgba(211, 174, 99, 0.7);
}

.rulecard__body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--line-soft);
}

.rulecard__body > p {
  font-size: 12px;
  line-height: 2;
  color: var(--ink-dim);
  margin: 12px 0;
}

.example {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  padding: 7px 12px;
  border-left: 2px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.02);
  margin-bottom: 6px;
}

.example__v {
  font-family: var(--serif);
  font-size: 14.5px;
  color: var(--gold-lt);
  letter-spacing: 0.05em;
}

.example__jp {
  font-size: 12px;
  color: var(--ink-dim);
}

.note {
  display: block;
  margin-top: 14px;
}

.note > span {
  display: block;
  font-size: 9.5px;
  letter-spacing: 0.22em;
  color: var(--gold);
  opacity: 0.8;
  margin-bottom: 6px;
}

.note textarea {
  width: 100%;
  resize: vertical;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.32);
  color: var(--ink);
  font-size: 12px;
  line-height: 1.9;
  letter-spacing: 0.03em;
}

.note textarea::placeholder {
  color: var(--ink-faint);
}

.note textarea:focus {
  border-color: var(--line-strong);
  outline: none;
}

.note--free {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* 履歴 */

.histlist {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.hist {
  display: flex;
  gap: 10px;
  padding: 10px 8px;
  border-bottom: 1px solid var(--line-soft);
}

.hist__mark {
  font-size: 11px;
  width: 14px;
  flex-shrink: 0;
  color: var(--ink-faint);
}

.hist.is-ok .hist__mark {
  color: var(--emerald);
}

.hist.is-err .hist__mark {
  color: var(--crimson);
}

.hist__body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.hist__text {
  font-size: 12.5px;
  color: var(--ink-dim);
  word-break: break-word;
}

.hist.is-ok .hist__text {
  color: var(--ink);
}

.hist__meta {
  font-size: 9.5px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}

/* 実験室 */

.labcard {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
  background: rgba(255, 255, 255, 0.015);
}

.labcard h4 {
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--gold);
  opacity: 0.85;
  margin-bottom: 14px;
}

.labcontrols {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.labcontrols label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.labcontrols select {
  padding: 7px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: #0b111b;
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.03em;
}

.labtoggles {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
}

.switch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--ink-dim);
  cursor: pointer;
  letter-spacing: 0.06em;
}

.switch input {
  accent-color: #c39a49;
  width: 14px;
  height: 14px;
}

.labout {
  display: block;
  font-family: var(--serif);
  font-size: 24px;
  letter-spacing: 0.08em;
  color: var(--gold-lt);
  text-align: center;
  padding: 14px;
  border-radius: 8px;
  background: radial-gradient(120% 100% at 50% 0%, rgba(211, 174, 99, 0.1), rgba(0, 0, 0, 0.3));
  border: 1px solid var(--line);
  margin-bottom: 12px;
  word-break: break-all;
}

.labmorph {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  justify-content: center;
}

.labcard--note h4 {
  color: var(--emerald);
  opacity: 0.8;
}

.tinylist {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tinylist li {
  font-size: 11.5px;
  line-height: 1.9;
  color: var(--ink-dim);
  padding-left: 14px;
  position: relative;
}

.tinylist li::before {
  content: "·";
  position: absolute;
  left: 2px;
  color: var(--gold);
}

/* ── モーダル ─────────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 4, 8, 0.82);
  animation: fadeIn 0.25s var(--ease);
}

.modal__panel {
  position: relative;
  width: min(620px, 100%);
  max-height: 86vh;
  overflow-y: auto;
  padding: 34px 34px 30px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0c1220, #070b12);
  box-shadow: var(--shadow-lg);
  animation: fadeUp 0.35s var(--ease);
}

.modal__panel h2 {
  font-size: 20px;
  letter-spacing: 0.14em;
  margin-bottom: 16px;
  color: var(--gold-lt);
}

.modal__panel p {
  font-size: 13px;
  line-height: 2.05;
  color: var(--ink-dim);
  margin-bottom: 14px;
}

.guidelist {
  counter-reset: g;
  margin: 18px 0 20px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.guidelist li {
  counter-increment: g;
  position: relative;
  padding-left: 34px;
  font-size: 12.5px;
  line-height: 1.95;
  color: var(--ink-dim);
}

.guidelist li::before {
  content: counter(g);
  position: absolute;
  left: 0;
  top: 0.35em;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-size: 11px;
  color: var(--gold);
}

.guidelist b {
  color: var(--gold-lt);
  font-weight: 400;
}

.modal__dim {
  font-size: 11.5px;
  color: var(--ink-faint);
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

/* ── 最終章 ───────────────────────────────────── */

.ending {
  max-width: 900px;
  margin: 0 auto;
  padding: 46px 26px 110px;
  animation: fadeUp 0.7s var(--ease) both;
}

.ending__head {
  text-align: center;
  margin-bottom: 46px;
}

.ending__kicker {
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: 0.5em;
  color: var(--gold);
  opacity: 0.7;
  margin-bottom: 14px;
}

.ending__title {
  font-size: clamp(28px, 4.6vw, 42px);
  letter-spacing: 0.22em;
  color: var(--ink);
  margin-bottom: 18px;
  text-shadow: 0 0 50px rgba(211, 174, 99, 0.22);
}

.ending__lede {
  font-size: 13.5px;
  line-height: 2.1;
  color: var(--ink-dim);
  margin-bottom: 22px;
}

.ending__count {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.chron {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 60px;
}

.chronline {
  display: flex;
  gap: 18px;
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.3s var(--ease);
  position: relative;
}

.chronline:hover {
  background: rgba(255, 255, 255, 0.02);
  border-color: var(--line);
}

.chronline.is-shown {
  background: linear-gradient(90deg, rgba(211, 174, 99, 0.05), transparent 70%);
  border-color: var(--line);
}

.chronline__num {
  font-family: var(--serif);
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  flex-shrink: 0;
  padding-top: 6px;
}

.chronline__body {
  min-width: 0;
  flex: 1;
}

.chronline__vline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-family: var(--serif);
  font-size: clamp(17px, 2.3vw, 23px);
  letter-spacing: 0.07em;
  line-height: 1.75;
  color: var(--gold-lt);
  margin-bottom: 6px;
}

.chronline__translation {
  font-size: 13.5px;
  color: var(--ink);
  letter-spacing: 0.05em;
  line-height: 1.95;
  min-height: 26px;
}

.chronline__note {
  font-size: 11px;
  color: var(--ink-faint);
  letter-spacing: 0.03em;
  line-height: 1.9;
  margin-top: 7px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
  animation: fadeIn 0.5s var(--ease);
}

.reveal {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  border-bottom: 1px dashed rgba(211, 174, 99, 0.3);
  padding-bottom: 1px;
  transition: color 0.2s var(--ease);
}

.reveal:hover {
  color: var(--gold-lt);
}

.finalqs {
  border-top: 1px solid var(--line);
  padding-top: 42px;
}

.finalqs__title {
  font-size: clamp(19px, 2.6vw, 24px);
  letter-spacing: 0.14em;
  text-align: center;
  margin-bottom: 10px;
}

.finalqs__lede {
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  margin-bottom: 32px;
}

.finalq {
  margin-bottom: 26px;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(10, 15, 25, 0.55);
  transition: border-color 0.4s var(--ease);
}

.finalq.is-done {
  border-color: rgba(99, 211, 171, 0.32);
}

.finalq__q {
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink);
  margin-bottom: 14px;
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.finalq__q span {
  font-size: 9.5px;
  letter-spacing: 0.2em;
  color: var(--gold);
  flex-shrink: 0;
}

.finalq__explain {
  font-size: 12.5px;
  line-height: 2;
  color: var(--ink-dim);
  margin-top: 14px;
  padding-left: 14px;
  border-left: 2px solid rgba(99, 211, 171, 0.3);
  animation: fadeUp 0.5s var(--ease);
}

/* ── エピローグ ───────────────────────────────── */

.epi {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  padding: 12vh 26px 110px;
  text-align: center;
}

.epi__aura {
  position: absolute;
  top: 6vh;
  left: 50%;
  transform: translateX(-50%);
  width: 700px;
  height: 700px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(211, 174, 99, 0.16), rgba(99, 211, 171, 0.05) 42%, transparent 66%);
  filter: blur(38px);
  pointer-events: none;
  animation: pulseAura 10s ease-in-out infinite;
}

.epi__kicker {
  position: relative;
  font-size: 10px;
  letter-spacing: 0.55em;
  color: var(--emerald);
  margin-bottom: 18px;
  animation: fadeUp 0.9s var(--ease) both;
}

.epi__title {
  position: relative;
  font-size: clamp(26px, 4.2vw, 40px);
  letter-spacing: 0.2em;
  margin-bottom: 44px;
  background: linear-gradient(170deg, #fff8e4, #f0dca6 40%, #b8913f);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fadeUp 0.9s 0.15s var(--ease) both;
}

.epi__body {
  position: relative;
  margin-bottom: 48px;
}

.epi__p {
  font-size: 14.5px;
  line-height: 2.3;
  color: var(--ink-dim);
  margin-bottom: 22px;
  opacity: 0;
  animation: fadeUp 1.1s var(--ease) forwards;
}

.epi__p:first-child {
  font-family: var(--serif);
  font-size: 20px;
  color: var(--gold-lt);
  letter-spacing: 0.1em;
}

.epi__stats {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 38px;
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin-bottom: 34px;
  opacity: 0;
  animation: fadeUp 1s var(--ease) forwards;
}

.epi__actions {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  opacity: 0;
  animation: fadeUp 1s var(--ease) forwards;
}

/* ── トースト ─────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translate(-50%, 24px);
  z-index: 120;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(12, 18, 28, 0.95);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.06em;
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s var(--ease);
  box-shadow: var(--shadow-sm);
  max-width: calc(100vw - 40px);
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  border-color: rgba(217, 115, 106, 0.5);
  color: #ffd8d3;
}

.toast.is-info {
  border-color: rgba(211, 174, 99, 0.45);
  color: var(--gold-lt);
}

.toast.is-unlock {
  border-color: rgba(99, 211, 171, 0.5);
  color: #d9fff0;
}

/* ── アニメーション ───────────────────────────── */

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideIn {
  from {
    transform: translateX(40px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes popIn {
  0% {
    transform: scale(0.86);
    opacity: 0;
  }
  60% {
    transform: scale(1.04);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-7px);
  }
  40% {
    transform: translateX(6px);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(2px);
  }
}

@keyframes breathe {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.96);
  }
  50% {
    opacity: 1;
    transform: scale(1.06);
  }
}

@keyframes pulseAura {
  0%,
  100% {
    opacity: 0.65;
    transform: translateX(-50%) scale(1);
  }
  50% {
    opacity: 1;
    transform: translateX(-50%) scale(1.06);
  }
}

@keyframes glyphGlow {
  0%,
  100% {
    color: rgba(211, 174, 99, 0.42);
    text-shadow: none;
  }
  50% {
    color: rgba(242, 223, 168, 0.95);
    text-shadow: 0 0 22px rgba(211, 174, 99, 0.6);
  }
}

/* ── レスポンシブ ─────────────────────────────── */

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 18px 18px 90px;
  }

  .sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 2px 12px;
    scrollbar-width: thin;
  }

  .phase {
    flex: 0 0 220px;
    margin-bottom: 0;
  }

  .hud {
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 16px;
  }

  .hud__actions {
    width: 100%;
    justify-content: flex-start;
    order: 3;
  }

  .hud__progress {
    margin-left: auto;
  }
}

@media (max-width: 680px) {
  body {
    font-size: 14px;
  }

  .puzzle {
    padding: 22px 18px 26px;
  }

  .hud__brandtext {
    display: none;
  }

  .hud__ring {
    width: 38px;
    height: 38px;
  }

  .hud__progresstext {
    display: none;
  }

  .tablet__inner {
    padding: 20px 14px;
  }

  .analysis__row {
    grid-template-columns: 1fr;
  }

  .solved__jp {
    padding-left: 0;
  }

  .title {
    padding: 7vh 18px 50px;
  }

  .title__stats {
    gap: 22px;
  }

  .labcontrols {
    grid-template-columns: 1fr;
  }

  .ending {
    padding: 30px 16px 90px;
  }

  .chronline {
    padding: 14px 12px;
    gap: 10px;
  }

  .modal__panel {
    padding: 26px 20px;
  }

  .drawer__panel {
    width: 100%;
  }

  .toast {
    bottom: 18px;
    font-size: 11.5px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .epi__p,
  .epi__stats,
  .epi__actions {
    opacity: 1;
  }
}
