/* 天守攻め — 和紙と朱の配色。mn.css の変数を上書き */
:root {
  --bg: #f3ede2; --surface: #fffaf1; --surface-2: #ebe2d2; --text: #221b16; --text-sub: #6b5f53; --line: #dacdb8;
  --accent: #b8321f; --accent-ink: #fff; --accent-soft: #f6dcd5; --gold: #b07d12; --gold-soft: #f4e6c3;
  --c-atk: #b8321f; --c-def: #2c5d8f; --c-skl: #3d7a4a; --c-pow: #a8740d; --c-hero: #6b3fa0; --c-curse: #5f5a55;
  --hp: #c0392b; --block: #2c5d8f; --energy: #e2a21b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14110f; --surface: #1f1a17; --surface-2: #2b2420; --text: #f1e9dd; --text-sub: #b3a796; --line: #3d342d;
    --accent: #e8664f; --accent-ink: #14110f; --accent-soft: #3d1f19; --gold: #e6b84a; --gold-soft: #3a2f17;
    --c-atk: #e8664f; --c-def: #6ea6dd; --c-skl: #74b884; --c-pow: #e6b84a; --c-hero: #b691e6; --c-curse: #8c857e;
    --hp: #ef6b5b; --block: #6ea6dd; --energy: #f0b93a;
  }
}
:root[data-theme="dark"] {
  --bg: #14110f; --surface: #1f1a17; --surface-2: #2b2420; --text: #f1e9dd; --text-sub: #b3a796; --line: #3d342d;
  --accent: #e8664f; --accent-ink: #14110f; --accent-soft: #3d1f19; --gold: #e6b84a; --gold-soft: #3a2f17;
  --c-atk: #e8664f; --c-def: #6ea6dd; --c-skl: #74b884; --c-pow: #e6b84a; --c-hero: #b691e6; --c-curse: #8c857e;
  --hp: #ef6b5b; --block: #6ea6dd; --energy: #f0b93a;
}
.tz-serif { font-family: var(--font-serif); }

/* タイトル */
.tz-hero { text-align: center; padding: 8px 0 4px; }
.tz-hero svg { width: 150px; height: auto; display: block; margin: 0 auto 4px; color: var(--accent); }
.tz-logo { font-family: var(--font-serif); font-size: clamp(44px, 14vw, 64px); font-weight: 900; letter-spacing: .12em; margin: 0; line-height: 1.15; }
.tz-today { border: 2px solid var(--accent); }
.tz-today h2 { font-family: var(--font-serif); font-size: 26px; margin: 2px 0 4px; }
.tz-gim { display: inline-block; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 13px; padding: 2px 10px; border-radius: 99px; margin-bottom: 6px; }
.tz-mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.tz-mini b { display: block; font-size: 22px; color: var(--accent); line-height: 1.2; }
.tz-mini span { font-size: 12px; color: var(--text-sub); }

/* HUD */
.tz-hud { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px 8px; font-size: 13px; margin-bottom: 8px; }
.tz-hud > span { white-space: nowrap; }
.tz-hud b { font-size: 15px; margin-left: 2px; }
.tz-hud .sp { flex: 1; }
.tz-hud button { border: 1px solid var(--line); background: var(--surface-2); border-radius: 8px; min-height: 34px; padding: 2px 8px; cursor: pointer; font-weight: 700; font-size: 13px; }
.tz-relics { display: flex; gap: 2px; flex-wrap: wrap; }
.tz-relics { flex-wrap: nowrap; }
.tz-hud .tz-relics button { min-height: 32px; padding: 0 2px; font-size: 17px; background: transparent; border: 0; }

