/* =========================================================
   ANOTERRA P0 — 現実を舞台に、金の細線と灯りだけを重ねる
   ========================================================= */
:root {
  --abyss: #07080a;
  --char: rgba(11, 12, 15, .78);
  --char-2: rgba(6, 7, 9, .9);
  --bone: #ece3cf;      /* 本文 */
  --bone-2: #a9a08c;    /* 補足 */
  --gold: #d6b062;      /* 細線 */
  --gold-hi: #f5dc9a;   /* 灯り */
  --gold-lo: #7c6130;
  --ember: #e0632e;     /* 危険・狩る */
  --blood: #a8231a;
  --spirit: #8fffe0;    /* 草鹿の紋様（物語の色） */
  --c-wood: #ffae5c; --c-stone: #bcd0ff; --c-metal: #7ae6ff;

  --line: rgba(214, 176, 98, .42);
  --line-soft: rgba(214, 176, 98, .18);

  --ease-sig: cubic-bezier(.87, .05, .02, .97);
  --ease-sharp: cubic-bezier(.7, .01, .23, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);

  --f-latin: "Cinzel", "Times New Roman", serif;
  --f-ital: "Cormorant Garamond", "Times New Roman", serif;
  --f-jp: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; }
body {
  background: var(--abyss); color: var(--bone);
  font-family: var(--f-jp); font-weight: 500; font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  overscroll-behavior: none; touch-action: manipulation;
}
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
button:focus-visible, .act:focus-visible { outline: 1px solid var(--gold-hi); outline-offset: 4px; }
[hidden] { display: none !important; }

/* ---------- 世界レイヤー ---------- */
#world-cam, #world-bg, #stage3d, #world-fx, #slowfx, #vig, #gather-fx { position: fixed; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
#world-cam { z-index: 0; object-fit: cover; background: var(--abyss); opacity: 0; transition: opacity .8s var(--ease-out); }
#world-bg { z-index: 0; }
.cam-live #world-cam { opacity: 1; }
.cam-live #world-bg { visibility: hidden; }
/* #grade は箱を作らない（子の mix-blend が実映像まで届くように、重ね合わせの文脈を切らない） */
#grade { display: contents; }
#grade i { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
.grade__tint { background: var(--tint, transparent); mix-blend-mode: soft-light; }
.grade__shade { background: #04060f; opacity: var(--shade, 0); mix-blend-mode: multiply; }
.grade__haze { background: linear-gradient(180deg, transparent 30%, rgba(210, 220, 232, .5) 75%, rgba(210, 220, 232, .2)); opacity: var(--haze, 0); mix-blend-mode: screen; }
#stage3d { z-index: 2; display: none; will-change: transform; }
#stage3d.is-on { display: block; }
#world-fx { z-index: 3; }
#slowfx { z-index: 4; background: #6d7a8c; mix-blend-mode: saturation; opacity: 0; transition: opacity .35s var(--ease-out); }
#slowfx.is-on { opacity: .85; transition-duration: .05s; }
#vig { z-index: 5; background: radial-gradient(ellipse 120% 90% at 50% 45%, transparent 45%, rgba(3, 4, 6, .78) 100%); }
#vig::before { content: ""; position: absolute; inset: 0; background: var(--grain); background-size: 160px; opacity: .07; mix-blend-mode: overlay; }
#vig::after { content: ""; position: absolute; inset: 0; background: rgba(4, 5, 7, 1); opacity: 0; transition: opacity .8s var(--ease-out); }
[data-mode="title"] #vig::after { opacity: .28; }
[data-mode="craft"] #vig::after, [data-mode="result"] #vig::after { opacity: .62; }
[data-mode="field"] #vig::after { opacity: .12; }
#gather-fx { z-index: 30; }

#app { position: fixed; inset: 0; z-index: 10; max-width: 520px; margin: 0 auto; }

/* ---------- 画面 ---------- */
.screen { position: absolute; inset: 0; display: none; flex-direction: column; padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 14px); }
.screen.is-active { display: flex; }

/* ---------- 共通部品 ---------- */
/* 金の細線の枠。四隅だけ濃く、辺は薄く */
.panel {
  position: relative; padding: 14px 16px 16px;
  background: linear-gradient(180deg, var(--char), var(--char-2));
  border: 1px solid var(--line-soft);
  -webkit-backdrop-filter: blur(10px) saturate(.8); backdrop-filter: blur(10px) saturate(.8);
}
.panel::before, .panel::after {
  content: ""; position: absolute; inset: -1px; pointer-events: none;
  background:
    linear-gradient(var(--gold), var(--gold)) top left / 14px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top left / 1px 14px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom right / 14px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom right / 1px 14px no-repeat;
}
.panel::after {
  background:
    linear-gradient(var(--gold), var(--gold)) top right / 14px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) top right / 1px 14px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom left / 14px 1px no-repeat,
    linear-gradient(var(--gold), var(--gold)) bottom left / 1px 14px no-repeat;
}
.panel__title {
  font-family: var(--f-jp); font-weight: 700; font-size: 12px; letter-spacing: .42em;
  color: var(--gold); margin-bottom: 10px; display: flex; align-items: center; gap: 10px;
}
.panel__title::before { content: ""; width: 5px; height: 5px; background: var(--gold); transform: rotate(45deg); flex: none; }
.panel__title::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--line), transparent); }