/* 地図 */
.tz-floor-now h2 { font-family: var(--font-serif); margin-bottom: 4px; }
.tz-nodes { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.tz-nodes.one { grid-template-columns: 1fr; }
.tz-node { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 10px; min-height: 120px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; text-align: center; }
.tz-node:hover, .tz-node:focus-visible { border-color: var(--accent); }
.tz-node .ic { font-size: 34px; line-height: 1.2; }
.tz-node b { font-size: 18px; }
.tz-node small { color: var(--text-sub); font-size: 12px; line-height: 1.5; }
.tz-node.elite { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.tz-map { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tz-map li { display: grid; grid-template-columns: 64px 1fr; gap: 8px; align-items: center; padding: 6px 10px; border-radius: 10px; font-size: 14px; }
.tz-map li.now { background: var(--accent-soft); font-weight: 700; }
.tz-map li.done { color: var(--text-sub); }
.tz-map .fl { font-family: var(--font-serif); font-weight: 700; }
.tz-map .ics { letter-spacing: .2em; }
.tz-map .ics s { opacity: .35; text-decoration: none; }

/* 戦闘 */
.tz-field { background: linear-gradient(180deg, var(--surface-2), var(--surface)); border: 1px solid var(--line); border-radius: 16px; padding: 10px 8px 8px; }
.tz-enemies { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; min-height: 140px; padding-top: 8px; }
.tz-en { position: relative; flex: 1 1 0; min-width: 96px; max-width: 170px; background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 6px 6px 8px; text-align: center; cursor: pointer; transition: border-color .15s, opacity .3s; }
.tz-en.is-target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.tz-en.is-down { opacity: .25; pointer-events: none; }
.tz-en .face { font-size: 36px; line-height: 1.15; }
.tz-en.boss .face { font-size: 52px; }
.tz-en .nm { font-size: 13px; font-weight: 700; line-height: 1.3; }
.tz-intent { display: inline-flex; align-items: center; gap: 2px; background: var(--text); color: var(--bg); border-radius: 99px; padding: 1px 9px; font-size: 14px; font-weight: 800; min-height: 26px; }
.tz-intent.atk { background: var(--hp); color: #fff; }
.tz-intent-nm { display: block; font-size: 11px; color: var(--text-sub); min-height: 15px; }
.tz-bar { position: relative; height: 14px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 4px; }
.tz-bar > i { position: absolute; inset: 0 auto 0 0; background: var(--hp); border-radius: 99px; transition: width .35s; }
.tz-bar > span { position: absolute; inset: 0; font-size: 11px; font-weight: 800; line-height: 14px; color: var(--text); text-shadow: 0 0 3px var(--surface); }
.tz-blk { display: inline-block; background: var(--block); color: #fff; font-size: 12px; font-weight: 800; border-radius: 6px; padding: 0 6px; margin-top: 3px; }
.tz-sts { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; margin-top: 3px; }
.tz-st { font-size: 12px; background: var(--surface-2); border-radius: 6px; padding: 0 5px; cursor: help; white-space: nowrap; }
.tz-target-mark { position: absolute; top: -10px; left: 50%; transform: translateX(-50%); font-size: 12px; background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 8px; font-weight: 800; }
.tz-me { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; margin-top: 10px; padding: 8px 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; position: relative; }
.tz-me .lbl { font-size: 13px; font-weight: 700; }
.tz-me .tz-bar { height: 18px; }
.tz-me .tz-bar > span { line-height: 18px; font-size: 12px; }
.tz-warn { font-size: 13px; font-weight: 700; color: var(--hp); }
.tz-warn.ok { color: var(--c-skl); }
.tz-ctrl { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin: 10px 0 8px; }
.tz-energy { width: 56px; height: 56px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #ffe08a, var(--energy)); color: #3a2600; display: grid; place-items: center; font-weight: 900; font-size: 20px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.15); }
.tz-energy small { display: block; font-size: 10px; line-height: 1; margin-top: -10px; }
.tz-piles { font-size: 12px; color: var(--text-sub); line-height: 1.4; }
.tz-piles button { border: 0; background: transparent; color: var(--text-sub); text-decoration: underline; cursor: pointer; padding: 2px 0; font-size: 12px; }
.tz-end { min-height: 56px; }

/* カード */
.tz-hand { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.tz-card { position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: center; min-height: 138px; padding: 16px 6px 8px; border-radius: 12px; border: 2px solid var(--cc, var(--line)); background: var(--surface); cursor: pointer; transition: transform .1s, opacity .2s; touch-action: manipulation; }
.tz-card:active { transform: scale(.96); }
.tz-card[disabled] { opacity: .45; cursor: not-allowed; }
.tz-card .cost { position: absolute; top: -8px; left: -6px; width: 28px; height: 28px; border-radius: 50%; background: var(--energy); color: #3a2600; font-weight: 900; font-size: 15px; display: grid; place-items: center; border: 2px solid var(--surface); }
.tz-card .ty { position: absolute; top: 2px; right: 6px; font-size: 10px; font-weight: 800; color: var(--cc); }
.tz-card .ic { font-size: 28px; line-height: 1.2; }
.tz-card .ic.kamon { display: inline-grid; place-items: center; width: 36px; height: 36px; margin: 0 auto; border-radius: 50%; border: 2px solid var(--cc); color: var(--cc); font-family: var(--font-serif); font-weight: 900; font-size: 20px; }
.tz-card .nm { font-weight: 800; font-size: 13px; line-height: 1.3; margin: 2px 0; }
.tz-card .tx { font-size: 12px; line-height: 1.45; color: var(--text-sub); }
.tz-card .tx em { font-style: normal; font-weight: 800; color: var(--c-skl); }
.tz-card.up .nm { color: var(--c-skl); }
.t-atk { --cc: var(--c-atk); } .t-def { --cc: var(--c-def); } .t-skl { --cc: var(--c-skl); } .t-pow { --cc: var(--c-pow); } .t-hero { --cc: var(--c-hero); } .t-curse { --cc: var(--c-curse); }
.tz-card.t-hero { background: linear-gradient(180deg, color-mix(in srgb, var(--c-hero) 10%, var(--surface)), var(--surface)); }
.tz-pickrow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tz-deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 8px; }
.tz-price { display: block; margin-top: 4px; font-weight: 800; color: var(--gold); font-size: 13px; }

/* 演出 */
.tz-float { position: absolute; left: 50%; top: 30%; transform: translateX(-50%); font-weight: 900; font-size: 24px; color: var(--hp); text-shadow: 0 1px 0 var(--surface), 0 0 6px var(--surface); pointer-events: none; animation: tz-float 1s ease-out forwards; z-index: 5; white-space: nowrap; }
.tz-float.blk { color: var(--block); font-size: 18px; }
.tz-float.heal { color: var(--c-skl); }
.tz-float.burn { color: #e07b00; }
@keyframes tz-float { from { opacity: 1; transform: translate(-50%, 0) scale(1.1); } to { opacity: 0; transform: translate(-50%, -36px) scale(1); } }
.tz-acting { animation: tz-lunge .35s ease-out; }
@keyframes tz-lunge { 50% { transform: translateY(10px) scale(1.04); } }
.tz-hint { background: var(--gold-soft); border: 1px solid var(--gold); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-bottom: 10px; }
.tz-hint button { margin-left: 6px; border: 0; background: transparent; color: var(--accent); font-weight: 800; cursor: pointer; }
.tz-banner { text-align: center; font-family: var(--font-serif); font-size: 28px; font-weight: 900; padding: 8px; }

/* 結果 */
.tz-result-big { font-family: var(--font-serif); font-size: clamp(56px, 18vw, 88px); font-weight: 900; line-height: 1.1; color: var(--accent); }
.tz-path { font-size: 22px; letter-spacing: .15em; }
.tz-rate { display: grid; gap: 4px; }
.tz-rate div { display: grid; grid-template-columns: 70px 1fr 44px; gap: 6px; align-items: center; font-size: 13px; }
.tz-rate i { display: block; height: 10px; background: var(--accent); border-radius: 99px; }
.tz-rate div.me { font-weight: 800; }
.tz-zukan { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.tz-zukan > div { border: 1px solid var(--line); border-radius: 10px; padding: 8px 4px; text-align: center; font-size: 12px; background: var(--surface); }
.tz-zukan > div.no { opacity: .4; }
.tz-zukan .big { font-size: 26px; display: block; }
.tz-relic-row { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.tz-relic-row .ic { font-size: 30px; }
@media (min-width: 720px) {
  .tz-hand { grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); }
  .tz-card { min-height: 150px; }
}

/* ---------- 画像 ---------- */
.tz-fallback { font-size: 28px; line-height: 1.2; }
.tz-keyart { width: 170px; height: 150px; margin: 0 auto 6px; border-radius: 14px; overflow: hidden; box-shadow: 0 6px 20px rgba(80, 30, 10, .25); }
.tz-keyart img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
.tz-photo { margin: -18px -18px 12px; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; aspect-ratio: 16 / 9; background: var(--surface-2); }
.mn-card-tight .tz-photo { margin: -12px -14px 10px; }
.tz-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tz-scene .scene { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 12px; float: right; margin: 0 0 8px 12px; border: 1px solid var(--line); }
.tz-scene::after { content: ""; display: block; clear: both; }
.tz-card .art { display: block; position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; overflow: hidden; background: #efe6d4; margin-bottom: 2px; }
.tz-card .art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tz-card .art .tz-fallback { display: grid; place-items: center; height: 100%; }
.tz-card .art.kamon img { object-position: center 12%; }
.tz-card .art .mon { position: absolute; right: 3px; bottom: 3px; width: 22px; height: 22px; border-radius: 50%; background: var(--c-hero); color: #fff; font-family: var(--font-serif); font-weight: 900; font-size: 13px; display: grid; place-items: center; }
.tz-card { padding-top: 12px; }
.tz-card .ty { top: 1px; }
.tz-en .face { height: 78px; display: grid; place-items: center; }
.tz-en .face img { width: 78px; height: 78px; object-fit: cover; border-radius: 10px; display: block; background: #efe6d4; }
.tz-en.boss .face { height: 92px; }
.tz-en.boss .face img.boss { width: 100%; max-width: 160px; height: 92px; border-radius: 10px; filter: saturate(.85) contrast(1.05); }
.tz-hud .tz-relics button img { width: 26px; height: 26px; border-radius: 6px; object-fit: cover; display: block; }
.tz-relic-row .ic img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; display: block; }
.tz-node .nimg { width: 84px; height: 84px; border-radius: 12px; overflow: hidden; display: grid; place-items: center; background: #efe6d4; }
.tz-node .nimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tz-zukan .zimg { display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; margin-bottom: 4px; background: var(--surface-2); }
.tz-zukan .zimg.sq { aspect-ratio: 1; }
.tz-zukan .zimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tz-zukan > div.no .zimg img { filter: grayscale(1); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tz-card .art, :root:not([data-theme="light"]) .tz-en .face img { filter: brightness(.92); } }