/* ボタン: 面取りの暗い板＋金の縁。押すと光が走る */
.btn {
  --edge: var(--gold); --txt: var(--gold-hi); --glow: rgba(245, 220, 154, .35);
  position: relative; isolation: isolate; overflow: hidden;
  font-family: var(--f-jp); font-weight: 700; font-size: 16px; letter-spacing: .32em; text-indent: .32em;
  color: var(--txt); padding: 14px 22px;
  background: linear-gradient(180deg, rgba(26, 22, 16, .92), rgba(10, 9, 8, .96));
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
  text-shadow: 0 0 12px var(--glow);
  transition: transform .18s var(--ease-sharp), filter .25s;
}
.btn::before { /* 縁 */
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--edge);
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%, 1px 50%, 10.5px calc(100% - 1px), calc(100% - 10.5px) calc(100% - 1px), calc(100% - 1px) 50%, calc(100% - 10.5px) 1px, 10.5px 1px, 1px 50%, 0 50%);
  opacity: .8;
}
.btn::after { /* 光の走り */
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(245, 220, 154, .28), transparent);
  transform: skewX(-20deg); opacity: 0;
}
.btn:active { transform: scale(.975, 1.02); }
.btn:active::after { animation: sweep .5s var(--ease-sharp); }
@keyframes sweep { from { left: -60%; opacity: 1; } to { left: 120%; opacity: 1; } }
.btn[disabled] { filter: grayscale(1) brightness(.5); pointer-events: none; }
.btn small { display: block; font-size: 10px; letter-spacing: .2em; text-indent: .2em; opacity: .65; margin-top: 3px; font-weight: 500; }
.btn--main { background: radial-gradient(120% 140% at 50% 120%, rgba(214, 176, 98, .28), transparent 60%), linear-gradient(180deg, rgba(30, 25, 17, .94), rgba(10, 9, 8, .97)); }
.btn--ember { --edge: #f08a52; --txt: #ffe1cf; --glow: rgba(255, 120, 60, .6); background: radial-gradient(120% 140% at 50% 120%, rgba(224, 99, 46, .45), transparent 65%), linear-gradient(180deg, rgba(40, 16, 10, .94), rgba(14, 7, 6, .97)); }
.btn--line { --edge: rgba(214, 176, 98, .55); --txt: var(--bone); --glow: transparent; letter-spacing: .12em; text-indent: .12em; font-size: 14px; }
.btn--xl { font-size: 19px; padding: 18px 28px; width: 100%; }

.icon-btn {
  width: 44px; height: 44px; display: grid; place-items: center; color: var(--gold-hi);
  background: var(--char); border: 1px solid var(--line);
  transform: rotate(45deg) scale(.78);
}
.icon-btn svg { width: 22px; height: 22px; transform: rotate(-45deg) scale(1.28); }

.chip {
  font-family: var(--f-jp); font-size: 12px; font-weight: 700; padding: 8px 10px; letter-spacing: .06em;
  background: rgba(10, 10, 12, .6); border: 1px solid var(--line-soft); color: var(--bone);
}
.chip.is-on { border-color: var(--gold); color: var(--gold-hi); background: rgba(214, 176, 98, .14); }
.chip--warn { border-color: rgba(224, 99, 46, .6); color: #ffb49a; }
.chip--dark { background: var(--char-2); border-color: var(--line); letter-spacing: .3em; padding: 8px 12px 8px 15px; }

.fine { font-size: 10.5px; color: var(--bone-2); letter-spacing: .06em; text-align: center; margin: 10px 0 0; line-height: 1.6; }

.topbar { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; position: relative; z-index: 3; }
.topbar__title { font-weight: 800; font-size: 19px; letter-spacing: .6em; text-indent: .6em; text-align: center; color: var(--bone); text-shadow: 0 2px 12px rgba(0, 0, 0, .8); }

/* ルーン円（SVG・JSで刻みを生成） */
.rune { overflow: visible; }
.rune circle, .rune path, [data-rune-g] circle, [data-rune-g] path { fill: none; stroke: var(--gold); vector-effect: non-scaling-stroke; }

/* ---------- タイトル ---------- */
[data-screen="title"] { justify-content: space-between; }
.title__logo { position: relative; margin-top: 16vh; display: grid; justify-items: center; text-align: center; }
.rune--title { position: absolute; left: 50%; top: 50%; width: min(118vw, 560px); aspect-ratio: 1; transform: translate(-50%, -50%); opacity: .55; animation: runeIn 2.4s .2s var(--ease-out) both, spin 160s linear infinite; }
.rune--title .r-slow { animation: spin 90s linear infinite reverse; transform-origin: 200px 200px; }
@keyframes runeIn { from { opacity: 0; scale: .86 .8; } }
@keyframes spin { to { rotate: 360deg; } }
.title__eyebrow { margin: 0 0 6px; font-family: var(--f-ital); font-style: italic; font-weight: 500; font-size: 15px; letter-spacing: .3em; color: var(--gold); animation: fadeUp 1.2s 1.1s var(--ease-out) both; }
.title__name { position: relative; margin: 0; font-family: var(--f-latin); font-weight: 900; font-size: clamp(40px, 12.4vw, 62px); letter-spacing: .12em; text-indent: .12em; line-height: 1; }
.title__word {
  display: block;
  background: linear-gradient(180deg, #fff4d2 0%, #e2c27c 38%, #8a6a32 62%, #d9bb77 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 18px rgba(245, 200, 120, .28)) drop-shadow(0 2px 1px rgba(0, 0, 0, .9));
  animation: logoIn 1.8s .3s var(--ease-sig) both;
}
.title__sheen {
  position: absolute; inset: 0; color: transparent;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .95) 48%, rgba(255, 240, 200, .6) 52%, transparent 62%) no-repeat;
  background-size: 250% 100%; background-position: 120% 0;
  -webkit-background-clip: text; background-clip: text;
  animation: sheen 5.5s 2.2s var(--ease-sharp) infinite;
}
@keyframes sheen { 0% { background-position: 120% 0; } 38%, 100% { background-position: -30% 0; } }
@keyframes logoIn { from { clip-path: inset(0 50% 0 50%); letter-spacing: .5em; filter: blur(10px); opacity: 0; } to { clip-path: inset(0 -5% 0 -5%); } }
.title__rule { display: block; width: 72%; height: 9px; margin: 16px 0 14px; position: relative; animation: ruleIn 1.3s .9s var(--ease-sig) both; }
.title__rule::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold), transparent); }
.title__rule::after { content: ""; position: absolute; left: 50%; top: 0; width: 9px; height: 9px; border: 1px solid var(--gold-hi); background: var(--abyss); transform: translateX(-50%) rotate(45deg); box-shadow: 0 0 12px rgba(245, 220, 154, .7); }
@keyframes ruleIn { from { transform: scaleX(0); opacity: 0; } }
.title__sub { margin: 0; font-weight: 700; font-size: 16px; letter-spacing: .34em; text-indent: .34em; color: var(--bone); text-shadow: 0 0 20px rgba(0, 0, 0, .9); animation: fadeUp 1.4s 1.4s var(--ease-out) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); filter: blur(4px); } }
.title__foot { animation: fadeUp 1.2s 1.9s var(--ease-out) both; }

/* ---------- フィールド ---------- */
[data-screen="field"] { gap: 12px; }
.field__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.wx-chip { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 0; }
.wx-chip__ico { width: 30px; height: 30px; flex: none; color: var(--gold-hi); filter: drop-shadow(0 0 6px rgba(245, 220, 154, .5)); }
.wx-chip b { display: block; font-size: 15px; letter-spacing: .12em; font-weight: 700; text-shadow: 0 1px 10px rgba(0, 0, 0, .9); }
.wx-chip small { display: block; font-size: 11px; color: var(--gold); letter-spacing: .1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 6px rgba(0, 0, 0, .9); }

.field__center { flex: 1; display: grid; place-items: center; position: relative; min-height: 170px; }
.steps { position: relative; width: 190px; height: 190px; display: grid; place-items: center; }
.steps__ring { position: absolute; inset: 0; overflow: visible; }
.steps__runes { transform-origin: 100px 100px; animation: spin 120s linear infinite; opacity: .55; }
.steps__track { fill: rgba(5, 6, 8, .5); stroke: var(--line-soft); stroke-width: 1; }
.steps__bar { fill: none; stroke: var(--gold-hi); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 502.7; stroke-dashoffset: 502.7; transform: rotate(-90deg); transform-origin: 100px 100px; filter: drop-shadow(0 0 5px rgba(245, 220, 154, .8)); transition: stroke-dashoffset .8s var(--ease-sharp); }
.steps__txt { position: relative; text-align: center; line-height: 1.2; }
.steps__txt b { display: block; font-family: var(--f-latin); font-weight: 700; font-size: 44px; color: var(--gold-hi); text-shadow: 0 0 18px rgba(245, 220, 154, .45); margin: 2px 0; }
.steps__txt small { font-size: 10.5px; letter-spacing: .2em; color: var(--bone-2); }

.presence { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 4px; }
.presence__line { margin: 0; font-size: 13px; letter-spacing: .5em; text-indent: .5em; color: var(--bone-2); animation: fadeUp .9s var(--ease-out) both; }
.presence__big { margin: 0 0 16px; font-weight: 800; font-size: 40px; letter-spacing: .3em; text-indent: .3em; color: #ffe1cf; text-shadow: 0 0 24px rgba(224, 99, 46, .8), 0 0 2px #000; animation: presenceIn 1.1s .25s var(--ease-sig) both; }
.presence .btn { min-width: 180px; animation: fadeUp .8s .8s var(--ease-out) both; }
@keyframes presenceIn { from { opacity: 0; letter-spacing: 1em; filter: blur(8px); transform: scale(1.1, .9); } }

.bag { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px 10px; }
.bag li { display: flex; align-items: center; gap: 6px; min-width: 0; padding: 4px 0; border-bottom: 1px solid rgba(214, 176, 98, .12); }
.bag li svg { width: 24px; height: 24px; flex: none; overflow: visible; }
.bag li span { font-size: 11px; color: var(--bone-2); white-space: nowrap; letter-spacing: .04em; }
.bag li b { font-family: var(--f-latin); font-weight: 700; font-size: 17px; margin-left: auto; color: var(--bone); }
.bag li.is-bump { animation: bump .6s var(--ease-pop); }
.bag li.is-bump b { color: var(--gold-hi); text-shadow: 0 0 10px var(--gold); }
@keyframes bump { 30% { transform: scale(1.1, .9); } 60% { transform: scale(.96, 1.05); } }
.bag--loot { grid-template-columns: repeat(2, 1fr); }

.equip { margin-top: 10px; display: flex; align-items: center; gap: 12px; font-size: 13px; min-height: 44px; }
.equip svg { width: 46px; height: 46px; flex: none; filter: drop-shadow(0 0 8px rgba(214, 176, 98, .25)); }
.equip b { font-weight: 700; letter-spacing: .08em; }
.equip em { font-style: normal; font-size: 11px; color: var(--bone-2); letter-spacing: .08em; }

.actions { display: grid; grid-template-columns: 1fr 1fr 1.25fr; gap: 10px; }
.act {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px 11px; color: var(--gold-hi);
  background: linear-gradient(180deg, rgba(20, 18, 15, .85), rgba(7, 7, 8, .92));
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-weight: 700; font-size: 15px; letter-spacing: .4em; text-indent: .4em;
  transition: transform .18s var(--ease-sharp), background .3s;
}
.act::before, .act::after { content: ""; position: absolute; top: 50%; width: 7px; height: 7px; border: 1px solid var(--gold); background: var(--abyss); transform: translateY(-50%) rotate(45deg); }
.act::before { left: -4px; } .act::after { right: -4px; }
.act svg { width: 32px; height: 32px; filter: drop-shadow(0 0 6px rgba(245, 220, 154, .35)); }
.act span { color: var(--bone); }
.act:active { transform: scale(.96, 1.03); background: linear-gradient(180deg, rgba(60, 48, 26, .9), rgba(12, 10, 8, .95)); }
.act--hunt { color: #ffb48c; border-color: rgba(240, 138, 82, .7); background: radial-gradient(90% 120% at 50% 110%, rgba(224, 99, 46, .42), transparent 70%), linear-gradient(180deg, rgba(34, 14, 9, .88), rgba(10, 6, 6, .95)); }
.act--hunt svg { filter: drop-shadow(0 0 10px rgba(255, 110, 50, .8)); animation: flame 2.6s ease-in-out infinite; transform-origin: 50% 90%; }
.act--hunt::before, .act--hunt::after { border-color: #f08a52; }
@keyframes flame { 50% { transform: scale(.96, 1.06) skewX(-2deg); } }

/* デバッグ */
.debug { position: absolute; right: 12px; top: calc(var(--safe-t) + 64px); z-index: 5; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.debug__toggle { width: 32px; height: 32px; background: var(--char-2); color: var(--gold); border: 1px solid var(--line); font-size: 13px; }
.debug__body { display: none; width: 268px; background: var(--char-2); border: 1px solid var(--line); padding: 10px; max-height: 70vh; overflow-y: auto; }
.debug.is-open .debug__body { display: block; animation: dbgIn .35s var(--ease-sig); }
@keyframes dbgIn { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }
.debug__h { margin: 6px 0 6px; font-size: 10px; letter-spacing: .3em; color: var(--gold); }
.debug__grid, .seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg .chip { flex: 1 0 28%; }
.no-debug .debug { display: none; }

/* ---------- 採集 ---------- */
[data-screen="gather"] { padding: 0; }
[data-screen="gather"] .topbar { padding: calc(var(--safe-t) + 12px) 16px 0; }
.depl { display: flex; gap: 8px; }
.depl span {
  --p: 0; position: relative; width: 34px; height: 34px; display: grid; place-items: center;
  font-size: 12px; font-weight: 700; color: var(--abyss);
  background: conic-gradient(rgba(6, 7, 9, .9) calc(var(--p) * 1turn), var(--c) 0);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  transition: filter .3s;
}
.depl span.is-empty { color: var(--bone-2); }
.depl span.is-got { animation: got .7s var(--ease-pop); }
@keyframes got { 0% { filter: brightness(3); transform: scale(1.5, 1.2); } 100% { filter: none; transform: none; } }
.reticle { position: absolute; left: 50%; top: 45%; width: min(70vw, 290px); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; }
.reticle svg { width: 100%; height: 100%; overflow: visible; }
.reticle__runes { transform-origin: 100px 100px; animation: spin 40s linear infinite; opacity: .7; }
.reticle__ring { fill: none; stroke: rgba(245, 220, 154, .45); stroke-width: 1; }
.reticle__corners { fill: none; stroke: var(--gold-hi); stroke-width: 1.5; filter: drop-shadow(0 0 4px rgba(245, 220, 154, .8)); }
.reticle__prog { fill: none; stroke: var(--gold-hi); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 566; stroke-dashoffset: 566; transform: rotate(-90deg); transform-origin: center; filter: drop-shadow(0 0 8px rgba(255, 220, 140, .95)); }
.reticle.is-hit svg { animation: retHit .6s var(--ease-pop); }
@keyframes retHit { 30% { transform: scale(1.12, .92); filter: brightness(2); } 60% { transform: scale(.96, 1.04); } }
.reticle__read { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 8px); text-align: center; white-space: nowrap; }
.reticle__read b { display: inline-block; font-weight: 800; font-size: 26px; letter-spacing: .3em; text-indent: .3em; color: var(--bone); text-shadow: 0 0 16px var(--c, transparent), 0 1px 8px rgba(0, 0, 0, .9); }
.reticle__read small { display: block; margin-top: 2px; font-family: var(--f-ital); font-style: italic; font-size: 13px; color: var(--gold); letter-spacing: .08em; text-shadow: 0 1px 4px #000; }
.gather__foot { position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 16px calc(var(--safe-b) + 14px); display: flex; flex-direction: column; align-items: center; background: linear-gradient(180deg, transparent, rgba(4, 5, 7, .75)); }
.gather__msg { font-size: 13px; font-weight: 700; margin: 0 0 14px; text-align: center; letter-spacing: .08em; min-height: 1.6em; text-shadow: 0 1px 8px #000; }
.gather__msg.is-bad { color: #ffb49a; }
.hold {
  position: relative; width: 94px; height: 94px; display: grid; place-items: center;
  font-weight: 700; font-size: 12px; line-height: 1.4; letter-spacing: .14em; color: var(--gold-hi);
  background: radial-gradient(circle, rgba(214, 176, 98, .3), rgba(8, 8, 10, .85) 70%);
  border: 1px solid var(--gold); border-radius: 50%;
  box-shadow: 0 0 0 6px rgba(214, 176, 98, .08), 0 0 24px rgba(214, 176, 98, .25) inset;
  touch-action: none; transition: transform .2s var(--ease-sharp), box-shadow .3s;
}
.hold span { display: block; padding: 0 14px; }
.hold.is-down { transform: scale(1.08, .94); box-shadow: 0 0 0 16px rgba(214, 176, 98, .12), 0 0 40px rgba(245, 220, 154, .6) inset; }
.demo { width: 100%; margin-top: 12px; }
.demo__why { margin: 0 0 10px; font-size: 12px; text-align: center; color: var(--gold-hi); letter-spacing: .04em; }
.demo__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.demo__row .btn { font-size: 13px; padding: 11px 4px; }
.gather--nocam .hold, .gather--nocam .reticle { display: none; }

/* ---------- 工房 ---------- */
[data-screen="craft"] { gap: 14px; }
.craft__list { display: flex; flex-direction: column; gap: 14px; overflow-y: auto; padding: 4px 1px 20px; }
.recipe { display: grid; grid-template-columns: 92px 1fr; gap: 14px; align-items: center; }
.recipe__art { width: 92px; height: 92px; background: radial-gradient(circle at 50% 55%, rgba(214, 176, 98, .22), transparent 68%); }
.recipe__art svg { width: 100%; height: 100%; }
.recipe h3 { margin: 0; font-weight: 800; font-size: 18px; letter-spacing: .12em; }
.recipe h3 em { font-style: normal; font-size: 11px; color: var(--gold); margin-left: 8px; letter-spacing: .2em; font-weight: 500; }
.recipe p { margin: 5px 0 10px; font-size: 12px; color: var(--bone-2); line-height: 1.7; }
.need { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.need span { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; }
.need span svg { width: 20px; height: 20px; }
.need span.is-short { color: #ffb49a; }
.recipe__btns { display: flex; gap: 8px; }
.recipe__btns .btn { font-size: 13px; padding: 10px 16px; letter-spacing: .2em; }
.stat { font-size: 11px; color: var(--bone-2); margin-bottom: 8px; }

.forge { position: fixed; inset: 0; z-index: 30; display: grid; place-content: center; justify-items: center; gap: 12px; background: radial-gradient(circle at 50% 45%, rgba(60, 40, 14, .6), rgba(3, 3, 4, .94) 70%); }
.rune--forge { position: absolute; left: 50%; top: calc(50% - 26px); width: 460px; aspect-ratio: 1; transform: translate(-50%, -50%); animation: runeIn 1.2s var(--ease-out) both, spin 30s linear infinite; }
.forge__art { position: relative; width: 220px; height: 220px; }
.forge__art::before { content: ""; position: absolute; inset: -30%; background: radial-gradient(circle, rgba(255, 220, 150, .55), transparent 60%); animation: forgeGlow 1.6s .9s var(--ease-out) both; }
@keyframes forgeGlow { 0% { opacity: 0; transform: scale(.3); } 30% { opacity: 1; transform: scale(1.1); } 100% { opacity: .5; } }
.forge__art svg { position: relative; width: 100%; height: 100%; overflow: visible; filter: drop-shadow(0 0 14px rgba(245, 220, 154, .45)); }
.forge__art .s { stroke-dasharray: 100; stroke-dashoffset: 100; fill-opacity: 0; animation: draw 1.1s var(--ease-sig) forwards, fillIn .45s 1s var(--ease-sharp) forwards; }
.forge__art path:not(.s), .forge__art circle { opacity: 0; animation: fillIn .4s 1.05s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fillIn { to { fill-opacity: 1; opacity: 1; } }
.forge__name { position: relative; font-weight: 800; font-size: 22px; margin: 0; letter-spacing: .24em; animation: fadeUp .8s 1.1s var(--ease-out) both; }
.forge__stamp { position: relative; font-family: var(--f-jp); font-weight: 800; font-size: 15px; letter-spacing: 1em; text-indent: 1em; color: var(--gold-hi); text-shadow: 0 0 14px var(--gold); animation: presenceIn 1s 1.3s var(--ease-sig) both; }

/* ---------- 戦闘 ---------- */
[data-screen="battle"] { padding: 0; }
#battle-cv { position: fixed; inset: 0; width: 100vw; height: 100%; display: block; touch-action: none; }
.hud { position: absolute; inset: 0; pointer-events: none; padding: calc(var(--safe-t) + 12px) 14px calc(var(--safe-b) + 14px); display: flex; flex-direction: column; justify-content: space-between; }
.hud button { pointer-events: auto; }
.hud__top { display: flex; gap: 12px; align-items: flex-start; }
.hud__mon { flex: 1; min-width: 0; }
.hud__name { display: flex; align-items: baseline; gap: 8px; text-shadow: 0 1px 8px rgba(0, 0, 0, .9); }
.hud__name b { font-weight: 800; font-size: 19px; letter-spacing: .24em; }
.hud__name em { font-family: var(--f-latin); font-style: normal; font-size: 9px; letter-spacing: .3em; color: var(--gold); }
.hud__rage { display: none; font-weight: 800; font-size: 13px; color: #ffd2bd; padding: 0 6px; border: 1px solid var(--ember); background: rgba(120, 30, 10, .6); text-shadow: 0 0 8px var(--ember); }
.hud__rage.is-on { display: inline-block; animation: presenceIn .5s var(--ease-sig); }
.hud__atk { font-size: 14px; font-weight: 700; letter-spacing: .2em; color: var(--gold-hi); margin-left: auto; opacity: 0; transition: opacity .1s; text-shadow: 0 0 10px var(--gold); }
.hud__atk.is-on { opacity: 1; animation: atkIn .35s var(--ease-sig); }
@keyframes atkIn { from { clip-path: inset(0 100% 0 0); transform: translateX(10px); } to { clip-path: inset(0 0 0 0); } }
.bar { position: relative; height: 6px; margin-top: 6px; background: rgba(0, 0, 0, .6); outline: 1px solid var(--line); outline-offset: 2px; overflow: hidden; }
.bar i, .bar em { position: absolute; left: 0; top: 0; bottom: 0; width: 100%; transform-origin: left; }
.bar i { z-index: 2; background: linear-gradient(90deg, #7a1d12, #d4482a 70%, #ff9a6a); box-shadow: 0 0 10px rgba(224, 99, 46, .8); transition: transform .12s var(--ease-sharp); }
.bar em { z-index: 1; background: rgba(245, 220, 154, .75); transition: transform .9s .35s var(--ease-sharp); }
.bar--me { height: 5px; width: 190px; }
.bar--me i { background: linear-gradient(90deg, #2c6d58, #6fe0b8); box-shadow: 0 0 10px rgba(111, 224, 184, .6); }
.bar--me.is-low i { background: linear-gradient(90deg, #6d140c, #e0442a); box-shadow: 0 0 12px rgba(224, 68, 42, .9); }
.parts { display: flex; gap: 6px; margin-top: 10px; }
.parts span { font-size: 11px; font-weight: 700; padding: 2px 8px; color: var(--bone-2); background: rgba(6, 7, 9, .6); border: 1px solid var(--line-soft); transition: color .2s, border-color .2s; }
.parts span.is-target { border-color: var(--gold); color: var(--gold-hi); box-shadow: 0 0 10px rgba(214, 176, 98, .35); }
.parts span.is-broken { color: #ffc9b4; border-color: var(--ember); text-decoration: line-through; text-decoration-color: var(--ember); }
.parts span.is-hit { animation: bump .3s var(--ease-pop); }
.timer { position: relative; width: 50px; height: 50px; display: grid; place-items: center; flex: none; }
.timer svg { position: absolute; inset: 0; transform: rotate(-90deg); overflow: visible; }
.timer__track { fill: rgba(6, 7, 9, .6); stroke: var(--line-soft); stroke-width: 1; }
.timer__bar { fill: none; stroke: var(--gold-hi); stroke-width: 2; stroke-dasharray: 125.7; stroke-dashoffset: 0; filter: drop-shadow(0 0 4px var(--gold)); }
.timer.is-late .timer__bar { stroke: var(--ember); }
.timer b { position: relative; font-family: var(--f-latin); font-weight: 700; font-size: 16px; }
.hud__bot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.hud__me { display: flex; flex-direction: column; gap: 6px; }
.hud__wpn { font-size: 12px; font-weight: 700; letter-spacing: .12em; text-shadow: 0 1px 6px #000; }
.hud__weapon { position: absolute; right: 6px; bottom: calc(var(--safe-b) + 58px); width: 118px; height: 118px; transform-origin: 80% 90%; transition: transform .25s var(--ease-sharp); }
.hud__weapon svg { width: 100%; height: 100%; filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .7)); }
.hud__weapon.is-swing { animation: swing .22s var(--ease-sig); }
.hud__weapon.is-heavy { animation: heavy .42s var(--ease-sig); }
.hud__weapon.is-charge { transform: translate(-10px, -18px) rotate(-26deg) scale(1.06, .96); }
.hud__weapon.is-charge3 svg { filter: drop-shadow(0 0 12px var(--gold-hi)) drop-shadow(0 0 3px #fff); }
@keyframes swing { 0% { transform: rotate(0); } 35% { transform: translate(-30px, -10px) rotate(-55deg) scale(1.1, .9); } 100% { transform: none; } }
@keyframes heavy { 0% { transform: translate(-10px, -18px) rotate(-26deg); } 30% { transform: translate(-60px, 10px) rotate(-120deg) scale(1.2, .85); } 100% { transform: none; } }
.guide { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; pointer-events: none; }
.guide__card {
  position: relative; max-width: 330px; padding: 20px 20px 18px; text-align: center; font-size: 13.5px; line-height: 1.85; letter-spacing: .04em;
  background: linear-gradient(180deg, rgba(10, 11, 14, .9), rgba(4, 5, 7, .94)); border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
  animation: fadeUp .6s var(--ease-out) both;
}
.guide__card > b:first-child { display: block; font-size: 18px; font-weight: 800; letter-spacing: .5em; text-indent: .5em; color: var(--gold-hi); margin-bottom: 4px; }
.guide__card b { color: var(--gold-hi); font-weight: 700; }
.guide__card small { color: var(--bone-2); font-size: 11px; letter-spacing: 0; white-space: nowrap; }
.guide__card kbd { font-family: var(--f-latin); color: var(--gold-hi); border: 1px solid var(--line); padding: 0 3px; margin: 0 1px; }
.stamp-layer { position: absolute; inset: 0; }
.stamp {
  position: absolute; left: 0; right: 0; text-align: center; transform: translateY(-50%);
  font-weight: 800; font-size: 58px; letter-spacing: .28em; text-indent: .28em; line-height: 1.1;
  background: linear-gradient(180deg, #ffffff 0%, #f1e6cf 55%, #a9a08c 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 16px rgba(255, 255, 255, .35)) drop-shadow(0 2px 2px rgba(0, 0, 0, .9));
  animation: stamp 1s var(--ease-sig) both;
}
.stamp::after { content: ""; position: absolute; left: 12%; right: 12%; top: 50%; height: 1px; background: linear-gradient(90deg, transparent, rgba(255, 240, 200, .9), transparent); animation: stampLine 1s var(--ease-sig) both; }
.stamp--gold { background-image: linear-gradient(180deg, #fff9e6 0%, #f5dc9a 45%, #b8893a 100%); filter: drop-shadow(0 0 22px rgba(245, 200, 110, .75)) drop-shadow(0 2px 2px rgba(0, 0, 0, .9)); }
.stamp--shu { background-image: linear-gradient(180deg, #ffe6d9 0%, #ff8a5a 50%, #a8231a 100%); filter: drop-shadow(0 0 20px rgba(224, 70, 30, .8)) drop-shadow(0 2px 2px rgba(0, 0, 0, .9)); }
.stamp--sm { font-size: 30px; letter-spacing: .4em; text-indent: .4em; }
@keyframes stamp {
  0% { opacity: 0; transform: translateY(-50%) scale(1.5, .7); letter-spacing: .9em; }
  16% { opacity: 1; transform: translateY(-50%) scale(.97, 1.04); }
  28% { transform: translateY(-50%) scale(1.01, .99); letter-spacing: .28em; }
  76% { opacity: 1; transform: translateY(-50%); clip-path: inset(-20% 0 -20% 0); }
  100% { opacity: 0; transform: translateY(-62%); clip-path: inset(-20% 0 -20% 100%); }
}
@keyframes stampLine { 0% { transform: scaleX(0); opacity: 0; } 20% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1.2); opacity: 0; } }

/* ---------- リザルト ---------- */
[data-screen="result"] { justify-content: center; }
.result { display: flex; flex-direction: column; gap: 14px; }
.result__eyebrow { margin: 0; text-align: center; font-family: var(--f-ital); font-style: italic; font-size: 15px; letter-spacing: .3em; color: var(--gold); animation: fadeUp 1s .1s var(--ease-out) both; }
.result__stamp {
  align-self: center; font-weight: 800; font-size: 64px; line-height: 1.05; letter-spacing: .3em; text-indent: .3em;
  background: linear-gradient(180deg, #fff9e6 0%, #f5dc9a 45%, #9b7430 100%); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 24px rgba(245, 200, 110, .55)) drop-shadow(0 2px 2px #000);
  animation: presenceIn 1.2s .15s var(--ease-sig) both;
}
.result__stamp.is-flee { background-image: linear-gradient(180deg, #f2fffb, #8fffe0 50%, #2c6d58); filter: drop-shadow(0 0 22px rgba(143, 255, 224, .45)) drop-shadow(0 2px 2px #000); }
.result__stamp.is-lose { background-image: linear-gradient(180deg, #f3ece0, #a9a08c 50%, #4d473d); filter: drop-shadow(0 2px 2px #000); }
.result__lead { text-align: center; margin: 0; font-weight: 700; letter-spacing: .12em; line-height: 1.8; font-size: 14px; text-shadow: 0 1px 8px #000; animation: fadeUp 1s .6s var(--ease-out) both; }
.result__rows { display: grid; grid-template-columns: 1fr auto; margin: 0; padding: 4px 16px; background: linear-gradient(180deg, var(--char), var(--char-2)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); animation: fadeUp 1s .8s var(--ease-out) both; }
.result__rows dt, .result__rows dd { margin: 0; padding: 8px 0; border-bottom: 1px solid rgba(214, 176, 98, .12); font-size: 13px; }
.result__rows dt { color: var(--bone-2); letter-spacing: .06em; }
.result__rows dd { font-weight: 700; text-align: right; color: var(--bone); }
.result__rows dt:nth-last-of-type(1), .result__rows dd:nth-last-of-type(1) { border-bottom: 0; }
.result .panel { animation: fadeUp 1s 1s var(--ease-out) both; }
.result__tip { margin: 0; font-size: 12px; text-align: center; color: var(--gold-hi); letter-spacing: .06em; }
.result .btn { animation: fadeUp 1s 1.2s var(--ease-out) both; }

/* ---------- シート ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgba(3, 4, 6, .7); display: grid; align-items: end; padding: 16px 16px calc(var(--safe-b) + 16px); }
.sheet__card { max-width: 488px; width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; animation: sheetIn .5s var(--ease-sig); max-height: 86vh; overflow-y: auto; }
@keyframes sheetIn { from { transform: translateY(40px); opacity: 0; clip-path: inset(100% 0 0 0); } }
.sheet__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet__btns .btn { white-space: nowrap; font-size: 13px; padding: 13px 6px; letter-spacing: .12em; text-indent: .12em; }
.pick { display: grid; gap: 10px; }
.pick button { display: grid; grid-template-columns: 64px 1fr; align-items: center; gap: 10px; text-align: left; padding: 8px 18px; letter-spacing: .1em; text-indent: 0; }
.pick button small { letter-spacing: .06em; text-indent: 0; }
.pick svg { width: 64px; height: 64px; }

/* ---------- トースト・幕 ---------- */
.toast {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 70px); z-index: 60; transform: translate(-50%, -20px);
  background: linear-gradient(180deg, rgba(12, 12, 14, .94), rgba(5, 5, 7, .96)); color: var(--bone);
  border-top: 1px solid var(--gold); border-bottom: 1px solid var(--gold);
  padding: 11px 18px; font-size: 13px; font-weight: 700; letter-spacing: .06em; max-width: calc(100% - 32px); text-align: center;
  opacity: 0; pointer-events: none; transition: transform .4s var(--ease-sig), opacity .25s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { border-color: var(--ember); color: #ffd2bd; }

/* 幕: 闇が下から満ち、金の一線が走り抜ける */
.curtain { position: fixed; inset: 0; z-index: 50; pointer-events: none; display: grid; place-items: center; }
.curtain i { position: absolute; inset: 0; clip-path: inset(100% 0 0 0); }
.curtain i:nth-child(1) { background: linear-gradient(180deg, transparent, rgba(245, 220, 154, .9) 49.8%, #fff 50%, rgba(245, 220, 154, .9) 50.2%, transparent); clip-path: inset(0 100% 0 0); opacity: .9; height: 2px; top: 50%; box-shadow: 0 0 18px rgba(245, 220, 154, .9); }
.curtain i:nth-child(2) { background: radial-gradient(ellipse at 50% 50%, #0d0e11, #030304 80%); }
.curtain b { position: relative; font-family: var(--f-jp); font-weight: 800; font-size: 40px; color: var(--bone); opacity: 0; letter-spacing: .4em; text-indent: .4em; text-align: center; line-height: 1.3; text-shadow: 0 0 20px rgba(245, 220, 154, .3); }
.curtain b small { display: block; font-family: var(--f-jp); font-weight: 500; font-size: 13px; color: var(--gold); letter-spacing: .4em; text-indent: .4em; margin-top: 8px; }
.curtain.is-in i:nth-child(2) { animation: curIn .5s var(--ease-sig) forwards; }
.curtain.is-in i:nth-child(1) { z-index: 2; animation: lineRun .7s .12s var(--ease-sig) forwards; }
.curtain.is-in b { animation: curText .6s .35s var(--ease-out) forwards; }
.curtain.is-out i:nth-child(2) { clip-path: inset(0 0 0 0); animation: curOut .55s var(--ease-sig) forwards; }
.curtain.is-out b { opacity: 0; }
@keyframes curIn { from { clip-path: inset(100% 0 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes curOut { to { clip-path: inset(0 0 100% 0); } }
@keyframes lineRun { 0% { clip-path: inset(0 100% 0 0); } 50% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 100%); } }
@keyframes curText { from { opacity: 0; letter-spacing: .9em; filter: blur(6px); } to { opacity: 1; } }

/* ---------- 動きを減らす ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
  .stamp { animation: stampRm 1s linear both !important; }
  @keyframes stampRm { 0%, 80% { opacity: 1; } 100% { opacity: 0; } }
  .forge__art .s { stroke-dashoffset: 0; fill-opacity: 1; }
  .forge__art path:not(.s), .forge__art circle { opacity: 1; }
  .title__sheen { display: none; }
}
