﻿:root {
  --bg: #e8e6df;
  --paper: #f7f5ee;
  --paper-strong: #fffdf7;
  --ink: #1f252b;
  --muted: #687078;
  --line: #cbc5b8;
  --line-dark: #a99f90;
  --panel: #fffdf7;
  --panel-2: #f2efe7;
  --accent: #b42318;
  --accent-dark: #7a1a15;
  --accent-2: #2f6f68;
  --accent-3: #3f587e;
  --soft: #ece7db;
  --stamp: #b42318;
  --folder: #d8c59f;
  --warn: #9a6700;
  --custom: #7c2d12;
  --custom-bg: #fff7ed;
  --custom-line: #fdba74;
  --radius: 8px;
  --shadow-sm: 0 1px 0 rgba(31, 37, 43, 0.08);
  --shadow-md: 0 10px 24px rgba(53, 45, 32, 0.1);
  --shadow-lg: 0 22px 48px rgba(53, 45, 32, 0.16);
  --focus: 0 0 0 3px rgba(47, 111, 104, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  letter-spacing: 0;
}

.login-card-gate,
.login-tutorial-panel {
  position: fixed;
  inset: 0;
  z-index: 240;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-width: 0;
  min-height: 0;
  padding: 22px;
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(238, 241, 243, 0.96);
}

.login-card-gate[hidden],
.login-tutorial-panel[hidden] {
  display: none !important;
}

.support-modal {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: contain;
}

.support-modal[hidden] {
  display: none !important;
}

.login-card-library-modal {
  position: fixed;
  inset: 0;
  z-index: 1780;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  overflow: hidden;
  overscroll-behavior: contain;
}

.login-card-library-modal[hidden] {
  display: none !important;
}

.login-card-library-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.78);
  backdrop-filter: blur(6px);
}

.login-card-library-card {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(110px, 1fr) auto;
  gap: 14px;
  width: min(680px, 100%);
  max-height: calc(100dvh - 28px);
  padding: clamp(18px, 4vw, 30px);
  overflow: hidden;
  border: 1px solid rgba(15, 118, 110, 0.42);
  border-radius: 14px;
  background: var(--paper-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.login-card-library-head,
.login-card-library-actions,
.login-card-library-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.login-card-library-head {
  justify-content: space-between;
}

.login-card-library-head h2 {
  margin: 8px 0 0;
  font-size: clamp(1.45rem, 5vw, 2rem);
}

.login-card-library-close {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.7rem;
  line-height: 1;
}

.login-card-library-status {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.login-card-library-status[data-error="true"] {
  color: var(--accent);
  font-weight: 800;
}

.login-card-library-list {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding-right: 3px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.login-card-library-item {
  justify-content: space-between;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel-2);
}

.login-card-library-item-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.login-card-library-item-copy strong,
.login-card-library-item-copy small {
  overflow-wrap: anywhere;
}

.login-card-library-item-copy small {
  color: var(--muted);
}

.login-card-library-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

body.login-card-library-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .login-card-library-card {
    padding: 18px 15px;
  }

  .login-card-library-item {
    align-items: stretch;
    flex-direction: column;
  }

  .login-card-library-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .login-card-library-actions .primary {
    grid-column: 1 / -1;
  }
}

/* R87 life story plaza */
.life-story-plaza {
  display: grid;
  gap: 16px;
}

.debate-forum-panel { display: grid; gap: 18px; overflow: hidden; border: 1px solid #2a2532; background: linear-gradient(145deg, #17151d 0%, #22202a 46%, #15151b 100%); color: #f7f1e5; box-shadow: 0 22px 52px rgba(24, 16, 34, .28); }

/* R141 minimal color-block debate board */
.debate-shell { --debate-pro:#f05b61; --debate-con:#4e7cf2; --debate-ink:#f7f8fc; --debate-muted:#9ea7ba; --debate-surface:#10131d; --debate-surface-2:#181d2c; --debate-display:"Arial Narrow","Aptos Display","Microsoft YaHei",sans-serif; display:grid; gap:14px; padding:clamp(12px,2vw,24px); color:var(--debate-ink); background:#090b11; border:1px solid #252b3b; border-radius:20px; box-shadow:0 22px 58px #02030acc; }
.debate-minimal-hero { display:grid; grid-template-columns:1fr auto; gap:18px; align-items:end; padding:clamp(18px,3vw,32px); border-radius:15px; background:linear-gradient(120deg,#181c2b 0%,#111522 62%,#1a1420 100%); }
.debate-minimal-hero h2 { margin:4px 0 0; font-family:var(--debate-display); font-size:clamp(2rem,5vw,4.2rem); font-weight:800; letter-spacing:-.055em; line-height:.95; }
.debate-eyebrow { display:inline-flex; padding:5px 9px; border-radius:99px; background:#ffffff12; color:#c6cee1; font:700 .68rem/1 var(--debate-display); letter-spacing:.13em; }
.debate-primary-actions { display:flex; gap:9px; flex-wrap:wrap; justify-content:end; }
.debate-hero-button { min-height:46px; padding:0 17px; border:0; border-radius:12px; color:#fff; font:800 .9rem/1 var(--debate-display); cursor:pointer; transition:transform .18s ease,filter .18s ease; }
.debate-hero-button:hover { transform:translateY(-2px); filter:brightness(1.09); }.debate-hero-button-pro { background:var(--debate-pro); }.debate-hero-button-con { background:var(--debate-con); }
.debate-power-board { display:grid; grid-template-columns:auto minmax(160px,1fr) auto; gap:12px; align-items:center; padding:13px 16px; border-radius:14px; background:var(--debate-surface-2); }
.debate-power-label { display:flex; gap:8px; align-items:baseline; color:var(--debate-pro); font-family:var(--debate-display); }.debate-power-label span { color:var(--debate-muted); font-size:.78rem; }.debate-power-label-con { color:var(--debate-con); }
.debate-power-track { display:flex; height:12px; overflow:hidden; border-radius:99px; background:#293248; box-shadow:inset 0 1px 3px #0008; }.debate-power-fill-pro,.debate-power-fill-con { display:block; min-width:0; transition:width .3s ease; }.debate-power-fill-pro{background:var(--debate-pro)}.debate-power-fill-con{background:var(--debate-con)}
.debate-composer-popover { padding:1px; border-radius:16px; background:linear-gradient(110deg,var(--debate-pro),var(--debate-con)); }.debate-composer-popover[hidden]{display:none}
.debate-composer-popover .debate-compose { border:0; border-radius:15px; background:#151a28; }.debate-composer-head{display:flex;justify-content:space-between;align-items:center}.debate-composer-head h3{font-family:var(--debate-display);font-size:1.15rem}.debate-close-composer{border:0;background:#ffffff12;color:#cbd3e5;border-radius:8px;padding:7px 10px;cursor:pointer}.debate-submit-button{min-height:44px;border:0;border-radius:10px;background:#f2f5ff;color:#151827;font-weight:800;cursor:pointer}
.debate-masthead { display:flex; justify-content:space-between; gap:1rem; align-items:end; padding-bottom:1rem; border-bottom:3px solid #262229; }
.debate-masthead h2 { margin:.2rem 0; font:700 clamp(2rem,5vw,3.8rem)/1 Georgia,serif; letter-spacing:.02em; }
.debate-masthead p { margin:.3rem 0; color:#5d5960; max-width:55ch; }
.debate-kicker,.debate-section-label { color:#6a5a4b; font:700 .7rem/1 ui-monospace,monospace; letter-spacing:.18em; text-transform:uppercase; }
.debate-mode-switcher { display:flex; gap:.25rem; border-bottom:1px solid #cfc5b8; }
.debate-mode-tab { border:0; border-bottom:3px solid transparent; background:none; padding:.75rem 1rem; color:#655d58; font-weight:700; cursor:pointer; }
.debate-mode-tab.active,.debate-mode-tab[aria-pressed="true"] { color:var(--debate-ink); border-bottom-color:#262229; }
.debate-mode-tab:focus-visible,.debate-shell button:focus-visible,.debate-shell select:focus-visible,.debate-shell input:focus-visible,.debate-shell textarea:focus-visible { outline:3px solid #d18a00; outline-offset:2px; }
.debate-topic-workspace,.debate-forum-workspace { display:grid; grid-template-columns:minmax(230px,.8fr) minmax(0,1.5fr); gap:1rem; align-items:start; }
.debate-topic-index,.debate-post-index,.debate-ballot-stage,.debate-post-reader { background:#fffdf8; border:1px solid #d8cfc3; padding:1rem; }
.debate-topic-index,.debate-post-index { display:grid; gap:.8rem; min-width:0; }
.debate-ballot-stage,.debate-post-reader { min-height:320px; }
.debate-discussion-stream { display:grid; gap:.85rem; margin-top:1.25rem; padding-top:1.1rem; border-top:2px solid #2a2625; }
.debate-compose { display:grid; gap:.65rem; padding:.9rem; border-top:2px solid #262229; background:#f0e8dc; }
.debate-compose h3 { margin:0; font:700 1rem/1.3 Georgia,"Microsoft YaHei",serif; }
.debate-form-sides { display:grid; grid-template-columns:1fr 1fr; gap:.6rem; }
.debate-compose input,.debate-compose textarea,.debate-compose select { width:100%; box-sizing:border-box; border:1px solid #b9aea0; border-radius:2px; background:#fffdf8; padding:.65rem; color:var(--debate-ink); }
.debate-compose textarea { min-height:82px; resize:vertical; }
.debate-topic-index-card,.debate-post-index-card { display:grid; gap:.55rem; width:100%; padding:.85rem; border:1px solid #d8cfc3; border-left:4px solid transparent; border-radius:2px; background:#fffdf8; color:var(--debate-ink); text-align:left; cursor:pointer; transition:border-color .16s ease,background .16s ease,transform .16s ease; }
.debate-topic-index-card:hover,.debate-post-index-card:hover { border-color:#8f8173; transform:translateY(-1px); }
.debate-topic-selected,.debate-post-selected { border-left-color:#262229; background:#f1e8db; box-shadow:0 7px 18px #211a1430; }
.debate-index-heading,.debate-index-stats,.debate-comment-head,.debate-post-reply-head { display:flex; justify-content:space-between; align-items:center; gap:.65rem; }
.debate-index-heading time,.debate-index-author,.debate-index-stats,.debate-public-id,.debate-ballot-meta,.debate-post-meta,.debate-post-reply-head span { color:#726a64; font-size:.76rem; }
.debate-topic-index-card>strong,.debate-post-index-card>strong { font:700 1rem/1.45 Georgia,"Microsoft YaHei",serif; }
.debate-post-excerpt { margin:0; color:#5c5652; line-height:1.55; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.debate-status-chip,.debate-tag,.debate-side-badge { display:inline-flex; width:max-content; padding:.22rem .48rem; border:1px solid currentColor; border-radius:99px; font-size:.68rem; font-weight:800; letter-spacing:.04em; }
.debate-status-chip { color:#795f39; }
.debate-ballot-head h3,.debate-post-reader-head h3 { margin:.35rem 0; font:700 clamp(1.55rem,3vw,2.35rem)/1.2 Georgia,"Microsoft YaHei",serif; }
.debate-topic-background,.debate-post-body { margin:1rem 0; color:#403b38; font-size:1rem; line-height:1.8; white-space:pre-wrap; overflow-wrap:anywhere; }
.debate-stance-grid { display:grid; grid-template-columns:1fr 1fr; gap:.8rem; }
.debate-stance { position:relative; display:grid; align-content:start; gap:.65rem; min-height:155px; padding:1rem; border:1px solid; background:#fff; }
.debate-stance-pro { border-color:#d9585870; background:linear-gradient(145deg,#fff8f6,#f9e8e5); }
.debate-stance-con { border-color:#3268c870; background:linear-gradient(145deg,#f7faff,#e7eefb); }
.debate-stance-head { display:flex; justify-content:space-between; gap:.5rem; align-items:center; }
.debate-stance-pro .debate-stance-label,.debate-side-pro { color:var(--debate-pro); }
.debate-stance-con .debate-stance-label,.debate-side-con { color:var(--debate-con); }
.debate-stance-label { font-size:.72rem; font-weight:900; letter-spacing:.11em; }
.debate-stance p { margin:0; line-height:1.7; }
.debate-vote-button { min-height:42px; margin-top:auto; border:0; border-radius:2px; color:#fff; font-weight:800; cursor:pointer; }
.debate-vote-pro { background:var(--debate-pro); }.debate-vote-con { background:var(--debate-con); }
.debate-your-vote { width:max-content; margin-top:auto; padding:.35rem .6rem; border:1px solid currentColor; font-weight:800; }
.debate-stance-pro .debate-your-vote { color:var(--debate-pro); }.debate-stance-con .debate-your-vote { color:var(--debate-con); }
.debate-vote-meter { position:relative; display:grid; grid-template-columns:var(--pro-share) calc(100% - var(--pro-share)); min-height:28px; margin-top:.8rem; overflow:hidden; border-radius:2px; color:#fff; font-size:.72rem; font-weight:800; }
.debate-vote-meter-pro,.debate-vote-meter-con { display:flex; align-items:center; min-width:0; padding:0 .55rem; white-space:nowrap; overflow:hidden; }
.debate-vote-meter-pro { justify-content:flex-start; background:var(--debate-pro); }.debate-vote-meter-con { justify-content:flex-end; background:var(--debate-con); }
.debate-vote-meter.compact { min-height:8px; margin:0; font-size:0; }
.debate-vote-meter.compact span { padding:0; }
.debate-discussion-toolbar { display:flex; align-items:center; justify-content:space-between; gap:.8rem; }
.debate-discussion-toolbar h3 { margin:0; font:700 1.05rem Georgia,"Microsoft YaHei",serif; }
.debate-comment-composer,.debate-reply-form,.debate-post-reply-form { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.6rem; padding:.8rem; background:#f2eadf; border-left:4px solid #8b8176; }
.debate-comment-composer-pro { border-left-color:var(--debate-pro); }.debate-comment-composer-con { border-left-color:var(--debate-con); }
.debate-comment-composer textarea,.debate-post-reply-form textarea,.debate-reply-form input { width:100%; min-height:42px; box-sizing:border-box; padding:.65rem; border:1px solid #b9aea0; background:#fffdf8; color:var(--debate-ink); resize:vertical; }
.debate-comment { display:grid; gap:.65rem; padding:.9rem 1rem; border:1px solid #d9d0c5; border-left:4px solid; background:#fffdf8; }
.debate-comment-pro { border-left-color:var(--debate-pro); }.debate-comment-con { border-left-color:var(--debate-con); }
.debate-comment-head>div { display:grid; gap:.08rem; }.debate-comment-body { margin:0; line-height:1.72; white-space:pre-wrap; }
.debate-inline-actions { display:flex; gap:.4rem; flex-wrap:wrap; }
.debate-action { min-height:34px; padding:.4rem .7rem; border:1px solid #b9aea0; border-radius:2px; background:#fffdf8; color:#403a35; font-weight:700; cursor:pointer; }
.debate-action:hover { border-color:#5d544c; background:#ede3d6; }.debate-action-primary { background:#272326; border-color:#272326; color:#fff; }
.debate-replies { display:grid; gap:.55rem; margin:.2rem 0 0 1rem; padding:.75rem; border-left:2px solid #b8ab9d; background:#f4ede4; }
.debate-reply-row,.debate-post-reply { padding:.7rem; border-top:1px solid #d7cdc1; }.debate-reply-row p,.debate-post-reply p { margin:.2rem 0 .5rem; line-height:1.65; }
.debate-post-reader { scroll-margin-top:1rem; }.debate-post-reader-head { padding-bottom:.8rem; border-bottom:2px solid #262229; }
.debate-post-actions { padding-bottom:1rem; border-bottom:1px solid #d8cfc3; }
.debate-post-reply-stream { display:grid; gap:.7rem; margin-top:1rem; }.debate-post-reply-stream h4 { margin:.2rem 0; }
.debate-empty,.debate-loading,.debate-discussion-hint { padding:1rem; border:1px dashed #bcb0a3; background:#f6eee4; color:#6b625b; line-height:1.6; }
.debate-empty-stage { min-height:230px; display:grid; place-items:center; text-align:center; }
.debate-status.error,.debate-shell .error { color:#a5282f; }.debate-tag-chat{color:#6f5b3d}.debate-tag-character{color:#7e3e78}.debate-tag-battle{color:#a33e3e}.debate-tag-story{color:#315c89}.debate-tag-suggestion{color:#397553}
.debate-forum-toolbar { display:flex; justify-content:flex-end; gap:.5rem; margin-bottom:1rem; }
.debate-forum-toolbar select,.debate-discussion-toolbar select { min-height:38px; border:1px solid #b9aea0; background:#fffdf8; color:var(--debate-ink); padding:.45rem .6rem; }
.debate-status { min-height:1.2em; }
@media (max-width: 820px) { .debate-masthead { display:block; }.debate-topic-workspace,.debate-forum-workspace { grid-template-columns:1fr; }.debate-discussion-stream { grid-column:auto; }.debate-form-sides,.debate-stance-grid { grid-template-columns:1fr; }.debate-shell { padding:.8rem; }.debate-topic-index,.debate-post-index,.debate-ballot-stage,.debate-post-reader { padding:.8rem; }.debate-comment-composer,.debate-reply-form,.debate-post-reply-form { grid-template-columns:1fr; }.debate-action,.debate-vote-button { min-height:44px; }.debate-replies { margin-left:.35rem; } }

/* Minimal board overrides: dense color blocks, not an article layout. */
.debate-shell .debate-mode-switcher{padding:4px;border:0;border-radius:12px;background:#151a28}.debate-shell .debate-mode-tab{flex:1;border:0;border-radius:9px;padding:11px 14px;color:#a9b3c7;font-family:var(--debate-display);font-weight:800}.debate-shell .debate-mode-tab.active,.debate-shell .debate-mode-tab[aria-pressed="true"]{background:#f4f6ff;color:#161925}
.debate-shell .debate-topic-workspace,.debate-shell .debate-forum-workspace{gap:12px}.debate-shell .debate-topic-index,.debate-shell .debate-post-index,.debate-shell .debate-ballot-stage,.debate-shell .debate-post-reader{border:0;border-radius:15px;background:var(--debate-surface);color:var(--debate-ink);padding:14px}.debate-shell .debate-ballot-stage,.debate-shell .debate-post-reader{background:var(--debate-surface-2)}
.debate-shell .debate-topic-index-card,.debate-shell .debate-post-index-card{border:0;border-radius:11px;border-left:4px solid #323a50;background:#1c2232;color:var(--debate-ink);padding:13px}.debate-shell .debate-topic-index-card:hover,.debate-shell .debate-post-index-card:hover{background:#252d41;border-color:#8994b0}.debate-shell .debate-topic-selected,.debate-shell .debate-post-selected{border-left-color:#fff;background:#303a53;box-shadow:none}
.debate-shell .debate-index-heading time,.debate-shell .debate-index-author,.debate-shell .debate-index-stats,.debate-shell .debate-public-id,.debate-shell .debate-ballot-meta,.debate-shell .debate-post-meta,.debate-shell .debate-post-reply-head span{color:var(--debate-muted)}.debate-shell .debate-post-excerpt,.debate-shell .debate-topic-background,.debate-shell .debate-post-body{color:#c8cfdd}
.debate-shell .debate-status-chip{color:#b9c4da;background:#ffffff0d;border-color:#ffffff20}.debate-shell .debate-tag,.debate-shell .debate-side-badge{background:#ffffff10}.debate-shell .debate-vote-meter{background:#2b354c;border-radius:99px}.debate-shell .debate-stance{border:0;border-radius:13px;color:#fff}.debate-shell .debate-stance-pro{background:linear-gradient(145deg,#7e303a,#3c202b)}.debate-shell .debate-stance-con{background:linear-gradient(145deg,#294b99,#1b284d)}.debate-shell .debate-vote-button{border-radius:9px;background:#fff;color:#151827}.debate-shell .debate-your-vote{border:0;border-radius:8px;background:#ffffff24;color:#fff}
.debate-shell .debate-discussion-stream{border-color:#303a51}.debate-shell .debate-comment{border:0;border-left:4px solid;border-radius:10px;background:#202737;color:#e8ebf3}.debate-shell .debate-comment-pro{border-color:var(--debate-pro)}.debate-shell .debate-comment-con{border-color:var(--debate-con)}.debate-shell .debate-comment-composer,.debate-shell .debate-reply-form,.debate-shell .debate-post-reply-form,.debate-shell .debate-replies{background:#151a28;border-color:#49516a}.debate-shell .debate-action{border:0;border-radius:8px;background:#ffffff12;color:#dce2ee}.debate-shell .debate-action:hover{background:#ffffff20}.debate-shell .debate-action-primary{background:#f4f6ff;color:#171a26}.debate-shell .debate-compose input,.debate-shell .debate-compose textarea,.debate-shell .debate-compose select,.debate-shell .debate-forum-toolbar select,.debate-shell .debate-discussion-toolbar select{border:1px solid #35405b;border-radius:9px;background:#0e1320;color:#eef1f8}.debate-shell .debate-empty,.debate-shell .debate-loading,.debate-shell .debate-discussion-hint{border:0;border-radius:10px;background:#1b2130;color:#aeb8cb}
@media (max-width:820px){.debate-minimal-hero{grid-template-columns:1fr;align-items:start}.debate-primary-actions{justify-content:start}.debate-hero-button{flex:1}.debate-power-board{grid-template-columns:1fr;gap:7px}.debate-power-label,.debate-power-label-con{justify-content:space-between}.debate-power-label-con{order:3}.debate-power-track{order:2}.debate-shell .debate-mode-tab{min-height:42px}.debate-composer-popover{border-radius:13px}}

/* R142 debate control board: paired factions, deliberate color blocks, low text density. */
.debate-shell{--debate-pro:#ef5a67;--debate-con:#4c7dff;--debate-void:#0b0d13;--debate-panel:#151a26;--debate-line:#293247;--debate-display:"Aptos Display","Microsoft YaHei UI","PingFang SC",sans-serif;background:var(--debate-void);border-color:#252d3e;border-radius:24px;gap:18px;box-shadow:0 28px 74px #000a}
.debate-minimal-hero{position:relative;overflow:hidden;min-height:156px;padding:30px 32px;background:linear-gradient(110deg,#171c2a 0%,#101521 58%,#161623 100%);border:1px solid #2c3447;border-radius:18px}.debate-minimal-hero::after{content:"";position:absolute;right:-46px;bottom:-68px;width:210px;height:210px;border-radius:50%;background:conic-gradient(from 210deg,#ef5a6740,#4c7dff24,#ef5a6700);filter:blur(2px);pointer-events:none}.debate-minimal-hero>*{position:relative;z-index:1}.debate-minimal-hero h2{font-family:var(--debate-display);font-size:clamp(2.35rem,5vw,4.8rem);letter-spacing:-.075em}.debate-eyebrow{background:#ffffff0b;border:1px solid #ffffff17;color:#d3d9e6;letter-spacing:.18em}
.debate-primary-actions{gap:10px}.debate-hero-button{min-width:132px;min-height:50px;border-radius:10px;box-shadow:0 10px 24px #0004;transition:background-color .2s ease,color .2s ease,box-shadow .2s ease}.debate-hero-button:hover{transform:none;box-shadow:0 14px 30px #0008}.debate-hero-button-pro{background:var(--debate-pro)}.debate-hero-button-con{background:var(--debate-con)}
.debate-power-board{grid-template-columns:minmax(128px,.8fr) minmax(220px,2fr) minmax(128px,.8fr);gap:0;min-height:112px;padding:0;overflow:hidden;border:1px solid var(--debate-line);border-radius:18px;background:var(--debate-panel)}.debate-power-side{display:grid;align-content:center;gap:3px;min-height:110px;padding:18px 20px;font-family:var(--debate-display)}.debate-power-side strong{font-size:.74rem;letter-spacing:.16em}.debate-power-side span{font-size:.78rem;color:#ffffffa8}.debate-power-side b{font-size:clamp(1.7rem,3vw,2.5rem);letter-spacing:-.07em}.debate-power-side-pro{background:linear-gradient(135deg,#6e2633,#321a25);color:#ffdbe0}.debate-power-side-con{justify-items:end;text-align:right;background:linear-gradient(225deg,#203b86,#182448);color:#dce7ff}.debate-power-track{height:100%;min-height:18px;border-radius:0;background:#101625;box-shadow:inset 0 0 0 1px #ffffff08}.debate-power-fill-pro{background:linear-gradient(90deg,#9b3644,var(--debate-pro))}.debate-power-fill-con{background:linear-gradient(90deg,var(--debate-con),#294da5)}
.debate-shell .debate-mode-switcher{padding:5px;gap:4px;background:#111725;border:1px solid var(--debate-line);border-radius:12px}.debate-shell .debate-mode-tab{border:0;border-radius:8px;color:#9ca8c0;cursor:pointer;transition:background-color .18s ease,color .18s ease,box-shadow .18s ease}.debate-shell .debate-mode-tab.active{background:#eaf0ff;color:#111827;box-shadow:0 4px 14px #0005}.debate-shell .debate-mode-tab:hover{background:#ffffff12;color:#f8faff}
.debate-shell .debate-topic-index,.debate-shell .debate-post-index,.debate-shell .debate-ballot-stage,.debate-shell .debate-post-reader{background:#111724;border-color:var(--debate-line);border-radius:16px}.debate-shell .debate-topic-index-card,.debate-shell .debate-post-index-card{border-color:#293449;background:#171e2c;cursor:pointer;transition:border-color .2s ease,background-color .2s ease,box-shadow .2s ease}.debate-shell .debate-topic-index-card:hover,.debate-shell .debate-post-index-card:hover{transform:none;border-color:#5a6b8f;background:#1b2435;box-shadow:0 12px 26px #0004}.debate-shell .debate-topic-selected,.debate-shell .debate-post-selected{border-color:#d8e3ff;background:#222d42;box-shadow:inset 4px 0 0 #d9e4ff}.debate-shell .debate-composer-popover{border:1px solid #3b4761;background:#111725;box-shadow:0 24px 60px #0009}.debate-shell .debate-compose{background:#151b29}.debate-shell .debate-close-composer{cursor:pointer}
.debate-shell :focus-visible{outline:3px solid #f7fbff;outline-offset:3px;box-shadow:0 0 0 6px #4c7dff77}.debate-shell button,.debate-shell select{cursor:pointer}
@media (prefers-reduced-motion: reduce){.debate-shell *{transition-duration:.01ms!important;animation-duration:.01ms!important;scroll-behavior:auto!important}}
@media (max-width: 820px){.debate-shell{padding:12px;border-radius:16px}.debate-minimal-hero{min-height:0;padding:24px 20px}.debate-power-board{grid-template-columns:1fr;gap:0}.debate-power-side{min-height:74px;grid-template-columns:auto 1fr auto;align-items:center;padding:14px 17px}.debate-power-side-con{justify-items:stretch;text-align:left}.debate-power-side-con strong{order:1}.debate-power-side-con span{order:2;text-align:center}.debate-power-side-con b{order:3;text-align:right}.debate-power-track{min-height:15px;height:15px}.debate-primary-actions{display:grid;grid-template-columns:1fr 1fr}.debate-hero-button{width:100%;min-width:0}.debate-shell .debate-topic-workspace,.debate-shell .debate-forum-workspace{grid-template-columns:1fr}.debate-shell .debate-ballot-stage,.debate-shell .debate-post-reader{min-height:320px}}

/* R143 desktop clarity: less decoration, high-contrast reading, explicit new cache key. */
.debate-minimal-hero::after{display:none}.debate-shell .debate-status:empty{display:none}.debate-shell .debate-eyebrow{display:none}.debate-shell .debate-minimal-hero{min-height:112px;padding:24px 28px;background:#151b28}.debate-shell .debate-minimal-hero h2{font-size:clamp(2rem,3.4vw,3.25rem);letter-spacing:-.045em}.debate-shell .debate-index-author,.debate-shell .debate-index-stats{color:#d7dfef}.debate-shell .debate-index-heading time,.debate-shell .debate-public-id,.debate-shell .debate-ballot-meta,.debate-shell .debate-post-meta,.debate-shell .debate-post-reply-head span{color:#b8c5dc}.debate-shell .debate-post-excerpt,.debate-shell .debate-topic-background,.debate-shell .debate-post-body{color:#edf2fc}.debate-shell .debate-topic-index-card,.debate-shell .debate-post-index-card{padding:15px}.debate-shell .debate-power-board{min-height:96px}.debate-shell .debate-power-side{min-height:94px}.debate-shell .debate-topic-workspace,.debate-shell .debate-forum-workspace{gap:14px}.debate-shell .debate-topic-index,.debate-shell .debate-post-index{padding:12px}.debate-shell .debate-ballot-stage,.debate-shell .debate-post-reader{padding:20px}.debate-shell .debate-mode-switcher{max-width:300px}.debate-shell .debate-mode-tab{min-height:38px}
@media (min-width: 821px){.debate-shell{max-width:1180px;margin-inline:auto}.debate-shell .debate-topic-workspace,.debate-shell .debate-forum-workspace{grid-template-columns:minmax(270px,.72fr) minmax(0,1.65fr)}.debate-shell .debate-power-track{min-height:94px}}

.life-story-plaza-heading {
  align-items: flex-start;
  gap: 16px;
}

.life-story-plaza-heading h2,
.life-story-publish-form h2 {
  margin: 8px 0 4px;
}

.life-story-plaza-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.7fr);
  gap: 18px;
  min-height: 520px;
}

.life-story-feed-pane,
.life-story-reader {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: var(--shadow-sm);
}

.life-story-feed-pane {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 12px;
}

.life-story-feed {
  display: grid;
  gap: 10px;
}

.life-story-feed-card {
  display: grid;
  gap: 7px;
  width: 100%;
  min-height: 96px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.life-story-feed-card:hover,
.life-story-feed-card[aria-current="true"] {
  border-color: var(--accent-2);
  background: var(--paper-strong);
  transform: translateY(-1px);
}

.life-story-feed-card:focus-visible,
.life-story-load-more:focus-visible,
.life-story-reader button:focus-visible,
.life-story-publish-dialog button:focus-visible,
.life-story-publish-dialog input:focus-visible,
.life-story-publish-dialog textarea:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.life-story-feed-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.life-story-feed-excerpt {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.65;
}

.life-story-feed-meta,
.life-story-reader-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  color: var(--muted);
  font-size: 0.82rem;
}

.life-story-load-more {
  width: 100%;
  min-height: 44px;
}

.life-story-reader {
  padding: clamp(18px, 3vw, 34px);
  overflow-wrap: anywhere;
}

.life-story-reader-header {
  display: grid;
  gap: 10px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.life-story-reader-actions {
  margin-top: 2px;
}

.life-story-reader-header h2 {
  margin: 0;
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1.35;
}

.life-story-reader-excerpt {
  margin: 0;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.75;
}

.life-story-reader-body {
  padding: 12px 0 8px;
  font-family: "Noto Serif SC", "Songti SC", SimSun, serif;
  font-size: clamp(1rem, 1.7vw, 1.08rem);
  line-height: 2;
}

.life-story-reader-body p {
  margin: 1.15em 0;
  text-indent: 2em;
}

.life-story-comment-section {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.life-story-comment-section[hidden] {
  display: none !important;
}

.life-story-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.life-story-comment-head h3 {
  margin: 0;
}

.life-story-comments {
  display: grid;
  gap: 10px;
}

.life-story-comment {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border-left: 3px solid var(--accent-2);
  background: var(--panel-2);
}

.life-story-comment p {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.7;
}

.life-story-comment-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

.life-story-comment-form textarea,
.life-story-publish-form textarea {
  resize: vertical;
}

.life-story-comment-form button,
.life-story-publish-form button {
  min-height: 44px;
}

.life-story-publish-dialog {
  width: min(820px, calc(100vw - 28px));
  max-height: min(92vh, 960px);
  padding: 0;
  border: 1px solid var(--line-dark);
  border-radius: 12px;
  background: var(--panel);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.life-story-publish-dialog::backdrop {
  background: rgba(24, 28, 32, 0.72);
  backdrop-filter: blur(4px);
}

.life-story-publish-form {
  display: grid;
  gap: 15px;
  padding: clamp(18px, 3vw, 28px);
}

.life-story-publish-form textarea {
  max-height: 48vh;
}

@media (max-width: 768px) {
  .life-story-plaza-layout {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .life-story-feed-pane {
    max-height: 46vh;
    overflow-y: auto;
  }

  .life-story-reader {
    padding: 18px 15px;
  }

  .life-story-publish-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .life-story-feed-card {
    transition: none;
  }

  .life-story-feed-card:hover {
    transform: none;
  }
}

.support-modal-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 24%, rgba(190, 142, 69, 0.2), transparent 44%),
    rgba(18, 16, 15, 0.78);
  backdrop-filter: blur(7px);
}

.support-modal-card {
  position: relative;
  display: grid;
  gap: 18px;
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  padding: clamp(24px, 5vw, 42px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(174, 125, 52, 0.56);
  border-radius: 14px;
  background:
    linear-gradient(145deg, rgba(255, 253, 247, 0.98), rgba(244, 235, 215, 0.98)),
    var(--paper-strong);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42), inset 0 0 0 1px rgba(255, 255, 255, 0.68);
  text-align: center;
  animation: support-modal-arrive 260ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.support-modal-card::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(148, 100, 35, 0.18);
  border-radius: 9px;
  pointer-events: none;
}

.support-modal-kicker {
  color: #9a661b;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.support-modal-card h2 {
  margin: 0;
  color: #61271f;
  font-family: "STKaiti", "KaiTi", "Microsoft YaHei", sans-serif;
  font-size: clamp(1.65rem, 6vw, 2.35rem);
  line-height: 1.15;
}

.support-modal-copy {
  display: grid;
  gap: 8px;
  padding: 18px 12px;
  border-block: 1px solid rgba(154, 102, 27, 0.2);
}

.support-modal-copy p {
  margin: 0;
  color: #423932;
  font-size: clamp(0.98rem, 2.8vw, 1.08rem);
  font-weight: 700;
  line-height: 1.75;
}

.support-modal-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 10px;
}

.support-modal-actions button {
  min-height: 48px;
  white-space: normal;
}

.support-payment-modal .support-modal-actions .primary {
  border-color: #312e81 !important;
  background: #3730a3 !important;
  color: #ffffff !important;
  box-shadow: 0 8px 18px rgba(55, 48, 163, 0.24) !important;
}

.support-payment-modal .support-modal-actions .primary:hover:not(:disabled) {
  border-color: #1e1b4b !important;
  background: #27236f !important;
  color: #ffffff !important;
}

.support-payment-modal .support-modal-actions .primary:disabled {
  border-color: #9ca3af !important;
  background: #e5e7eb !important;
  color: #374151 !important;
  box-shadow: none !important;
  opacity: 1 !important;
}

.support-payment-modal .support-modal-actions .secondary:disabled {
  border-color: #9ca3af !important;
  background: #f3f4f6 !important;
  color: #374151 !important;
  opacity: 1 !important;
}

.support-payment-card {
  width: min(510px, 100%);
  gap: 14px;
  padding: clamp(18px, 4vw, 30px);
}

.support-payment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  text-align: left;
}

.support-payment-head > div {
  display: grid;
  gap: 7px;
}

.support-modal-close {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(122, 26, 21, 0.28);
  border-radius: 50%;
  background: rgba(255, 253, 247, 0.9);
  color: #7a1a15;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.support-payment-code {
  display: block;
  width: min(100%, 390px);
  max-height: min(60dvh, 520px);
  margin: 0 auto;
  object-fit: contain;
  border: 8px solid #fff;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(37, 31, 24, 0.16);
}

.support-payment-note {
  margin: 0;
  color: #6c625a;
  font-size: 0.85rem;
  line-height: 1.6;
}

.support-donation-status {
  min-height: 1.5em;
  margin: 0;
  color: #6c625a;
  font-size: 0.88rem;
  line-height: 1.55;
}

.support-donation-status.is-error { color: #a11f1f; }
.support-donation-status.is-success { color: #17603a; font-weight: 800; }

body.support-modal-open {
  overflow: hidden;
}

@keyframes support-modal-arrive {
  from { opacity: 0; transform: translateY(18px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 520px) {
  .support-modal-card {
    gap: 14px;
    padding: 22px 18px;
  }

  .support-modal-actions {
    grid-template-columns: 1fr;
  }

  .support-modal-actions button {
    min-height: 46px;
  }

  .support-payment-code {
    width: min(100%, 340px);
    max-height: 55dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .support-modal-card {
    animation: none;
  }
}

.login-card-gate-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.07) 1px, transparent 1px),
    linear-gradient(0deg, rgba(15, 118, 110, 0.06) 1px, transparent 1px);
  background-size: 44px 44px;
  pointer-events: none;
}

.login-card-panel,
.login-tutorial-card {
  position: relative;
  width: min(720px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow-lg);
}

.login-card-panel {
  display: grid;
  gap: 18px;
  min-width: 0;
  min-height: 0;
  max-height: calc(100vh - 44px);
  max-height: calc(100dvh - 44px);
  padding: clamp(22px, 4vw, 42px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

.login-card-panel-copy {
  display: grid;
  gap: 10px;
}

.login-card-panel-copy h2,
.login-card-welcome h2,
.login-tutorial-head h2 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.5rem);
  line-height: 1.12;
  letter-spacing: 0;
}

.login-card-panel-copy p,
.login-card-welcome p,
.login-tutorial-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.login-card-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.login-card-actions button {
  min-height: 68px;
  white-space: normal;
}

.login-acquisition-grid {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.login-acquisition-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 96px;
  padding: 16px 14px;
  border: 1px solid rgba(15, 118, 110, 0.42);
  border-radius: 8px;
  color: #fffdf7;
  box-shadow: 0 16px 34px rgba(31, 37, 43, 0.2), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.login-card-gate .login-acquisition-card {
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.98), rgba(17, 94, 89, 0.98)),
    #0f766e !important;
  border-color: rgba(15, 118, 110, 0.64) !important;
  color: #fff !important;
}

.login-card-gate .login-acquisition-android {
  background:
    linear-gradient(135deg, rgba(180, 35, 24, 0.98), rgba(120, 29, 22, 0.98)),
    #b42318 !important;
  border-color: rgba(122, 26, 21, 0.68) !important;
  color: #fff !important;
}

.login-acquisition-title {
  font-size: clamp(1.06rem, 2.5vw, 1.42rem);
  font-weight: 1000;
  letter-spacing: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.28);
}

.login-card-gate .login-acquisition-option small {
  color: #fff !important;
  opacity: 0.86;
  font-size: 0.82rem;
  font-weight: 800;
  line-height: 1.35;
}

.login-acquisition-option:hover:not(:disabled),
.login-acquisition-option:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(31, 37, 43, 0.28), inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.login-acquisition-option:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.46);
  outline-offset: 2px;
}

.login-acquisition-option:disabled {
  opacity: 0.68;
  cursor: wait;
}

.login-acquisition-season2 {
  background: linear-gradient(135deg, #3b173d, #7a2e4b 54%, #d0874a);
  color: #fff8ed;
}

.culling-season-group-picker {
  padding: 12px;
  border: 1px solid rgba(223, 174, 86, .46);
  border-radius: 12px;
  background: rgba(29, 19, 35, .96);
  color: #fff7e8;
}

.culling-season-group-picker p { margin: 0 0 8px; }
.culling-season-group-actions { display: flex; flex-wrap: wrap; gap: 7px; }
.culling-season-group-actions button { border: 1px solid rgba(255,255,255,.28); border-radius: 999px; padding: 6px 10px; background: #f6d398; color: #301525; cursor: pointer; }

.login-lite-mode-option {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: rgba(236, 254, 255, 0.72);
  color: #115e59;
  font-weight: 900;
}

.login-lite-mode-option input {
  width: 18px;
  height: 18px;
  accent-color: #0f766e;
}

.login-card-status-loading {
  display: block;
  padding: 14px 16px;
  border: 1px solid rgba(15, 118, 110, 0.28);
  border-radius: 8px;
  background: #ecfeff;
  color: #0f766e;
  font-size: clamp(1.08rem, 2vw, 1.32rem);
  font-weight: 900;
  line-height: 1.5;
}

.login-card-welcome {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background: #f2fbf8;
}

.login-welcome-lite-option {
  grid-column: auto;
  width: fit-content;
  max-width: 100%;
}

.login-card-welcome[hidden],
.login-card-actions[hidden] {
  display: none !important;
}

.latest-only-announcement li:nth-child(n+7) {
  display: none;
}

.shibuya-phase-one-announcement .announcement-lead {
  list-style: none;
  margin-left: -1.2rem;
  text-align: center;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #9f171f;
}

.shibuya-phase-one-announcement .announcement-platform {
  list-style: none;
  margin-left: -1.2rem;
  color: #8f691a;
  font-weight: 700;
}

.competition-only[hidden] {
  display: none !important;
}

.competition-draw-quota {
  align-self: center;
  color: #667085;
  font-size: 0.9rem;
  font-weight: 700;
}

.competition-draw-status {
  align-self: center;
  max-width: min(100%, 34rem);
  color: #475467;
  font-size: 0.9rem;
  font-weight: 650;
}

.competition-draw-status[data-level="error"] {
  color: #b42318;
}

.competition-draw-status[data-level="success"] {
  color: #067647;
}

.competition-restart-decision[hidden] { display: none; }
.competition-restart-decision { position: fixed; z-index: 2147483000; inset: 0; display: grid; place-items: center; padding: 20px; }
.competition-restart-backdrop { position: absolute; inset: 0; background: rgba(16, 24, 40, 0.58); }
.competition-restart-card { position: relative; width: min(100%, 440px); padding: 20px; border: 1px solid #d0d5dd; border-radius: 8px; background: #ffffff; box-shadow: 0 20px 50px rgba(16, 24, 40, 0.24); }
.competition-restart-card h2, .competition-restart-card p { margin-top: 0; }

body.login-card-competition .login-card-welcome {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff7ed;
}

body.competition-mode.competition-first-draft .tabs .tab:not([data-tab="run"]),
body.competition-mode.competition-first-draft #restartBtn,
body.competition-mode.competition-first-draft #runAllBtn,
body.competition-mode.competition-first-draft #nextBtn,
body.competition-mode.competition-first-draft #combatExportBtn,
body.competition-mode.competition-first-draft #exportBtn {
  display: none !important;
}

body.competition-mode.competition-complete .tabs .tab:not([data-tab="duel"]):not([data-tab="results"]):not([data-tab="changelog"]) {
  display: none !important;
}

body.competition-mode .debug-only,
body.competition-mode .decorative-only,
body.competition-mode .duel-bg-ornament {
  display: none !important;
}

body.competition-mode:not(.points-competition-mode) .login-card-character-row input[type="checkbox"] {
  display: none;
}

body.competition-mode [data-jjk-battle-tab="custom"],
body.competition-mode [data-jjk-battle-open="custom"],
body.competition-mode [data-jjk-battle-page-panel="custom"],
body.competition-mode #loginCardManagerFileInput {
  display: none !important;
}

body.competition-mode #customCharacterInterface,
body.competition-mode #duelCustomAddBtn,
body.competition-mode #duelCustomClearBtn,
body.competition-mode #duelApplyLibraryBtn,
body.competition-mode #duelWheelImportBtn,
body.competition-mode #duelWheelImportCurrentBtn,
body.competition-mode #duelImportCodeBtn,
body.competition-mode #duelCustomHandAddBtn {
  display: none !important;
}

.online-competition-spectator-panel {
  margin-top: 10px;
  border: 1px solid rgba(15, 118, 110, 0.24);
  border-radius: 8px;
  background: rgba(236, 254, 255, 0.58);
}

.online-competition-spectator-panel summary,
.online-special-spectator-panel summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 900;
}

.online-spectator-stage,
.online-special-spectator-stage {
  margin: 0 12px 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #ffffff;
  color: #115e59;
  font-weight: 900;
}

.online-special-spectator-panel {
  max-width: 1180px;
  width: min(1180px, calc(100vw - 24px));
  margin: 10px auto 0;
  border: 1px solid rgba(30, 64, 175, 0.22);
  border-radius: 8px;
  background: rgba(239, 246, 255, 0.76);
}

.online-special-spectator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
  padding: 0 12px 12px;
}

.points-competition-panel {
  border: 1px solid rgba(219, 39, 119, 0.18);
}

.points-permanent-panel {
  padding: 14px;
}

.points-permanent-title {
  margin: -2px -2px 14px;
  border-bottom: 1px solid rgba(185, 28, 28, 0.14);
}

.points-competition-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.points-competition-controls {
  display: flex;
  gap: 10px;
  align-items: end;
  flex-wrap: wrap;
}

.points-manual-match-tools {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(100, 116, 139, 0.18);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.72);
}

.points-manual-match-tools > summary {
  color: #475569;
  font-weight: 850;
  cursor: pointer;
}

.points-manual-match-tools > .muted {
  margin: 10px 0 8px;
}

.points-manual-match-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.points-current-score {
  display: grid;
  gap: 2px;
  min-width: 150px;
  justify-items: center;
  text-align: center;
  margin-inline: auto;
  padding: 10px 14px;
  border: 1px solid rgba(185, 28, 28, 0.36);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(254, 226, 226, 0.96), rgba(255, 247, 237, 0.9));
  color: #7f1d1d;
  box-shadow: 0 10px 22px rgba(127, 29, 29, 0.12);
}

.points-current-score[hidden] {
  display: none !important;
}

.points-current-score span {
  font-size: 12px;
  font-weight: 900;
}

.points-current-score strong {
  font-size: clamp(1.45rem, 3vw, 2.1rem);
  line-height: 1;
}

.points-battle-lobby {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(185, 28, 28, 0.22);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.78);
}

.points-matchmaking-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(320px, 1.4fr);
  gap: 14px 20px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(146, 64, 14, 0.28);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(254, 226, 226, 0.82)),
    repeating-linear-gradient(90deg, transparent 0 14px, rgba(127, 29, 29, 0.035) 14px 15px);
  box-shadow: 0 12px 28px rgba(127, 29, 29, 0.08);
}

.points-match-flow-panel {
  position: relative;
  overflow: hidden;
  scroll-margin-top: calc(76px + env(safe-area-inset-top, 0px));
  grid-template-columns: minmax(240px, 0.8fr) minmax(280px, 1.2fr);
  border-color: rgba(190, 24, 93, 0.34);
  background:
    radial-gradient(circle at 12% 12%, rgba(244, 63, 94, 0.16), transparent 28%),
    linear-gradient(145deg, rgba(255, 251, 235, 0.98), rgba(255, 241, 242, 0.94));
}

.points-match-flow-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 0 45%, rgba(255, 255, 255, 0.34) 49%, transparent 54%);
  transform: translateX(-115%);
}

.points-match-flow-panel[data-ranked-stage="versus"]::after {
  animation: ranked-panel-sweep 720ms cubic-bezier(.2, .8, .2, 1) both;
}

.points-match-flow-head,
.points-match-stepper,
.points-matchmaking-controls,
.points-match-acceptance-actions,
.points-matchmaking-status {
  grid-column: 1 / -1;
}

.points-match-flow-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(159, 18, 57, 0.16);
}

.points-match-flow-head h4 {
  margin: 5px 0 0;
  color: #881337;
  font-size: clamp(1.25rem, 2.8vw, 1.75rem);
  letter-spacing: 0.08em;
}

#pointsMatchStageLabel {
  color: #9f1239;
  text-align: right;
}

.points-match-stepper {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.points-match-stepper li {
  position: relative;
  display: grid;
  gap: 3px;
  justify-items: center;
  padding: 8px 4px;
  border: 1px solid rgba(100, 116, 139, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.56);
  color: #64748b;
  font-size: 0.75rem;
  font-weight: 800;
}

.points-match-stepper li span {
  font: 700 0.65rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  opacity: 0.7;
}

.points-match-stepper li.active {
  border-color: rgba(225, 29, 72, 0.55);
  color: #9f1239;
  background: linear-gradient(145deg, rgba(255, 228, 230, 0.95), rgba(255, 255, 255, 0.9));
  box-shadow: 0 7px 18px rgba(190, 24, 93, 0.12);
}

.points-match-stepper li.done {
  border-color: rgba(22, 163, 74, 0.32);
  color: #166534;
  background: rgba(240, 253, 244, 0.86);
}

.points-match-scene {
  display: grid;
  grid-template-columns: minmax(120px, 0.85fr) minmax(130px, 1.15fr);
  gap: 14px;
  align-items: center;
  min-height: 170px;
  padding: 12px;
  border: 1px solid rgba(159, 18, 57, 0.16);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
}

.points-match-radar {
  position: relative;
  aspect-ratio: 1;
  width: min(145px, 100%);
  margin: auto;
  border: 1px solid rgba(251, 113, 133, 0.55);
  border-radius: 50%;
  overflow: hidden;
  background:
    linear-gradient(90deg, transparent 49.5%, rgba(251, 113, 133, 0.25) 50%, transparent 50.5%),
    linear-gradient(transparent 49.5%, rgba(251, 113, 133, 0.25) 50%, transparent 50.5%),
    radial-gradient(circle, transparent 0 30%, rgba(251, 113, 133, 0.2) 30.5% 31%, transparent 31.5% 62%, rgba(251, 113, 133, 0.18) 62.5% 63%, transparent 63.5%);
}

.points-match-radar::after {
  content: "";
  position: absolute;
  inset: 50% auto auto 50%;
  width: 45%;
  height: 45%;
  transform-origin: left top;
  background: conic-gradient(from 270deg, rgba(251, 113, 133, 0.58), transparent 32%);
  opacity: 0.18;
}

.points-match-flow-panel[data-ranked-stage="queueing"] .points-match-radar::after,
.points-match-flow-panel[data-ranked-stage="assessing"] .points-match-radar::after {
  opacity: 1;
  animation: ranked-radar-scan 1.6s linear infinite;
}

.points-match-radar span {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fda4af;
  box-shadow: 0 0 12px #fb7185;
}

.points-match-radar span:nth-child(1) { left: 28%; top: 31%; }
.points-match-radar span:nth-child(2) { right: 19%; top: 42%; }
.points-match-radar span:nth-child(3) { left: 44%; bottom: 18%; }
.points-match-radar span:nth-child(4) { right: 37%; top: 18%; }

.points-match-radar i {
  position: absolute;
  inset: 50%;
  width: 8px;
  height: 8px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 5px rgba(251, 113, 133, 0.18), 0 0 18px #fb7185;
}

.points-match-opponent-card {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.points-match-opponent-card .muted {
  color: #fda4af;
}

#pointsMatchOpponent {
  overflow-wrap: anywhere;
  font-size: clamp(1.1rem, 3vw, 1.55rem);
}

#pointsMatchTimer {
  color: #cbd5e1;
  line-height: 1.5;
}

.points-match-acceptance-actions {
  display: grid;
  grid-template-columns: minmax(140px, auto) minmax(160px, auto) 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(225, 29, 72, 0.25);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
}

.points-match-acceptance-actions[hidden] {
  display: none !important;
}

.ranked-versus-overlay {
  position: fixed;
  z-index: 1450;
  inset: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: clamp(16px, 6vw, 72px);
  padding: clamp(20px, 7vw, 92px);
  color: #fff;
  background:
    linear-gradient(102deg, rgba(15, 23, 42, 0.98) 0 49.7%, rgba(127, 29, 29, 0.98) 50.3% 100%);
  animation: ranked-versus-enter 780ms cubic-bezier(.2, .85, .2, 1) both;
}

.ranked-versus-overlay[hidden] {
  display: none !important;
}

.ranked-versus-overlay > b {
  font: 950 clamp(2.4rem, 8vw, 7rem)/1 ui-sans-serif, system-ui, sans-serif;
  color: #fef2f2;
  text-shadow: 0 0 35px rgba(251, 113, 133, 0.7);
}

.ranked-versus-side {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.ranked-versus-side span {
  color: #fda4af;
  font: 800 0.72rem/1 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: 0.18em;
}

.ranked-versus-side strong {
  overflow-wrap: anywhere;
  font-size: clamp(1.4rem, 4vw, 3.4rem);
}

.ranked-versus-opponent {
  text-align: right;
}

.ranked-battle-stage-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(225, 29, 72, 0.34);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255, 241, 242, 0.98), rgba(255, 247, 237, 0.92));
  box-shadow: 0 10px 24px rgba(159, 18, 57, 0.1);
}

.ranked-battle-stage-banner[hidden] {
  display: none !important;
}

.ranked-battle-stage-banner > div {
  display: grid;
  gap: 5px;
}

.ranked-battle-mini-steps {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranked-battle-mini-steps li {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 800;
}

.ranked-battle-mini-steps li.done { color: #166534; background: rgba(34, 197, 94, 0.12); }
.ranked-battle-mini-steps li.active { color: #9f1239; background: rgba(244, 63, 94, 0.14); }

body.ranked-battle-mode [data-jjk-battle-page-panel="online"] > .jjk-battle-section-head,
body.ranked-battle-mode #onlineSyncSettingsDetails,
body.ranked-battle-mode #onlineRoomSection,
body.ranked-battle-mode #onlineJoinSection {
  display: none !important;
}

@keyframes ranked-radar-scan {
  to { transform: rotate(1turn); }
}

@keyframes ranked-panel-sweep {
  to { transform: translateX(115%); }
}

@keyframes ranked-versus-enter {
  from { opacity: 0; clip-path: inset(0 50%); }
  to { opacity: 1; clip-path: inset(0); }
}

.points-matchmaking-copy h4 {
  margin: 7px 0 5px;
  color: #7f1d1d;
  font-size: 1.2rem;
}

.points-matchmaking-copy p,
.points-matchmaking-status {
  margin: 0;
  color: #713f12;
  line-height: 1.65;
}

.points-matchmaking-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(130px, 0.55fr) auto auto;
  gap: 10px;
  align-items: end;
}

.points-matchmaking-controls .field {
  min-width: 0;
}

.points-matchmaking-status {
  grid-column: 1 / -1;
  padding: 9px 11px;
  border-left: 3px solid rgba(185, 28, 28, 0.56);
  background: rgba(255, 255, 255, 0.66);
}

.points-battle-lobby[hidden] {
  display: none !important;
}

.points-battle-lobby-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}

.points-battle-lobby-list {
  display: grid;
  gap: 8px;
}

.points-battle-lobby-row {
  display: grid;
  grid-template-columns: minmax(90px, 0.5fr) minmax(160px, 1fr) minmax(120px, 0.7fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(185, 28, 28, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.points-battle-lobby-row strong {
  color: #991b1b;
  font-size: 1.08rem;
}

.points-rank-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.points-rank-list {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.points-primary-rank,
.points-history-panel {
  padding: 12px;
  border: 1px solid rgba(185, 28, 28, 0.18);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.68);
}

.points-primary-rank h4 {
  margin: 0;
  color: #7f1d1d;
}

.points-history-panel {
  margin-top: 14px;
}

.points-history-controls {
  display: flex;
  align-items: end;
  gap: 10px;
  flex-wrap: wrap;
  margin: 12px 0;
}

.points-rank-row {
  display: grid;
  grid-template-columns: minmax(130px, 1.5fr) minmax(80px, 0.8fr) minmax(70px, 0.6fr) minmax(96px, 0.9fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.points-rank-row.promoted {
  background: linear-gradient(90deg, rgba(250, 204, 21, 0.32), rgba(255, 255, 255, 0.8));
  border-color: rgba(202, 138, 4, 0.35);
}

.points-rank-row em {
  color: var(--muted);
  font-style: normal;
}

.points-admin-controls {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

@media (max-width: 760px) {
  .points-competition-head {
    display: grid;
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .points-current-score {
    margin-inline: 0;
    width: 100%;
    min-width: 0;
    justify-items: start;
    text-align: left;
  }

  .points-current-score strong {
    font-size: 1.7rem;
  }

  .points-competition-controls {
    width: 100%;
    align-items: stretch;
  }

  .points-competition-controls .field {
    flex: 1 1 140px;
    min-width: 0;
  }

  .points-matchmaking-panel,
  .points-matchmaking-controls {
    grid-template-columns: 1fr;
  }

  .points-match-flow-panel {
    padding: 11px;
  }

  .points-match-stepper {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
    padding-bottom: 4px;
  }

  .points-match-stepper li {
    flex: 0 0 72px;
    scroll-snap-align: center;
  }

  .points-match-scene {
    grid-template-columns: 110px minmax(0, 1fr);
    min-height: 132px;
  }

  .points-match-acceptance-actions {
    grid-template-columns: 1fr 1fr;
  }

  .points-match-acceptance-actions .muted {
    grid-column: 1 / -1;
  }

  .ranked-versus-overlay {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .ranked-versus-opponent {
    text-align: center;
  }

  .ranked-battle-stage-banner {
    display: grid;
  }

  .points-matchmaking-controls button {
    width: 100%;
  }

  .points-manual-match-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .points-manual-match-actions button {
    width: 100%;
  }

  .points-rank-grid {
    grid-template-columns: 1fr;
  }

  .points-rank-row {
    grid-template-columns: 1fr 1fr;
  }
}

/* V26.7-r96: make the character workbench and battle setup read as focused tools. */
#duel .duel-panel h2,
#duel .duel-panel h3,
.jjk-battle-section-head h3,
.duel-character-workbench h3 {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink-strong);
  letter-spacing: -0.02em;
}

.duel-custom-panel.duel-character-workbench {
  gap: 18px;
  padding: clamp(16px, 2vw, 24px);
  border-color: #dfe4f1;
  border-radius: 24px;
  background:
    radial-gradient(circle at 100% 0, rgba(91, 91, 214, 0.08), transparent 34%),
    var(--surface-card);
  box-shadow: 0 18px 48px rgba(33, 45, 75, 0.09);
}

.duel-character-workbench > .duel-import-code-panel,
.duel-character-workbench > .duel-library-assist {
  grid-column: 1 / -1;
}

.duel-character-workbench > .duel-ai-designer-launch,
.duel-character-workbench > .duel-custom-grid,
.duel-character-workbench > .duel-custom-stats {
  align-self: stretch;
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--surface-soft);
}

.duel-character-workbench > .duel-ai-designer-launch {
  grid-column: 1;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  background: linear-gradient(145deg, #eef2ff, #f8f7ff);
}

.duel-character-workbench > .duel-ai-designer-launch button {
  width: 100%;
}

.duel-character-workbench > .duel-custom-grid:not(.duel-custom-grid-wide) {
  grid-column: 2 / -1;
}

.duel-character-workbench > .duel-custom-stats {
  grid-column: 1;
  border-style: solid;
}

.duel-character-workbench > .duel-custom-grid-wide {
  grid-column: 2 / -1;
}

.duel-character-workbench > .duel-custom-interface,
.duel-character-workbench > .duel-import-code-panel,
.duel-character-workbench > .duel-library-assist {
  border-color: var(--line-soft);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
}

.duel-character-workbench > .duel-workbench-toolbar {
  border-color: #d9def5;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 28px rgba(33, 45, 75, 0.09);
}

.duel-character-workbench .duel-special-card-workspace > section {
  border-color: var(--line-soft);
  border-radius: 18px;
  background: var(--surface-soft);
}

.duel-panel .duel-selectors {
  padding: 16px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: linear-gradient(135deg, #f8fafc, #f4f3ff);
}

.duel-panel .duel-battle-empty,
.duel-panel .duel-battle-stage {
  border-color: var(--line-soft);
  border-radius: 24px;
  box-shadow: 0 18px 46px rgba(25, 36, 64, 0.1);
}

@media (max-width: 1180px) and (min-width: 768px) {
  .duel-custom-panel.duel-character-workbench {
    grid-template-columns: minmax(220px, 0.78fr) minmax(0, 1.7fr);
  }

  .duel-character-workbench > .duel-custom-grid:not(.duel-custom-grid-wide),
  .duel-character-workbench > .duel-custom-grid-wide {
    grid-column: 2;
  }
}

@media (max-width: 767px) {
  .duel-character-workbench > .duel-ai-designer-launch,
  .duel-character-workbench > .duel-custom-grid:not(.duel-custom-grid-wide),
  .duel-character-workbench > .duel-custom-stats,
  .duel-character-workbench > .duel-custom-grid-wide {
    grid-column: 1 / -1;
  }

  .duel-character-workbench > .duel-custom-grid,
  .duel-character-workbench > .duel-custom-stats {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .points-match-radar::after,
  .points-match-flow-panel::after,
  .ranked-versus-overlay {
    animation: none !important;
    transition: none !important;
  }
}

.online-special-seat-card {
  min-width: 0;
  border: 1px solid rgba(30, 64, 175, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  padding: 10px;
}

.online-special-seat-card[data-side="right"],
.online-special-seat-card[data-role="boss"] {
  border-color: rgba(153, 27, 27, 0.22);
  background: rgba(255, 247, 237, 0.86);
}

.online-special-seat-card[data-you="true"] {
  border-color: rgba(15, 118, 110, 0.42);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.online-special-seat-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.online-special-seat-head strong,
.online-special-seat-meta,
.online-special-action-list,
.online-special-seat-note {
  min-width: 0;
}

.online-special-seat-head strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-special-seat-head em {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
}

.online-special-seat-meta,
.online-special-seat-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.42;
}

.online-special-action-list {
  display: grid;
  gap: 5px;
  margin-top: 8px;
}

.online-special-action-chip {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid rgba(30, 64, 175, 0.12);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.92);
  font-size: 0.84rem;
  line-height: 1.35;
}

.online-special-action-chip strong,
.online-special-action-chip span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.online-special-action-chip span {
  color: var(--muted);
  font-size: 0.78rem;
}

.online-special-action-empty {
  color: var(--muted);
  font-size: 0.84rem;
}

.online-turn-archive {
  display: grid;
  gap: 6px;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 0.92rem;
}

.online-spectator-stage.deal-animation {
  animation: onlineDealFlash 420ms ease-out;
}

@keyframes onlineDealFlash {
  0% { transform: translateY(-6px); opacity: 0.45; }
  100% { transform: translateY(0); opacity: 1; }
}

body.duel-lite-mode .online-spectator-stage.deal-animation {
  animation: none;
}

.login-tutorial-panel {
  align-items: stretch;
  place-items: center;
}

.login-tutorial-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100vh - 44px);
  overflow: hidden;
}

.login-tutorial-head {
  display: grid;
  grid-template-columns: auto minmax(180px, 1fr);
  align-items: center;
  column-gap: 12px;
  row-gap: 10px;
  padding: 24px 28px 12px;
  border-bottom: 1px solid var(--line);
}

.login-tutorial-head h2 {
  min-width: 0;
  grid-column: 2;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
}

.login-tutorial-body {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 22px 28px;
}

.login-tutorial-nav {
  justify-content: flex-end;
  padding: 14px 28px 22px;
  border-top: 1px solid var(--line);
}

.login-tutorial-actions {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  flex-wrap: nowrap;
  gap: 10px;
  justify-content: flex-end;
  pointer-events: auto;
}

.login-tutorial-actions button {
  white-space: nowrap;
}

body .login-tutorial-actions .login-tutorial-skip,
body .login-tutorial-actions .login-tutorial-collapse {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  right: auto !important;
  z-index: auto !important;
}

body.login-tutorial-collapsed .login-tutorial-panel {
  pointer-events: none;
  background: transparent;
}

body.login-tutorial-collapsed .login-tutorial-card {
  width: auto;
  max-width: calc(100vw - 24px);
  max-height: none;
  pointer-events: auto;
}

body.login-tutorial-collapsed .login-tutorial-head {
  padding: 10px;
  border-bottom: 0;
}

body.login-tutorial-collapsed .login-tutorial-head .badge,
body.login-tutorial-collapsed .login-tutorial-head h2,
body.login-tutorial-collapsed .login-tutorial-body,
body.login-tutorial-collapsed .login-tutorial-nav {
  display: none;
}

body.login-tutorial-collapsed .login-tutorial-actions {
  pointer-events: auto;
}

.tutorial-center-dialog {
  position: fixed;
  inset: 0;
  z-index: 246;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top, 0px)) max(14px, env(safe-area-inset-right, 0px)) max(14px, env(safe-area-inset-bottom, 0px)) max(14px, env(safe-area-inset-left, 0px));
  background: rgba(15, 23, 42, 0.64);
}

.tutorial-center-dialog[hidden] {
  display: none !important;
}

.tutorial-center-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.tutorial-center-card {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(860px, calc(100dvh - 28px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.34);
}

.tutorial-center-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.tutorial-center-head h2,
.tutorial-center-head p,
.tutorial-course-panel h3,
.tutorial-course-panel h4,
.tutorial-course-panel p {
  margin: 0;
}

.tutorial-center-head h2 {
  margin-top: 6px;
}

.tutorial-center-content {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
}

.tutorial-course-list {
  min-height: 0;
  overflow: auto;
  padding: 18px;
  border-right: 1px solid var(--line);
}

.tutorial-course-group + .tutorial-course-group {
  margin-top: 18px;
}

.tutorial-course-group h3 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tutorial-course-button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 12px;
  margin: 0 0 8px;
  padding: 12px 14px;
  text-align: left;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 92%, #0f766e 8%);
}

.tutorial-course-button strong,
.tutorial-course-button small {
  min-width: 0;
}

.tutorial-course-button small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.tutorial-course-button .tutorial-course-status {
  color: #0f766e;
  font-size: 0.78rem;
  white-space: nowrap;
}

.tutorial-course-button:disabled {
  opacity: 0.55;
}

.tutorial-course-panel {
  min-height: 0;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 28px;
}

.tutorial-course-panel:not([hidden]) {
  display: grid;
}

.tutorial-course-meta,
.tutorial-course-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.tutorial-course-panel h3 {
  font-size: clamp(1.45rem, 3vw, 2rem);
}

.tutorial-course-panel h4 {
  font-size: 1.1rem;
}

.tutorial-course-panel > p {
  color: var(--muted);
  line-height: 1.8;
}

.tutorial-course-controls {
  margin-top: 8px;
}

.tutorial-center-dialog[data-tutorial-view="course"] {
  place-items: center end;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.16);
}

.tutorial-center-dialog[data-tutorial-view="course"] .tutorial-center-backdrop {
  display: none;
}

.tutorial-center-dialog[data-tutorial-view="course"] .tutorial-center-card {
  width: min(470px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  pointer-events: auto;
}

.tutorial-center-dialog[data-tutorial-view="course"] .tutorial-course-list,
.tutorial-center-dialog[data-tutorial-view="course"] #tutorialCenterSummary {
  display: none;
}

.tutorial-center-dialog[data-tutorial-view="course"] .tutorial-center-content {
  grid-template-columns: 1fr;
}

.tutorial-resume-dock {
  position: fixed;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: max(14px, env(safe-area-inset-bottom, 0px));
  z-index: 247;
  max-width: min(420px, calc(100vw - 28px));
  box-shadow: 0 10px 34px rgba(15, 23, 42, 0.26);
}

.tutorial-target-highlight {
  position: relative;
  z-index: 245 !important;
  outline: 3px solid #14b8a6 !important;
  outline-offset: 5px;
  border-radius: 10px;
  box-shadow: 0 0 0 9px rgba(20, 184, 166, 0.22), 0 12px 34px rgba(15, 118, 110, 0.24) !important;
}

@media (max-width: 720px) {
  .tutorial-center-dialog {
    place-items: end center;
    padding: 0;
  }

  .tutorial-center-dialog[data-tutorial-view="course"] {
    place-items: end center;
  }

  .tutorial-center-card,
  .tutorial-center-dialog[data-tutorial-view="course"] .tutorial-center-card {
    width: 100%;
    max-height: min(88dvh, 780px);
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .tutorial-center-content {
    grid-template-columns: 1fr;
  }

  .tutorial-course-list {
    border-right: 0;
  }

  .tutorial-center-dialog[data-tutorial-view="center"] .tutorial-course-panel {
    display: none;
  }

  .tutorial-center-head,
  .tutorial-course-panel {
    padding: 16px;
  }

  .tutorial-course-controls > button {
    flex: 1 1 calc(50% - 10px);
  }
}

.login-tutorial-highlight {
  outline: 3px solid #0f766e;
  outline-offset: 4px;
  box-shadow: 0 0 0 8px rgba(20, 184, 166, 0.18);
}

.login-card-tutorial-form {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.archive-encyclopedia-entry {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 18px 0 8px;
  padding: 14px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--paper-strong);
  box-shadow: var(--shadow-sm);
}

.archive-encyclopedia-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 18px;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  background: var(--ink);
  color: var(--ink);
  color: var(--paper);
  font-weight: 800;
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.archive-encyclopedia {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.archive-encyclopedia.is-floating {
  position: fixed;
  right: 24px;
  top: 152px;
  z-index: 360;
  width: min(640px, calc(100vw - 36px));
  height: min(520px, calc(100vh - 176px));
  min-width: min(360px, calc(100vw - 24px));
  min-height: 260px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 112px);
  overflow: auto;
  resize: both;
  box-shadow: 0 18px 50px rgba(20, 16, 9, 0.25);
}

.archive-encyclopedia-placeholder {
  display: none;
}

.archive-encyclopedia:not([open]) {
  display: none;
}

.archive-encyclopedia > summary {
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 900;
}

.archive-encyclopedia-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--paper-strong);
}

.archive-encyclopedia.is-floating .archive-encyclopedia-toolbar {
  cursor: move;
}

.archive-encyclopedia .jjk-battle-info-grid {
  padding: 0 14px 14px;
}

.duel-collapsible-tool {
  display: grid;
  gap: 12px;
}

.duel-collapsible-tool > summary {
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  font-weight: 800;
}

.duel-collapsible-tool[open] > summary {
  margin-bottom: 10px;
}

.login-card-manager {
  display: grid;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.login-card-manager-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
}

.login-card-count {
  display: grid;
  align-content: center;
  gap: 4px;
  min-height: 64px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.login-card-count span {
  color: var(--muted);
  font-size: 0.82rem;
}

.login-card-count strong {
  font-size: 1.25rem;
}

.login-card-activity-summary {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid rgba(158, 118, 36, 0.42);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(231, 191, 87, 0.14), rgba(18, 22, 31, 0.03));
}

.login-card-activity-summary[hidden] {
  display: none;
}

.login-card-activity-summary span,
.login-card-activity-summary small {
  color: var(--muted);
}

.login-card-character-list {
  display: grid;
  gap: 8px;
}

.login-card-character-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.login-card-character-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}

.login-card-character-row span,
.login-card-character-main span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.login-card-character-row small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.login-card-character-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.login-card-character-editor[hidden] {
  display: none;
}

.login-card-editor-text {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.login-card-stat-grid,
.login-card-hand-editor-row {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.login-card-hand-editor-list {
  display: grid;
  gap: 10px;
}

.login-card-hand-editor-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.login-card-hand-editor-head,
.login-card-hand-summary,
.login-card-json-editor {
  grid-column: 1 / -1;
}

.login-card-hand-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.login-card-hand-editor-head strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.login-card-hand-editor-row label {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.login-card-hand-editor-row input,
.login-card-hand-editor-row select {
  width: 100%;
  min-width: 0;
}

.login-card-json-editor {
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--paper-strong);
}

body.duel-theme-dark .login-card-gate,
body.duel-theme-dark .login-tutorial-panel {
  background: rgba(17, 24, 39, 0.98);
}

body.duel-theme-dark .login-card-gate-bg {
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.09) 1px, transparent 1px),
    linear-gradient(0deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
}

body.duel-theme-dark .login-card-panel,
body.duel-theme-dark .login-tutorial-card,
body.duel-theme-dark .login-card-manager {
  border-color: #334155;
  background: #111827;
  color: #e5edf5;
}

body.duel-theme-dark .login-card-welcome,
body.duel-theme-dark .login-card-tutorial-form,
body.duel-theme-dark .login-card-count,
body.duel-theme-dark .login-card-character-row {
  border-color: #334155;
  background: #182235;
}

body.duel-theme-dark .login-card-status-loading {
  border-color: #2dd4bf;
  background: #102a2f;
  color: #99f6e4;
}

body.duel-theme-dark .login-tutorial-head,
body.duel-theme-dark .login-tutorial-nav {
  border-color: #334155;
}

button {
  font: inherit;
}

button,
select,
input {
  transition: border-color 140ms ease, box-shadow 140ms ease, background-color 140ms ease, transform 140ms ease;
}

button:focus-visible,
select:focus-visible,
input:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

.debug-only,
.debug-tab {
  display: none !important;
}

.debug-summon-only {
  display: none !important;
}

body.debug-mode .debug-only {
  display: revert !important;
}

body.debug-mode .field.debug-only {
  display: grid !important;
}

body.debug-summoned .debug-summon-only,
body.debug-mode .debug-summon-only {
  display: inline-flex !important;
}

body.debug-mode .debug-tab,
body.debug-mode button.debug-only {
  display: inline-flex !important;
}

body.debug-mode .panel-heading.debug-only {
  display: flex !important;
}

.debug-force[hidden] {
  display: none !important;
}

.debug-force {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed var(--accent);
  border-radius: var(--radius);
  background: #fff7ed;
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  gap: 8px 12px;
  align-items: center;
}

.debug-force label {
  font-weight: 800;
}

.debug-force select {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
  color: var(--ink);
}

.debug-force .muted {
  grid-column: 2;
}

.debug-entry-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px dashed rgba(47, 111, 104, 0.72);
  border-radius: var(--radius);
  background: rgba(240, 253, 250, 0.62);
  display: grid;
  gap: 10px;
}

body.debug-mode .debug-entry-panel.debug-only {
  display: grid !important;
}

.debug-entry-panel[hidden] {
  display: none !important;
}

.debug-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.debug-entry-head strong {
  color: var(--ink);
}

.debug-entry-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 12px;
}

.half-custom-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #b7d6ea;
  border-radius: var(--radius);
  background: #eef8ff;
  display: grid;
  grid-template-columns: minmax(110px, auto) minmax(160px, 1fr) auto;
  gap: 8px 12px;
  align-items: center;
}

.half-custom-panel label {
  font-weight: 800;
}

.half-custom-panel select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
}

.half-custom-panel .muted {
  grid-column: 2 / -1;
}

.ai-free-panel {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(47, 111, 104, 0.36);
  border-radius: var(--radius);
  background: rgba(240, 253, 250, 0.52);
  display: grid;
  grid-template-columns: minmax(170px, 0.55fr) minmax(260px, 1fr);
  gap: 12px;
  align-items: start;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.58);
}

.ai-free-head,
.ai-free-actions {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ai-free-head strong {
  color: var(--ink);
  font-size: 16px;
}

.ai-free-help-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-free-anchor {
  min-width: 0;
}

.ai-free-story {
  grid-row: span 2;
}

.ai-free-panel select,
.ai-free-panel textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 8px 10px;
  font: inherit;
}

.ai-free-anchor-result {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(47, 111, 104, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  padding: 8px 10px;
  font-weight: 750;
  line-height: 1.45;
}

.ai-free-panel textarea {
  resize: vertical;
  min-height: 92px;
}

.ai-free-strategy-section {
  display: grid;
  gap: 6px;
}

.ai-free-strategy-section strong,
.ai-free-analysis-block strong {
  font-size: 13px;
  color: var(--ink);
}

.ai-free-strategy-section p {
  margin: 0;
}

.ai-free-strategy-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ai-free-strategy-buttons .secondary {
  min-height: 32px;
  padding: 5px 10px;
}

.ai-free-analysis-panel {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(47, 111, 104, 0.26);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
}

.ai-free-analysis-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 800;
  color: var(--ink);
}

.ai-free-analysis-status {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

.ai-free-analysis-block {
  display: grid;
  gap: 5px;
}

.ai-free-analysis-list {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-free-analysis-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.ai-free-boundary-note {
  margin: 0;
  padding: 7px 9px;
  border-left: 3px solid rgba(47, 111, 104, 0.46);
  border-radius: 6px;
  background: rgba(47, 111, 104, 0.08);
  color: #43505a;
  font-size: 13px;
  line-height: 1.55;
}

.ai-free-actions .primary {
  min-height: 36px;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 28px 13px;
  border-bottom: 1px solid var(--line-dark);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(242, 239, 231, 0.94)),
    var(--paper);
  box-shadow: 0 1px 0 rgba(255, 253, 247, 0.75), 0 10px 22px rgba(53, 45, 32, 0.08);
  backdrop-filter: blur(10px);
}

.topbar h1 {
  margin: 0;
  font-size: 25px;
  line-height: 1.25;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topbar h1::before {
  content: "JJK DUEL";
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid rgba(180, 35, 24, 0.58);
  color: var(--stamp);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  background: rgba(255, 247, 237, 0.68);
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.feedback-contact {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  margin: 6px 0 0;
  padding: 2px 9px;
  border: 1px solid rgba(180, 35, 24, 0.45);
  border-radius: 4px;
  background: rgba(255, 247, 237, 0.66);
  color: var(--stamp) !important;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 8px;
  padding: 12px 28px;
  border-bottom: 1px solid rgba(169, 159, 144, 0.82);
  background:
    linear-gradient(180deg, rgba(247, 245, 238, 0.9), rgba(232, 226, 214, 0.76));
  backdrop-filter: blur(8px);
}

.tab {
  min-width: 84px;
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(169, 159, 144, 0.9);
  border-radius: 6px 6px 2px 2px;
  background: rgba(247, 245, 238, 0.74);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(31, 37, 43, 0.035);
}

.tab.active {
  border-color: rgba(180, 35, 24, 0.34);
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: var(--shadow-sm), inset 0 -3px 0 var(--stamp);
}

.tab:hover {
  border-color: var(--line-dark);
  color: var(--ink);
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 28px 42px;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.run-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.side-stack {
  display: grid;
  gap: 18px;
}

.compact-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.compact-heading h3 {
  margin: 0;
}

.wheel-settings-panel {
  display: grid;
  gap: 12px;
}

.wheel-settings-grid {
  display: grid;
  gap: 12px;
}

.wheel-setting-field {
  display: grid;
  gap: 7px;
}

.wheel-setting-field span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.wheel-setting-field output {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.wheel-setting-field input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.wheel-setting-toggles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.wheel-setting-toggles label {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  user-select: none;
}

.wheel-setting-toggles input {
  accent-color: var(--accent);
}

.panel {
  position: relative;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.94), rgba(247, 245, 238, 0.92)),
    var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 18px 18px 22px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

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

.panel.compact {
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

.panel-heading {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: -2px -2px 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(169, 159, 144, 0.55);
}

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

.panel h2,
.panel h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  width: fit-content;
  max-width: 100%;
  padding: 3px 9px 4px;
  border: 1px solid rgba(169, 159, 144, 0.68);
  border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #f8efd9, #ead8b5);
  color: #26323a;
  box-shadow: 0 1px 0 rgba(255, 253, 247, 0.76);
}

.duel-panel .panel-heading {
  align-items: flex-start;
}

.duel-panel .panel-heading p {
  margin: 6px 0 0;
}

.jjk-battle-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(91, 78, 60, 0.16);
}

.jjk-battle-tab {
  border: 1px solid rgba(91, 78, 60, 0.22);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.72);
  color: var(--ink);
  padding: 8px 12px;
  cursor: pointer;
}

.jjk-battle-tab.active {
  border-color: rgba(15, 118, 110, 0.5);
  background: rgba(204, 251, 241, 0.52);
  box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.18);
}

.jjk-battle-page[hidden] {
  display: none !important;
}

.jjk-battle-page {
  margin-top: 14px;
}

.jjk-battle-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.jjk-battle-section-head h3 {
  margin: 0;
}

.jjk-battle-section-head p {
  margin: 0;
  max-width: 760px;
}

.jjk-battle-home-grid,
.jjk-battle-info-grid,
.online-player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.jjk-battle-home-card,
.jjk-battle-info-grid article,
.online-player-grid article {
  border: 1px solid rgba(91, 78, 60, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.72);
  color: var(--ink);
  padding: 14px;
  text-align: left;
}

.jjk-battle-home-card {
  cursor: pointer;
}

.jjk-battle-home-card:hover,
.jjk-battle-home-card:focus-visible {
  border-color: rgba(15, 118, 110, 0.45);
  background: rgba(204, 251, 241, 0.36);
}

.jjk-battle-home-card strong,
.jjk-battle-info-grid strong,
.online-player-grid strong {
  display: block;
  margin-bottom: 6px;
}

.jjk-battle-home-card span,
.jjk-battle-info-grid span,
.online-player-grid span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.online-duel-intel-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.online-duel-intel-panel[hidden] {
  display: none !important;
}

.online-duel-intel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.online-duel-intel-title strong {
  color: var(--ink);
}

.online-duel-intel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.online-duel-intel-card {
  display: grid;
  gap: 10px;
  border: 1px solid #d6dee8;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.94);
  box-shadow: var(--shadow-sm);
  padding: 12px;
}

.online-duel-intel-card.you {
  border-color: rgba(15, 118, 110, 0.34);
  background: rgba(240, 253, 250, 0.9);
}

.online-duel-intel-card:nth-child(2) {
  text-align: right;
}

.online-duel-intel-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.online-duel-intel-card:nth-child(2) .online-duel-intel-head {
  flex-direction: row-reverse;
}

.online-duel-intel-head span,
.online-duel-intel-head strong {
  display: block;
}

.online-duel-intel-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.online-duel-intel-head strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.online-duel-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.online-duel-intel-card:nth-child(2) .online-duel-chips {
  justify-content: flex-end;
}

.online-duel-chips span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(47, 111, 104, 0.24);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.64);
  color: #334155;
  font-size: 12px;
  font-weight: 800;
}

.online-duel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.online-duel-stat {
  min-width: 0;
  display: grid;
  gap: 2px;
  padding: 7px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.56);
}

.online-duel-stat .character-panel-stat-label,
.online-duel-stat .character-panel-stat-value {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.online-duel-stat .character-panel-stat-grade {
  color: var(--ink);
  font-size: clamp(22px, 3.8vw, 30px);
  line-height: 1;
  overflow-wrap: anywhere;
}

.online-duel-intel-detail {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 6px 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.online-duel-intel-detail dt {
  color: #475569;
  font-weight: 900;
}

.online-duel-intel-detail dd {
  margin: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.online-duel-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.jjk-battle-home-card.douna-home-card {
  border-color: rgba(153, 27, 27, 0.34);
  background: linear-gradient(180deg, rgba(255, 247, 237, 0.92), rgba(254, 226, 226, 0.78));
}

.jjk-battle-active-surface {
  display: none;
  margin-top: 16px;
}

.duel-panel[data-active-battle-page="solo"] .jjk-battle-active-surface,
.duel-panel[data-active-battle-page="douna"] .jjk-battle-active-surface,
.duel-panel[data-active-battle-page="online"] .jjk-battle-active-surface {
  display: block;
}

.douna-gauntlet-panel {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid rgba(153, 27, 27, 0.24);
  border-radius: 8px;
  background: rgba(255, 251, 245, 0.84);
}

.douna-gauntlet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.douna-gauntlet-head h3 {
  margin: 6px 0;
}

.douna-gauntlet-head p {
  margin: 0;
  max-width: 760px;
}

.douna-gauntlet-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.douna-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.douna-status,
.online-mode-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.douna-status {
  min-height: 34px;
  padding: 8px 10px;
  border: 1px dashed rgba(91, 78, 60, 0.24);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 253, 247, 0.78);
}

.douna-damage-share,
.douna-damage-broadcasts {
  flex-basis: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.douna-damage-broadcasts span {
  padding: 4px 8px;
  border: 1px solid rgba(20, 83, 45, 0.18);
  border-radius: 8px;
  background: rgba(220, 252, 231, 0.72);
  color: #14532d;
  font-size: 12px;
  font-weight: 800;
}

.douna-leaderboard-panel {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(91, 78, 60, 0.18);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.82);
}

.douna-leaderboard-summary {
  cursor: pointer;
  font-weight: 900;
  color: var(--ink);
  list-style-position: inside;
}

.douna-leaderboard-panel:not([open]) {
  display: block;
}

.douna-leaderboard-panel:not([open]) .douna-leaderboard-head,
.douna-leaderboard-panel:not([open]) .douna-leaderboard-tabs,
.douna-leaderboard-panel:not([open]) .douna-leaderboard-message,
.douna-leaderboard-panel:not([open]) #dounaLeaderboardStatus,
.douna-leaderboard-panel:not([open]) #dounaLeaderboardList {
  display: none;
}

.douna-leaderboard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.douna-leaderboard-head h3 {
  margin: 6px 0;
}

.douna-leaderboard-head p {
  margin: 0;
  max-width: 760px;
}

.douna-leaderboard-controls {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: 8px;
}

.douna-leaderboard-controls label {
  display: grid;
  gap: 4px;
  min-width: 132px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.douna-leaderboard-controls select {
  min-height: 36px;
  border: 1px solid rgba(91, 78, 60, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--ink);
  padding: 6px 9px;
  font-weight: 800;
}

.douna-leaderboard-message {
  margin: 0;
}

.douna-leaderboard-message input {
  width: 100%;
}

.douna-leaderboard-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.douna-leaderboard-tabs button {
  border: 1px solid rgba(91, 78, 60, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  color: var(--muted);
  padding: 8px 11px;
  font-weight: 800;
  cursor: pointer;
}

.douna-leaderboard-tabs button.active {
  border-color: rgba(153, 27, 27, 0.42);
  background: rgba(254, 226, 226, 0.62);
  color: var(--ink);
}

.douna-leaderboard-list {
  display: grid;
  gap: 8px;
}

.douna-leaderboard-entry {
  display: grid;
  grid-template-columns: minmax(42px, 0.35fr) minmax(140px, 1.1fr) repeat(5, minmax(86px, 0.7fr));
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(91, 78, 60, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.douna-leaderboard-entry.header {
  color: var(--muted);
  font-size: 0.9rem;
  background: rgba(244, 238, 225, 0.72);
}

.douna-leaderboard-entry strong,
.douna-leaderboard-entry span {
  min-width: 0;
}

.douna-leaderboard-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.douna-leaderboard-roster {
  grid-column: 2 / -1;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.douna-leaderboard-message-line {
  grid-column: 2 / -1;
  color: var(--text);
  font-size: 0.9rem;
  line-height: 1.45;
  padding: 6px 8px;
  border: 1px solid rgba(91, 78, 60, 0.12);
  border-radius: 8px;
  background: rgba(244, 238, 225, 0.58);
}

.online-douna-roster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.online-douna-roster-grid article {
  border: 1px solid rgba(91, 78, 60, 0.16);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.78);
  padding: 12px;
}

.online-douna-roster-grid .online-douna-mode-card {
  border-color: rgba(20, 83, 45, 0.24);
  background: rgba(236, 253, 245, 0.78);
}

.online-douna-roster-grid strong,
.online-douna-roster-grid span {
  display: block;
}

.online-douna-roster-grid strong {
  margin-bottom: 6px;
}

.online-douna-roster-grid span {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.douna-submit-dialog {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.42);
}

.douna-submit-card {
  width: min(520px, 100%);
  padding: 18px;
  border: 1px solid rgba(153, 27, 27, 0.26);
  border-radius: 8px;
  background: #fffaf4;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.douna-submit-card h3 {
  margin: 8px 0 6px;
}

.douna-submit-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.douna-submit-summary span {
  padding: 8px;
  border: 1px solid rgba(127, 29, 29, 0.14);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.86);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.douna-submit-ranking {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  padding: 10px;
  border: 1px solid rgba(91, 78, 60, 0.14);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.74);
}

.douna-submit-ranking-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
  font-weight: 800;
}

.duel-chip.strong {
  border-color: rgba(153, 27, 27, 0.34);
  background: rgba(254, 226, 226, 0.72);
  color: #7f1d1d;
}

.online-player-grid {
  margin: 12px 0;
}

.online-player-grid article[data-you="true"] {
  border-color: rgba(15, 118, 110, 0.5);
  background: rgba(204, 251, 241, 0.34);
}

.duel-selectors {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  gap: 14px;
  margin: 16px 0;
}

.online-alpha-panel {
  display: grid;
  gap: 12px;
  margin: 14px 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-sm);
}

.online-alpha-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.online-alpha-head h3 {
  margin: 0;
}

.online-alpha-head p {
  margin: 6px 0 0;
}

.online-alpha-grid {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(220px, 1.4fr) auto;
  gap: 10px;
  align-items: end;
}

.online-alpha-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
}

.online-section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  color: var(--ink);
}

.online-collapsible-section > summary.online-section-title {
  grid-column: 1 / -1;
  cursor: pointer;
  list-style: none;
}

.online-collapsible-section > summary.online-section-title::-webkit-details-marker {
  display: none;
}

.online-collapsible-section > summary.online-section-title::after {
  content: "收起";
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  background: var(--panel-2);
}

.online-collapsible-section:not([open]) {
  gap: 0;
}

.online-collapsible-section:not([open]) > summary.online-section-title::after {
  content: "展开";
  color: var(--accent);
}

.online-collapsible-section:not([open]) > :not(summary) {
  display: none;
}

.online-section-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.online-sync-grid {
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1.6fr) auto;
}

.online-official-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.online-debug-panel {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(15, 23, 42, 0.04);
}

.online-debug-panel summary {
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.online-debug-log {
  max-height: 180px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 8px 0 0;
  padding: 8px;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.9);
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.45;
}

.online-advanced-settings {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.online-advanced-settings summary {
  cursor: pointer;
  padding: 9px 10px;
  font-weight: 700;
}

.online-advanced-settings .online-sync-grid {
  padding: 0 10px 10px;
}

.online-room-section {
  grid-template-columns: minmax(0, 1fr);
}

.online-room-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
  min-width: 0;
}

.online-room-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.online-room-current {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.online-room-current strong {
  color: var(--ink);
  letter-spacing: 0.04em;
}

.online-alpha-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.online-invite-field input {
  min-width: 0;
}

.online-endpoint-field {
  grid-column: span 2;
}

.online-endpoint-field[hidden],
.online-alpha-actions[hidden] {
  display: none;
}

.online-backend-hint {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  font-size: 0.86rem;
}

.online-alpha-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.online-alpha-status span {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.online-alpha-status strong {
  color: var(--ink);
}

.online-turn-actions {
  justify-content: flex-end;
}

.online-turn-actions .is-ready {
  border-color: rgba(15, 118, 110, 0.5);
  background: var(--accent);
  color: #fff;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: none;
}

.field input,
.field select,
.field textarea {
  min-height: 40px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--paper-strong);
  color: var(--ink);
  padding: 0 10px;
  box-shadow: inset 0 1px 0 rgba(255, 253, 247, 0.85);
}

.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: #b8c7d9;
}

.field textarea {
  min-height: 70px;
  padding: 10px;
  resize: vertical;
  line-height: 1.5;
}

.field select[multiple] {
  min-height: 96px;
  padding: 8px;
}

.duel-custom-panel {
  display: grid;
  gap: 14px;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid rgba(169, 159, 144, 0.72);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(247, 245, 238, 0.94)),
    var(--paper-strong);
  box-shadow: var(--shadow-sm);
}

.duel-custom-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.duel-character-workbench {
  grid-template-columns: minmax(250px, 0.9fr) minmax(320px, 1.15fr) minmax(320px, 1.15fr);
  align-items: start;
}

.duel-character-workbench > .duel-custom-head,
.duel-character-workbench > .duel-workbench-toolbar,
.duel-character-workbench > .duel-custom-interface,
.duel-character-workbench > .action-row,
.duel-character-workbench > .duel-custom-list {
  grid-column: 1 / -1;
}

.duel-workbench-kicker {
  display: block;
  margin-bottom: 3px;
  color: #876b35;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.duel-workbench-toolbar {
  position: sticky;
  top: max(8px, env(safe-area-inset-top));
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(137, 108, 52, 0.3);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.96);
  box-shadow: 0 8px 24px rgba(35, 31, 25, 0.1);
  backdrop-filter: blur(12px);
}

.duel-workbench-mobile-nav {
  display: none;
  gap: 6px;
  margin-left: auto;
}

.duel-workbench-mobile-nav button {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
  color: var(--ink);
  font-weight: 800;
}

.duel-custom-mode {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  gap: 4px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 253, 247, 0.82);
}

.duel-custom-mode legend {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.duel-custom-mode label {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  cursor: pointer;
}

.duel-custom-mode input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.duel-custom-mode span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.duel-custom-mode input:checked + span {
  background: var(--ink);
  color: #fffdf7;
}

.duel-custom-grid,
.duel-custom-stats,
.duel-library-grid {
  display: grid;
  gap: 12px;
}

.duel-custom-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.duel-custom-grid-wide,
.duel-custom-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.duel-custom-stats {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(248, 251, 253, 0.68);
}

.duel-ai-assist {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(47, 111, 104, 0.28);
  border-radius: 8px;
  background: rgba(240, 253, 250, 0.52);
}

.duel-ai-designer-launch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px;
  border: 1px solid rgba(47, 111, 104, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(240, 253, 250, 0.78), rgba(238, 242, 255, 0.72));
}

.duel-ai-designer-launch > div {
  display: grid;
  gap: 4px;
}

.duel-ai-designer-dialog {
  width: min(980px, calc(100vw - 32px));
  max-height: min(900px, calc(100dvh - 32px));
  padding: 0;
  overflow: auto;
  border: 1px solid rgba(47, 111, 104, 0.48);
  border-radius: 12px;
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: 0 28px 90px rgba(20, 29, 38, 0.32);
}

.duel-ai-designer-dialog::backdrop {
  background: rgba(15, 23, 42, 0.64);
  backdrop-filter: blur(5px);
}

.duel-ai-designer-dialog .duel-ai-assist {
  padding: 18px;
  border: 0;
  background: transparent;
}

.duel-ai-designer-head,
.duel-ai-designer-actions {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.duel-ai-designer-head h3 {
  margin: 6px 0;
}

.duel-ai-designer-actions {
  position: sticky;
  bottom: 0;
  align-items: center;
  justify-content: flex-end;
  padding-top: 12px;
  border-top: 1px solid rgba(47, 111, 104, 0.24);
  background: var(--paper-strong);
}

.duel-ai-candidate-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(49, 46, 129, 0.24);
  border-radius: 8px;
  background: rgba(238, 242, 255, 0.66);
}

.duel-ai-candidate-preview {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
}

.duel-ai-candidate-card {
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(49, 46, 129, 0.18);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
}

.duel-ai-candidate-choice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.duel-ai-candidate-choice input {
  inline-size: 18px;
  block-size: 18px;
  margin: 0;
}

.duel-ai-candidate-choice > span {
  color: var(--ink-muted);
  font-size: 12px;
  text-align: end;
}

.duel-import-code-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(44, 62, 80, 0.24);
  border-radius: 8px;
  background: rgba(248, 251, 253, 0.78);
}

.duel-import-code-panel textarea {
  min-height: 84px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.duel-custom-interface,
.duel-special-card-editor {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(47, 111, 104, 0.34);
  border-radius: 8px;
  background: rgba(240, 253, 250, 0.42);
}

.duel-special-card-editor > summary,
.duel-special-card-editor > .debug-entry-head,
.duel-special-card-editor > .duel-special-card-workspace,
.duel-special-card-editor > .action-row,
.duel-special-card-editor > .duel-custom-list {
  grid-column: 1 / -1;
}

.duel-special-card-workspace {
  display: grid;
  grid-template-columns: minmax(300px, 0.82fr) minmax(420px, 1.18fr);
  gap: 14px;
  align-items: start;
}

.duel-special-card-compose,
.duel-atomic-chain-pane {
  min-width: 0;
}

.duel-special-card-compose {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(47, 111, 104, 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.62);
}

.duel-custom-hand-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.duel-custom-hand-summary {
  grid-column: span 3;
}

.duel-atomic-effect-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(49, 46, 129, 0.26);
  border-radius: 8px;
  background: linear-gradient(145deg, rgba(238, 242, 255, 0.88), rgba(250, 245, 255, 0.72));
}

@media (max-width: 960px) {
  .duel-special-card-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .duel-ai-designer-launch,
  .duel-ai-designer-head {
    align-items: stretch;
    flex-direction: column;
  }
}

.duel-effect-language-panel,
.duel-effect-preview-panel,
.duel-effect-dsl-panel,
.duel-workbench-debug {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(67, 56, 202, 0.2);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
}

.duel-effect-dsl-panel > summary,
.duel-effect-syntax-guide > summary,
.duel-workbench-debug > summary {
  cursor: pointer;
  font-weight: 900;
}

.duel-effect-syntax-guide {
  padding: 10px;
  border: 1px dashed rgba(67, 56, 202, 0.34);
  border-radius: 7px;
  background: rgba(238, 242, 255, 0.62);
}

.duel-effect-syntax-guide p { margin: 8px 0; line-height: 1.65; }
.duel-effect-syntax-guide code { overflow-wrap: anywhere; }
.duel-effect-syntax-examples { display: flex; flex-wrap: wrap; gap: 8px; }
.duel-effect-syntax-examples button { min-height: 44px; padding: 8px 12px; cursor: pointer; }
.duel-effect-syntax-examples button:focus-visible { outline: 3px solid #4338ca; outline-offset: 2px; }

.duel-effect-semantic-review {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(67, 56, 202, 0.3);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
}
.duel-effect-semantic-review[hidden] { display: none; }
.duel-effect-semantic-legend { display: flex; flex-wrap: wrap; gap: 7px; }
.duel-effect-semantic-legend span,
.duel-semantic-clause-state { padding: 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 800; }
[data-semantic-state="direct"] { background: #dcfce7; color: #166534; }
[data-semantic-state="composite"] { background: #dbeafe; color: #1e40af; }
[data-semantic-state="descriptive"] { background: #fef3c7; color: #92400e; }
[data-semantic-state="needs-confirmation"] { background: #fee2e2; color: #991b1b; }
.duel-semantic-group { display: grid; gap: 8px; padding: 9px; border: 1px solid rgba(71, 85, 105, 0.22); border-radius: 7px; }
.duel-semantic-group h4 { margin: 0; }
.duel-semantic-clause { display: grid; gap: 5px; padding: 8px; border-left: 3px solid #64748b; background: rgba(255, 255, 255, 0.72); }
.duel-semantic-clause p { margin: 0; line-height: 1.55; }
.duel-semantic-clause pre { margin: 0; padding: 7px; overflow: auto; background: #171923; color: #f7e7a9; white-space: pre-wrap; overflow-wrap: anywhere; }

.duel-effect-dsl-preview {
  min-height: 74px;
  max-height: 260px;
  margin: 8px 0 0;
  padding: 10px;
  overflow: auto;
  border-radius: 6px;
  background: #171923;
  color: #f7e7a9;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 12px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
}

.duel-atomic-effect-toolbar,
.duel-atomic-effect-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.duel-atomic-effect-help {
  grid-column: 1 / -1;
  margin: 0;
  color: #4338ca;
  font-size: 12px;
  line-height: 1.5;
}

.duel-atomic-condition {
  padding: 8px 10px;
  border: 1px dashed rgba(67, 56, 202, 0.28);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.56);
}

.duel-atomic-condition > summary {
  cursor: pointer;
  font-weight: 700;
}

.duel-atomic-condition[open] > summary {
  margin-bottom: 9px;
}

.duel-atomic-checkbox input {
  width: 22px;
  min-height: 22px;
}

.duel-atomic-effect-list {
  display: grid;
  gap: 7px;
}

.duel-atomic-effect-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-left: 3px solid #6366f1;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

.duel-atomic-effect-order {
  display: grid;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: #4338ca;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.duel-atomic-effect-copy {
  display: grid;
  flex: 1 1 240px;
  gap: 2px;
  min-width: 0;
}

.duel-atomic-effect-copy strong {
  color: #312e81;
  font-size: 13px;
}

.duel-atomic-effect-copy > span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #312e81;
  font-size: 12px;
  line-height: 1.5;
}

.duel-workbench-debug {
  margin-top: 2px;
}

.duel-library-assist {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(92, 70, 42, 0.26);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.56);
}

.duel-library-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.duel-library-grid select {
  min-height: 142px;
}

.duel-ai-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 900;
}

.duel-ai-toggle input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.duel-ai-output {
  margin: 0;
  white-space: pre-wrap;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px;
  font-size: 13px;
  line-height: 1.6;
}

.duel-manual-data-entry {
  border: 2px solid rgba(186, 84, 34, 0.42);
  border-radius: 8px;
  background: rgba(255, 247, 237, 0.88);
  padding: 10px 12px;
}

.duel-manual-data-entry summary {
  cursor: pointer;
  font-weight: 900;
  color: #8a3f13;
}

.duel-manual-format {
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px dashed rgba(138, 63, 19, 0.35);
  border-radius: 8px;
  background: #fffdf8;
  padding: 10px;
  font-size: 12px;
  line-height: 1.55;
}

.duel-manual-data-entry textarea {
  min-height: 126px;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
}

.duel-ai-progress {
  display: grid;
  gap: 6px;
  color: #0f5f59;
  font-size: 12px;
  font-weight: 850;
}

.duel-ai-progress[hidden] {
  display: none;
}

.duel-ai-progress > div {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(15, 95, 89, 0.14);
}

.duel-ai-progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0f766e, #22c55e);
  transition: width 520ms cubic-bezier(.22, .9, .24, 1);
}

.duel-debug-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0;
  padding: 14px;
  border: 1px dashed rgba(47, 111, 104, 0.72);
  border-radius: 8px;
  background: rgba(240, 253, 250, 0.58);
}

body.debug-mode .duel-debug-panel.debug-only {
  display: grid !important;
}

.duel-debug-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.duel-special-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(120px, 0.6fr) minmax(260px, 1.6fr);
  gap: 12px;
}

.duel-special-definition textarea {
  min-height: 76px;
}

.duel-custom-list {
  display: grid;
  gap: 8px;
}

.duel-custom-list .muted {
  margin: 0;
}

.duel-custom-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.duel-custom-item strong,
.duel-custom-item span {
  display: block;
}

.duel-custom-item span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.duel-custom-item .duel-custom-tag {
  color: #7c2d12;
  font-weight: 800;
}

.duel-custom-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.duel-custom-actions .secondary {
  min-height: 34px;
  padding: 6px 9px;
  font-size: 12px;
}

.secondary.danger {
  border-color: rgba(180, 35, 24, 0.48);
  color: var(--accent);
}

.duel-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  margin: 16px 0;
  padding: 16px;
  border: 1px solid rgba(47, 111, 104, 0.42);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(47, 111, 104, 0.1), rgba(255, 253, 247, 0.94) 42%, rgba(180, 35, 24, 0.09)),
    var(--paper-strong);
  box-shadow: inset 0 1px 0 rgba(255, 253, 247, 0.86), var(--shadow-sm);
}

.duel-match-summary-card {
  display: grid;
  align-content: center;
  gap: 6px;
  min-height: 68px;
}

.duel-match-summary-card.right {
  text-align: right;
}

.duel-match-summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.duel-match-summary-card strong {
  font-size: clamp(18px, 2.5vw, 30px);
  line-height: 1.12;
}

.duel-match-summary-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.duel-versus {
  display: grid;
  place-items: center;
  min-width: 54px;
  color: #fff;
  font-weight: 900;
  width: 54px;
  height: 54px;
  align-self: center;
  border-radius: 50%;
  background: var(--stamp);
  box-shadow: var(--shadow-sm);
}

.duel-battle {
  margin: 10px 0;
}

.duel-battle-empty,
.duel-battle-stage {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-strong);
  box-shadow: var(--shadow-md);
}

.duel-battle-empty {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px;
  background:
    linear-gradient(90deg, rgba(31, 37, 43, 0.04), rgba(255, 253, 247, 0.96)),
    var(--paper-strong);
}

.duel-battle-empty p {
  margin: 6px 0 0;
  line-height: 1.6;
}

.duel-battle-stage {
  padding: 12px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(21, 32, 43, 0.035), rgba(255, 255, 255, 0) 170px),
    #fff;
}

.duel-floating-combat-text {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 42%;
  transform: translate(-50%, -50%);
  pointer-events: none;
  padding: 4px 12px;
  color: #b42318;
  font-size: clamp(38px, 7vw, 76px);
  font-weight: 950;
  line-height: 1;
  letter-spacing: 0;
  text-shadow:
    0 3px 0 rgba(255, 255, 255, 0.92),
    0 12px 28px rgba(127, 29, 29, 0.34);
  animation: duelMissFloat 1s ease-out forwards;
}

.duel-floating-combat-text.left {
  left: 32%;
}

.duel-floating-combat-text.right {
  left: 68%;
}

.duel-floating-combat-text.swap {
  left: 50%;
  top: 30%;
  min-width: min(520px, calc(100% - 32px));
  padding: 10px 16px;
  border-radius: 8px;
  background: rgba(127, 29, 29, 0.92);
  color: #fff7ed;
  font-size: clamp(20px, 4vw, 34px);
  line-height: 1.18;
  text-align: center;
  text-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  box-shadow: 0 16px 34px rgba(127, 29, 29, 0.22);
}

.douna-swap-notice {
  margin-bottom: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(153, 27, 27, 0.32);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(127, 29, 29, 0.94), rgba(185, 28, 28, 0.86));
  color: #fff7ed;
  font-weight: 700;
  box-shadow: 0 10px 20px rgba(127, 29, 29, 0.14);
}

.douna-swap-popup {
  position: fixed;
  left: 50%;
  top: 86px;
  z-index: 1200;
  display: none;
  width: min(420px, calc(100vw - 32px));
  transform: translateX(-50%);
  padding: 14px 16px;
  border: 1px solid rgba(153, 27, 27, 0.32);
  border-radius: 8px;
  background: #fff7ed;
  color: #7f1d1d;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.22);
}

.douna-swap-popup.is-visible {
  display: block;
}

.douna-swap-popup strong,
.douna-swap-popup span {
  display: block;
}

.douna-swap-popup strong {
  margin-bottom: 4px;
  font-size: 14px;
}

.douna-swap-popup span {
  color: #1f2937;
  font-size: 15px;
  line-height: 1.45;
}

@keyframes duelMissFloat {
  0% {
    opacity: 0;
    transform: translate(-50%, -34%) scale(0.86);
  }
  14% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.08);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -80%) scale(1);
  }
}

.duel-battle-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.duel-battle-head h3 {
  margin-top: 8px;
  line-height: 1.25;
}

.duel-battle-head p {
  margin: 6px 0 0;
  line-height: 1.5;
}

.duel-battle-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1.4fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: 10px 0 8px;
  padding: 10px;
  border: 1px solid #cfddea;
  border-radius: 8px;
  background: rgba(248, 251, 253, 0.92);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

.duel-side-score {
  display: grid;
  gap: 4px;
}

.duel-side-score.right {
  text-align: right;
}

.duel-side-score strong {
  line-height: 1.25;
}

.duel-side-score span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duel-score-track {
  display: flex;
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf3;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

.duel-score-track span:first-child {
  background: linear-gradient(90deg, #0f766e, #22c55e);
}

.duel-score-track span:last-child {
  background: linear-gradient(90deg, #ef4444, #991b1b);
}

.duel-battle-special-counters {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid #d6dee8;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
}

.duel-battle-special-counters.empty {
  display: none;
}

.duel-special-counter-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.duel-special-counter-row.no-label {
  grid-template-columns: minmax(0, 1fr);
}

.duel-special-counter-row > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.duel-special-counter-row > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 5px;
}

.duel-special-counter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.05);
  line-height: 1;
  white-space: nowrap;
}

.duel-special-counter-chip b,
.duel-special-counter-chip strong {
  font-size: 12px;
  font-weight: 900;
}

.duel-special-counter-chip b {
  color: #7f1d1d;
}

.duel-special-counter-chip strong {
  color: var(--ink);
}

.duel-resource-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr) minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
  margin: 0;
}

.duel-battle-support-grid {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
}

.duel-resource-side,
.duel-round-memo,
.duel-replay-meta,
.duel-residual-log {
  border: 1px solid #d6dee8;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.94);
  box-shadow: var(--shadow-sm);
}

.duel-resource-side {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.duel-resource-side.right {
  text-align: right;
}

.duel-resource-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.duel-resource-side.right .duel-resource-head {
  flex-direction: row-reverse;
}

.duel-resource-head strong,
.duel-resource-head span {
  display: block;
}

.duel-resource-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duel-resource-row {
  display: grid;
  grid-template-columns: minmax(92px, 120px) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duel-resource-side.right .duel-resource-row {
  grid-template-columns: minmax(92px, 120px) minmax(0, 1fr);
}

.duel-resource-row span,
.duel-resource-row strong {
  display: block;
  line-height: 1.35;
}

.duel-resource-row strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.duel-resource-bar {
  position: relative;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5edf3;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

.duel-resource-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #64748b, #0f172a);
}

.duel-resource-bar em {
  position: absolute;
  top: 0;
  bottom: 0;
  display: block;
  border-radius: inherit;
  pointer-events: none;
}

.duel-resource-bar em.preview-loss {
  background: rgba(255, 255, 255, 0.54);
}

.duel-resource-bar em.preview-gain {
  background: rgba(125, 211, 252, 0.62);
}

.duel-resource-row.hp .duel-resource-bar em.preview-gain {
  background: rgba(252, 165, 165, 0.58);
}

.duel-resource-row strong.preview-value {
  color: #0f5f59;
}

.duel-resource-row.hp .duel-resource-bar i {
  background: linear-gradient(90deg, #b42318, #f97316);
}

.duel-resource-row.ce .duel-resource-bar i {
  background: linear-gradient(90deg, #0f766e, #22c55e);
}

.duel-resource-row.stability .duel-resource-bar i {
  background: linear-gradient(90deg, #2563eb, #7c3aed);
}

.duel-resource-meta,
.duel-domain-load,
.duel-status-effects {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.duel-resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
}

.duel-resource-side.right .duel-resource-meta {
  justify-content: flex-end;
}

.duel-domain-load {
  display: grid;
  gap: 5px;
  padding: 8px;
  border: 1px dashed rgba(47, 111, 104, 0.35);
  border-radius: 8px;
  background: rgba(47, 111, 104, 0.06);
}

.duel-domain-load strong {
  color: var(--ink);
}

.duel-domain-load .duel-resource-bar i {
  background: linear-gradient(90deg, #8b5cf6, #b42318);
}

.duel-status-effects {
  display: grid;
  gap: 4px;
  min-height: 18px;
  padding: 8px;
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: 8px;
  background: rgba(180, 35, 24, 0.05);
}

.duel-status-effects > .duel-status-heading {
  color: #8a1f17;
  font-weight: 950;
}

.duel-status-effects > .duel-status-content {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  color: var(--ink);
  font-weight: 850;
}

.duel-resource-side.right .duel-status-content {
  justify-content: flex-end;
}

.duel-status-effects .duel-status-tag,
.duel-status-effects .duel-status-empty {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid rgba(100, 116, 139, 0.28);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.88);
  color: #475569;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
}

.duel-status-effects .duel-status-tag.initiative-first {
  border-color: rgba(217, 119, 6, 0.48);
  background: rgba(254, 243, 199, 0.94);
  color: #92400e;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.1);
}

.duel-status-effects .duel-status-tag.initiative-second {
  border-color: rgba(37, 99, 235, 0.38);
  background: rgba(219, 234, 254, 0.94);
  color: #1d4ed8;
}

.duel-status-effects .duel-status-tag.condition {
  border-color: rgba(180, 35, 24, 0.28);
  background: rgba(254, 226, 226, 0.72);
  color: #991b1b;
}

.duel-round-memo {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(15, 118, 110, 0.09), rgba(248, 250, 252, 0.96)),
    rgba(248, 250, 252, 0.94);
}

.duel-round-memo strong {
  color: #0f5f59;
  font-size: 13px;
}

.duel-round-memo p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.duel-round-memo dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 8px;
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
}

.duel-round-memo dt {
  color: var(--muted);
  font-weight: 900;
}

.duel-round-memo dd {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
  overflow-wrap: anywhere;
}

.duel-replay-meta {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
}

.duel-replay-meta strong {
  font-size: 13px;
}

.duel-replay-meta dl {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 6px 8px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.duel-replay-meta dt {
  font-weight: 900;
}

.duel-replay-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.duel-replay-meta-log {
  margin-top: 14px;
}

.duel-battlefield-units {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(47, 111, 104, 0.3);
  border-radius: 10px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08), rgba(180, 35, 24, 0.05)),
    rgba(248, 250, 252, 0.95);
  box-shadow: var(--shadow-sm);
}

.duel-battlefield-units.empty {
  border-style: dashed;
  background: rgba(248, 250, 252, 0.72);
}

.duel-battlefield-units.empty p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.duel-battlefield-units-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.duel-battlefield-units-head strong {
  color: var(--ink);
  font-size: 14px;
}

.duel-battlefield-units-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.duel-battlefield-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.duel-battlefield-unit-card {
  display: grid;
  gap: 8px;
  padding: 11px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.86);
}

.duel-battlefield-unit-card.neutral {
  border-color: rgba(180, 35, 24, 0.25);
  background: rgba(255, 247, 237, 0.86);
}

.duel-battlefield-unit-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: start;
}

.duel-battlefield-unit-title span {
  color: #0f766e;
  font-size: 12px;
  font-weight: 950;
}

.duel-battlefield-unit-title strong {
  color: var(--ink);
  text-align: right;
}

.duel-battlefield-unit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.duel-battlefield-unit-meta span {
  padding: 2px 7px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: rgba(248, 250, 252, 0.9);
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.duel-battlefield-unit-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.duel-uzumaki-selection-panel {
  display: grid;
  gap: 10px;
  margin: 10px 0;
  padding: 12px;
  border: 1px solid rgba(127, 29, 29, 0.32);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(254, 242, 242, 0.95), rgba(240, 253, 250, 0.92)),
    #fff;
}

.duel-uzumaki-selection-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.duel-uzumaki-selection-head strong {
  display: block;
  color: #7f1d1d;
  font-size: 14px;
}

.duel-uzumaki-selection-head span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.duel-uzumaki-selection-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.duel-uzumaki-selection-summary span,
.duel-uzumaki-unit span,
.duel-uzumaki-unit em {
  padding: 2px 7px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.duel-uzumaki-unit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.duel-uzumaki-unit {
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.duel-uzumaki-unit:hover,
.duel-uzumaki-unit:focus-visible {
  border-color: rgba(15, 118, 110, 0.45);
  outline: none;
}

.duel-uzumaki-unit.selected {
  border-color: rgba(127, 29, 29, 0.62);
  background: rgba(254, 226, 226, 0.82);
}

.duel-uzumaki-unit strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.duel-uzumaki-unit em {
  width: fit-content;
  color: #7f1d1d;
}

.duel-uzumaki-selection-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.duel-residual-log {
  margin: 14px 0 0;
  padding: 12px;
}

.duel-residual-log.empty {
  color: var(--muted);
}

.duel-residual-log h4 {
  margin: 0 0 10px;
}

.duel-residual-log-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.duel-residual-log-head h4 {
  margin: 0;
}

.duel-log-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.duel-log-filter,
.duel-log-type {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  border-radius: 999px;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.duel-residual-log ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.duel-residual-log li {
  padding: 9px 10px;
  border: 1px solid rgba(214, 222, 232, 0.9);
  border-radius: 8px;
  background: #fff;
}

.duel-residual-log .duel-log-round {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duel-residual-log .duel-log-type {
  margin: 0 0 4px;
}

.duel-residual-log p {
  margin: 3px 0 0;
  line-height: 1.55;
}

.duel-log-context {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.duel-log-context span {
  padding: 3px 7px;
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: 8px;
  background: rgba(180, 35, 24, 0.05);
  color: #8a1f17;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.35;
}

.duel-domain-profile-panel {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid #d6dee8;
  border-radius: 8px;
  background: #fbfaf6;
  box-shadow: var(--shadow-sm);
}

.duel-domain-profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.duel-domain-profile-head h4 {
  margin: 0;
}

.duel-domain-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.duel-domain-profile-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #e2ded4;
  border-radius: 8px;
  background: #fffefb;
}

.duel-domain-profile-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.duel-domain-core {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.duel-domain-core div {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(214, 222, 232, 0.78);
  border-radius: 8px;
  background: #f8fafc;
}

.duel-domain-core dt,
.duel-domain-core dd {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
}

.duel-domain-core dt {
  color: var(--muted);
  font-weight: 800;
}

.duel-domain-core dd {
  color: var(--ink);
  font-weight: 900;
  overflow-wrap: anywhere;
}

.duel-domain-profile-card span,
.duel-domain-profile-card p,
.duel-domain-profile-card em {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.duel-domain-profile-card strong {
  color: var(--ink);
  overflow-wrap: anywhere;
}

.duel-domain-profile-card em {
  color: var(--accent);
  font-style: normal;
}

.duel-domain-profile-result {
  padding: 7px 8px;
  border-left: 3px solid rgba(180, 35, 24, 0.42);
  background: rgba(180, 35, 24, 0.05);
}

.duel-domain-profile-details {
  border-top: 1px solid rgba(214, 222, 232, 0.8);
  padding-top: 6px;
}

.duel-domain-profile-details summary {
  color: var(--ink);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
}

.duel-domain-profile-details p {
  margin-top: 5px;
}

.duel-domain-profile-card.trial {
  border-color: rgba(180, 35, 24, 0.22);
  background: #fff8f7;
}

.duel-action-panel {
  display: grid;
  gap: 8px;
  margin: 8px 0;
  padding: 10px;
  border: 1px solid #d6dee8;
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.95);
  box-shadow: var(--shadow-sm);
}

.duel-action-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.duel-action-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.duel-action-head h4 {
  margin: 0 0 4px;
}

.duel-action-head p {
  margin: 0;
  line-height: 1.5;
}

.duel-hand-execute-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, auto);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.08), rgba(255, 253, 247, 0.96));
}

.duel-hand-execute-control .duel-action-hint {
  margin: 0;
}

.duel-hand-execute-control .primary {
  min-width: 160px;
  white-space: nowrap;
}

.duel-initiative-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(180, 35, 24, 0.24);
  border-radius: 8px;
  background: linear-gradient(100deg, rgba(180, 35, 24, 0.08), rgba(255, 253, 247, 0.96));
}

.duel-initiative-control strong,
.duel-initiative-control p,
.duel-initiative-control span {
  display: block;
  margin: 0;
}

.duel-initiative-control p,
.duel-initiative-control span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.duel-initiative-control > span {
  grid-column: 1 / -1;
}

.duel-initiative-options {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.duel-initiative-selection {
  display: grid;
  gap: 0.2rem;
  min-width: min(100%, 18rem);
  padding: 0.55rem 0.7rem;
  border: 1px solid color-mix(in srgb, var(--accent, #8f63ff) 36%, transparent);
  border-radius: 0.7rem;
  background: color-mix(in srgb, var(--accent, #8f63ff) 9%, transparent);
}

.duel-initiative-selection strong,
.duel-initiative-selection span {
  margin: 0;
}

.duel-initiative-option.active {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff4f2;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.1);
}

.duel-action-warning {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(180, 35, 24, 0.22);
  border-radius: 8px;
  color: #8a1f17;
  background: rgba(180, 35, 24, 0.07);
  font-size: 13px;
  font-weight: 800;
}

.duel-action-message {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(15, 118, 110, 0.22);
  border-radius: 8px;
  color: #0f5f59;
  background: rgba(15, 118, 110, 0.07);
  font-size: 13px;
  font-weight: 900;
}

.duel-hand-lock-message {
  margin: 0;
  padding: 14px 16px;
  border: 2px solid rgba(180, 35, 24, 0.32);
  border-radius: 8px;
  background: rgba(180, 35, 24, 0.1);
  color: #7f1d1d;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.35;
  text-align: center;
}

.duel-mahoraga-banner {
  display: grid;
  place-items: center;
  min-height: 82px;
  padding: 16px;
  border: 2px solid rgba(15, 23, 42, 0.58);
  border-radius: 12px;
  background:
    radial-gradient(circle at 22% 20%, rgba(180, 35, 24, 0.2), transparent 34%),
    linear-gradient(135deg, #0f172a, #2f1f18 48%, #111827);
  color: #fff7ed;
  font-size: clamp(30px, 7vw, 66px);
  font-weight: 1000;
  letter-spacing: 0.12em;
  text-align: center;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.46);
}

.duel-hand-pool-hint {
  margin: 0;
  padding: 7px 10px;
  border: 1px solid rgba(15, 118, 110, 0.16);
  border-radius: 8px;
  background: rgba(240, 253, 250, 0.72);
  color: #0f5f59;
  font-size: 12px;
  font-weight: 900;
}

.duel-action-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.86);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.duel-action-toolbar-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.duel-hand-control-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.duel-selected-hand-summary {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.duel-selected-hand-summary > strong {
  color: var(--ink);
  font-size: 12px;
}

.duel-selected-hand-list {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.duel-selected-hand-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 6px;
  align-items: center;
  color: var(--ink);
}

.duel-selected-hand-list li span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e;
  font-size: 11px;
}

.duel-selected-hand-list li strong,
.duel-selected-hand-list li em {
  overflow-wrap: anywhere;
}

.duel-selected-hand-list li em {
  color: var(--muted);
  font-style: normal;
}

.duel-selected-hand-empty,
.duel-action-hint {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duel-action-choices {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.duel-domain-hand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.duel-domain-hand-head strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.duel-domain-hand-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.duel-domain-hand-choices {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.duel-domain-hand-choices .duel-action-choice {
  border-color: rgba(88, 28, 135, 0.24);
  background: #fbf7ff;
}

.duel-domain-hand-choices .duel-action-cost {
  background: rgba(88, 28, 135, 0.08);
  color: #581c87 !important;
  border-left-color: rgba(88, 28, 135, 0.28);
}

.duel-hand-card {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.duel-rct-target-picker { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid rgba(15,118,110,.25); border-radius: 8px; color: #115e59; background: rgba(240,253,250,.9); font-size: .72rem; font-weight: 800; }
.duel-rct-target-picker select { min-width: 0; width: 100%; padding: 6px 8px; border: 1px solid rgba(15,118,110,.32); border-radius: 6px; color: #134e4a; background: #fff; }

.duel-haruta-interaction {
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 12px;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(231, 189, 98, 0.58);
  border-left: 4px solid #c42135;
  border-radius: 4px 14px 14px 4px;
  color: #f3eadc;
  background:
    radial-gradient(circle at 88% 5%, rgba(196, 33, 53, 0.28), transparent 31%),
    radial-gradient(circle at 12% 110%, rgba(231, 189, 98, 0.16), transparent 38%),
    linear-gradient(145deg, #19171b 0%, #0b0b0e 58%, #171116 100%);
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.4), 0 10px 24px rgba(35, 18, 22, 0.18);
}

.duel-haruta-interaction::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.14;
  background:
    repeating-linear-gradient(112deg, transparent 0 18px, rgba(255, 255, 255, 0.12) 19px, transparent 20px),
    linear-gradient(90deg, transparent 49.7%, rgba(231, 189, 98, 0.18) 50%, transparent 50.3%);
  pointer-events: none;
}

.duel-haruta-interaction-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.duel-haruta-interaction-head small,
.duel-haruta-vitals article > small,
.duel-haruta-intents small {
  display: block;
  color: #bcae9d;
  font: 800 0.64rem/1.25 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.duel-haruta-interaction-head h5 {
  margin: 4px 0 3px;
  color: #fff1c9;
  font: 950 clamp(1.05rem, 2.3vw, 1.38rem)/1.15 "STKaiti", "KaiTi", serif;
  letter-spacing: 0.05em;
  text-shadow: 0 0 15px rgba(231, 189, 98, 0.2);
}

.duel-haruta-interaction-head p {
  margin: 0;
  color: #cfc5b9;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.5;
}

.duel-haruta-interaction-head > span {
  padding: 6px 9px;
  border: 1px solid rgba(231, 189, 98, 0.5);
  border-radius: 999px;
  color: #ffe9a6;
  background: rgba(92, 62, 15, 0.36);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.duel-haruta-vitals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.duel-haruta-vitals article {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 72px;
  padding: 10px;
  border: 1px solid rgba(204, 194, 177, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.duel-haruta-vitals article > strong {
  color: #f7df9e;
  font-size: 0.93rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.duel-haruta-miracles,
.duel-haruta-protectee {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.duel-haruta-miracles b,
.duel-haruta-protectee b {
  color: #fff1c9;
  font-size: 0.76rem;
  white-space: nowrap;
}

.duel-haruta-eye-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.duel-haruta-eye-row em {
  color: #8f8881;
  font-size: 0.72rem;
  font-style: normal;
}

.duel-haruta-eye {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 12px;
  border: 1px solid currentColor;
  border-radius: 80% 12% 80% 12%;
  color: #e8c56d;
  background: rgba(232, 197, 109, 0.15);
  transform: rotate(-7deg);
  box-shadow: 0 0 9px rgba(232, 197, 109, 0.2);
}

.duel-haruta-eye::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  content: "";
  background: currentColor;
  transform: translate(-50%, -50%);
}

.duel-haruta-eye.is-dark {
  color: #5f5b59;
  background: rgba(34, 32, 34, 0.72);
  box-shadow: none;
}

.duel-haruta-protectee > span {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.duel-haruta-protectee i {
  color: #d94a58;
  font-size: 1rem;
  font-style: normal;
  line-height: 1;
  text-shadow: 0 0 9px rgba(217, 74, 88, 0.32);
}

.duel-haruta-protectee i.is-lost {
  color: #615b5d;
  text-shadow: none;
}

.duel-haruta-intents {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.duel-haruta-intents article {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(196, 33, 53, 0.52);
  border-radius: 8px;
  background: linear-gradient(120deg, rgba(110, 17, 31, 0.43), rgba(20, 17, 20, 0.72));
}

.duel-haruta-intents article.is-tool {
  border-color: rgba(231, 189, 98, 0.42);
  background: linear-gradient(120deg, rgba(91, 65, 17, 0.34), rgba(20, 17, 20, 0.72));
}

.duel-haruta-intents article.is-disabled {
  border-color: rgba(103, 118, 111, 0.35);
  background: rgba(40, 49, 45, 0.38);
}

.duel-haruta-intents strong {
  color: #fff1e6;
  font-size: 0.87rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.duel-haruta-intents span {
  color: #c9bfb5;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.4;
}

.duel-haruta-intents .duel-haruta-intent-detail {
  color: #eee2d3;
  font-size: 0.74rem;
  font-weight: 800;
}

.duel-haruta-intents .duel-haruta-ordinary-counters {
  margin-top: 2px;
  padding-top: 5px;
  border-top: 1px dashed rgba(231, 189, 98, 0.2);
  color: #e7cc82;
  font-weight: 850;
}

.duel-haruta-race {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.duel-haruta-race article {
  display: grid;
  gap: 5px;
}

.duel-haruta-race article > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #d9d0c4;
  font-size: 0.71rem;
  font-weight: 850;
}

.duel-haruta-race b {
  color: #f7df9e;
}

.duel-haruta-meter {
  display: block;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(231, 189, 98, 0.22);
  border-radius: 999px;
  background: #282529;
}

.duel-haruta-meter > span {
  display: block;
  width: var(--haruta-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #876321, #f1d077);
  box-shadow: 0 0 12px rgba(241, 208, 119, 0.32);
  transition: width 180ms ease-out;
}

.duel-haruta-race .is-danger .duel-haruta-meter > span {
  background: linear-gradient(90deg, #751323, #e24c5b);
  box-shadow: 0 0 12px rgba(226, 76, 91, 0.36);
}

.duel-haruta-counter-section {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(231, 189, 98, 0.2);
}

.duel-haruta-counter-section > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.duel-haruta-counter-section > div:first-child strong {
  color: #fff0bd;
  font-size: 0.82rem;
}

.duel-haruta-counter-section > div:first-child span {
  color: #aaa19a;
  font-size: 0.68rem;
  text-align: right;
}

.duel-haruta-counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 7px;
}

.duel-haruta-counter {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 66px !important;
  padding: 8px 10px;
  border: 1px solid rgba(183, 169, 148, 0.28) !important;
  border-radius: 7px;
  color: #e8dfd2 !important;
  background: rgba(255, 255, 255, 0.045) !important;
  box-shadow: none !important;
  text-align: left;
  cursor: pointer;
}

.duel-haruta-counter span,
.duel-haruta-counter em {
  color: #aaa099;
  font-size: 0.64rem;
  font-style: normal;
  line-height: 1.35;
}

.duel-haruta-counter strong {
  color: #f7e6b4;
  font-size: 0.78rem;
  overflow-wrap: anywhere;
}

.duel-haruta-counter.is-available {
  border-color: rgba(231, 189, 98, 0.66) !important;
  background: linear-gradient(135deg, rgba(105, 73, 16, 0.52), rgba(31, 25, 20, 0.75)) !important;
  box-shadow: inset 0 0 0 1px rgba(231, 189, 98, 0.08) !important;
}

.duel-haruta-counter.is-available:hover,
.duel-haruta-counter.is-available:focus-visible {
  border-color: #f4d37d !important;
  background: linear-gradient(135deg, rgba(131, 90, 17, 0.66), rgba(40, 28, 22, 0.82)) !important;
  outline: 2px solid rgba(244, 211, 125, 0.2);
  outline-offset: 2px;
}

.duel-haruta-counter.is-selected {
  border-color: rgba(74, 190, 159, 0.62) !important;
  background: rgba(27, 91, 75, 0.35) !important;
}

.duel-haruta-counter.is-strategy {
  cursor: default;
}

.duel-haruta-counter.is-strategy:hover {
  outline: none;
  outline-offset: 0;
}

.duel-haruta-counter.is-blocked,
.duel-haruta-counter.is-missing {
  opacity: 0.72;
  cursor: not-allowed;
}

.duel-haruta-counter-empty,
.duel-haruta-route-hint {
  margin: 0;
  color: #c2b8ad;
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.48;
}

.duel-haruta-counter-empty {
  padding: 8px 10px;
  border: 1px dashed rgba(183, 169, 148, 0.28);
  border-radius: 7px;
}

.duel-haruta-route-hint {
  padding: 8px 10px;
  border-left: 3px solid #e0b958;
  background: rgba(224, 185, 88, 0.08);
}

.duel-haruta-route-hint b {
  color: #ffe59b;
}

.duel-haruta-target-picker {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 7px 8px;
  align-items: center;
  padding: 8px 9px;
  border: 1px solid rgba(196, 33, 53, 0.36);
  border-radius: 8px;
  color: #7a1a27;
  background: linear-gradient(120deg, rgba(255, 244, 226, 0.96), rgba(255, 235, 236, 0.94));
  font-size: 0.72rem;
  font-weight: 900;
}

.duel-haruta-target-picker select {
  min-width: 0;
  width: 100%;
  padding: 7px 8px;
  border: 1px solid rgba(130, 74, 33, 0.34);
  border-radius: 6px;
  color: #401219;
  background: #fffdf8;
  font-weight: 800;
}

.duel-haruta-target-picker small {
  grid-column: 1 / -1;
  color: #765b50;
  font-size: 0.64rem;
  font-weight: 750;
  line-height: 1.4;
}

@media (max-width: 640px) {
  .duel-initiative-control {
    grid-template-columns: minmax(0, 1fr);
    align-items: stretch;
  }

  .duel-initiative-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    justify-content: stretch;
  }

  .duel-initiative-control .duel-initiative-option {
    min-width: 0;
    min-height: 44px !important;
    padding-inline: 5px;
    white-space: nowrap;
  }

  .duel-initiative-selection,
  .duel-initiative-control > span {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }

  .duel-haruta-interaction {
    gap: 8px;
    max-height: min(65dvh, 580px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 9px;
  }

  .duel-haruta-interaction-head {
    grid-template-columns: 1fr;
  }

  .duel-haruta-vitals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
  }

  .duel-haruta-vitals article:last-child {
    grid-column: 1 / -1;
  }

  .duel-haruta-miracles,
  .duel-haruta-protectee {
    align-items: flex-start;
    flex-direction: column;
    justify-content: flex-start;
  }

  .duel-haruta-miracles b {
    font-size: 0.64rem;
    white-space: normal;
  }

  .duel-haruta-intents,
  .duel-haruta-race,
  .duel-haruta-counter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .duel-haruta-interaction-head > span {
    justify-self: start;
  }

  .duel-haruta-vitals article {
    min-height: 0;
    gap: 4px;
    padding: 7px;
  }

  .duel-haruta-vitals article > small,
  .duel-haruta-vitals article > strong {
    font-size: 0.62rem;
  }

  .duel-haruta-intents article {
    padding: 8px;
  }

  .duel-haruta-counter-section > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .duel-haruta-counter-section > div:first-child span {
    text-align: left;
  }

  .duel-haruta-counter {
    min-height: 44px;
  }

  .duel-haruta-target-picker {
    grid-template-columns: 1fr;
  }

  .duel-haruta-target-picker select {
    min-height: 44px;
  }

  .duel-haruta-target-picker small {
    grid-column: 1;
  }
}

/* Mobile wheel and Douna battle density. */
@media (orientation: landscape) and (max-width: 900px) {
  html[data-jjk-phone-layout="true"] .wheel-stage,
  html[data-jjk-app-runtime="capacitor"] .wheel-stage,
  html[data-jjk-app-runtime-hint="capacitor"] .wheel-stage {
    width: min(52vw, 330px) !important;
    max-width: 330px !important;
    max-height: 72vh;
  }
}

@media (orientation: portrait) and (max-width: 760px) {
  .douna-status .douna-damage-broadcasts {
    position: static !important;
    flex-basis: 100%;
    max-height: 96px !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    flex-direction: column !important;
    align-items: stretch !important;
    flex-wrap: nowrap !important;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }

  .douna-status .douna-damage-broadcasts span {
    flex: 0 0 auto;
  }

  .douna-damage-broadcasts {
    max-height: 46px !important;
    overflow-y: auto !important;
    align-content: flex-start;
    gap: 3px !important;
  }

  .douna-damage-broadcasts span {
    padding: 2px 5px !important;
    font-size: 10px !important;
    line-height: 1.2;
  }

  body .login-tutorial-panel {
    max-height: 48dvh !important;
    background: transparent !important;
  }

  body .login-tutorial-card {
    max-height: 48dvh !important;
    padding: 0 !important;
    background: rgba(15, 23, 42, .72) !important;
    backdrop-filter: blur(10px) saturate(1.05) !important;
  }

  body .login-tutorial-head,
  body .login-tutorial-body,
  body .login-tutorial-nav {
    padding-inline: 12px !important;
  }

  body .login-tutorial-body {
    max-height: 26dvh;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
  }
}

.duel-tower-interaction {
  --tower-accent: #b78be7;
  --tower-accent-bright: #e5c9ff;
  --tower-accent-soft: rgba(183, 139, 231, 0.18);
  --tower-danger: #e05a6c;
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 12px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(183, 139, 231, 0.58);
  border: 1px solid color-mix(in srgb, var(--tower-accent) 58%, transparent);
  border-left: 4px solid var(--tower-accent);
  border-radius: 4px 14px 14px 4px;
  color: #f3eef5;
  background:
    radial-gradient(circle at 88% 8%, var(--tower-accent-soft), transparent 34%),
    radial-gradient(circle at 5% 105%, rgba(224, 190, 116, 0.13), transparent 38%),
    linear-gradient(145deg, #19171d 0%, #0b0b0e 60%, #151218 100%);
  box-shadow: inset 0 0 34px rgba(0, 0, 0, 0.42), 0 10px 24px rgba(25, 17, 29, 0.2);
}

.duel-tower-interaction.is-toji {
  --tower-accent: #b9c5cf;
  --tower-accent-bright: #f1f5f7;
  --tower-accent-soft: rgba(168, 184, 197, 0.17);
  --tower-danger: #ee5364;
}

.duel-tower-interaction.is-awasaka {
  --tower-accent: #d9ab55;
  --tower-accent-bright: #ffe5a7;
  --tower-accent-soft: rgba(217, 171, 85, 0.2);
  --tower-danger: #db654e;
}

.duel-tower-interaction::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: "";
  opacity: 0.15;
  background:
    repeating-linear-gradient(115deg, transparent 0 22px, rgba(255, 255, 255, 0.11) 23px, transparent 24px),
    linear-gradient(90deg, transparent 49.7%, var(--tower-accent-soft) 50%, transparent 50.3%);
  pointer-events: none;
}

.duel-tower-interaction-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.duel-tower-interaction-head small,
.duel-tower-intents small,
.duel-tower-inverse-read small {
  display: block;
  color: #bdb4c0;
  font: 800 0.64rem/1.25 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.duel-tower-interaction-head h5 {
  margin: 4px 0 3px;
  color: var(--tower-accent-bright);
  font: 950 clamp(1.05rem, 2.3vw, 1.38rem)/1.15 "STKaiti", "KaiTi", serif;
  letter-spacing: 0.045em;
  text-shadow: 0 0 15px var(--tower-accent-soft);
}

.duel-tower-interaction-head p {
  max-width: 72ch;
  margin: 0;
  color: #d1c8d3;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.52;
}

.duel-tower-interaction-head > span {
  padding: 6px 9px;
  border: 1px solid rgba(183, 139, 231, 0.58);
  border: 1px solid color-mix(in srgb, var(--tower-accent) 58%, transparent);
  border-radius: 999px;
  color: var(--tower-accent-bright);
  background: var(--tower-accent-soft);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.duel-tower-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  min-width: 0;
}

.duel-tower-metric {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 66px;
  padding: 9px 10px;
  border: 1px solid rgba(215, 205, 218, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.duel-tower-metric > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #d8d0da;
  font-size: 0.71rem;
  font-weight: 850;
}

.duel-tower-metric b,
.duel-tower-metric > strong {
  color: var(--tower-accent-bright);
}

.duel-tower-metric > strong {
  font-size: 0.76rem;
  line-height: 1.35;
}

.duel-tower-meter {
  display: block;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(183, 139, 231, 0.24);
  border: 1px solid color-mix(in srgb, var(--tower-accent) 24%, transparent);
  border-radius: 999px;
  background: #29262c;
}

.duel-tower-meter > span {
  display: block;
  width: var(--tower-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8564a0, var(--tower-accent-bright));
  background: linear-gradient(90deg, color-mix(in srgb, var(--tower-accent) 62%, #34283e), var(--tower-accent-bright));
  box-shadow: 0 0 12px var(--tower-accent-soft);
  transition: width 180ms ease-out;
}

.duel-tower-metric.is-hunt .duel-tower-meter > span,
.duel-tower-metric.is-ritual .duel-tower-meter > span {
  background: linear-gradient(90deg, #71243d, var(--tower-danger));
}

.duel-tower-metric.is-anchor .duel-tower-meter > span,
.duel-tower-metric.is-counter .duel-tower-meter > span {
  background: linear-gradient(90deg, #426f68, #79d7c2);
}

.duel-tower-metric.is-zero-ce {
  border-color: rgba(185, 197, 207, 0.3);
  background: linear-gradient(135deg, rgba(68, 77, 84, 0.34), rgba(20, 20, 22, 0.6));
}

.duel-tower-intents {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
  min-width: 0;
}

.duel-tower-intents article {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(183, 139, 231, 0.46);
  border: 1px solid color-mix(in srgb, var(--tower-accent) 46%, transparent);
  border-radius: 8px;
  background: linear-gradient(120deg, var(--tower-accent-soft), rgba(18, 17, 20, 0.74));
}

.duel-tower-intents article.is-ogami:nth-child(2) {
  border-color: rgba(224, 190, 116, 0.42);
  background: linear-gradient(120deg, rgba(112, 78, 25, 0.32), rgba(18, 17, 20, 0.74));
}

.duel-tower-intents strong {
  color: #fff4ed;
  font-size: 0.88rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.duel-tower-intents span {
  color: #cec4d0;
  font-size: 0.71rem;
  font-weight: 700;
  line-height: 1.45;
}

.duel-tower-intents .duel-tower-intent-detail {
  color: #eee5f0;
  font-size: 0.75rem;
  font-weight: 800;
}

.duel-tower-intents .duel-tower-intent-counter {
  padding-top: 5px;
  border-top: 1px dashed rgba(183, 139, 231, 0.24);
  border-top: 1px dashed color-mix(in srgb, var(--tower-accent) 24%, transparent);
  color: var(--tower-accent-bright);
  font-weight: 850;
}

.duel-tower-intent-empty,
.duel-tower-counter-empty {
  margin: 0;
  padding: 9px 10px;
  border: 1px dashed rgba(201, 190, 204, 0.28);
  border-radius: 8px;
  color: #c9becb;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.5;
}

.duel-tower-inverse-read {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 1.2fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px 11px;
  border: 1px solid rgba(217, 171, 85, 0.34);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(48, 85, 78, 0.2), rgba(112, 72, 24, 0.23));
}

.duel-tower-inverse-read strong {
  display: block;
  margin-top: 3px;
  color: #ffe5a7;
  font-size: 0.82rem;
}

.duel-tower-inverse-read > span {
  color: #d7cbb8;
  font-size: 0.72rem;
  font-weight: 750;
  line-height: 1.45;
}

.duel-tower-inverse-read > b {
  padding: 6px 9px;
  border: 1px solid rgba(217, 171, 85, 0.38);
  border-radius: 999px;
  color: #ffe9b6;
  background: rgba(97, 67, 20, 0.34);
  font-size: 0.7rem;
  white-space: nowrap;
}

.duel-tower-inverse-read.is-paired {
  border-color: rgba(93, 210, 185, 0.52);
  background: linear-gradient(90deg, rgba(37, 113, 96, 0.32), rgba(112, 72, 24, 0.26));
  box-shadow: inset 0 0 0 1px rgba(93, 210, 185, 0.08);
}

.duel-tower-inverse-read.is-paired > b {
  border-color: rgba(93, 210, 185, 0.48);
  color: #adf0df;
  background: rgba(24, 100, 82, 0.34);
}

.duel-tower-counter-section {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(183, 139, 231, 0.22);
  border-top: 1px solid color-mix(in srgb, var(--tower-accent) 22%, transparent);
}

.duel-tower-counter-section > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.duel-tower-counter-section > div:first-child strong {
  color: var(--tower-accent-bright);
  font-size: 0.83rem;
}

.duel-tower-counter-section > div:first-child span {
  color: #aea4b0;
  font-size: 0.68rem;
  text-align: right;
}

.duel-tower-counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 7px;
  min-width: 0;
}

.duel-tower-counter {
  display: grid;
  gap: 3px;
  align-content: start;
  min-width: 0;
  min-height: 76px !important;
  padding: 9px 10px !important;
  border: 1px solid rgba(192, 181, 195, 0.28) !important;
  border-radius: 7px !important;
  color: #ece3ee !important;
  background: rgba(255, 255, 255, 0.045) !important;
  box-shadow: none !important;
  text-align: left !important;
  cursor: pointer;
}

.duel-tower-counter span,
.duel-tower-counter em,
.duel-tower-counter small {
  color: #b6aab8 !important;
  font-size: 0.64rem !important;
  font-style: normal;
  line-height: 1.36;
  overflow-wrap: anywhere;
}

.duel-tower-counter strong {
  color: var(--tower-accent-bright) !important;
  font-size: 0.79rem !important;
  overflow-wrap: anywhere;
}

.duel-tower-counter.is-available {
  border-color: rgba(183, 139, 231, 0.68) !important;
  border-color: color-mix(in srgb, var(--tower-accent) 68%, transparent) !important;
  background: linear-gradient(135deg, var(--tower-accent-soft), rgba(30, 25, 32, 0.82)) !important;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tower-accent) 9%, transparent) !important;
}

.duel-tower-counter.is-available:hover,
.duel-tower-counter.is-available:focus-visible {
  border-color: var(--tower-accent-bright) !important;
  background: linear-gradient(135deg, color-mix(in srgb, var(--tower-accent) 35%, transparent), rgba(38, 30, 40, 0.9)) !important;
  outline: 2px solid color-mix(in srgb, var(--tower-accent) 22%, transparent);
  outline-offset: 2px;
}

.duel-tower-counter.is-selected {
  border-color: rgba(93, 210, 185, 0.65) !important;
  background: rgba(26, 99, 82, 0.36) !important;
}

.duel-tower-counter.is-blocked {
  opacity: 0.7;
  cursor: not-allowed;
}

.duel-tower-route-hint {
  margin: 0;
  padding: 8px 10px;
  border-left: 3px solid var(--tower-accent);
  color: #cec4d0;
  background: var(--tower-accent-soft);
  font-size: 0.71rem;
  font-weight: 750;
  line-height: 1.5;
}

.duel-tower-route-hint b {
  color: var(--tower-accent-bright);
}

.duel-dagon-interaction {
  --dagon-sea: #62d8d1;
  --dagon-sea-bright: #b7fff4;
  --dagon-deep: #07191f;
  --dagon-lifeline: #b18cff;
  --dagon-danger: #ff7b7b;
  position: relative;
  isolation: isolate;
  display: grid;
  gap: 11px;
  min-width: 0;
  overflow: hidden;
  padding: 14px;
  border: 1px solid rgba(98, 216, 209, 0.48);
  border-left: 4px solid var(--dagon-sea);
  border-radius: 4px 16px 16px 4px;
  color: #edfbfb;
  background:
    radial-gradient(circle at 84% 12%, rgba(73, 209, 199, 0.18), transparent 32%),
    linear-gradient(158deg, #12333a 0%, #081a20 43%, #071116 100%);
  box-shadow: inset 0 0 42px rgba(0, 0, 0, 0.42), 0 12px 28px rgba(5, 34, 39, 0.24);
}

.duel-dagon-interaction > :not(.duel-dagon-sea) {
  position: relative;
  z-index: 2;
}

.duel-dagon-sea {
  position: absolute;
  z-index: 0;
  inset: 0;
  overflow: hidden;
  opacity: 0.7;
  pointer-events: none;
}

.duel-dagon-sea > i {
  position: absolute;
  right: -12%;
  left: -12%;
  height: 76px;
  border: 1px solid rgba(143, 255, 242, 0.18);
  border-radius: 48% 52% 0 0;
  background: linear-gradient(180deg, rgba(92, 219, 208, 0.1), transparent 70%);
  transform: rotate(-2deg);
  animation: dagon-wave-drift 5.6s ease-in-out infinite alternate;
}

.duel-dagon-sea > i:first-child {
  top: 16%;
}

.duel-dagon-sea > i:nth-child(2) {
  top: 49%;
  opacity: 0.65;
  transform: rotate(3deg) scaleX(1.12);
  animation-delay: -2.1s;
}

.duel-dagon-lifeline {
  position: absolute;
  right: 7%;
  bottom: -7px;
  width: min(42%, 260px);
  height: 68%;
  opacity: 0;
  background:
    linear-gradient(98deg, transparent 43%, rgba(178, 141, 255, 0.92) 45% 48%, transparent 50%),
    linear-gradient(82deg, transparent 51%, rgba(121, 94, 181, 0.68) 53% 55%, transparent 57%);
  filter: drop-shadow(0 0 12px rgba(177, 140, 255, 0.48));
  transform: translateY(18%) scaleY(0.6);
  transform-origin: bottom;
}

.duel-dagon-interaction.is-stage-2 .duel-dagon-lifeline {
  opacity: 0.72;
  transform: translateY(0) scaleY(1);
  animation: dagon-lifeline-breathe 2.8s ease-in-out infinite;
}

.duel-dagon-interaction-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.duel-dagon-interaction-head small,
.duel-dagon-intent small {
  display: block;
  color: #9dc1c2;
  font: 800 0.64rem/1.3 ui-monospace, "SFMono-Regular", Consolas, monospace;
  letter-spacing: 0.075em;
}

.duel-dagon-interaction-head h5 {
  margin: 4px 0 3px;
  color: var(--dagon-sea-bright);
  font: 950 clamp(1.08rem, 2.3vw, 1.42rem)/1.14 "STKaiti", "KaiTi", serif;
  letter-spacing: 0.045em;
  text-shadow: 0 0 18px rgba(86, 224, 212, 0.25);
}

.duel-dagon-interaction.is-stage-2 .duel-dagon-interaction-head h5 {
  color: #d7c4ff;
  text-shadow: 0 0 18px rgba(177, 140, 255, 0.35);
}

.duel-dagon-interaction-head p {
  max-width: 74ch;
  margin: 0;
  color: #c8dedf;
  font-size: 0.75rem;
  font-weight: 720;
  line-height: 1.52;
}

.duel-dagon-interaction-head > span {
  padding: 6px 9px;
  border: 1px solid rgba(98, 216, 209, 0.48);
  border-radius: 999px;
  color: var(--dagon-sea-bright);
  background: rgba(18, 80, 84, 0.46);
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.duel-dagon-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.duel-dagon-metric {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
  min-height: 64px;
  padding: 9px 10px;
  border: 1px solid rgba(157, 221, 216, 0.2);
  border-radius: 9px;
  background: rgba(1, 17, 22, 0.54);
}

.duel-dagon-metric > div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #cce3e3;
  font-size: 0.71rem;
  font-weight: 850;
}

.duel-dagon-metric b,
.duel-dagon-metric > strong {
  color: var(--dagon-sea-bright);
}

.duel-dagon-metric > strong {
  font-size: 0.72rem;
  line-height: 1.35;
}

.duel-dagon-metric > i {
  display: block;
  height: 8px;
  overflow: hidden;
  border: 1px solid rgba(98, 216, 209, 0.24);
  border-radius: 999px;
  background: #10262b;
}

.duel-dagon-metric > i > span {
  display: block;
  width: var(--dagon-progress, 0%);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #397a7c, var(--dagon-sea-bright));
  box-shadow: 0 0 12px rgba(98, 216, 209, 0.3);
  transition: width 180ms ease-out;
}

.duel-dagon-metric.is-pressure > i > span {
  background: linear-gradient(90deg, #66373f, var(--dagon-danger));
}

.duel-dagon-metric.is-lifeline {
  border-color: rgba(177, 140, 255, 0.38);
}

.duel-dagon-metric.is-lifeline > i > span {
  background: linear-gradient(90deg, #5d488e, #d7c4ff);
  box-shadow: 0 0 12px rgba(177, 140, 255, 0.35);
}

.duel-dagon-metric.is-locked {
  opacity: 0.78;
  background: rgba(1, 14, 18, 0.65);
}

.duel-dagon-intent {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 123, 123, 0.5);
  border-left: 4px solid var(--dagon-danger);
  border-radius: 4px 10px 10px 4px;
  background: linear-gradient(112deg, rgba(96, 38, 46, 0.46), rgba(5, 27, 33, 0.78));
}

.duel-dagon-intent strong {
  color: #fff2eb;
  font-size: 0.94rem;
  line-height: 1.35;
}

.duel-dagon-intent p {
  margin: 0;
  color: #e7dad7;
  font-size: 0.75rem;
  font-weight: 730;
  line-height: 1.48;
}

.duel-dagon-intent span,
.duel-dagon-intent em {
  font-size: 0.69rem;
  font-style: normal;
  font-weight: 820;
  line-height: 1.4;
}

.duel-dagon-intent span {
  color: #ffcfbc;
}

.duel-dagon-intent em {
  color: #acebe4;
}

.duel-dagon-intent-empty,
.duel-dagon-counter-empty {
  margin: 0;
  padding: 9px 10px;
  border: 1px dashed rgba(157, 221, 216, 0.3);
  border-radius: 8px;
  color: #b8d1d1;
  font-size: 0.72rem;
  line-height: 1.48;
}

.duel-dagon-allies {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-width: 0;
}

.duel-dagon-allies article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 7px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(157, 221, 216, 0.2);
  border-radius: 7px;
  background: rgba(2, 19, 24, 0.62);
}

.duel-dagon-allies article > span {
  color: #e5f6f5;
  font-size: 0.72rem;
  font-weight: 850;
}

.duel-dagon-allies article > b {
  color: #87e6da;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.duel-dagon-allies article > small {
  grid-column: 1 / -1;
  color: #9bbabc;
  font-size: 0.62rem;
}

.duel-dagon-allies article.is-wounded {
  border-color: rgba(255, 191, 112, 0.42);
}

.duel-dagon-allies article.is-wounded > b {
  color: #ffd08e;
}

.duel-dagon-allies article.is-critical {
  border-color: rgba(255, 123, 123, 0.58);
  background: rgba(82, 27, 36, 0.45);
}

.duel-dagon-allies article.is-critical > b {
  color: #ff9c9c;
}

.duel-dagon-counter-section {
  display: grid;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(98, 216, 209, 0.22);
}

.duel-dagon-counter-section > div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.duel-dagon-counter-section > div:first-child strong {
  color: var(--dagon-sea-bright);
  font-size: 0.83rem;
}

.duel-dagon-counter-section > div:first-child span {
  color: #91afb1;
  font-size: 0.68rem;
  text-align: right;
}

.duel-dagon-counter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 7px;
  min-width: 0;
}

.duel-dagon-counter {
  display: grid;
  gap: 3px;
  align-content: start;
  min-width: 0;
  min-height: 76px !important;
  padding: 9px 10px !important;
  border: 1px solid rgba(145, 196, 194, 0.28) !important;
  border-radius: 7px !important;
  color: #e9f7f7 !important;
  background: rgba(3, 24, 29, 0.76) !important;
  box-shadow: none !important;
  text-align: left !important;
  cursor: pointer;
}

.duel-dagon-counter span,
.duel-dagon-counter em,
.duel-dagon-counter small {
  color: #a9c2c3 !important;
  font-size: 0.64rem !important;
  font-style: normal;
  line-height: 1.36;
  overflow-wrap: anywhere;
}

.duel-dagon-counter strong {
  color: var(--dagon-sea-bright) !important;
  font-size: 0.79rem !important;
  overflow-wrap: anywhere;
}

.duel-dagon-counter.is-available {
  border-color: rgba(98, 216, 209, 0.65) !important;
  background: linear-gradient(135deg, rgba(43, 126, 126, 0.42), rgba(3, 24, 29, 0.86)) !important;
}

.duel-dagon-counter.is-available:hover,
.duel-dagon-counter.is-available:focus-visible {
  border-color: var(--dagon-sea-bright) !important;
  background: linear-gradient(135deg, rgba(67, 155, 151, 0.5), rgba(4, 32, 38, 0.9)) !important;
  outline: 2px solid rgba(98, 216, 209, 0.24);
  outline-offset: 2px;
}

.duel-dagon-counter.is-selected {
  border-color: rgba(177, 140, 255, 0.7) !important;
  background: rgba(80, 57, 128, 0.46) !important;
}

.duel-dagon-counter.is-blocked {
  opacity: 0.68;
  cursor: not-allowed;
}

.duel-dagon-goal,
.duel-dagon-canon {
  margin: 0;
  padding: 8px 10px;
  color: #c9dfdf;
  font-size: 0.71rem;
  font-weight: 730;
  line-height: 1.5;
}

.duel-dagon-goal {
  border-left: 3px solid var(--dagon-sea);
  background: rgba(31, 101, 102, 0.25);
}

.duel-dagon-canon {
  border: 1px dashed rgba(177, 140, 255, 0.36);
  border-radius: 7px;
  background: rgba(64, 46, 94, 0.24);
}

.duel-dagon-goal b {
  color: var(--dagon-sea-bright);
}

.duel-dagon-canon b {
  color: #d7c4ff;
}

@keyframes dagon-wave-drift {
  from { transform: translate3d(-2%, -4px, 0) rotate(-2deg); }
  to { transform: translate3d(2%, 5px, 0) rotate(1deg); }
}

@keyframes dagon-lifeline-breathe {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(177, 140, 255, 0.35)); }
  50% { filter: drop-shadow(0 0 18px rgba(177, 140, 255, 0.65)); }
}

@media (max-width: 720px) {
  .duel-tower-interaction {
    gap: 8px;
    max-height: min(65dvh, 580px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 9px;
  }

  .duel-tower-interaction-head,
  .duel-tower-inverse-read {
    grid-template-columns: minmax(0, 1fr);
  }

  .duel-tower-metrics,
  .duel-tower-intents,
  .duel-tower-counter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .duel-tower-interaction-head > span,
  .duel-tower-inverse-read > b {
    justify-self: start;
  }

  .duel-tower-counter-section > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .duel-tower-counter-section > div:first-child span {
    text-align: left;
  }

  .duel-tower-counter {
    min-height: 44px !important;
    width: 100%;
  }

  .duel-dagon-interaction {
    gap: 8px;
    max-height: min(65dvh, 590px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    padding: 9px;
  }

  .duel-dagon-interaction-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .duel-dagon-interaction-head > span {
    justify-self: start;
  }

  .duel-dagon-allies,
  .duel-dagon-counter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .duel-dagon-counter-section > div:first-child {
    align-items: flex-start;
    flex-direction: column;
  }

  .duel-dagon-counter-section > div:first-child span {
    text-align: left;
  }

  .duel-dagon-counter {
    min-height: 44px !important;
    width: 100%;
  }
}

@media (orientation: landscape) and (max-height: 520px) and (max-width: 1000px) {
  .duel-haruta-interaction,
  .duel-tower-interaction,
  .duel-dagon-interaction {
    max-height: min(72dvh, 380px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
  }
}

@media (max-width: 350px) {
  .duel-initiative-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .duel-haruta-intents,
  .duel-haruta-counter-grid,
  .duel-tower-intents,
  .duel-tower-counter-grid,
  .duel-dagon-metrics,
  .duel-dagon-allies,
  .duel-dagon-counter-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .duel-tower-meter > span,
  .duel-dagon-metric > i > span {
    transition: none;
  }

  .duel-dagon-sea > i,
  .duel-dagon-interaction.is-stage-2 .duel-dagon-lifeline {
    animation: none;
  }
}

/* Shibuya / Choso station fight ------------------------------------------------ */
.duel-choso-interaction {
  --choso-accent: #d3545d;
  --choso-accent-soft: rgba(211, 84, 93, .18);
  --choso-line: rgba(255, 223, 220, .16);
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  max-height: min(65dvh, 590px);
  margin: 14px 0;
  padding: 16px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  color: #f5eceb;
  border: 1px solid rgba(219, 111, 116, .42);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(44, 17, 22, .97), rgba(15, 13, 17, .98) 58%, rgba(8, 9, 12, .99));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 14px 34px rgba(0,0,0,.28);
  scrollbar-width: thin;
  scrollbar-color: var(--choso-accent) rgba(0,0,0,.28);
}

.duel-choso-interaction::-webkit-scrollbar { width: 8px; }
.duel-choso-interaction::-webkit-scrollbar-track { background: rgba(0,0,0,.24); border-radius: 999px; }
.duel-choso-interaction::-webkit-scrollbar-thumb { background: var(--choso-accent); border-radius: 999px; }

.duel-choso-interaction.is-water_plan {
  --choso-accent: #6fb9c7;
  --choso-accent-soft: rgba(75, 155, 174, .2);
  --choso-line: rgba(173, 226, 236, .18);
  border-color: rgba(101, 181, 197, .48);
  background:
    radial-gradient(circle at 82% 18%, rgba(67, 151, 172, .18), transparent 34%),
    repeating-linear-gradient(168deg, transparent 0 28px, rgba(126, 203, 218, .045) 29px 31px),
    linear-gradient(145deg, rgba(17, 38, 46, .98), rgba(12, 20, 27, .98) 60%, rgba(8, 10, 14, .99));
}

.duel-choso-interaction.is-bathroom_melee {
  --choso-accent: #cf5a62;
  --choso-accent-soft: rgba(193, 69, 79, .18);
  --choso-line: rgba(240, 231, 218, .13);
  border-color: rgba(207, 90, 98, .48);
  background:
    linear-gradient(rgba(255,255,255,.027) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.027) 1px, transparent 1px),
    radial-gradient(circle at 74% 24%, rgba(144, 27, 38, .2), transparent 35%),
    linear-gradient(150deg, rgba(37, 35, 35, .98), rgba(15, 17, 19, .99) 62%);
  background-size: 42px 42px, 42px 42px, auto, auto;
}

.duel-choso-blood-trace {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: .64;
}

.duel-choso-blood-trace i {
  position: absolute;
  right: -18%;
  width: 64%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--choso-accent) 35%, rgba(255,255,255,.72), transparent 86%);
  box-shadow: 0 0 9px var(--choso-accent-soft);
  transform: rotate(-13deg) scaleX(.38);
  transform-origin: right center;
  animation: choso-blood-trace 3.8s ease-in-out infinite;
}

.duel-choso-blood-trace i:nth-child(1) { top: 17%; }
.duel-choso-blood-trace i:nth-child(2) { top: 46%; animation-delay: -1.35s; }
.duel-choso-blood-trace i:nth-child(3) { top: 78%; animation-delay: -2.5s; }

@keyframes choso-blood-trace {
  0%, 100% { opacity: .08; transform: translateX(12%) rotate(-13deg) scaleX(.28); }
  42% { opacity: .74; transform: translateX(-18%) rotate(-13deg) scaleX(1); }
  68% { opacity: .18; transform: translateX(-34%) rotate(-13deg) scaleX(.72); }
}

.duel-choso-interaction-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--choso-line);
}

.duel-choso-interaction-head > div { min-width: 0; }
.duel-choso-interaction-head small {
  display: block;
  margin-bottom: 4px;
  color: #d8c9c6;
  font-size: .72rem;
  letter-spacing: .12em;
}
.duel-choso-interaction-head h5 { margin: 0; color: #fff7f5; font-size: clamp(1rem, 2.2vw, 1.32rem); line-height: 1.25; }
.duel-choso-interaction-head p { max-width: 68ch; margin: 7px 0 0; color: #d8cfcd; font-size: .84rem; line-height: 1.58; }
.duel-choso-interaction-head > span {
  align-self: start;
  white-space: nowrap;
  padding: 6px 9px;
  color: #fff;
  border: 1px solid var(--choso-line);
  border-radius: 999px;
  background: rgba(0,0,0,.22);
  font-size: .75rem;
  font-weight: 700;
}

.duel-choso-stage-route {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 12px 0;
  padding: 0;
  list-style: none;
}
.duel-choso-stage-route li {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  color: #978d8b;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 10px;
  background: rgba(0,0,0,.18);
  font-size: .75rem;
}
.duel-choso-stage-route li i { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #665e5d; }
.duel-choso-stage-route li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-choso-stage-route li.is-complete { color: #d7cfcb; }
.duel-choso-stage-route li.is-complete i { background: #b8aaa3; }
.duel-choso-stage-route li.is-active { color: #fff; border-color: var(--choso-accent); background: var(--choso-accent-soft); }
.duel-choso-stage-route li.is-active i { background: var(--choso-accent); box-shadow: 0 0 10px var(--choso-accent); }

.duel-choso-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.duel-choso-metric {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(255,255,255,.085);
  border-radius: 11px;
  background: rgba(0,0,0,.2);
}
.duel-choso-metric > div { display: flex; min-width: 0; justify-content: space-between; gap: 8px; color: #cabfbc; font-size: .72rem; }
.duel-choso-metric > div span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duel-choso-metric > div b { flex: 0 0 auto; color: #fff; }
.duel-choso-metric > i { display: block; height: 5px; margin-top: 7px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.08); }
.duel-choso-metric > i > span { display: block; width: var(--choso-progress, 0%); height: 100%; border-radius: inherit; background: var(--choso-accent); box-shadow: 0 0 8px var(--choso-accent); transition: width .22s ease; }
.duel-choso-metric.is-pressure > i > span { background: #d44852; }

.duel-choso-intent,
.duel-choso-intent-empty {
  position: relative;
  margin: 11px 0;
  padding: 12px 13px 12px 16px;
  border: 1px solid var(--choso-line);
  border-left: 3px solid var(--choso-accent);
  border-radius: 12px;
  background: linear-gradient(100deg, var(--choso-accent-soft), rgba(0,0,0,.22));
}
.duel-choso-intent small { display: block; color: #cdbfbc; font-size: .7rem; letter-spacing: .08em; }
.duel-choso-intent strong { display: block; margin-top: 4px; color: #fff; font-size: .95rem; }
.duel-choso-intent p { margin: 6px 0; color: #e1d8d5; font-size: .82rem; line-height: 1.55; }
.duel-choso-intent em { display: block; color: #d4c7c3; font-size: .73rem; font-style: normal; }
.duel-choso-intent-empty { color: #c9bcba; font-size: .8rem; }

.duel-choso-counter-section { min-width: 0; }
.duel-choso-counter-section > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.duel-choso-counter-section > div:first-child strong { color: #fff; font-size: .86rem; }
.duel-choso-counter-section > div:first-child span { color: #afa4a2; font-size: .71rem; text-align: right; }
.duel-choso-counter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}
.duel-choso-counter {
  display: flex;
  min-width: 0;
  min-height: 116px;
  padding: 10px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  color: #eee4e1;
  text-align: left;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  background: rgba(9, 9, 12, .72);
  box-shadow: none;
  white-space: normal;
}
.duel-choso-counter > span { color: var(--choso-accent); font-size: .66rem; letter-spacing: .08em; }
.duel-choso-counter > strong { color: #fff; font-size: .87rem; line-height: 1.3; }
.duel-choso-counter > small { flex: 1 1 auto; color: #c9bfbc; font-size: .72rem; line-height: 1.45; }
.duel-choso-counter > em { color: #a99e9b; font-size: .68rem; font-style: normal; }
.duel-choso-counter.is-available { cursor: pointer; border-color: color-mix(in srgb, var(--choso-accent) 66%, transparent); }
.duel-choso-counter.is-available:hover { transform: translateY(-2px); border-color: var(--choso-accent); background: var(--choso-accent-soft); }
.duel-choso-counter.is-selected { border-color: var(--choso-accent); background: var(--choso-accent-soft); box-shadow: inset 0 0 0 1px var(--choso-accent); }
.duel-choso-counter.is-selected > em { color: #fff; }
.duel-choso-counter.is-blocked { opacity: .52; }
.duel-choso-counter:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.duel-choso-counter-empty { margin: 0; padding: 11px; color: #c6b9b6; border: 1px dashed var(--choso-line); border-radius: 10px; font-size: .78rem; }

/* The shared V3 skin loads after this sheet and gives every button a pale
   surface with !important. Keep this encounter readable on its dark stage. */
body button.duel-choso-counter {
  min-height: 116px !important;
  border: 1px solid rgba(255,255,255,.12) !important;
  border-radius: 12px !important;
  color: #eee4e1 !important;
  background: rgba(9, 9, 12, .82) !important;
  box-shadow: none !important;
}
body button.duel-choso-counter.is-available { border-color: var(--choso-accent) !important; }
body button.duel-choso-counter.is-available:hover {
  color: #fff !important;
  border-color: var(--choso-accent) !important;
  background: var(--choso-accent-soft) !important;
  transform: translateY(-2px) !important;
}
body button.duel-choso-counter.is-selected,
body button.duel-choso-counter.is-selected:disabled {
  opacity: 1 !important;
  color: #fff !important;
  border-color: var(--choso-accent) !important;
  background: var(--choso-accent-soft) !important;
  box-shadow: inset 0 0 0 1px var(--choso-accent) !important;
}
body button.duel-choso-counter.is-blocked:disabled { opacity: .52 !important; }

.duel-choso-stage-note,
.duel-choso-goal {
  margin: 10px 0 0;
  padding: 9px 11px;
  color: #cabfbc;
  border-radius: 10px;
  background: rgba(0,0,0,.2);
  font-size: .76rem;
  line-height: 1.5;
}
.duel-choso-stage-note b,
.duel-choso-goal b { color: #fff; }
.duel-choso-goal { border-left: 2px solid var(--choso-accent); }

/* Shibuya / Megumi pursued by the unknown revenant --------------------------- */
.duel-megumi-toji-interaction {
  --choso-accent: #d7bd78;
  --choso-accent-soft: rgba(215, 189, 120, .13);
  --choso-line: rgba(228, 218, 190, .16);
  border-color: rgba(207, 190, 142, .38);
  background:
    radial-gradient(circle at 82% 8%, rgba(214, 194, 139, .08), transparent 31%),
    repeating-linear-gradient(160deg, transparent 0 34px, rgba(255,255,255,.022) 35px 36px),
    linear-gradient(145deg, rgba(27, 28, 30, .98), rgba(13, 14, 16, .99) 62%, rgba(7, 8, 10, .99));
}

.duel-megumi-toji-interaction.is-break_the_lock {
  --choso-accent: #b8c2c6;
  --choso-accent-soft: rgba(184, 194, 198, .12);
  border-color: rgba(184, 194, 198, .34);
}

.duel-megumi-toji-interaction.is-read_the_landing {
  --choso-accent: #eee1b5;
  --choso-accent-soft: rgba(238, 225, 181, .15);
  border-color: rgba(238, 225, 181, .46);
  background:
    radial-gradient(circle at 75% 20%, rgba(238, 225, 181, .1), transparent 30%),
    linear-gradient(150deg, rgba(23, 24, 25, .99), rgba(8, 9, 11, .99) 66%);
}

.duel-toji-speed-lines {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: .45;
}

.duel-toji-speed-lines i {
  position: absolute;
  left: -16%;
  width: 58%;
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, rgba(238, 230, 202, .78), transparent);
  transform: rotate(-9deg) scaleX(.36);
  transform-origin: left center;
  animation: toji-pursuit-line 3.2s cubic-bezier(.2,.7,.3,1) infinite;
}

.duel-toji-speed-lines i:nth-child(1) { top: 24%; }
.duel-toji-speed-lines i:nth-child(2) { top: 54%; animation-delay: -1.05s; }
.duel-toji-speed-lines i:nth-child(3) { top: 82%; animation-delay: -2.1s; }

@keyframes toji-pursuit-line {
  0%, 100% { opacity: .04; transform: translateX(-8%) rotate(-9deg) scaleX(.28); }
  36% { opacity: .66; transform: translateX(72%) rotate(-9deg) scaleX(1); }
  62% { opacity: .08; transform: translateX(118%) rotate(-9deg) scaleX(.56); }
}

.duel-toji-intent {
  background:
    linear-gradient(100deg, rgba(215, 189, 120, .11), rgba(0,0,0,.27));
}

/* Shibuya / Jogo flashover and Sukuna challenge ----------------------------- */
.duel-jogo-flashover-interaction {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(236, 103, 61, .38);
  border-radius: 14px;
  color: #f8e7da;
  background:
    radial-gradient(circle at 82% 0, rgba(255, 104, 38, .16), transparent 34%),
    linear-gradient(145deg, rgba(43, 18, 13, .98), rgba(13, 12, 14, .99) 72%);
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 14px 34px rgba(0,0,0,.28);
}

.duel-jogo-flashover-interaction header small { color: #e7a16f; font-weight: 800; letter-spacing: .08em; }
.duel-jogo-flashover-interaction header h5 { margin: 4px 0 6px; color: #fff4e7; font-size: 1.05rem; }
.duel-jogo-flashover-interaction header p,
.duel-jogo-flashover-interaction article p,
.duel-jogo-flashover-lock { margin: 0; color: #d9c4b7; line-height: 1.58; }
.duel-jogo-flashover-canon { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.duel-jogo-flashover-canon span {
  padding: 8px 10px;
  border: 1px solid rgba(230, 111, 66, .2);
  border-radius: 9px;
  color: #f0d5c3;
  background: rgba(91, 28, 16, .23);
  font-size: .76rem;
  line-height: 1.45;
}
.duel-jogo-flashover-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.duel-jogo-flashover-actions article {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(229, 137, 88, .25);
  border-left: 3px solid #cf6138;
  border-radius: 7px 11px 11px 7px;
  background: rgba(0,0,0,.23);
}
.duel-jogo-flashover-actions strong { display: block; margin-bottom: 5px; color: #ffcf9e; }
.duel-jogo-flashover-actions p { font-size: .74rem; }
.duel-jogo-flashover-lock { padding: 9px 10px; border-left: 2px solid #d74f35; background: rgba(92, 20, 13, .22); font-size: .78rem; }
.duel-jogo-flashover-lock b { color: #ffb27c; }

.duel-sukuna-jogo-interaction {
  --choso-accent: #ef6c42;
  --choso-accent-soft: rgba(239, 108, 66, .14);
  --choso-line: rgba(247, 151, 102, .16);
  border-color: rgba(235, 104, 63, .42);
  background:
    radial-gradient(circle at 84% 5%, rgba(254, 111, 43, .14), transparent 28%),
    radial-gradient(circle at 10% 95%, rgba(126, 15, 22, .2), transparent 35%),
    linear-gradient(145deg, rgba(39, 17, 15, .99), rgba(12, 11, 14, .99) 68%);
}
.duel-sukuna-jogo-interaction.is-maximum_meteor { --choso-accent: #f3a451; border-color: rgba(243, 164, 81, .48); }
.duel-sukuna-jogo-interaction.is-final_fire { --choso-accent: #e94d3d; border-color: rgba(245, 73, 53, .58); }
.duel-sukuna-jogo-heat { position: absolute; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.duel-sukuna-jogo-heat i {
  position: absolute;
  bottom: -35%;
  width: 42%;
  height: 70%;
  border-radius: 48% 52% 38% 62%;
  background: radial-gradient(ellipse at 50% 100%, rgba(255, 103, 34, .2), transparent 68%);
  filter: blur(2px);
  animation: sukuna-jogo-heat-rise 4.6s ease-in-out infinite;
}
.duel-sukuna-jogo-heat i:nth-child(1) { left: 2%; }
.duel-sukuna-jogo-heat i:nth-child(2) { left: 31%; animation-delay: -1.5s; }
.duel-sukuna-jogo-heat i:nth-child(3) { right: 1%; animation-delay: -3s; }
@keyframes sukuna-jogo-heat-rise {
  0%, 100% { opacity: .22; transform: translateY(13%) scale(.92); }
  50% { opacity: .62; transform: translateY(-5%) scale(1.06); }
}
.duel-sukuna-jogo-canon-lock {
  padding: 11px 12px;
  border: 1px solid rgba(235, 107, 62, .29);
  border-left: 3px solid var(--choso-accent);
  border-radius: 7px 11px 11px 7px;
  background: linear-gradient(100deg, rgba(121, 29, 18, .24), rgba(0,0,0,.25));
}
.duel-sukuna-jogo-canon-lock small { display: block; color: #e68e65; font-weight: 800; letter-spacing: .1em; }
.duel-sukuna-jogo-canon-lock strong { display: block; margin: 4px 0; color: #fff0dd; }
.duel-sukuna-jogo-canon-lock p { margin: 0; color: #d9c1b1; font-size: .77rem; line-height: 1.52; }

.duel-sukuna-mahoraga-interaction {
  --choso-accent: #d6b76b;
  --choso-accent-soft: rgba(214, 183, 107, .13);
  --choso-line: rgba(224, 205, 151, .15);
  border-color: rgba(218, 190, 111, .42);
  background:
    radial-gradient(circle at 86% 10%, rgba(224, 192, 104, .12), transparent 25%),
    radial-gradient(circle at 12% 92%, rgba(78, 91, 87, .2), transparent 38%),
    linear-gradient(145deg, rgba(23, 25, 23, .99), rgba(10, 12, 12, .99) 72%);
}
.duel-sukuna-mahoraga-interaction.is-malevolent_shrine {
  --choso-accent: #b4695e;
  border-color: rgba(177, 92, 78, .5);
}
.duel-sukuna-mahoraga-interaction.is-different_finish {
  --choso-accent: #e18b4b;
  border-color: rgba(225, 139, 75, .56);
}
.duel-mahoraga-wheel {
  position: absolute;
  top: 16px;
  right: 18px;
  width: 76px;
  aspect-ratio: 1;
  border: 1px solid rgba(226, 204, 139, .16);
  border-radius: 50%;
  opacity: .38;
  pointer-events: none;
  animation: shibuya-mahoraga-wheel-turn 11s steps(8, end) infinite;
}
.duel-mahoraga-wheel::before,
.duel-mahoraga-wheel::after {
  content: "";
  position: absolute;
  inset: 34%;
  border: 1px solid rgba(235, 214, 149, .45);
  border-radius: 50%;
}
.duel-mahoraga-wheel::after { inset: 44%; background: rgba(229, 202, 124, .48); }
.duel-mahoraga-wheel i {
  position: absolute;
  left: calc(50% - 1px);
  top: 3px;
  width: 2px;
  height: 31px;
  transform-origin: 1px 35px;
  background: linear-gradient(to bottom, rgba(234, 211, 145, .58), transparent);
}
.duel-mahoraga-wheel i:nth-child(2) { transform: rotate(45deg); }
.duel-mahoraga-wheel i:nth-child(3) { transform: rotate(90deg); }
.duel-mahoraga-wheel i:nth-child(4) { transform: rotate(135deg); }
.duel-mahoraga-wheel i:nth-child(5) { transform: rotate(180deg); }
.duel-mahoraga-wheel i:nth-child(6) { transform: rotate(225deg); }
.duel-mahoraga-wheel i:nth-child(7) { transform: rotate(270deg); }
.duel-mahoraga-wheel i:nth-child(8) { transform: rotate(315deg); }
@keyframes shibuya-mahoraga-wheel-turn {
  from { transform: rotate(0); }
  to { transform: rotate(360deg); }
}
.duel-mahoraga-adaptation {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  border: 1px solid rgba(219, 191, 115, .25);
  border-left: 3px solid var(--choso-accent);
  border-radius: 7px 11px 11px 7px;
  background: linear-gradient(100deg, rgba(91, 78, 42, .24), rgba(0, 0, 0, .24));
}
.duel-mahoraga-adaptation small { color: #cdbd91; font-weight: 800; letter-spacing: .08em; }
.duel-mahoraga-adaptation strong { color: #fff1c8; }
.duel-mahoraga-adaptation p { margin: 0; color: #d2c8ad; font-size: .77rem; line-height: 1.52; }
.duel-mahoraga-ritual-anchors { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.duel-mahoraga-ritual-anchors span {
  padding: 8px 10px;
  border: 1px solid rgba(198, 179, 126, .18);
  border-radius: 9px;
  background: rgba(0, 0, 0, .2);
  color: #d8cfb8;
  font-size: .76rem;
  line-height: 1.45;
}
.duel-mahoraga-ritual-anchors b { display: block; color: #f0dc9f; }

/* Shibuya / Mahito encounters ------------------------------------------------ */
.duel-mahito-interaction {
  --choso-accent: #b98ad6;
  --choso-accent-soft: rgba(185, 138, 214, .14);
  --choso-line: rgba(216, 190, 232, .16);
  border-color: rgba(186, 139, 215, .42);
  background:
    radial-gradient(circle at 84% 12%, rgba(172, 100, 203, .13), transparent 30%),
    radial-gradient(circle at 8% 94%, rgba(76, 133, 143, .13), transparent 36%),
    linear-gradient(145deg, rgba(27, 20, 34, .99), rgba(13, 13, 18, .99) 65%, rgba(8, 9, 12, .99));
}

.duel-mahito-interaction.is-nanami-last-stand {
  --choso-accent: #c7aa79;
  --choso-accent-soft: rgba(199, 170, 121, .13);
  --choso-line: rgba(226, 207, 171, .15);
  border-color: rgba(199, 170, 121, .4);
  background:
    radial-gradient(circle at 82% 9%, rgba(187, 151, 92, .1), transparent 29%),
    repeating-linear-gradient(168deg, transparent 0 37px, rgba(255,255,255,.018) 38px 39px),
    linear-gradient(145deg, rgba(29, 27, 25, .99), rgba(13, 14, 16, .99) 68%);
}

.duel-mahito-interaction.is-mahito_closes_in,
.duel-mahito-interaction.is-two_fronts_converge {
  --choso-accent: #8fb8c1;
  --choso-accent-soft: rgba(111, 171, 184, .13);
  border-color: rgba(124, 180, 192, .4);
}

.duel-mahito-interaction.is-last_trust,
.duel-mahito-interaction.is-final_curse_fight {
  --choso-accent: #d2a16c;
  --choso-accent-soft: rgba(210, 161, 108, .14);
  border-color: rgba(217, 163, 103, .48);
  background:
    radial-gradient(circle at 80% 9%, rgba(187, 92, 72, .13), transparent 28%),
    radial-gradient(circle at 10% 92%, rgba(87, 105, 132, .14), transparent 35%),
    linear-gradient(145deg, rgba(34, 24, 24, .99), rgba(13, 13, 18, .99) 68%);
}

.duel-mahito-soul-lines {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  opacity: .42;
}

.duel-mahito-soul-lines i {
  position: absolute;
  right: -22%;
  width: 62%;
  height: 38px;
  border-top: 1px solid color-mix(in srgb, var(--choso-accent) 58%, transparent);
  border-radius: 50%;
  transform: rotate(-8deg) translateX(4%);
  animation: mahito-soul-line 5.4s ease-in-out infinite;
}

.duel-mahito-soul-lines i::before,
.duel-mahito-soul-lines i::after {
  content: "";
  position: absolute;
  top: -4px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--choso-accent);
  border-radius: 50%;
  background: rgba(12, 12, 16, .86);
}
.duel-mahito-soul-lines i::before { left: 29%; }
.duel-mahito-soul-lines i::after { left: 67%; }
.duel-mahito-soul-lines i:nth-child(1) { top: 18%; }
.duel-mahito-soul-lines i:nth-child(2) { top: 49%; animation-delay: -1.8s; }
.duel-mahito-soul-lines i:nth-child(3) { top: 80%; animation-delay: -3.6s; }

@keyframes mahito-soul-line {
  0%, 100% { opacity: .18; transform: rotate(-8deg) translateX(7%); }
  48% { opacity: .72; transform: rotate(-8deg) translateX(-13%); }
}

.duel-mahito-intent {
  background:
    linear-gradient(102deg, var(--choso-accent-soft), rgba(0, 0, 0, .28));
}

.duel-mahito-canon-cast {
  display: grid;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid var(--choso-line);
  border-radius: 11px;
  background: rgba(0, 0, 0, .2);
}
.duel-mahito-canon-cast > small { color: var(--choso-accent); font-weight: 800; letter-spacing: .08em; }
.duel-mahito-canon-cast > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.duel-mahito-canon-cast span { color: #d8d2dc; font-size: .75rem; line-height: 1.45; }
.duel-mahito-canon-cast b { display: block; color: #fff2dc; }

.duel-mahito-counter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.duel-mahito-counter > span { color: var(--choso-accent); }

@media (max-width: 620px) {
  .duel-choso-interaction {
    max-height: min(65dvh, 590px);
    margin: 10px 0;
    padding: 12px;
    border-radius: 14px;
  }
  .duel-choso-interaction-head { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .duel-choso-interaction-head > span { justify-self: start; }
  .duel-choso-stage-route,
  .duel-choso-metrics,
  .duel-choso-counter-grid,
  .duel-mahito-canon-cast > div { grid-template-columns: minmax(0, 1fr); }
  .duel-choso-stage-route li span { white-space: normal; }
  .duel-choso-counter,
  body button.duel-choso-counter { min-height: 0 !important; }
  .duel-choso-counter-section > div:first-child { align-items: flex-start; flex-direction: column; gap: 3px; }
  .duel-choso-counter-section > div:first-child span { text-align: left; }
  .duel-jogo-flashover-canon,
  .duel-jogo-flashover-actions,
  .duel-mahoraga-ritual-anchors { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 410px) {
  .duel-choso-interaction { width: 100%; max-width: 100%; padding: 10px; }
  .duel-choso-interaction-head h5 { font-size: 1rem; }
  .duel-choso-interaction-head p,
  .duel-choso-intent p { overflow-wrap: anywhere; }
}

@media (prefers-reduced-motion: reduce) {
  .duel-choso-blood-trace i { animation: none !important; opacity: .2; transform: rotate(-13deg) scaleX(.65); }
  .duel-toji-speed-lines i { animation: none !important; opacity: .16; transform: rotate(-9deg) scaleX(.72); }
  .duel-sukuna-jogo-heat i { animation: none !important; opacity: .18; transform: none; }
  .duel-mahoraga-wheel { animation: none !important; opacity: .2; transform: rotate(22.5deg); }
  .duel-mahito-soul-lines i { animation: none !important; opacity: .18; transform: rotate(-8deg) translateX(-3%); }
  .duel-choso-counter,
  .duel-choso-metric > i > span { transition: none !important; }
  .duel-choso-counter.is-available:hover { transform: none; }
}

.duel-hand-card.active .duel-hand-detail {
  border-color: rgba(180, 35, 24, 0.22);
}

.duel-hand-card.disabled .duel-hand-detail {
  opacity: 0.65;
}

.duel-action-choice {
  display: grid;
  gap: 4px;
  min-height: 128px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.duel-hand-main {
  height: 100%;
}

.duel-action-choice:hover:not(:disabled),
.duel-action-choice.active {
  border-color: var(--accent);
  background: #fff8f7;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.12), var(--shadow-sm);
}

.duel-hand-card.active .duel-action-choice {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: 0 0 0 2px rgba(15, 118, 110, 0.14), var(--shadow-sm);
}

.duel-hand-card.summon .duel-action-choice {
  border-color: rgba(37, 99, 235, 0.3);
  background: #eff6ff;
}

.duel-hand-card.summon.active .duel-action-choice {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.14), var(--shadow-sm);
}

.duel-hand-card.mahoraga-ritual .duel-action-choice {
  border-color: rgba(212, 175, 55, 0.68);
  background: linear-gradient(135deg, #09090b 0%, #18181b 48%, #3f2f11 100%);
  color: #f8e7ad;
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.24), 0 12px 26px rgba(9, 9, 11, 0.22);
}

.duel-hand-card.mahoraga-ritual .duel-action-choice:hover:not(:disabled),
.duel-hand-card.mahoraga-ritual.active .duel-action-choice {
  border-color: #f6d365;
  background: linear-gradient(135deg, #030303 0%, #141414 42%, #5f4516 100%);
  box-shadow: 0 0 0 2px rgba(246, 211, 101, 0.22), 0 14px 30px rgba(9, 9, 11, 0.28);
}

.duel-hand-card.mahoraga-ritual .duel-action-card-type,
.duel-hand-card.mahoraga-ritual .duel-action-risk,
.duel-hand-card.mahoraga-ritual .duel-action-cost,
.duel-hand-card.mahoraga-ritual .duel-summon-preview {
  border-color: rgba(246, 211, 101, 0.34);
  background: rgba(246, 211, 101, 0.12);
  color: #f8e7ad !important;
}

.duel-hand-card.mahoraga-ritual .duel-action-status,
.duel-hand-card.mahoraga-ritual .duel-action-effect,
.duel-hand-card.mahoraga-ritual .duel-action-tags,
.duel-hand-card.mahoraga-ritual .duel-action-numeric-brief,
.duel-hand-card.mahoraga-ritual .duel-action-subtitle {
  color: #f5d98b;
}

.duel-summon-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  min-width: 0;
  color: #1e3a8a;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.duel-summon-preview b {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border-radius: 4px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
}

.duel-action-choice:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.duel-hand-card.active .duel-action-choice:disabled {
  cursor: default;
  opacity: 1;
}

.duel-action-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.duel-action-subtitle {
  color: #475569 !important;
  font-size: 11px;
  font-weight: 800;
}

.duel-hand-card.mahoraga-ritual .duel-action-title {
  color: #fff4bf;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
}

.duel-hand-card.mahoraga-ritual .duel-action-subtitle {
  color: #f6d365 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.duel-selected-order-badge {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 118, 110, 0.12);
  color: #0f766e !important;
  font-size: 11px;
  font-weight: 900;
}

.duel-action-choice span,
.duel-action-choice em {
  line-height: 1.45;
}

.duel-action-choice span:not(.duel-action-title) {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.duel-action-cost {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(180, 35, 24, 0.08);
  color: var(--accent) !important;
  overflow-wrap: anywhere;
}

.duel-action-compact-stats {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
}

.duel-action-compact-stats i {
  display: inline-flex;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.duel-action-attack {
  background: rgba(15, 118, 110, 0.1);
  color: #0f766e !important;
}

.duel-action-defense {
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8 !important;
}

.duel-action-numeric-brief {
  color: #334155 !important;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.duel-action-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.duel-action-card-type,
.duel-action-rarity,
.duel-action-risk {
  display: inline-flex;
  max-width: 100%;
  padding: 1px 5px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.duel-action-rarity {
  color: #7c2d12;
  background: rgba(251, 146, 60, 0.1);
}

.duel-action-risk {
  color: #7c2d12;
  background: rgba(251, 146, 60, 0.1);
}

.duel-action-effect,
.duel-action-tags {
  overflow-wrap: anywhere;
}

.duel-action-choice em {
  color: var(--accent);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.duel-action-status {
  padding-top: 5px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.duel-action-status.selected {
  color: #0f766e;
}

.duel-action-status.blocked {
  color: var(--accent);
}

.duel-hand-detail {
  padding: 0 6px 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.88);
  color: var(--muted);
  font-size: 11px;
}

.duel-hand-detail > summary,
.duel-card-developer-details > summary,
.duel-hand-debug > summary {
  cursor: pointer;
  color: var(--ink);
  font-weight: 900;
}

.duel-card-detail-grid {
  display: grid;
  gap: 8px;
  padding-top: 8px;
}

.duel-card-detail-section {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.duel-card-detail-section h5 {
  margin: 0;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.duel-card-detail-section ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 16px;
}

.duel-card-detail-section li {
  margin: 0;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-action-choice {
  min-height: 74px !important;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 8px;
  padding: 8px 10px;
}

body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-action-title,
body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-action-compact-stats {
  align-self: center;
}

body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-action-compact-stats {
  justify-content: flex-end;
}

body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-action-subtitle,
body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-action-card-meta,
body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-action-numeric-brief,
body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-summon-preview,
body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-action-effect,
body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-action-tags,
body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-hand-detail {
  display: none;
}

body.duel-compact-cards .duel-hand-card:not(.active):not(:focus-within) .duel-action-status {
  grid-column: 1 / -1;
  padding-top: 4px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  white-space: normal;
}

body.duel-lite-mode *:not(.shibuya-incident-page):not(.shibuya-incident-page *):not(.shibuya-modal):not(.shibuya-modal *):not(.shibuya-cinematic):not(.shibuya-cinematic *),
body.duel-lite-mode *:not(.shibuya-incident-page):not(.shibuya-incident-page *):not(.shibuya-modal):not(.shibuya-modal *):not(.shibuya-cinematic):not(.shibuya-cinematic *)::before,
body.duel-lite-mode *:not(.shibuya-incident-page):not(.shibuya-incident-page *):not(.shibuya-modal):not(.shibuya-modal *):not(.shibuya-cinematic):not(.shibuya-cinematic *)::after {
  animation: none !important;
  scroll-behavior: auto !important;
  transition: none !important;
  transform: none !important;
  filter: none !important;
  backdrop-filter: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
}

body.duel-lite-mode .wheel-rotor {
  transition: transform var(--wheel-spin-duration, 300ms) cubic-bezier(.12,.74,.14,1) !important;
  transform: rotate(var(--wheel-rotation, 0deg)) !important;
  will-change: transform;
}

body.duel-lite-mode,
body.duel-lite-mode::before,
body.duel-lite-mode::after,
body.duel-lite-mode .duel-battle-shell,
body.duel-lite-mode .duel-battle-panel,
body.duel-lite-mode .duel-action-panel,
body.duel-lite-mode .duel-action-choice,
body.duel-lite-mode .duel-hand-card,
body.duel-lite-mode .duel-resource-card,
body.duel-lite-mode .duel-resource-side {
  background-image: none !important;
}

body.duel-lite-mode .duel-action-choice::before,
body.duel-lite-mode .duel-action-choice::after,
body.duel-lite-mode .duel-hand-card::before,
body.duel-lite-mode .duel-hand-card::after,
body.duel-lite-mode .duel-action-panel::before,
body.duel-lite-mode .duel-action-panel::after {
  content: none !important;
  display: none !important;
}

body.duel-lite-mode .duel-skin-preview-grid,
body.duel-lite-mode .duel-floating-combat-text,
body.duel-lite-mode .duel-bg-ornament,
body.duel-lite-mode .duel-card-detail-section,
body.duel-lite-mode .duel-summon-preview,
body.duel-lite-mode .duel-action-tags,
body.duel-lite-mode .duel-action-subtitle,
body.duel-lite-mode .duel-action-card-meta,
body.duel-lite-mode .duel-action-numeric-brief,
body.duel-lite-mode .duel-action-effect,
body.duel-lite-mode .duel-hand-detail,
body.duel-lite-mode .duel-card-developer-details,
body.duel-lite-mode .duel-hand-debug,
body.duel-lite-mode .duel-domain-profile-card,
body.duel-lite-mode .duel-residual-log,
body.duel-lite-mode .duel-beta-feedback-panel,
body.duel-lite-mode .duel-hand-pool-hint {
  display: none !important;
}

body.duel-lite-mode .duel-battle-shell,
body.duel-lite-mode .duel-battle-panel,
body.duel-lite-mode .duel-hand-card,
body.duel-lite-mode .duel-action-choice,
body.duel-lite-mode .duel-resource-card {
  background: var(--paper-strong) !important;
  box-shadow: none !important;
  filter: none !important;
}

body.duel-lite-mode .duel-hand-card,
body.duel-lite-mode .duel-action-choice {
  contain: layout style paint;
  min-height: auto !important;
}

body.duel-lite-mode .duel-battle-log {
  max-height: 220px;
}

body.duel-lite-mode .duel-visual-settings-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.duel-pipeline-report-panel {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
  padding: 0.65rem 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(248, 250, 252, 0.72);
  color: #334155;
  font-size: 0.9rem;
}

@media (hover: none), (pointer: coarse), (max-width: 640px) {
  .duel-action-choice,
  .duel-hand-discard-btn {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  .duel-action-choice {
    transition: none !important;
  }

  .duel-action-choice:hover:not(:disabled) {
    transform: none;
  }

  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-action-choice {
    min-height: 74px !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 8px;
    padding: 8px 10px;
  }

  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-action-title,
  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-action-compact-stats {
    align-self: center;
  }

  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-action-compact-stats {
    justify-content: flex-end;
  }

  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-action-subtitle,
  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-action-card-meta,
  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-action-numeric-brief,
  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-summon-preview,
  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-action-effect,
  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-action-tags,
  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-hand-detail {
    display: none;
  }

  body.duel-compact-cards .duel-hand-card:not(.active):focus-within .duel-action-status {
    grid-column: 1 / -1;
    padding-top: 4px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    white-space: normal;
  }

  body.duel-lite-mode .jjk-battle-shell,
  body.duel-lite-mode .duel-battle-shell,
  body.duel-lite-mode .duel-board,
  body.duel-lite-mode .duel-battle-grid {
    gap: 8px !important;
  }

  body.duel-lite-mode .duel-battle-panel,
  body.duel-lite-mode .duel-resource-card,
  body.duel-lite-mode .duel-action-choice {
    border-radius: 8px !important;
    padding: 8px !important;
  }

  body.duel-lite-mode .duel-hand-list,
  body.duel-lite-mode .duel-domain-hand-list {
    gap: 6px !important;
  }
}

.duel-card-developer-details,
.duel-hand-debug {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  color: #64748b;
  font-size: 11px;
}

.duel-card-developer-details dl,
.duel-hand-debug dl {
  display: grid;
  grid-template-columns: minmax(82px, max-content) minmax(0, 1fr);
  gap: 3px 8px;
  margin: 6px 0 0;
}

.duel-card-developer-details dt,
.duel-card-developer-details dd,
.duel-hand-debug dt,
.duel-hand-debug dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.duel-card-developer-details dt,
.duel-hand-debug dt {
  color: #475569;
  font-weight: 900;
}

.duel-beta-feedback-panel {
  margin: 0 0 12px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: rgba(248, 250, 252, 0.9);
  box-shadow: var(--shadow-sm);
}

.duel-beta-feedback-panel summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  cursor: pointer;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.duel-beta-feedback-panel summary span {
  color: var(--muted);
  font-size: 12px;
}

.duel-beta-feedback-body {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duel-beta-feedback-body p,
.duel-beta-feedback-body ul {
  margin: 0;
}

.duel-beta-feedback-body ul {
  padding-left: 18px;
}

.duel-beta-feedback-note {
  display: grid;
  gap: 5px;
}

.duel-beta-feedback-note textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

.duel-beta-feedback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.duel-beta-feedback-output {
  max-height: 220px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 11px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.duel-interaction {
  display: grid;
  grid-template-columns: minmax(260px, 0.9fr) minmax(320px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.duel-native-nav {
  display: none;
}

.duel-native-report-pane {
  display: contents;
}

.duel-tactic-panel,
.duel-round-panel {
  border: 1px solid #d6dee8;
  border-radius: 8px;
  padding: 14px;
  background: rgba(248, 250, 252, 0.9);
  box-shadow: var(--shadow-sm);
}

.duel-tactic-panel summary,
.duel-round-panel h4 {
  margin: 0 0 10px;
}

.duel-tactic-panel summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  list-style: none;
}

.duel-tactic-panel summary::-webkit-details-marker {
  display: none;
}

.duel-tactic-panel summary strong {
  font-size: 16px;
}

.duel-tactic-panel summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  text-align: right;
}

.duel-tactics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.duel-tactic {
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 10px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.duel-tactic strong,
.duel-tactic span {
  display: block;
}

.duel-tactic strong {
  margin-bottom: 4px;
}

.duel-tactic span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.duel-tactic.active {
  border-color: var(--accent);
  background: #fff8f7;
  box-shadow: 0 0 0 2px rgba(180, 35, 24, 0.12), var(--shadow-sm);
}

.duel-tactic:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: #b8c7d9;
}

.duel-tactic:disabled {
  cursor: default;
  opacity: 0.72;
}

.duel-current-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.duel-current-choice span {
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
}

.duel-current-choice strong {
  color: var(--ink);
}

.duel-round-panel .primary {
  width: 100%;
}

.duel-auto-stage {
  display: grid;
  gap: 12px;
}

.duel-auto-meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  background: #e8eef4;
  box-shadow: inset 0 1px 3px rgba(15, 23, 42, 0.12);
}

.duel-auto-meter span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #0f766e, #b42318);
  transition: width 420ms ease;
}

.duel-auto-latest,
.duel-auto-empty {
  min-height: 96px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.duel-auto-latest {
  display: grid;
  gap: 5px;
}

.duel-auto-latest span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
}

.duel-auto-latest p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.duel-auto-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.duel-log {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.duel-log.empty {
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.duel-log li {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.duel-log li span {
  grid-row: span 2;
  color: var(--accent);
  font-weight: 900;
}

.duel-log li p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.duel-result {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  background: linear-gradient(90deg, #ecfdf5, #ffffff);
  box-shadow: var(--shadow-sm);
}

.duel-result span {
  color: #166534;
  font-size: 12px;
  font-weight: 900;
}

.duel-result strong {
  font-size: 22px;
}

.duel-result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.duel-ai-battle {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(22, 101, 52, 0.18);
}

.duel-ai-battle .secondary {
  justify-self: start;
}

.duel-ai-battle p {
  color: var(--ink);
}

.duel-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.duel-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.96), rgba(247, 245, 238, 0.96)),
    var(--paper-strong);
  padding: 14px 14px 14px 18px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.duel-card::before {
  content: "";
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 8px;
  width: 2px;
  background: rgba(180, 35, 24, 0.24);
}

.duel-card h3 {
  position: relative;
  margin: 0 0 6px;
  font-size: 20px;
}

.duel-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 12px;
}

.duel-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid rgba(169, 159, 144, 0.78);
  border-radius: 4px;
  background: #f3efe4;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duel-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.duel-stat {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #fffdf7, #f0ece1);
}

.duel-stat .character-panel-stat-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.duel-stat .character-panel-stat-grade {
  display: block;
  margin-top: 4px;
  font-size: clamp(26px, 4vw, 34px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.character-panel-stat {
  align-content: start;
  min-width: 0;
}

.character-panel-stat-value {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.character-rank-reference {
  grid-column: 1 / -1;
  min-width: 0;
  margin-top: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper-strong);
  overflow: hidden;
}

.character-rank-reference summary {
  padding: 11px 13px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.character-rank-reference-scroll {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.character-rank-reference table {
  width: 100%;
  min-width: 430px;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.character-rank-reference th,
.character-rank-reference td {
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

.character-rank-reference thead th {
  color: var(--muted);
  font-size: 11px;
}

.character-rank-reference tbody th {
  color: var(--accent);
  font-size: 16px;
}

.character-rank-reference td {
  color: var(--text);
  font-size: 12px;
}

.character-rank-reference > p {
  margin: 0;
  padding: 9px 12px 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.online-rank-reference {
  margin-top: 10px;
  border-color: rgba(148, 163, 184, 0.28);
  background: rgba(255, 255, 255, 0.62);
}

.duel-block {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.duel-block dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.duel-block dd {
  margin: 0;
  line-height: 1.6;
}

.current-panel h2 {
  margin: 12px 0 8px;
  font-size: 26px;
  line-height: 1.25;
}

.why-text {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.7;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(180, 35, 24, 0.52);
  border-radius: 4px;
  background: rgba(255, 247, 237, 0.72);
  color: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.wheel-area {
  min-height: 280px;
  border: 1px dashed var(--line-dark);
  border-radius: var(--radius);
  background: var(--soft);
  padding: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 253, 247, 0.72);
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.wheel-layout {
  display: grid;
  grid-template-columns: 1fr;
  place-items: center;
}

.wheel-stage {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
}

.wheel-rotor {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 10px solid #fff;
  overflow: hidden;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(15, 23, 42, 0.05);
  transform: rotate(0deg);
  will-change: transform;
}

.wheel-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
}

.wheel-slice {
  stroke: #fff;
  stroke-width: 2.4px;
  stroke-linejoin: round;
}

.wheel-slice.selected {
  filter: brightness(1.08) saturate(1.08);
}

.wheel-inner-guide {
  fill: none;
  stroke: rgba(255, 255, 255, 0.62);
  stroke-width: 1.2px;
}

.wheel-label-layer {
  pointer-events: none;
}

.wheel-label {
  fill: #fff;
  font-weight: 900;
  text-anchor: middle;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: rgba(0, 0, 0, 0.18);
  stroke-width: 3px;
  stroke-linejoin: round;
}

.wheel-label.selected {
  fill: #fffde7;
  stroke: #ff006e;
  stroke-width: 5px;
}

.wheel-pointer {
  position: absolute;
  z-index: 3;
  top: -8px;
  left: 50%;
  width: 34px;
  height: 44px;
  background: linear-gradient(180deg, #ff3b8d 0%, #b42318 100%);
  clip-path: polygon(50% 100%, 0 0, 100% 0);
  transform: translateX(-50%);
  filter: drop-shadow(0 5px 6px rgba(180, 35, 24, 0.3));
  pointer-events: none;
}

.wheel-hub {
  position: absolute;
  z-index: 2;
  width: 118px;
  height: 118px;
  border-radius: 50%;
  border: 8px solid #fff;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.16);
}

.wheel-debug-list {
  width: min(100%, 540px);
  max-height: 220px;
  overflow: auto;
  margin-top: 14px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.wheel-debug-row {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 7px 8px;
  border-bottom: 1px solid #edf0f5;
  font-size: 13px;
}

.wheel-debug-row:last-child {
  border-bottom: 0;
}

.wheel-lite-option-list {
  display: grid;
  width: min(100%, 540px);
  max-height: min(38vh, 280px);
  overflow: auto;
  gap: 6px;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
}

body.duel-lite-mode .wheel-label-layer {
  display: none !important;
}

.wheel-lite-option {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.wheel-lite-option .swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.wheel-lite-option.selected {
  border-color: var(--accent);
  background: #fff7ed;
  color: var(--accent-dark);
  font-weight: 900;
}

body.duel-lite-mode .wheel-lite-option-list {
  max-height: min(42vh, 320px);
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.weight {
  color: var(--muted);
  font-size: 12px;
}

.result-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(47, 111, 104, 0.32);
  border-left: 5px solid var(--accent-2);
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.88), rgba(237, 244, 238, 0.86)),
    #f4fbf6;
  border-radius: 6px;
  box-shadow: var(--shadow-sm);
}

.result-card.custom-run-result {
  border-left-color: var(--custom);
  background: var(--custom-bg);
  box-shadow: inset 0 0 0 1px var(--custom-line);
}

.custom-run-mark {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 8px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fed7aa;
  color: var(--custom);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.result-card strong {
  display: block;
  margin-bottom: 4px;
}

.result-red-alert {
  color: #dc2626;
  font-weight: 900;
}

.computed-grade-card {
  width: min(100%, 460px);
  margin: 12px auto 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper-strong);
  box-shadow: 0 10px 24px rgba(53, 45, 32, 0.1);
}

.computed-grade-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.computed-grade-card strong {
  display: block;
  margin: 4px 0 8px;
  font-size: 30px;
  line-height: 1;
}

.computed-grade-card p {
  margin: 6px 0 0;
  color: var(--text);
}

.result-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

.result-accumulated {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #99f6e4;
}

.result-accumulated span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.result-accumulated ol {
  margin: 0;
  padding-left: 22px;
}

.result-accumulated li {
  margin: 3px 0;
  overflow-wrap: anywhere;
}

.action-row,
.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.top-donation-btn {
  min-height: 40px;
  border: 1px solid #9c3f28;
  background: linear-gradient(135deg, #d86a35 0%, #b33b35 58%, #8f2f45 100%);
  color: #fff9ed;
  font-weight: 900;
  letter-spacing: 0.02em;
  box-shadow: 0 5px 14px rgba(151, 51, 47, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

.top-donation-btn:hover:not(:disabled) {
  border-color: #7f2b2f;
  background: linear-gradient(135deg, #e57939 0%, #c5433a 58%, #9d3450 100%);
  color: #ffffff;
}

.top-donation-btn:focus-visible {
  outline: 3px solid rgba(216, 106, 53, 0.34);
  outline-offset: 2px;
}

.debug-toggle,
.ai-free-toggle {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--paper-strong);
  color: var(--muted);
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-sm);
}

.debug-toggle:has(input:disabled) {
  opacity: 0.56;
  cursor: not-allowed;
}

.debug-settings-panel {
  gap: 10px;
}

.debug-settings-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ai-settings-debug-toggle {
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
}

.ai-settings-debug-toggle small {
  color: var(--muted);
  line-height: 1.45;
}

.play-mode-control {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 4px;
  border: 1px solid var(--line-dark);
  border-radius: 6px;
  background: var(--panel-2);
  box-shadow: var(--shadow-sm);
}

.play-mode-control legend {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.play-mode-control label {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 5px 10px;
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}

.play-mode-control input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.play-mode-control label:has(input:checked) {
  background: var(--paper-strong);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(180, 35, 24, 0.36), var(--shadow-sm);
}

.debug-toggle input,
.ai-free-toggle input {
  accent-color: var(--accent);
}

.ai-free-toggle small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

body.ai-free-enabled .ai-free-toggle {
  color: var(--ink);
  border-color: rgba(47, 111, 104, 0.72);
  background: #f0fdfa;
}

body.debug-mode .debug-toggle {
  color: var(--ink);
  border-color: var(--accent);
  background: #fff7ed;
}

.action-row {
  margin-top: 14px;
}

.current-panel > .action-row {
  min-height: 44px;
  align-items: center;
}

.primary,
.secondary {
  min-height: 40px;
  padding: 8px 15px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 8px 18px rgba(15, 118, 110, 0.14);
}

.secondary {
  background: var(--paper-strong);
  color: var(--ink);
  border-color: var(--line-dark);
  box-shadow: var(--shadow-sm);
}

.secondary.mini {
  min-height: 30px;
  padding: 4px 9px;
  font-size: 12px;
}

.primary:hover:not(:disabled),
.secondary:hover:not(:disabled) {
  transform: translateY(-1px);
}

.primary:hover:not(:disabled) {
  background: var(--accent-dark);
}

.secondary:hover:not(:disabled) {
  border-color: var(--line-dark);
  background: var(--panel-2);
}

.primary:disabled,
.secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-grid button {
  text-align: left;
  background: var(--paper-strong);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.choice-grid button:hover {
  border-color: var(--accent-3);
}

.choice-grid button.selected {
  border-color: var(--accent-3);
  background: #fff7ed;
  box-shadow: inset 5px 0 0 var(--stamp);
}

.state-list {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 10px;
  margin: 12px 0 0;
}

.state-list dt {
  color: var(--muted);
}

.state-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.strength-summary {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.score-line {
  display: grid;
  grid-template-columns: 92px 1fr 42px;
  gap: 8px;
  align-items: center;
}

.score-note {
  margin: -4px 0 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
}

.instant-combat-card {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #cde7df;
  border-radius: 8px;
  background: #f7fffc;
  box-shadow: var(--shadow-sm);
}

.instant-combat-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
  margin-bottom: 8px;
  font-weight: 800;
}

.instant-combat-head strong {
  font-size: 22px;
  color: var(--accent-2);
}

.instant-meta {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 4px 8px;
  margin: 0 0 10px;
  font-size: 12px;
}

.instant-meta dt {
  color: var(--muted);
}

.instant-meta dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.instant-axis .bar span {
  background: var(--accent-2);
}

.flow-tree {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.flow-review-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-review-summary span,
.flow-condition {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 5px 9px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.flow-review-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  padding: 14px;
  min-width: 0;
  max-width: 100%;
}

.flow-review-critical {
  border-color: rgba(180, 35, 24, 0.32);
  background: #fff8f4;
}

.flow-review-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.flow-review-heading h3 {
  margin: 0;
  font-size: 1.05rem;
}

.flow-graph-section {
  background: #1f242d;
  border-color: #343b47;
  color: #f6f0e7;
  overflow: hidden;
}

.flow-graph-section .flow-review-heading {
  position: sticky;
  top: 0;
  z-index: 8;
  align-items: flex-start;
  padding: 8px 0 10px;
  background: linear-gradient(180deg, #1f242d 78%, rgba(31, 36, 45, 0));
}

.flow-graph-section .muted,
.flow-graph-section .flow-review-heading h3 {
  color: #f6f0e7;
}

.flow-graph-toolbar {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.flow-graph-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.flow-graph-controls .secondary {
  min-height: 32px;
  padding: 0 10px;
  border-color: rgba(246, 240, 231, 0.24);
  background: rgba(255, 255, 255, 0.08);
  color: #f6f0e7;
}

.flow-graph-controls .secondary.active {
  border-color: #f0c46b;
  background: rgba(240, 196, 107, 0.18);
}

.flow-graph-viewport {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: auto;
  height: clamp(420px, 72vh, 760px);
  border: 1px solid #343b47;
  border-radius: 8px;
  background: #20242d;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
  cursor: grab;
  overscroll-behavior: contain;
  touch-action: none;
  scrollbar-color: #6f7888 #20242d;
  scrollbar-width: thin;
}

.flow-graph-viewport:focus-visible {
  outline: 2px solid rgba(240, 196, 107, 0.75);
  outline-offset: 2px;
}

.flow-graph-viewport.is-panning {
  cursor: grabbing;
  user-select: none;
}

.flow-graph-svg {
  display: block;
  max-width: none;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    #20242d;
  background-size: 34px 34px;
}

.flow-graph-band rect {
  fill: rgba(255, 255, 255, 0.026);
  stroke: rgba(255, 255, 255, 0.05);
}

.flow-graph-band text {
  fill: rgba(246, 240, 231, 0.42);
  font-size: 18px;
  font-weight: 900;
}

.flow-graph-edge {
  fill: none;
  stroke: rgba(246, 240, 231, 0.34);
  stroke-width: 1.2;
  marker-end: url(#flowArrowMuted);
}

.flow-graph-edge.sequence {
  stroke: rgba(112, 194, 186, 0.6);
  stroke-width: 1.5;
  marker-end: url(#flowArrow);
}

.flow-graph-edge.route {
  stroke: rgba(240, 196, 107, 0.58);
  stroke-width: 1.4;
  stroke-dasharray: 5 4;
  marker-end: url(#flowArrow);
}

.flow-graph-edge.option {
  stroke: rgba(246, 240, 231, 0.18);
  stroke-width: 0.9;
  marker-end: none;
}

#flowArrow path {
  fill: rgba(240, 196, 107, 0.82);
}

#flowArrowMuted path {
  fill: rgba(246, 240, 231, 0.38);
}

.flow-graph-node rect {
  fill: #f7f2e8;
  stroke: rgba(255, 255, 255, 0.28);
}

.flow-graph-node.timeline rect {
  fill: #dcefed;
}

.flow-graph-node.special rect {
  fill: #f3e6c8;
}

.flow-graph-node.period rect {
  fill: #303743;
  stroke: rgba(240, 196, 107, 0.45);
}

.graph-node-title {
  fill: #151a20;
  font-size: 13px;
  font-weight: 900;
}

.graph-node-meta {
  fill: #59616b;
  font-size: 11px;
  font-weight: 800;
}

.flow-graph-node.period .graph-node-title,
.flow-graph-node.period .graph-node-meta {
  fill: #f6f0e7;
}

.flow-graph-option rect {
  fill: #ffffff;
  stroke: rgba(246, 240, 231, 0.32);
}

.flow-graph-option text {
  fill: #1f252b;
  font-size: 10px;
  font-weight: 800;
}

.flow-graph-option.muted rect {
  fill: #363d49;
}

.flow-graph-option.muted text {
  fill: rgba(246, 240, 231, 0.72);
}

.flow-branch-list {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.flow-branch-list.compact {
  padding-left: 18px;
}

.flow-review-node {
  padding-left: 2px;
}

.flow-review-node details,
.flow-period {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.flow-period + .flow-period {
  margin-top: 10px;
}

.flow-review-node summary,
.flow-period > summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  min-height: 44px;
}

.flow-node-order {
  width: 26px;
  min-width: 26px;
  height: 26px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.flow-node-title {
  font-weight: 900;
  overflow-wrap: anywhere;
}

.flow-node-body {
  border-top: 1px solid var(--line);
  padding: 12px;
  display: grid;
  gap: 12px;
}

.flow-node-meta,
.flow-dynamic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.flow-dynamic-list span {
  border: 1px dashed var(--line-dark);
  border-radius: 8px;
  padding: 6px 8px;
  background: var(--panel-2);
}

.flow-option-group {
  display: grid;
  gap: 8px;
}

.flow-option-group-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.flow-option-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
}

.flow-option-item {
  border-left: 3px solid rgba(47, 111, 104, 0.32);
  padding: 8px 0 8px 10px;
}

.flow-option-head {
  display: grid;
  grid-template-columns: minmax(80px, auto) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.flow-option-head code {
  font-size: 0.78rem;
  color: var(--accent-3);
  font-weight: 900;
}

.flow-option-head span {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.flow-option-head em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  white-space: nowrap;
}

.flow-route-notes {
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 5px;
}

.flow-route-notes li {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

.route-kind {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 900;
}

.route-next {
  background: #e7f5f2;
  color: var(--accent-2);
}

.route-block {
  background: #fff1f0;
  color: var(--accent);
}

.wheel-library {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.library-wheel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
}

.library-uncovered {
  background: #fffaf0;
  border-color: #f4c66f;
}

.library-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.library-heading h3 {
  margin: 0;
  font-size: 1rem;
}

.library-wheel ol {
  margin: 0;
  padding-left: 20px;
}

.library-wheel li {
  margin: 6px 0;
  color: var(--text);
}

.library-wheel li em {
  color: var(--muted);
  font-style: normal;
  margin-left: 6px;
}

.stage-band {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.stage-band:first-child {
  border-top: 0;
  padding-top: 0;
}

.stage-title {
  margin: 0 0 10px;
  font-size: 18px;
}

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

.node-card {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fff;
}

.node-card h4 {
  margin: 0 0 6px;
  font-size: 15px;
}

.node-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.tagline {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag {
  padding: 2px 7px;
  background: #eef2ff;
  color: #3730a3;
  border-radius: 999px;
  font-size: 12px;
}

.result-log {
  display: grid;
  gap: 10px;
}

.custom-run-banner {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--custom-line);
  border-left: 5px solid var(--custom);
  border-radius: 6px;
  background: var(--custom-bg);
  color: var(--custom);
}

.custom-run-banner strong {
  font-size: 16px;
}

.custom-run-banner span {
  color: #9a3412;
  line-height: 1.5;
}

.log-row {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.log-row.custom-run-log-row {
  border-color: var(--custom-line);
  background: #fffaf5;
}

.log-row.skipped {
  background: #fafafa;
  color: var(--muted);
}

.backtrack-btn {
  margin-top: 8px;
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: #fff7ed;
  color: var(--accent);
  cursor: pointer;
}

.backtrack-btn:hover {
  background: #ffedd5;
}

.log-title {
  font-weight: 700;
}

.custom-run-chip {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #fed7aa;
  color: var(--custom);
  font-size: 12px;
  font-weight: 800;
}

.export-box {
  max-height: 360px;
  overflow: auto;
  padding: 12px;
  background: #101828;
  color: #f9fafb;
  border-radius: 6px;
  white-space: pre-wrap;
}

.creator-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin: 12px 0;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  color: var(--muted);
  font-size: 13px;
}

.field input,
.field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 9px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  box-shadow: var(--shadow-sm);
}

.template-preview {
  margin-top: 12px;
}

.ai-panel .ai-intro {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.ai-provider-settings {
  display: grid;
  gap: 12px;
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.global-settings-panel {
  display: grid;
  gap: 14px;
  margin: 14px 0 0;
}

.global-settings-panel[hidden] {
  display: none;
}

.settings-gear {
  white-space: nowrap;
}

.ai-provider-settings-summary {
  border-style: dashed;
  background: rgba(255, 255, 255, 0.45);
}

.ai-provider-settings .creator-grid {
  margin: 0;
}

.ai-mode-panel {
  display: grid;
  gap: 10px;
}

.ai-provider-meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.checkbox-field {
  align-content: start;
}

.checkbox-field input {
  width: auto;
  min-height: 20px;
  justify-self: start;
  box-shadow: none;
}

.action-row.compact {
  gap: 8px;
  margin-top: 0;
}

.ai-output {
  min-height: 260px;
  max-height: 640px;
  margin-top: 12px;
  overflow: auto;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: var(--paper-strong);
  padding: 18px;
  color: var(--ink);
  line-height: 1.85;
  white-space: normal;
}

.ai-output h3 {
  margin: 0 0 14px;
  font-size: 22px;
  line-height: 1.35;
}

.ai-output p {
  margin: 0 0 14px;
  text-indent: 2em;
}

.ai-output p:last-child {
  margin-bottom: 0;
}

.ai-output .ai-bullet {
  text-indent: 0;
  padding-left: 1em;
  border-left: 3px solid rgba(180, 35, 24, 0.28);
}

.ai-diagnostics-panel {
  margin-top: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(102, 175, 255, 0.28);
  border-radius: 12px;
  background: rgba(6, 14, 24, 0.72);
}

.ai-diagnostics-panel > summary {
  cursor: pointer;
  font-weight: 700;
  color: #9dccff;
}

.ai-diagnostic-entry {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 3px solid #477dad;
  border-radius: 8px;
  background: rgba(13, 25, 39, 0.9);
  overflow-wrap: anywhere;
}

.ai-diagnostic-entry.is-error {
  border-left-color: #d46b6b;
}

.ai-diagnostic-entry code {
  color: #b9dcff;
}

.error-text {
  color: var(--accent);
  font-weight: 800;
}

.notes-panel li {
  margin: 8px 0;
  line-height: 1.65;
}

@media (max-width: 1180px) {
  .duel-action-choices {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 980px) {
  .run-grid {
    grid-template-columns: 1fr;
  }

  .wheel-layout {
    grid-template-columns: 1fr;
  }

  .ai-free-panel {
    grid-template-columns: 1fr;
  }

  .ai-free-anchor,
  .ai-free-story,
  .ai-free-strategy-section,
  .ai-free-analysis-panel {
    grid-column: 1;
  }

  .ai-free-story {
    grid-row: auto;
  }

  .duel-cards,
  .duel-selectors,
  .online-alpha-grid,
  .online-sync-grid,
  .online-room-grid,
  .online-room-section,
  .online-alpha-status,
  .duel-interaction,
  .duel-resource-panel,
  .duel-domain-profile-grid,
  .duel-action-choices,
  .duel-custom-grid,
  .duel-custom-grid-wide,
  .duel-custom-hand-grid,
  .duel-atomic-effect-toolbar,
  .duel-atomic-effect-fields,
  .duel-library-grid,
  .duel-debug-grid,
  .duel-special-grid {
    grid-template-columns: 1fr;
  }

  .duel-custom-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .flow-review-heading,
  .flow-review-node summary,
  .flow-period > summary,
  .flow-option-head {
    align-items: stretch;
  }

  .flow-review-heading {
    flex-direction: column;
  }

  .flow-option-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .flow-option-head em {
    white-space: normal;
  }

  .duel-battle-status {
    grid-template-columns: 1fr;
  }

  .duel-side-score.right {
    text-align: left;
  }

  .wheel-stage {
    max-width: 420px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 767px) {
  .duel-character-workbench,
  .duel-special-card-workspace {
    grid-template-columns: 1fr;
  }

  .duel-character-workbench,
  .duel-custom-interface,
  .duel-special-card-editor,
  .duel-atomic-effect-editor {
    padding: 8px;
  }

  .duel-character-workbench > *,
  .duel-special-card-workspace > * {
    grid-column: 1 / -1;
    min-width: 0;
  }

  .duel-ai-designer-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
  }

  .duel-custom-hand-summary {
    grid-column: 1 / -1;
  }

  .duel-workbench-toolbar {
    top: max(4px, env(safe-area-inset-top));
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 8px;
  }

  .duel-workbench-toolbar > button {
    min-width: 0;
  }

  .duel-workbench-mobile-nav {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin-left: 0;
  }

  .duel-workbench-mobile-nav button {
    min-width: 0;
    padding-inline: 4px;
  }

  .duel-atomic-effect-item {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .duel-atomic-effect-item .duel-custom-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (prefers-reduced-motion: reduce) {
  .duel-workbench-toolbar,
  .duel-atomic-effect-item {
    scroll-behavior: auto;
    transition: none;
  }
}

@media (max-width: 980px) {
  .duel-action-choices {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .duel-domain-hand-choices {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
}

@media (max-width: 640px) {
  .online-duel-intel-grid {
    grid-template-columns: 1fr;
  }

  .online-duel-intel-card,
  .online-duel-intel-card:nth-child(2) {
    text-align: left;
  }

  .online-duel-intel-card:nth-child(2) .online-duel-intel-head {
    flex-direction: row;
  }

  .online-duel-intel-card:nth-child(2) .online-duel-chips {
    justify-content: flex-start;
  }

  .online-duel-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .online-duel-intel-detail {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  main,
  .topbar,
  .tabs {
    padding-left: 14px;
    padding-right: 14px;
  }

  .topbar {
    gap: 10px;
  }

  .topbar h1 {
    flex-wrap: wrap;
    gap: 6px;
    font-size: 19px;
    overflow-wrap: anywhere;
  }

  .topbar h1::before {
    min-height: 20px;
    padding: 2px 6px;
    font-size: 9px;
  }

  .topbar p {
    margin-top: 4px;
    font-size: 12px;
  }

  .feedback-contact {
    min-height: 24px;
    padding: 2px 7px;
    font-size: 12px;
  }

  .top-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .top-donation-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .play-mode-control {
    width: 100%;
    min-width: 0;
  }

  .play-mode-control label {
    flex: 1;
    justify-content: center;
    padding: 5px 8px;
  }

  #restartBtn {
    min-width: 88px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .ai-free-toggle {
    grid-column: 1 / -1;
    width: 100%;
    align-items: flex-start;
  }

  .ai-free-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .tabs {
    overflow-x: auto;
    gap: 8px;
    scroll-snap-type: x proximity;
  }

  .tab {
    min-width: max-content;
    scroll-snap-align: start;
  }

  .log-row,
  .state-list {
    grid-template-columns: 1fr;
  }

  .wheel-area {
    padding: 14px;
  }

  .duel-summary {
    grid-template-columns: 1fr;
  }

  .duel-match-summary-card.right {
    text-align: left;
  }

  .duel-versus {
    min-height: 28px;
  }

  .duel-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .duel-battle-empty,
  .duel-battle-head,
  .douna-gauntlet-head,
  .douna-leaderboard-head,
  .online-alpha-head,
  .online-official-status,
  .online-section-title,
  .duel-custom-head,
  .duel-custom-item {
    flex-direction: column;
  }

  .duel-atomic-effect-item {
    align-items: stretch;
    flex-direction: column;
  }

  .douna-leaderboard-entry {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .douna-leaderboard-entry.header {
    display: none;
  }

  .douna-leaderboard-roster {
    grid-column: 1 / -1;
  }

  .online-turn-actions {
    justify-content: flex-start;
  }

  .duel-action-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .duel-action-toolbar-buttons {
    justify-content: flex-start;
  }

  .duel-hand-control-buttons,
  .duel-beta-feedback-actions {
    justify-content: flex-start;
  }

  .duel-hand-control-buttons .mini,
  .duel-beta-feedback-actions .mini {
    min-height: 34px;
  }

  .duel-selected-hand-list li {
    grid-template-columns: 22px minmax(0, 1fr);
  }

  .duel-selected-hand-list li em {
    grid-column: 2;
  }

  .duel-custom-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .duel-custom-hand-summary {
    grid-column: 1 / -1;
  }

  .duel-custom-actions {
    justify-content: flex-start;
  }

  .duel-tactics,
  .duel-current-choice {
    grid-template-columns: 1fr;
  }

  .debug-force {
    grid-template-columns: 1fr;
  }

  .debug-force .muted {
    grid-column: 1;
  }

  .debug-entry-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .debug-entry-grid {
    grid-template-columns: 1fr;
  }

  .half-custom-panel {
    grid-template-columns: 1fr;
  }

  .half-custom-panel .muted {
    grid-column: 1;
  }

  .wheel-stage {
    max-width: 280px;
  }

  .wheel-hub {
    width: 76px;
    height: 76px;
    border-width: 6px;
  }
}

@media (max-width: 640px) {
  .login-card-actions,
  .login-card-manager-grid {
    grid-template-columns: 1fr;
  }

  .login-card-editor-text,
  .login-card-stat-grid,
  .login-card-hand-editor-row {
    grid-template-columns: 1fr;
  }

  .archive-encyclopedia-entry {
    align-items: stretch;
  }

  .archive-encyclopedia-open {
    width: 100%;
  }

  .archive-encyclopedia.is-floating {
    right: 10px;
    top: 92px;
    width: calc(100vw - 20px);
    height: min(72vh, 560px);
    max-height: calc(100vh - 104px);
    resize: vertical;
  }

  .archive-encyclopedia-toolbar {
    grid-template-columns: 1fr;
  }

  .login-card-gate,
  .login-tutorial-panel {
    padding:
      max(8px, env(safe-area-inset-top, 0px))
      max(8px, env(safe-area-inset-right, 0px))
      max(8px, env(safe-area-inset-bottom, 0px))
      max(8px, env(safe-area-inset-left, 0px));
  }

  body .login-card-panel {
    width: 100% !important;
    max-height: calc(100vh - 16px);
    max-height: calc(100dvh - 16px);
    gap: 12px;
    padding: clamp(12px, 4vw, 20px) !important;
  }

  .login-card-panel-copy {
    gap: 6px;
  }

  .login-card-panel-copy h2 {
    font-size: clamp(1.3rem, 7vw, 1.75rem);
  }

  .login-card-panel-copy p {
    font-size: 0.9rem;
    line-height: 1.45;
  }

  .login-card-actions {
    gap: 8px;
  }

  .login-acquisition-grid {
    gap: 8px;
  }

  .login-acquisition-option {
    min-height: 68px;
    padding: 10px 8px;
    gap: 3px;
  }

  .login-card-actions button {
    min-height: 44px;
    padding: 9px 10px;
  }

  .login-lite-mode-option {
    min-height: 34px;
    padding: 6px 8px;
  }

  #loginCardStatus,
  .login-card-status-loading {
    margin: 0;
    padding: 8px 10px;
    font-size: 0.82rem;
    line-height: 1.4;
  }

  .login-tutorial-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    justify-content: stretch;
    width: 100%;
  }

  .login-tutorial-actions button {
    min-width: 0;
    padding-left: 10px;
    padding-right: 10px;
  }

  .login-tutorial-card {
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }

  .login-tutorial-head,
  .login-tutorial-body,
  .login-tutorial-nav {
    padding-left: 16px;
    padding-right: 16px;
  }

  .login-tutorial-head {
    grid-template-columns: auto minmax(160px, 1fr);
    align-items: start;
    row-gap: 8px;
    padding-top: 16px;
  }

  .login-tutorial-head h2 {
    align-self: center;
    font-size: 1.28rem;
    line-height: 1.2;
    writing-mode: horizontal-tb;
    text-orientation: mixed;
    white-space: nowrap;
    overflow-wrap: normal;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .duel-action-toolbar-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .duel-action-toolbar-buttons .mini {
    width: 100%;
  }

  .duel-action-choice {
    min-height: 0;
    padding: 7px;
  }

  .duel-action-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .duel-domain-hand-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .duel-domain-hand-head span {
    text-align: left;
  }

  .duel-action-title {
    font-size: 12px;
  }

  .duel-action-choice span:not(.duel-action-title),
  .duel-action-choice em {
    font-size: 10px;
  }
}

@media (max-width: 640px) and (orientation: portrait) {
  .duel-battle,
  .duel-action-panel,
  .duel-resource-panel,
  .duel-battle-log,
  .duel-residual-log {
    contain: layout paint;
  }

  .duel-action-panel,
  .duel-hand-card,
  .duel-resource-side,
  .duel-log-entry {
    contain: layout paint;
    overflow-anchor: none;
  }

  .duel-action-panel {
    gap: 10px;
    padding: 9px;
    border-radius: 8px;
    transform: translateZ(0);
  }

  .duel-action-head,
  .duel-action-meta,
  .duel-domain-hand-head {
    align-items: stretch;
    flex-direction: column;
  }

  .duel-action-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .duel-action-toolbar {
    position: sticky;
    top: 0;
    z-index: 3;
  }

  .duel-hand-choices,
  .duel-domain-hand-choices {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .duel-hand-card {
    transform: translateZ(0);
  }

  body:not(.duel-compact-cards) .duel-hand-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .duel-card-detail-grid {
    grid-template-columns: 1fr;
  }

  body.duel-card-skin-v224 .duel-hand-card .duel-action-choice::before,
  body.duel-card-skin-custom .duel-hand-card .duel-action-choice::before,
  .duel-hand-card.duel-card-skin-v224 .duel-action-choice::before,
  .duel-hand-card.duel-card-skin-custom .duel-action-choice::before {
    display: block !important;
  }
}

@media (max-width: 420px) {
  .top-actions {
    grid-template-columns: 1fr;
  }

  #restartBtn {
    width: 100%;
  }
}

.online-spectator-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--border, #d8dee8);
}

.online-spectator-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.online-spectator-meta strong,
.online-spectator-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.online-spectator-meta span {
  color: var(--muted);
  font-size: 0.9rem;
}

.online-spectator-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.online-spectator-actions button {
  white-space: nowrap;
}

body.online-spectator-mode .topbar,
body.online-spectator-mode .wheel-layout,
body.online-spectator-mode .jjk-battle-tabs,
body.online-spectator-mode .jjk-battle-section-head,
body.online-spectator-mode .online-alpha-panel > .online-alpha-head,
body.online-spectator-mode .online-sync-section,
body.online-spectator-mode .online-room-section,
body.online-spectator-mode #duelSummary,
body.online-spectator-mode #duelCards,
body.online-spectator-mode .duel-panel-head {
  display: none !important;
}

body.online-spectator-mode .online-prepare-section .online-section-title,
body.online-spectator-mode .online-prepare-section #onlineLockCharacterBtn,
body.online-spectator-mode .online-prepare-section #onlineUnlockCharacterBtn {
  display: none !important;
}

body.online-spectator-mode .online-prepare-section {
  display: none;
  justify-content: flex-end;
  padding: 8px 16px;
  border: 0;
  background: transparent;
}

body.online-spectator-mode #onlineWatchRoomBtn {
  display: none;
}

body.online-spectator-mode .app-shell,
body.online-spectator-mode .panel,
body.online-spectator-mode .jjk-battle-page,
body.online-spectator-mode .online-alpha-panel {
  max-width: none;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

body.online-spectator-mode.battle-focus-mode .app-shell {
  width: 100%;
  max-width: none;
  margin-inline: auto;
}

body.online-spectator-mode .online-battle-section {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 0;
  background: #f6f7fb;
}

body.online-spectator-mode .online-alpha-status,
body.online-spectator-mode .online-player-grid,
body.online-spectator-mode .online-special-spectator-panel,
body.online-spectator-mode .online-douna-roster-grid {
  max-width: 1180px;
  width: min(1180px, calc(100vw - 24px));
  margin-inline: auto;
}

body.online-spectator-mode .online-turn-actions,
body.online-spectator-mode .online-debug-panel {
  display: none !important;
}

.duel-spectator-stage {
  box-sizing: border-box;
  width: 100%;
  max-width: 100vw;
  margin-inline: auto;
  min-height: calc(100vh - 56px);
  padding: 12px;
  background: #f6f7fb;
}

.duel-spectator-focus-actions {
  position: sticky;
  top: 0;
  z-index: 35;
  display: flex;
  justify-content: flex-end;
  margin: -4px -4px 8px;
  padding: 4px;
  background: rgba(246, 247, 251, 0.94);
}

.duel-spectator-top {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.duel-spectator-layout {
  display: grid;
  grid-template-columns: minmax(160px, 22vw) minmax(280px, 1fr) minmax(160px, 22vw);
  gap: 10px;
  align-items: start;
}

.duel-spectator-hand {
  position: sticky;
  top: 58px;
  max-height: calc(100vh - 76px);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--border, #d8dee8);
  background: #fff;
  border-radius: 8px;
}

.duel-spectator-hand h4 {
  margin: 0 0 8px;
  font-size: 0.95rem;
}

.duel-spectator-hand-list {
  display: grid;
  gap: 8px;
}

.duel-spectator-hand .duel-hand-card {
  font-size: 0.78rem;
}

.duel-spectator-hand .duel-action-choice {
  min-height: 0;
  padding: 7px;
  text-align: left;
  cursor: default;
}

.duel-spectator-hand .duel-action-title {
  font-size: 0.82rem;
}

.duel-spectator-hand .duel-action-subtitle,
.duel-spectator-hand .duel-action-effect,
.duel-spectator-hand .duel-action-card-meta {
  font-size: 0.72rem;
}

.duel-spectator-hand .duel-action-choice * {
  overflow-wrap: anywhere;
}

.duel-spectator-center .duel-round-panel {
  transform-origin: top center;
}

@media (max-width: 860px) {
  .duel-spectator-layout {
    grid-template-columns: 1fr;
  }

  .duel-spectator-hand {
    position: static;
    max-height: none;
  }
}

/* V3.6 modern shell: low-noise surfaces, rounded controls and combat focus. */
:root {
  --surface-page: #f4f6fa;
  --surface-card: #ffffff;
  --surface-soft: #f8fafc;
  --surface-accent: #eef2ff;
  --ink-strong: #172033;
  --ink-muted: #657087;
  --line-soft: #e3e8f1;
  --brand-modern: #5b5bd6;
  --brand-modern-strong: #4545b8;
  --radius-card: 22px;
  --radius-control: 14px;
  --shadow-card: 0 10px 32px rgba(33, 45, 75, 0.07);
}

html {
  scroll-behavior: auto;
  background: var(--surface-page);
}

body {
  color: var(--ink-strong);
  background: var(--surface-page);
  text-rendering: optimizeLegibility;
}

.app-shell {
  width: min(1480px, calc(100% - 28px));
  margin-inline: auto;
}

.topbar,
.panel,
.jjk-battle-page,
.jjk-battle-active-surface,
.online-alpha-section,
.douna-gauntlet-panel,
.duel-battle-stage {
  border-color: var(--line-soft);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  background: var(--surface-card);
}

.topbar {
  margin-top: 14px;
  padding: 18px 20px;
}

.topbar h1 {
  margin: 0;
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  letter-spacing: -0.025em;
}

.top-actions {
  gap: 8px;
}

button,
input,
select,
textarea,
.tab,
.jjk-battle-tab,
.jjk-battle-home-card {
  border-radius: var(--radius-control);
}

button {
  min-height: 40px;
  transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease, transform 120ms ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button.primary,
.primary {
  border-color: var(--brand-modern);
  background: var(--brand-modern);
}

button.primary:hover:not(:disabled),
.primary:hover:not(:disabled) {
  border-color: var(--brand-modern-strong);
  background: var(--brand-modern-strong);
}

.tabs,
.jjk-battle-tabs {
  gap: 6px;
  padding: 7px;
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  background: var(--surface-card);
  overflow-x: auto;
  scrollbar-width: thin;
}

.tab,
.jjk-battle-tab {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
}

.tab.active,
.jjk-battle-tab.active {
  color: var(--brand-modern-strong);
  background: var(--surface-accent);
  box-shadow: none;
}

.panel-heading,
.jjk-battle-section-head,
.duel-battle-head {
  gap: 12px;
}

.jjk-battle-home-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.jjk-battle-home-card {
  min-height: 132px;
  padding: 18px;
  border-color: var(--line-soft);
  background: var(--surface-soft);
  box-shadow: none;
}

.jjk-battle-home-card:hover {
  border-color: #bfc7f5;
  background: var(--surface-accent);
}

details {
  border-radius: 16px;
}

details > summary {
  min-height: 44px;
  cursor: pointer;
}

.duel-battle-support-grid,
.duel-resource-panel,
.duel-battlefield-panel,
.duel-domain-profile-panel,
.duel-interaction,
.duel-action-panel,
.duel-beta-feedback-panel,
.duel-replay-meta,
.duel-log,
.duel-residual-log {
  content-visibility: auto;
  contain-intrinsic-size: auto 320px;
}

.duel-battle-stage {
  padding: clamp(12px, 2vw, 22px);
}

.duel-battle-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

body.battle-focus-mode {
  background: #eef1f7;
}

body.battle-focus-mode .app-shell {
  width: min(1540px, calc(100% - 18px));
}

body.battle-focus-mode .topbar,
body.battle-focus-mode .tabs,
body.battle-focus-mode #duel > .duel-panel > .panel-heading,
body.battle-focus-mode #duel > .duel-panel > .jjk-battle-tabs,
body.battle-focus-mode #duel .jjk-battle-page,
body.battle-focus-mode #duel #duelSummary,
body.battle-focus-mode #duel #duelCards,
body.battle-focus-mode #duel .jjk-battle-active-surface > .jjk-battle-section-head {
  display: none !important;
}

body.battle-focus-mode main,
body.battle-focus-mode #duel,
body.battle-focus-mode #duel > .duel-panel,
body.battle-focus-mode #duel .jjk-battle-active-surface {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

body.battle-focus-mode #duel .duel-battle {
  min-height: 100vh;
  padding-block: 9px;
}

@media (max-width: 760px) {
  :root {
    --radius-card: 18px;
    --radius-control: 12px;
    --shadow-card: 0 6px 20px rgba(33, 45, 75, 0.06);
  }

  .app-shell,
  body.battle-focus-mode .app-shell {
    width: min(100% - 12px, 1480px);
  }

  .topbar {
    padding: 14px;
  }

  .topbar .ai-free-toggle small,
  .topbar .play-mode-control small {
    display: none;
  }

  .feedback-contact {
    display: flex;
    width: 100%;
    max-width: 100%;
    min-height: 32px;
    margin-top: 6px;
    padding: 6px 8px;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.45;
    text-align: left;
  }

  .panel,
  .jjk-battle-page,
  .jjk-battle-active-surface {
    padding: 12px;
  }

  .duel-battle-stage {
    padding: 10px;
  }

  .duel-battle-head-actions {
    width: 100%;
    justify-content: stretch;
  }

  .duel-battle-head-actions > button {
    flex: 1 1 145px;
  }

  .duel-turn-execute,
  .duel-turn-execute-bar,
  .duel-online-lock-row {
    position: sticky;
    bottom: 6px;
    z-index: 12;
    padding: 8px;
    border: 1px solid var(--line-soft);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.98);
  }
}

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

@media (max-width: 640px) and (max-height: 600px) {
  body .login-card-panel {
    gap: 8px;
    padding: 10px !important;
  }

  .login-card-panel-copy {
    gap: 4px;
  }

  .login-card-panel-copy h2 {
    font-size: 1.28rem;
  }

  .login-card-panel-copy p {
    font-size: 0.8rem;
    line-height: 1.32;
  }

  .login-acquisition-option {
    min-height: 58px;
    padding: 7px 6px;
  }

  .login-acquisition-title {
    font-size: 0.96rem;
  }

  .login-card-gate .login-acquisition-option small {
    font-size: 0.7rem;
  }

  .login-card-actions button {
    min-height: 40px;
    padding: 6px 8px;
    font-size: 0.82rem;
  }

  .login-lite-mode-option {
    min-height: 30px;
    padding: 4px 7px;
    font-size: 0.8rem;
  }
}

@media (orientation: landscape) and (max-height: 600px) {
  .login-card-gate,
  .login-tutorial-panel,
  .update-modal {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    padding:
      max(4px, env(safe-area-inset-top, 0px))
      max(4px, env(safe-area-inset-right, 0px))
      max(4px, env(safe-area-inset-bottom, 0px))
      max(4px, env(safe-area-inset-left, 0px));
    overflow: hidden;
  }

  body .login-card-panel {
    width: min(820px, 100%) !important;
    max-height: calc(100dvh - 8px) !important;
    gap: 7px;
    padding: 8px 12px !important;
  }

  .update-modal-card {
    width: min(720px, 100%);
    min-width: 0;
    min-height: 0;
    max-height: calc(100dvh - 8px) !important;
    gap: 8px;
    padding: 10px 14px;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .update-modal-head { gap: 4px; }
  .update-modal-head h2 { font-size: clamp(1rem, 5vh, 1.3rem); }
  .update-modal-card ul { gap: 4px; font-size: clamp(.68rem, 2.8vh, .84rem); line-height: 1.35; }
  .update-modal-card .primary { min-height: 34px; padding: 5px 10px; }

  .login-card-panel-copy { gap: 3px; }
  .login-card-panel-copy h2 { font-size: clamp(1rem, 4.2vh, 1.32rem); }
  .login-card-panel-copy p { font-size: clamp(.68rem, 2.7vh, .82rem); line-height: 1.28; }
  .login-acquisition-option { min-height: 46px; padding: 6px 8px; gap: 1px; }
  .login-acquisition-title { font-size: clamp(.86rem, 3.4vh, 1rem); }
  .login-card-gate .login-acquisition-option small { font-size: clamp(.62rem, 2.4vh, .72rem); }
  .login-card-actions button { min-height: 36px; padding: 5px 8px; font-size: .76rem; }
  .login-lite-mode-option { min-height: 26px; padding: 3px 6px; font-size: .72rem; }
  #loginCardStatus,
  .login-card-status-loading { padding: 5px 7px; font-size: .7rem; line-height: 1.25; }
}

/* 涩谷事变：独立活动界面与首次入场演出 */
.shibuya-incident-tab {
  position: relative;
  overflow: hidden;
  border-color: rgba(162, 27, 37, 0.65) !important;
  color: #f3d49b !important;
  background: linear-gradient(118deg, #09090c 0 36%, #5f0c16 58%, #120a0d 100%) !important;
  isolation: isolate;
}

.shibuya-incident-tab::before {
  content: "";
  position: absolute;
  inset: -70% -25%;
  z-index: -1;
  background: conic-gradient(from 90deg, transparent, rgba(226, 42, 49, 0.5), transparent 35%);
  animation: shibuyaTabSweep 4.8s linear infinite;
}

.shibuya-incident-tab span {
  display: inline-block;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 1.05em;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-shadow: 0 0 8px rgba(239, 38, 49, 0.75), 1px 1px 0 #000;
  transform: skewX(-7deg);
}

.shibuya-incident-tab:hover span,
.shibuya-incident-tab.active span {
  animation: shibuyaTabPulse 0.9s steps(2, end) infinite;
}

.shibuya-home-card {
  color: #f7e7c1;
  border-color: #721421 !important;
  background:
    radial-gradient(circle at 82% 20%, rgba(173, 23, 33, 0.46), transparent 34%),
    repeating-linear-gradient(132deg, rgba(255,255,255,.025) 0 2px, transparent 2px 9px),
    #09090c !important;
}

.shibuya-home-card strong { color: #e8bd70; font-family: "STKaiti", "KaiTi", serif; letter-spacing: .18em; }

@keyframes shibuyaTabSweep { to { transform: rotate(360deg); } }
@keyframes shibuyaTabPulse { 50% { filter: brightness(1.35); transform: skewX(-7deg) translateY(-1px); } }

.shibuya-incident-page {
  --shibuya-ink: #07070a;
  --shibuya-panel: #121216;
  --shibuya-red: #c42135;
  --shibuya-red-deep: #65101c;
  --shibuya-gold: #e7bd62;
  --shibuya-amber: #c98b3d;
  --shibuya-ivory: #f8f1e2;
  --shibuya-muted: #b9b3ad;
  position: relative;
  overflow: hidden;
  color: var(--shibuya-ivory);
  border: 1px solid #55454a;
  border-radius: 22px;
  padding: clamp(14px, 2.5vw, 28px);
  background:
    linear-gradient(rgba(7,7,9,.965), rgba(7,7,9,.965)),
    repeating-linear-gradient(135deg, #3b151d 0 1px, transparent 1px 14px);
  box-shadow: inset 0 0 90px rgba(144, 13, 31, .22), 0 18px 45px rgba(0,0,0,.32);
}

.shibuya-incident-page::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: .11;
  pointer-events: none;
  background: url("./assets/shibuya/operation-map.svg") center top / cover no-repeat;
  mix-blend-mode: screen;
}

.shibuya-incident-page > * { position: relative; z-index: 1; }

.shibuya-page-head,
.shibuya-section-title,
.shibuya-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.shibuya-page-head { margin-bottom: 18px; padding: 6px 4px 14px; border-bottom: 1px solid rgba(231,189,98,.2); }
.shibuya-page-head h3 { margin: 2px 0 0; color: #f1d599; font-family: "STKaiti", "KaiTi", serif; font-size: clamp(2rem, 5vw, 4rem); letter-spacing: .2em; text-shadow: 3px 3px 0 #5e111b; }
.shibuya-incident-page .shibuya-page-head h3 {
  width: auto !important;
  padding: 0 !important;
  border: 0 !important;
  color: #f1d599 !important;
  background: transparent !important;
  box-shadow: none !important;
}
.shibuya-incident-page #shibuyaAccessStatus,
.shibuya-incident-page .muted { color: #bdb6ae !important; }
.shibuya-kicker { color: #c9b68d; font-size: .75rem; letter-spacing: .32em; }
.shibuya-head-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.shibuya-incident-page .shibuya-head-actions .secondary {
  border-color: #8d4b53 !important;
  color: #f2dadd !important;
  background: rgba(72, 22, 29, .92) !important;
}
.shibuya-enter-button {
  border: 1px solid #be4050 !important;
  color: #fff4d8 !important;
  background: linear-gradient(110deg, #30070d, #941523 58%, #2a070c) !important;
  box-shadow: 0 0 20px rgba(167, 23, 36, .35), inset 0 0 10px rgba(255,255,255,.08) !important;
}

.shibuya-hud {
  display: grid;
  grid-template-columns: repeat(4, minmax(100px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.shibuya-hud > div {
  position: relative;
  overflow: hidden;
  min-height: 70px;
  padding: 11px 14px 10px;
  border: 1px solid #3b2c31;
  border-radius: 4px 13px 13px 4px;
  background: linear-gradient(135deg, rgba(28,27,31,.98), rgba(12,12,15,.98));
}

.shibuya-hud > div::after { content: ""; position: absolute; right: -18px; bottom: -28px; width: 66px; height: 66px; border: 1px solid rgba(231,189,98,.12); transform: rotate(45deg); }

.shibuya-hud span { display: block; color: #b7b0ae; font-size: .72rem; letter-spacing: .1em; }
.shibuya-hud strong { color: #f1d599; font-size: 1.2rem; }
.shibuya-hud small { display: block; margin-top: 4px; color: #9f9892; font-size: .58rem; line-height: 1.35; letter-spacing: .015em; }
.shibuya-operation-strip {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(150px, .34fr);
  align-items: stretch;
  gap: 0;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid rgba(231,189,98,.35);
  border-radius: 6px 18px 18px 6px;
  background: linear-gradient(110deg, rgba(43,34,18,.96), rgba(17,17,21,.98) 42%, rgba(9,9,12,.98));
  box-shadow: 0 12px 28px rgba(0,0,0,.28), inset 0 1px rgba(255,255,255,.035);
}
.shibuya-operation-strip[data-tone="crimson"],
.shibuya-operation-strip[data-tone="red"] { border-color: rgba(196,33,53,.62); background: linear-gradient(110deg, rgba(91,15,27,.9), rgba(22,16,20,.98) 44%, rgba(9,9,12,.98)); }
.shibuya-operation-strip[data-tone="amber"] { border-color: rgba(201,139,61,.6); background: linear-gradient(110deg, rgba(75,46,16,.92), rgba(22,18,15,.98) 44%, rgba(9,9,12,.98)); }
.shibuya-operation-strip[data-tone="ivory"] { border-color: rgba(248,241,226,.44); background: linear-gradient(110deg, rgba(58,55,50,.92), rgba(22,22,24,.98) 44%, rgba(9,9,12,.98)); }
.shibuya-route-sigil { display: grid; place-items: center; min-width: 92px; padding: 18px 15px; color: #120e08; background: var(--shibuya-gold); font: 1000 1.15rem/1 ui-monospace, monospace; letter-spacing: .11em; clip-path: polygon(0 0, 100% 0, 82% 100%, 0 100%); }
.shibuya-operation-strip[data-tone="crimson"] .shibuya-route-sigil,
.shibuya-operation-strip[data-tone="red"] .shibuya-route-sigil { color: #fff5e6; background: var(--shibuya-red); }
.shibuya-operation-strip[data-tone="ivory"] .shibuya-route-sigil { background: var(--shibuya-ivory); }
.shibuya-operation-strip[data-tone="amber"] .shibuya-route-sigil { background: var(--shibuya-amber); }
.shibuya-route-copy { padding: 12px 18px; }
.shibuya-route-copy > span { display: block; color: #9f9994; font: 700 .62rem/1.2 ui-monospace, monospace; letter-spacing: .24em; }
.shibuya-route-copy strong { display: block; margin-top: 5px; color: #fff4d9; font-size: 1.12rem; letter-spacing: .14em; }
.shibuya-route-copy p { margin: 5px 0 0; color: #d1cac0; font-size: .78rem; line-height: 1.55; }
.shibuya-route-progress { display: grid; align-content: center; gap: 6px; padding: 12px 18px; border-left: 1px solid rgba(255,255,255,.08); }
.shibuya-route-progress span { color: #bdb6ac; font-size: .67rem; line-height: 1.4; }
.shibuya-route-progress b { color: #f2d48e; font: 800 .75rem/1 ui-monospace, monospace; text-align: right; }
.shibuya-route-progress > i { display: block; height: 5px; overflow: hidden; border-radius: 99px; background: #302d2d; }
.shibuya-route-progress > i > em { display: block; width: 0; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--shibuya-red), var(--shibuya-gold)); transition: width .35s ease; }
.shibuya-route-shift-button { min-height: 30px; padding: 6px 10px; border: 1px solid rgba(232,190,99,.62); border-radius: 6px; color: #f4d99d; background: linear-gradient(135deg, rgba(119,24,28,.72), rgba(20,18,18,.96)); font: 800 .66rem/1.2 ui-monospace, monospace; letter-spacing: .06em; }
.shibuya-route-shift-button:hover:not(:disabled) { border-color: #f0cc7b; box-shadow: 0 0 18px rgba(209,67,49,.24); transform: translateY(-1px); }
.shibuya-stage-brief { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; margin-bottom: 10px; padding: 9px 11px; border: 1px solid rgba(228,190,108,.38); background: rgba(26,20,17,.72); }
.shibuya-stage-brief span,.shibuya-stage-brief em { color: #c9b581; font: 800 .66rem/1 ui-monospace, monospace; }
.shibuya-stage-brief b { color: #fff0ce; letter-spacing: .08em; }
.shibuya-expedition-route-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.shibuya-expedition-route-card { position: relative; min-height: 215px; padding: 14px; overflow: hidden; border: 1px solid #4e4743; border-top: 4px solid #7c2228; border-radius: 5px 14px 14px 5px; background: linear-gradient(150deg,#231315,#0d0d10 66%); }
.shibuya-expedition-route-card.is-recommended { border-color: rgba(232,190,99,.72); border-top-color: var(--shibuya-gold); background: linear-gradient(150deg,#2c2515,#0e0d0d 68%); box-shadow: inset 0 0 28px rgba(231,189,98,.06); }
.shibuya-expedition-route-card header,.shibuya-expedition-route-card footer { display: flex; justify-content: space-between; gap: 8px; color: #a9a19a; font: 700 .62rem/1.4 ui-monospace, monospace; }
.shibuya-expedition-route-card header b { color: #e9c773; letter-spacing: .1em; }
.shibuya-expedition-route-card > strong { display: block; margin-top: 14px; color: #fff0d1; font-size: 1.02rem; letter-spacing: .12em; }
.shibuya-expedition-route-card > small { display: block; margin-top: 5px; color: #b9afa5; line-height: 1.45; }
.shibuya-expedition-route-card > p { min-height: 66px; margin: 13px 0; color: #d4cac0; font-size: .74rem; line-height: 1.58; }
.shibuya-route-shift-hint { margin: 12px 0 0; padding-left: 10px; border-left: 2px solid #8a2c31; color: #beb3aa; font-size: .72rem; }
.shibuya-boon-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.shibuya-boon-card { min-height: 150px; padding: 13px; border: 1px solid rgba(230,190,104,.38); border-top: 3px solid #d8ad58; border-radius: 6px 12px 12px 6px; background: radial-gradient(circle at 80% 10%,rgba(218,170,76,.12),transparent 42%),#121112; }
.shibuya-boon-card header { display: flex; justify-content: space-between; gap: 8px; color: #a9a096; font: 700 .61rem/1.4 ui-monospace,monospace; }
.shibuya-boon-card header b { color: #d9b45e; letter-spacing: .1em; }
.shibuya-boon-card > strong { display: block; margin-top: 14px; color: #fff0ce; letter-spacing: .1em; }
.shibuya-boon-card > p { margin: 11px 0 0; color: #cfc5b9; font-size: .73rem; line-height: 1.58; }
.shibuya-stage-rest-choices { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 14px 0 4px; }
.shibuya-stage-rest-choices article { min-height: 112px; padding: 14px; border: 1px solid rgba(229,190,105,.42); border-radius: 7px 14px 14px 7px; background: linear-gradient(145deg,rgba(105,22,31,.24),rgba(15,15,18,.96)); }
.shibuya-stage-rest-choices article:last-child { border-color: rgba(112,167,189,.46); background: linear-gradient(145deg,rgba(24,71,88,.25),rgba(15,15,18,.96)); }
.shibuya-stage-rest-choices strong { color: #f5d98e; letter-spacing: .1em; }
.shibuya-stage-rest-choices article:last-child strong { color: #a9deef; }
.shibuya-stage-rest-choices p { margin: 10px 0 0; color: #d2c9bd; font-size: .76rem; line-height: 1.55; }
.shibuya-mission-message { min-height: 3.2em; padding: 12px 16px; border-left: 3px solid var(--shibuya-red); color: #eee6d8; background: rgba(136, 17, 31, .11); }
.shibuya-run-surface { contain: layout style; }
.shibuya-run-surface.has-active-encounter .shibuya-mission-message { border-color: #e7b64d; background: rgba(183, 128, 25, .12); }

.shibuya-layout { display: grid; grid-template-columns: minmax(235px, .78fr) minmax(420px, 1.7fr); gap: 14px; align-items: start; }
.shibuya-layout > * { min-width: 0; }
.shibuya-party-panel,
.shibuya-tree-panel,
.shibuya-rankings,
.shibuya-no-run-surface {
  border: 1px solid #4d4144;
  border-radius: 16px;
  padding: 14px;
  background: rgba(17, 17, 20, .94);
  box-shadow: inset 0 1px rgba(255,255,255,.035), 0 10px 28px rgba(0,0,0,.22);
}

.shibuya-section-title { margin-bottom: 12px; color: #e0bb75; font-weight: 800; letter-spacing: .1em; }
.shibuya-section-title small { color: #b2aba9; font-weight: 400; letter-spacing: 0; }
.shibuya-party-list { display: grid; gap: 8px; }
.shibuya-party-member { position: relative; overflow: hidden; padding: 11px; border: 1px solid #3d3436; border-radius: 4px 12px 12px 4px; background: linear-gradient(135deg, #151419, #0b0b0e); }
.shibuya-party-member.is-left { opacity: .48; filter: grayscale(1); }
.shibuya-party-member header { display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 9px; }
.shibuya-party-member header > span { min-width: 0; }
.shibuya-party-member header small { display: block; margin-top: 2px; }
.shibuya-member-mark { display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid #735c32; border-radius: 50%; color: #f0d493; background: #211c13; font-family: "STKaiti", "KaiTi", serif; font-style: normal; font-weight: 900; box-shadow: inset 0 0 0 3px #0e0e11; }
.shibuya-party-member strong { color: #eee0c4; }
.shibuya-party-member small { color: #b7afad; }
.shibuya-resource-line { display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 7px; margin-top: 7px; font-size: .72rem; }
.shibuya-resource-track { height: 6px; overflow: hidden; border-radius: 99px; background: #28262a; }
.shibuya-resource-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #781420, #d54850); }
.shibuya-resource-line.ce .shibuya-resource-track i { background: linear-gradient(90deg, #7c6738, var(--shibuya-gold)); }
.shibuya-member-permanent-buff { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 6px; margin-top: 8px; padding: 6px 8px; border: 1px solid rgba(231,189,98,.34); border-radius: 7px; color: #e8c778; background: rgba(85,57,13,.22); font-size: .7rem; }
.shibuya-member-permanent-buff b { color: #fff0b8; }
.shibuya-member-permanent-buff small { margin: 0; color: #b9afa3; text-align: right; }
.shibuya-member-event-growth { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; padding: 5px 8px; border: 1px solid rgba(174,126,215,.28); border-radius: 7px; color: #cdb3e4; background: rgba(54,28,72,.2); font-size: .68rem; }
.shibuya-member-event-growth b { color: #eadcf5; font-weight: 800; text-align: right; }
.shibuya-growth-choice-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin-top: 12px; }
.shibuya-growth-choice { min-height: 104px; padding: 12px; border: 1px solid #554a3a; border-radius: 8px; background: linear-gradient(145deg, rgba(55,43,23,.78), rgba(15,15,19,.96)); }
.shibuya-growth-choice strong { color: #f5d98f; font: 900 1rem/1.1 "STKaiti", "KaiTi", serif; }
.shibuya-growth-choice p { margin: 9px 0 0; color: #d0c7bb; font-size: .76rem; line-height: 1.55; }
.shibuya-growth-choice.tone-ceControl { border-color: rgba(142,103,190,.7); background: linear-gradient(145deg, rgba(56,31,77,.85), rgba(14,13,20,.96)); }
.shibuya-growth-choice.tone-martial { border-color: rgba(181,62,72,.72); background: linear-gradient(145deg, rgba(79,24,29,.82), rgba(17,12,15,.96)); }

@media (max-width: 640px) {
  .shibuya-growth-choice-grid { grid-template-columns: 1fr; }
  .shibuya-growth-choice { min-height: auto; }
}

.shibuya-branch-overview { display: grid; grid-template-columns: repeat(5, minmax(108px, 1fr)); gap: 6px; margin-bottom: 10px; overflow-x: auto; scrollbar-width: thin; }
.shibuya-branch-chip { position: relative; min-width: 108px; padding: 9px 10px 10px; border: 1px solid #3e3839; border-top: 3px solid #71695f; border-radius: 3px 10px 10px 3px; color: #bbb4ac; background: rgba(13,13,16,.92); opacity: .68; }
.shibuya-branch-chip b { display: block; color: #aaa29b; font: 900 .62rem/1 ui-monospace, monospace; }
.shibuya-branch-chip span { display: block; margin-top: 5px; color: #ddd4c8; font-size: .76rem; font-weight: 900; white-space: nowrap; }
.shibuya-branch-chip small { display: block; margin-top: 3px; color: #9e9790; font-size: .61rem; white-space: nowrap; }
.shibuya-branch-chip.active { border-color: var(--shibuya-gold); color: #fff4d8; background: linear-gradient(145deg, #30250f, #121215); opacity: 1; box-shadow: 0 0 16px rgba(231,189,98,.22); }
.shibuya-branch-chip.visited { opacity: .92; }
.shibuya-branch-chip.tone-crimson.active,
.shibuya-branch-chip.tone-red.active { border-color: var(--shibuya-red); background: linear-gradient(145deg, #3c1018, #111114); box-shadow: 0 0 16px rgba(196,33,53,.25); }
.shibuya-branch-chip.tone-amber.active { border-color: var(--shibuya-amber); background: linear-gradient(145deg, #39240f, #111114); }
.shibuya-branch-chip.tone-ivory.active { border-color: var(--shibuya-ivory); background: linear-gradient(145deg, #34322e, #111114); }
.shibuya-map-legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 5px 2px 10px; color: #aaa39d; font-size: .63rem; letter-spacing: .05em; }
.shibuya-map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.shibuya-map-legend i { width: 7px; height: 7px; border-radius: 50%; background: var(--shibuya-gold); box-shadow: 0 0 7px rgba(231,189,98,.4); }
.shibuya-map-legend i.branch { background: var(--shibuya-ivory); box-shadow: none; }
.shibuya-map-legend i.danger { background: var(--shibuya-red); box-shadow: 0 0 7px rgba(196,33,53,.5); }

.shibuya-event-tree-viewport {
  height: clamp(420px, 58vh, 680px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: #8a692f #111115;
  scrollbar-width: thin;
  border: 1px solid #2f292b;
  border-radius: 15px;
  background: #0a0a0c;
  box-shadow: inset 0 0 24px rgba(0,0,0,.34);
}
.shibuya-event-tree-viewport:focus-visible { outline: 3px solid rgba(231,189,98,.72); outline-offset: 3px; }
.shibuya-event-tree-viewport::-webkit-scrollbar { width: 10px; }
.shibuya-event-tree-viewport::-webkit-scrollbar-track { background: #111115; }
.shibuya-event-tree-viewport::-webkit-scrollbar-thumb { border: 2px solid #111115; border-radius: 99px; background: linear-gradient(var(--shibuya-gold), #7e2733); }
.shibuya-event-tree {
  position: relative;
  min-height: 100%;
  padding: 26px clamp(8px, 3vw, 30px) 42px;
  background:
    linear-gradient(rgba(8,8,11,.82), rgba(8,8,11,.94)),
    url("./assets/shibuya/operation-map.svg") center / cover no-repeat,
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,.025) 31px 32px),
    #0a0a0c;
}
.shibuya-event-tree::before { content: ""; position: absolute; top: 44px; bottom: 48px; left: 50%; width: 3px; background: linear-gradient(var(--shibuya-gold), #5c5554 32%, var(--shibuya-red) 78%, transparent); box-shadow: 0 0 14px rgba(228,185,86,.18); }
.shibuya-tree-node-wrap { position: relative; display: flex; justify-content: center; padding: 0 0 34px; }
.shibuya-tree-node-wrap::after { content: ""; position: absolute; left: 50%; bottom: 16px; width: 8px; height: 8px; border: 2px solid #8b8582; border-radius: 50%; background: var(--shibuya-ink); transform: translateX(-50%); }
.shibuya-tree-node-wrap:nth-child(odd):not(.lane-locked) { transform: translateX(-10%); }
.shibuya-tree-node-wrap:nth-child(even):not(.lane-locked) { transform: translateX(10%); }
.shibuya-tree-node-wrap.lane-enter { transform: translateX(-22%); }
.shibuya-tree-node-wrap.lane-locked { transform: translateX(24%); opacity: .62; }
.shibuya-tree-node {
  position: relative;
  z-index: 1;
  width: min(360px, 90%);
  min-width: 180px;
  padding: 12px 15px 14px;
  border: 1px solid #736d6a;
  border-left-width: 4px;
  border-radius: 5px 16px 16px 5px;
  color: var(--shibuya-ivory);
  text-align: left;
  background: linear-gradient(135deg, #18181b, #0d0d0f);
  box-shadow: 0 9px 24px rgba(0,0,0,.46), inset 0 1px rgba(255,255,255,.04);
}
.shibuya-incident-page .shibuya-tree-node {
  border-width: 1px 1px 1px 4px !important;
  border-style: solid !important;
  border-color: #736d6a !important;
  border-radius: 5px 16px 16px 5px !important;
  color: var(--shibuya-ivory) !important;
  background: linear-gradient(135deg, #18181b, #0d0d0f) !important;
  box-shadow: 0 9px 24px rgba(0,0,0,.46), inset 0 1px rgba(255,255,255,.04) !important;
}
.shibuya-incident-page .shibuya-tree-node[data-node-type="enter"],
.shibuya-incident-page .shibuya-tree-node[data-node-type="event"] { border-color: var(--shibuya-gold) !important; }
.shibuya-incident-page .shibuya-tree-node[data-node-type="battle"] { border-color: #c84451 !important; background: linear-gradient(135deg, #241217, #0d0d0f 70%) !important; }
.shibuya-incident-page .shibuya-tree-node[data-node-type="rest"] { border-color: var(--shibuya-muted) !important; background: linear-gradient(135deg, #202023, #0e0e10) !important; }
.shibuya-incident-page .shibuya-tree-node[data-node-type="accident"] { border-color: #8f6269 !important; background: linear-gradient(135deg, #25171b, #101012) !important; }
.shibuya-incident-page .shibuya-tree-node[data-node-type="emergency"] { color: #ff6977 !important; border-color: #e1253b !important; background: #09090b !important; box-shadow: 0 0 18px rgba(225, 33, 53, .32), 0 9px 24px rgba(0,0,0,.5) !important; }
.shibuya-incident-page .shibuya-tree-node[data-node-type="deathBattle"] { color: #ff263d !important; background: linear-gradient(145deg, #070707, #2e230b) !important; box-shadow: 0 0 20px rgba(225, 25, 45, .5) !important; animation: shibuyaDeathNode 1.2s ease-in-out infinite alternate; }
.shibuya-incident-page .shibuya-tree-node.current { cursor: pointer; border-color: var(--shibuya-gold) !important; color: #fff8e7 !important; background: linear-gradient(135deg, #2c2413, #121214 72%) !important; box-shadow: 0 0 22px rgba(228,185,86,.34), 0 9px 24px rgba(0,0,0,.48) !important; animation: shibuyaNodeGlow 1.3s ease-in-out infinite alternate; }
.shibuya-incident-page .shibuya-tree-node.is-in-battle { outline: 3px solid rgba(241, 213, 153, .78); outline-offset: 4px; box-shadow: 0 0 28px rgba(224, 178, 77, .62) !important; }
.shibuya-incident-page .shibuya-tree-node.completed { color: #d2ceca !important; border-color: var(--shibuya-muted) !important; background: linear-gradient(135deg, #202023, #111113) !important; opacity: .86; }
.shibuya-incident-page .shibuya-tree-node.locked { cursor: not-allowed; color: #8d8885 !important; border-color: #514d4c !important; background: #101012 !important; }
.shibuya-node-meta { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 7px; }
.shibuya-node-index { color: var(--shibuya-gold); font: 900 .7rem/1 ui-monospace, monospace; letter-spacing: .14em; }
.shibuya-node-kind { padding: 3px 7px; border: 1px solid currentColor; border-radius: 99px; color: #bdb6b2; font-size: .61rem; font-style: normal; font-weight: 800; letter-spacing: .08em; }
.shibuya-node-title { display: block; font-weight: 900; letter-spacing: .12em; }
.shibuya-node-coordinate { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.shibuya-node-coordinate b { color: #f2d791; font: 900 .72rem/1 ui-monospace, monospace; letter-spacing: .12em; }
.shibuya-node-coordinate em { color: #a9a29c; font: 800 .61rem/1 ui-monospace, monospace; letter-spacing: .1em; }
.shibuya-node-place { display: block; margin-top: 5px; color: #a9a29b; font-size: .67rem; letter-spacing: .06em; }
.shibuya-tree-node small { display: block; margin-top: 6px; color: #d3ccc3; font-size: .72rem; line-height: 1.45; opacity: 1; }
.shibuya-incident-page .shibuya-tree-node[data-route-tone="crimson"],
.shibuya-incident-page .shibuya-tree-node[data-route-tone="red"] { border-color: var(--shibuya-red) !important; }
.shibuya-incident-page .shibuya-tree-node[data-route-tone="amber"] { border-color: var(--shibuya-amber) !important; }
.shibuya-incident-page .shibuya-tree-node[data-route-tone="ivory"] { border-color: var(--shibuya-ivory) !important; }
@keyframes shibuyaNodeGlow { to { filter: brightness(1.1); box-shadow: 0 0 26px rgba(228,185,86,.48), 0 9px 24px rgba(0,0,0,.48); } }
@keyframes shibuyaDeathNode { to { filter: brightness(1.35); box-shadow: 0 0 26px rgba(225, 25, 45, .72); } }

.shibuya-rankings { margin-top: 16px; content-visibility: auto; contain-intrinsic-size: 360px; }
.shibuya-rank-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.shibuya-rank-grid > section { padding: 12px; border: 1px solid #362f31; border-radius: 12px; background: #0d0d11; }
.shibuya-rank-grid h4 { margin: 0 0 9px; color: #d9b56f; }
.shibuya-incident-page .shibuya-rank-grid h4 { color: #e4c57f !important; background: transparent !important; text-shadow: none !important; }
.shibuya-incident-page .shibuya-rankings .mini { border-color: #74613a !important; color: #f1d698 !important; background: linear-gradient(135deg, #292111, #111114) !important; box-shadow: 0 5px 14px rgba(0,0,0,.25) !important; }
.shibuya-rank-row { display: grid; grid-template-columns: 36px 1fr auto; gap: 8px; padding: 7px 5px; border-top: 1px solid #272326; }
.shibuya-rank-row:first-child { border-top: 0; }
.shibuya-rank-row em { color: #d8aa51; font-style: normal; font-weight: 900; }
.shibuya-no-run-surface { color: #a59ca0; text-align: center; }

.shibuya-modal {
  position: fixed;
  inset: 0;
  z-index: 2147482800;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 5, 8, .78);
  backdrop-filter: blur(7px);
}
.shibuya-modal[hidden] { display: none; }
.shibuya-modal-card { width: min(680px, 96vw); max-height: 88vh; overflow: auto; overscroll-behavior: contain; padding: 20px; border: 1px solid #7e2733; border-radius: 18px; color: #e7ded2; background: linear-gradient(150deg, #171419, #09090d); box-shadow: 0 24px 80px #000; }
.shibuya-modal-head h2 { margin: 0; color: #ebca89 !important; font-family: "STKaiti", "KaiTi", serif; text-shadow: 2px 2px 0 rgba(126, 39, 51, .58); }
.shibuya-modal-body { margin: 16px 0; line-height: 1.75; }
.shibuya-modal-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.shibuya-modal .shibuya-modal-actions > button,
.shibuya-modal .shibuya-modal-head > button {
  border: 1px solid #75653f !important;
  color: #f0d89f !important;
  background: linear-gradient(145deg, #292212, #111115) !important;
  box-shadow: 0 6px 18px rgba(0,0,0,.28) !important;
}
.shibuya-modal .shibuya-modal-actions > button:hover:not(:disabled),
.shibuya-modal .shibuya-modal-head > button:hover:not(:disabled) {
  border-color: #e7bd62 !important;
  color: #fff7e4 !important;
  transform: translateY(-1px);
}
.shibuya-modal .shibuya-modal-actions > button.primary {
  border-color: #b93949 !important;
  color: #fff5dc !important;
  background: linear-gradient(120deg, #4b0c14, #a01c2c 58%, #31070d) !important;
  box-shadow: 0 7px 22px rgba(160, 28, 44, .28) !important;
}
.shibuya-member-choice { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; width: 100%; margin: 8px 0; padding: 12px; border: 1px solid #3b3034 !important; border-radius: 11px; color: #f2eadc !important; text-align: left; background: #111116 !important; box-shadow: 0 8px 20px rgba(0,0,0,.28) !important; }
.shibuya-member-choice:hover { border-color: #c23b4d; box-shadow: 0 0 0 2px rgba(162, 41, 57, .2); }
.shibuya-boss-buff-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin: 14px 0 4px; }
.shibuya-boss-buff-card { display: grid; gap: 5px; min-height: 96px; padding: 12px; border: 1px solid #5f4e38; border-left: 4px solid var(--shibuya-gold); border-radius: 4px 12px 12px 4px; background: linear-gradient(145deg, #211b12, #0e0e12 70%); box-shadow: 0 8px 20px rgba(0,0,0,.24); }
.shibuya-boss-buff-card b { color: #f1ce82; font-size: .92rem; }
.shibuya-boss-buff-card span { color: #d5cbbd; font-size: .78rem; line-height: 1.55; }
.shibuya-boss-buff-card em { color: #d56b77; font-size: .7rem; font-style: normal; }
.shibuya-boss-buff-card.is-disabled { border-color: #3c3538; border-left-color: #6c6265; filter: saturate(.35); opacity: .68; }
.shibuya-boss-mechanic-eyebrow { margin: 0 0 8px; color: #e0b866; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.shibuya-boss-mechanic-intro { position: relative; margin: 0 0 16px; padding: 3px 3px 3px 14px; color: #f1e7d9; font-size: .96rem; line-height: 1.82; text-wrap: pretty; }
.shibuya-boss-mechanic-intro::before { content: ""; position: absolute; inset: 4px auto 4px 0; width: 2px; background: linear-gradient(#d8ae58, rgba(169,47,64,.35)); box-shadow: 0 0 12px rgba(216,174,88,.24); }
.shibuya-boss-mechanic-guide { display: grid; gap: 8px; padding-top: 2px; }
.shibuya-boss-mechanic-guide-label { display: flex; align-items: center; gap: 9px; margin: 0; color: #b9aaa0; font-size: .69rem; font-weight: 900; letter-spacing: .18em; }
.shibuya-boss-mechanic-guide-label::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(185,170,160,.42), transparent); }
.shibuya-boss-mechanic-rules { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.shibuya-boss-mechanic-rules > li { position: relative; padding: 8px 10px 8px 24px; border-bottom: 1px solid rgba(91,72,74,.55); color: #d8cfc4; font-size: .86rem; line-height: 1.62; background: linear-gradient(90deg, rgba(70,20,28,.18), transparent 82%); }
.shibuya-boss-mechanic-rules > li::before { content: "◆"; position: absolute; left: 7px; top: 9px; color: #bd4656; font-size: .52rem; text-shadow: 0 0 8px rgba(189,70,86,.45); }
.shibuya-boss-mechanic-clear { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; margin: 14px 0 0; padding: 11px 12px; border: 1px solid #6c5430; border-radius: 9px; color: #f0e5d4; background: rgba(109, 74, 24, .18); }
.shibuya-boss-mechanic-clear strong { color: #e0b866; white-space: nowrap; }
.shibuya-boss-mechanic-clear span { min-width: 0; line-height: 1.58; overflow-wrap: anywhere; }
.shibuya-branch-intro { margin: 0 0 12px; color: #cfc6b8; }
.shibuya-branch-choice-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.shibuya-branch-choice-card { position: relative; overflow: hidden; min-height: 190px; padding: 14px; border: 1px solid #554b48; border-top: 4px solid var(--shibuya-gold); border-radius: 4px 14px 14px 4px; background: linear-gradient(145deg, #1d1b1b, #0d0d10); box-shadow: 0 10px 25px rgba(0,0,0,.24); }
.shibuya-branch-choice-card::after { content: ""; position: absolute; right: -32px; bottom: -45px; width: 110px; height: 110px; border: 1px solid rgba(231,189,98,.13); transform: rotate(45deg); }
.shibuya-branch-choice-card > header { display: flex; justify-content: space-between; gap: 8px; }
.shibuya-branch-choice-card > header b { color: #f0cc7b; font: 900 .68rem/1 ui-monospace, monospace; letter-spacing: .12em; }
.shibuya-branch-choice-card > header span { color: #9f9891; font-size: .61rem; text-align: right; }
.shibuya-branch-choice-card > strong { display: block; margin-top: 13px; color: #fff1d1; font-size: 1.05rem; letter-spacing: .12em; }
.shibuya-branch-choice-card > small { display: block; margin-top: 3px; color: #aaa29b; }
.shibuya-branch-choice-card > p { margin: 13px 0; color: #d2c9bb; font-size: .75rem; line-height: 1.55; }
.shibuya-branch-choice-card > footer { display: flex; justify-content: space-between; gap: 8px; color: #b6aea5; font: 700 .62rem/1.4 ui-monospace, monospace; }
.shibuya-branch-choice-card.tone-crimson,
.shibuya-branch-choice-card.tone-red { border-top-color: var(--shibuya-red); background: linear-gradient(145deg, #2c1116, #0d0d10); }
.shibuya-branch-choice-card.tone-amber { border-top-color: var(--shibuya-amber); background: linear-gradient(145deg, #2a1c0f, #0d0d10); }
.shibuya-branch-choice-card.tone-ivory { border-top-color: var(--shibuya-ivory); background: linear-gradient(145deg, #2a2926, #0d0d10); }
.shibuya-story-stamp { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: center; margin-bottom: 14px; padding: 9px 11px; border: 1px solid #463b38; border-left: 4px solid var(--shibuya-gold); border-radius: 3px 10px 10px 3px; background: #101014; }
.shibuya-story-stamp span { color: #f0ce83; font: 900 .74rem/1 ui-monospace, monospace; }
.shibuya-story-stamp b { color: #c8c0b6; font-size: .72rem; font-weight: 700; }
.shibuya-member-choice:focus-visible,
.shibuya-tree-node:focus-visible,
.shibuya-first-star-node:focus-visible { outline: 3px solid #f1d599; outline-offset: 4px; }

body.shibuya-cinematic-active { overflow: hidden !important; }
.shibuya-cinematic { position: fixed; inset: 0; z-index: 2147483000; overflow: hidden; color: #eee; background: transparent; isolation: isolate; }
.shibuya-cinematic[hidden] { display: none; }
.shibuya-cinematic-skip { position: absolute; top: max(18px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); z-index: 30; min-height: 44px; border: 1px solid #777 !important; color: #d0cbc3 !important; background: rgba(0,0,0,.72) !important; box-shadow: 0 5px 18px rgba(0,0,0,.3) !important; }
.shibuya-curtain { position: absolute; top: 0; bottom: 0; z-index: 2; width: 51.5%; background: #030304; transition: transform .72s cubic-bezier(.74, .02, .23, 1.1); will-change: transform; }
.shibuya-curtain-left { left: 0; transform: translateX(-102%); }
.shibuya-curtain-right { right: 0; transform: translateX(102%); }
.shibuya-cinematic.stage-curtain .shibuya-curtain { transform: translateX(0); }
.shibuya-cinematic-black { position: absolute; inset: 0; z-index: 1; background: #030304; opacity: 0; }
.shibuya-cinematic.stage-text .shibuya-cinematic-black,
.shibuya-cinematic.stage-ash .shibuya-cinematic-black,
.shibuya-cinematic.stage-veil .shibuya-cinematic-black,
.shibuya-cinematic.stage-command .shibuya-cinematic-black { opacity: 1; }
.shibuya-cinematic-text { position: absolute; top: 50%; left: 50%; z-index: 7; width: min(820px, 88vw); margin: 0; color: #e8e5df; font-family: "STSong", "SimSun", serif; font-size: clamp(1.2rem, 3vw, 2rem); line-height: 1.9; letter-spacing: .16em; text-align: center; transform: translate(-50%, -50%); text-shadow: 0 2px 14px #000; }
.shibuya-cinematic-text .ash-char { display: inline-block; white-space: pre; }
.shibuya-cinematic.stage-red .shibuya-cinematic-text,
.shibuya-cinematic.stage-collapse .shibuya-cinematic-text,
.shibuya-cinematic.stage-fall .shibuya-cinematic-text,
.shibuya-cinematic.stage-map .shibuya-cinematic-text,
.shibuya-cinematic.stage-white .shibuya-cinematic-text { opacity: 0; }
.shibuya-cinematic.stage-ash .ash-char { animation: shibuyaAsh 1.05s cubic-bezier(.3,.8,.4,1) forwards; animation-delay: calc(var(--ash-index) * 22ms); }
@keyframes shibuyaAsh { 35% { color: #aaa; } 100% { opacity: 0; filter: blur(5px); transform: translate(var(--ash-x), var(--ash-y)) rotate(var(--ash-r)); color: #666; } }
.shibuya-veil-arc { position: absolute; z-index: 8; left: 50%; top: 50%; width: min(570px, 82vw); aspect-ratio: 2 / 1; border-radius: 50% 50% 0 0 / 100% 100% 0 0; background: #000; transform: translate(-50%, -15%) scaleY(0); transform-origin: bottom; }
.shibuya-cinematic.stage-veil .shibuya-veil-arc { animation: shibuyaVeil .9s cubic-bezier(.7,0,.25,1) .7s forwards; }
.shibuya-cinematic.stage-veil .shibuya-cinematic-text { animation: shibuyaVeilText 1.05s cubic-bezier(.7,0,.25,1) .66s forwards; }
@keyframes shibuyaVeil { to { transform: translate(-50%, -90%) scaleY(1.25); } }
@keyframes shibuyaVeilText { 58% { opacity: .4; filter: blur(1px); } 100% { opacity: 0; filter: blur(7px); transform: translate(-50%, -65%); } }
.shibuya-red-collapse { position: absolute; inset: 0; z-index: 10; opacity: 0; background: #a30d1b; clip-path: inset(0); transform: translateZ(0); will-change: clip-path, transform; }
.shibuya-cinematic.stage-red .shibuya-red-collapse { opacity: 1; animation: shibuyaRedShock .42s steps(2,end) both; }
.shibuya-cinematic.stage-collapse { background: #fff; }
.shibuya-cinematic.stage-collapse .shibuya-red-collapse { opacity: 1; animation: shibuyaCollapse 1.15s cubic-bezier(.78,.02,.17,1) forwards; }
@keyframes shibuyaRedShock { 25% { transform: translate(-7px,4px); } 50% { transform: translate(6px,-5px); } 75% { transform: translate(-3px,-6px); } }
@keyframes shibuyaCollapse {
  0% { clip-path: inset(0); transform: translate(0); }
  68% { clip-path: inset(calc(50% - 27vmin)); transform: translate(-4px,3px); }
  82% { clip-path: inset(calc(50% - 24vmin)); transform: translate(5px,-4px); }
  100% { clip-path: inset(calc(50% - 25vmin)); transform: translate(0); }
}
.shibuya-collapse-corners { position: absolute; inset: 0; z-index: 11; opacity: 0; pointer-events: none; }
.shibuya-corner { position: absolute; width: 16vmin; height: 16vmin; border-style: solid; border-color: #1a1214; border-width: 0; filter: drop-shadow(0 0 8px rgba(0,0,0,.28)); will-change: transform; }
.corner-tl { --corner-x: calc(50vw - 25vmin); --corner-y: calc(50vh - 25vmin); top: 0; left: 0; border-top-width: 12px; border-left-width: 12px; }
.corner-tr { --corner-x: calc(-50vw + 25vmin); --corner-y: calc(50vh - 25vmin); top: 0; right: 0; border-top-width: 12px; border-right-width: 12px; }
.corner-bl { --corner-x: calc(50vw - 25vmin); --corner-y: calc(-50vh + 25vmin); bottom: 0; left: 0; border-bottom-width: 12px; border-left-width: 12px; }
.corner-br { --corner-x: calc(-50vw + 25vmin); --corner-y: calc(-50vh + 25vmin); bottom: 0; right: 0; border-bottom-width: 12px; border-right-width: 12px; }
.shibuya-cinematic.stage-collapse .shibuya-collapse-corners { opacity: 1; }
.shibuya-cinematic.stage-collapse .shibuya-corner { animation: shibuyaCornerPress 1.15s cubic-bezier(.78,.02,.17,1) forwards; }
@keyframes shibuyaCornerPress { to { transform: translate(var(--corner-x, 0), var(--corner-y, 0)); } }
.shibuya-prison-realm { position: absolute; left: 50%; top: 50%; z-index: 12; width: 50vmin; opacity: 0; transform: translate(-50%, -50%) scale(1.32); will-change: transform; }
.shibuya-cinematic.stage-collapse .shibuya-prison-realm { opacity: 1; animation: shibuyaPrisonSet 1.15s cubic-bezier(.78,.02,.17,1) forwards; }
@keyframes shibuyaPrisonSet { 0%, 62% { opacity: 0; transform: translate(-50%, -50%) scale(1.32); } 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); } }
.shibuya-falling-black { position: absolute; inset: 0; z-index: 13; background: #030304; transform: translateY(-102%); }
.shibuya-cinematic.stage-fall .shibuya-collapse-corners { opacity: 0; }
.shibuya-cinematic.stage-fall .shibuya-red-collapse { opacity: 1; clip-path: inset(calc(50% - 25vmin)); animation: shibuyaRedSquareFall 1.05s cubic-bezier(.38,.04,.85,.6) forwards; }
.shibuya-cinematic.stage-fall .shibuya-prison-realm { opacity: 1; transform: translate(-50%, -50%) scale(1); animation: shibuyaPrisonFall 1.05s cubic-bezier(.38,.04,.85,.6) forwards; }
.shibuya-cinematic.stage-fall .shibuya-falling-black { animation: shibuyaBlackFall 1.05s cubic-bezier(.38,.04,.85,.6) forwards; }
@keyframes shibuyaRedSquareFall { to { transform: translateY(155vh) rotate(14deg); } }
@keyframes shibuyaPrisonFall { to { transform: translate(-50%, 155vh) rotate(14deg); } }
@keyframes shibuyaBlackFall { to { transform: translateY(0); } }
.shibuya-star-map { position: absolute; left: 50%; top: 50%; z-index: 15; width: min(620px, 78vw, 72vh); opacity: 0; transform: translate(-50%, -50%) scale(.88); }
.shibuya-star-map svg { display: block; width: 100%; overflow: visible; }
.shibuya-star-map path { fill: none; stroke: #aaa5a2; stroke-width: 4; stroke-linejoin: round; filter: drop-shadow(0 0 8px rgba(255,255,255,.13)); }
.shibuya-star-map circle { fill: #c6c2bc; }
.shibuya-star-map circle:nth-of-type(4) { fill: #e0b24d; filter: drop-shadow(0 0 15px #e1ae3b); }
.shibuya-cinematic.stage-map { background: #030304; }
.shibuya-cinematic.stage-map .shibuya-star-map { opacity: 1; transform: translate(-50%, -50%) scale(1); transition: opacity .8s, transform .8s; }
.shibuya-first-star-node { position: absolute; left: 22.33%; top: 92.86%; z-index: 2; width: 48px; height: 48px; padding: 0; appearance: none; border: 0 !important; border-radius: 50% !important; color: transparent; background: transparent !important; cursor: pointer; pointer-events: none; touch-action: manipulation; transform: translate(-50%,-50%); box-shadow: 0 0 22px rgba(224,178,77,.22) !important; }
.shibuya-first-star-node::after { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: rgba(224,178,77,.12); box-shadow: 0 0 18px rgba(224,178,77,.32); pointer-events: none; }
.shibuya-cinematic.stage-map .shibuya-first-star-node { pointer-events: auto; }
.shibuya-first-star-node:hover { box-shadow: 0 0 34px #e0b24d !important; }
.shibuya-first-star-node:hover::after { animation: shibuyaStarBounce .55s cubic-bezier(.25,.9,.35,1.5); }
@keyframes shibuyaStarBounce { 45% { transform: translateY(-18%) scale(1.18); } }
.shibuya-cinematic-continue { display: none; position: absolute; left: 50%; bottom: max(34px, calc(env(safe-area-inset-bottom) + 22px)); z-index: 19; align-items: center; justify-content: center; gap: 9px; width: min(310px, calc(100vw - 44px)); min-height: 58px !important; height: auto !important; padding: 10px 18px; border: 1px solid rgba(224,178,77,.78) !important; border-radius: 999px !important; color: #e4c16d !important; background: linear-gradient(120deg, rgba(57,39,10,.94), rgba(8,8,9,.96)) !important; box-shadow: 0 0 0 1px rgba(224,178,77,.12), 0 14px 34px rgba(0,0,0,.44), 0 0 28px rgba(224,178,77,.16) !important; opacity: 0; pointer-events: none; touch-action: manipulation; transform: translate(-50%, 10px); transition: opacity .28s ease, transform .28s ease; }
.shibuya-cinematic-continue span { color: #bca76f; font-size: .72rem; letter-spacing: .08em; }
.shibuya-cinematic-continue strong { color: #ffe18d; font-size: 1rem; letter-spacing: .13em; }
.shibuya-cinematic.stage-map .shibuya-cinematic-continue { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.shibuya-cinematic.stage-white .shibuya-cinematic-continue { opacity: 0; pointer-events: none; }
@keyframes shibuyaStarTouchPulse { 0%,100% { box-shadow: 0 0 20px rgba(224,178,77,.2) !important; } 50% { box-shadow: 0 0 42px rgba(224,178,77,.72) !important; } }
.shibuya-white-transition { position: absolute; inset: 0; z-index: 20; display: grid; place-items: center; padding: 30px; color: #17171b; background: #fff; clip-path: circle(0 at 22.33% 92.86%); pointer-events: none; }
.shibuya-white-transition p { max-width: 840px; font-family: "STSong", "SimSun", serif; font-size: clamp(1.1rem, 3vw, 2rem); line-height: 1.8; text-align: center; opacity: 0; }
.shibuya-cinematic.stage-white .shibuya-white-transition { animation: shibuyaWhiteSpread .7s cubic-bezier(.65,0,.3,1) forwards; }
.shibuya-cinematic.stage-white .shibuya-white-transition p { animation: shibuyaMessageIn .7s ease .6s forwards; }
@keyframes shibuyaWhiteSpread { to { clip-path: circle(150% at 22.33% 92.86%); } }
@keyframes shibuyaMessageIn { to { opacity: 1; transform: translateY(-4px); } }

.shibuya-boss-history-stakes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
.shibuya-boss-history-stakes article { padding: 10px 11px; border: 1px solid rgba(132,118,101,.42); border-radius: 9px; background: rgba(18,16,18,.72); }
.shibuya-boss-history-stakes article.is-rewrite { border-color: rgba(211,164,66,.62); background: linear-gradient(145deg, rgba(91,64,19,.3), rgba(18,16,18,.8)); }
.shibuya-boss-history-stakes small { display: block; margin-bottom: 5px; color: #b8aaa0; font-size: .66rem; font-weight: 900; letter-spacing: .12em; }
.shibuya-boss-history-stakes .is-rewrite small { color: #efc86e; }
.shibuya-boss-history-stakes p { margin: 0; color: #e3d8ca; font-size: .79rem; line-height: 1.55; }
.shibuya-history-rewrite-confirmed { display: grid; gap: 3px; margin: 14px 0 0; padding: 11px 12px; border: 1px solid rgba(219,172,67,.68); border-radius: 9px; background: rgba(116,76,16,.2); }
.shibuya-history-rewrite-confirmed strong { color: #f0cb75; }
.shibuya-history-rewrite-confirmed span { color: #d9d0c5; font-size: .8rem; }

.shibuya-history-chain { grid-column: 1 / -1; display: grid; gap: 8px; min-width: 100%; padding: 11px 12px; border: 1px solid rgba(112,89,58,.55); border-radius: 10px; background: linear-gradient(100deg, rgba(21,18,19,.96), rgba(64,39,18,.36)); }
.shibuya-history-chain header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
.shibuya-history-chain header b { color: #ecc873; letter-spacing: .1em; }
.shibuya-history-chain header span { color: #b8aaa0; font-size: .72rem; }
.shibuya-history-chain > div { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.shibuya-history-chain > div span { flex: 0 0 auto; display: inline-flex; gap: 5px; align-items: center; padding: 5px 8px; border: 1px solid #40383a; border-radius: 999px; color: #8e8587; background: #171517; font-size: .69rem; }
.shibuya-history-chain > div span.is-achieved { border-color: #9b7734; color: #f0d48c; background: rgba(100,71,20,.3); }
.shibuya-history-chain > div i { font-style: normal; }
.shibuya-history-chain p { margin: 0; color: #c2b7aa; font-size: .75rem; }
.shibuya-history-chain p strong { color: #ead08e; }

.duel-shibuya-mission { position: relative; display: grid; gap: 10px; margin: 12px 0 14px; padding: 13px; overflow: hidden; border: 1px solid rgba(153,116,48,.68); border-left: 4px solid #d2a343; border-radius: 5px 13px 13px 5px; color: #eee5d7; background: linear-gradient(135deg, rgba(25,20,18,.98), rgba(55,31,23,.9)); box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.duel-shibuya-mission::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(110deg, transparent 42%, rgba(218,170,70,.055) 43%, transparent 44%); }
.duel-shibuya-mission > header { position: relative; z-index: 1; display: flex; justify-content: space-between; gap: 12px; align-items: start; }
.duel-shibuya-mission > header div { display: grid; gap: 4px; }
.duel-shibuya-mission > header small { color: #d1a854; font-size: .68rem; font-weight: 900; letter-spacing: .16em; }
.duel-shibuya-mission > header strong { color: #fff5df; font-size: .95rem; line-height: 1.45; }
.duel-shibuya-mission > header > span { padding: 4px 7px; border: 1px solid #806438; border-radius: 5px; color: #e8c77d; font-size: .72rem; font-weight: 900; }
.duel-shibuya-mission-grid { position: relative; z-index: 1; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; }
.duel-shibuya-mission-grid article { min-width: 0; padding: 9px 10px; border: 1px solid rgba(116,99,88,.42); border-radius: 8px; background: rgba(10,10,12,.42); }
.duel-shibuya-mission-grid article.is-danger { border-color: rgba(160,65,76,.55); background: rgba(85,21,30,.2); }
.duel-shibuya-mission-grid article.is-rewrite { border-color: rgba(198,148,52,.58); background: rgba(96,65,12,.2); }
.duel-shibuya-mission-grid small { display: block; margin-bottom: 4px; color: #b9aaa0; font-size: .64rem; font-weight: 900; letter-spacing: .09em; }
.duel-shibuya-mission-grid .is-danger small { color: #e08b96; }
.duel-shibuya-mission-grid .is-rewrite small { color: #e8bf64; }
.duel-shibuya-mission-grid p { margin: 0; color: #d8cec2; font-size: .75rem; line-height: 1.52; overflow-wrap: anywhere; }
.duel-shibuya-mission-live { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.duel-shibuya-mission-live > div { display: flex; flex-wrap: wrap; gap: 5px; align-items: center; padding: 8px 9px; border: 1px solid rgba(115,97,84,.4); border-radius: 8px; background: rgba(7,7,9,.38); }
.duel-shibuya-mission-live b { margin-right: 3px; color: #e2c178; font-size: .67rem; }
.duel-shibuya-mission-live span { padding: 3px 6px; border-radius: 999px; color: #d8d0c6; background: rgba(255,255,255,.065); font-size: .68rem; }
.duel-shibuya-mission-live .is-danger b { color: #e18a96; }
.duel-shibuya-mission-history { position: relative; z-index: 1; display: flex; gap: 7px; margin: 0; color: #c8bbaa; font-size: .7rem; }
.duel-shibuya-mission-history b { color: #e4bd67; white-space: nowrap; }

@media (max-width: 780px) {
  .shibuya-page-head { align-items: flex-start; flex-direction: column; }
  .shibuya-head-actions { width: 100%; justify-content: stretch; }
  .shibuya-head-actions > button { flex: 1 1 100%; width: 100%; }
  .shibuya-hud { grid-template-columns: 1fr 1fr; }
  .shibuya-operation-strip { grid-template-columns: 70px 1fr; }
  .shibuya-route-sigil { min-width: 70px; padding: 14px 9px; }
  .shibuya-route-progress { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.08); border-left: 0; }
  .shibuya-layout,
  .shibuya-rank-grid { grid-template-columns: minmax(0, 1fr); }
  .shibuya-branch-overview { grid-template-columns: repeat(5, 125px); padding-bottom: 5px; }
  .shibuya-tree-panel { order: 1; }
  .shibuya-party-panel { order: 2; }
  .shibuya-tree-node-wrap.lane-enter { transform: translateX(-12%); }
  .shibuya-tree-node-wrap.lane-locked { transform: translateX(12%); }
  .shibuya-tree-node-wrap:nth-child(n) { transform: none; }
  .shibuya-tree-node { width: 100%; min-width: 0; }
  .shibuya-event-tree-viewport { height: min(58vh, 520px); min-height: 360px; }
  .shibuya-modal { padding: 10px; }
  .shibuya-modal-card { width: 100%; max-height: 92vh; padding: 15px; border-radius: 14px; }
  .shibuya-modal-actions > button { flex: 1 1 130px; }
  .shibuya-boss-buff-grid { grid-template-columns: 1fr; }
  .shibuya-branch-choice-grid { grid-template-columns: 1fr; }
  .shibuya-expedition-route-grid { grid-template-columns: 1fr; }
  .shibuya-expedition-route-card { min-height: 0; }
  .shibuya-boon-grid { grid-template-columns: 1fr; }
  .shibuya-stage-rest-choices { grid-template-columns: 1fr; }
  .shibuya-boon-card { min-height: 0; }
  .shibuya-boss-history-stakes,
  .duel-shibuya-mission-grid,
  .duel-shibuya-mission-live { grid-template-columns: 1fr; }
  .duel-shibuya-mission { padding: 11px; }
  .duel-shibuya-mission-history { display: grid; }
}

@media (max-width: 780px), (pointer: coarse) {
  .shibuya-cinematic.stage-map .shibuya-first-star-node { width: 72px; height: 72px; animation: shibuyaStarTouchPulse 1.35s ease-in-out infinite; }
  .shibuya-cinematic.stage-map .shibuya-first-star-node::after { inset: 10px; background: rgba(224,178,77,.2); }
  .shibuya-cinematic-continue { display: inline-flex; }
  :is(html[data-jjk-phone-layout="true"], html[data-jjk-app-runtime="capacitor"], html[data-jjk-app-runtime-hint="capacitor"]) button.shibuya-cinematic-continue { min-height: 58px !important; height: auto !important; }
}

@media (prefers-reduced-motion: reduce) {
  .shibuya-incident-tab,
  .shibuya-incident-tab::after,
  .shibuya-tree-node,
  .shibuya-first-star-node::after,
  .shibuya-cinematic *,
  .shibuya-cinematic *::before,
  .shibuya-cinematic *::after {
    animation-duration: .001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* R91 page-local AI generation credits */
.ai-credits-mount { margin: 12px 0 16px; }
.ai-credits-widget {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 999px;
  background: rgba(10, 18, 35, 0.94);
  color: #dbeafe;
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
  font-size: 13px;
}

.ai-credits-balance { white-space: nowrap; }
.ai-credits-model { margin-inline-start: 18px; }
.ai-credits-widget label { display: inline-flex; align-items: center; gap: 5px; }
.ai-credits-widget select { min-height: 30px; border: 1px solid #405171; border-radius: 8px; background: #111a2c; color: #f8fafc; }
.ai-credits-widget button { min-height: 44px; padding: 7px 11px; border: 1px solid #52627d; border-radius: 999px; background: #172554; color: #dbeafe; cursor: pointer; }
.ai-credits-widget button:hover { background: #1e3a8a; }
.ai-credits-widget button:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.ai-credits-overlay { position: fixed; inset: 0; z-index: 1400; display: grid; place-items: center; padding: 20px; background: rgba(2, 6, 23, 0.78); }
.ai-credits-dialog { position: relative; width: min(420px, 100%); padding: 24px; border: 1px solid #405171; border-radius: 18px; background: #111827; color: #e5e7eb; box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5); }
.ai-credits-dialog h2 { margin: 0 0 12px; color: #fbbf24; font-size: 20px; }
.ai-credits-dialog ul { padding-left: 22px; line-height: 1.8; }
.ai-credits-dialog-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.ai-credits-dialog button { min-height: 44px; padding: 8px 16px; border: 1px solid #52627d; border-radius: 10px; background: #1d4ed8; color: #fff; cursor: pointer; }
.ai-credits-dialog button:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }
.ai-credits-dialog button:disabled { border-color: #64748b; background: #334155; color: #f8fafc; cursor: wait; opacity: 1; }
.ai-credits-dialog [data-ai-reject] { background: transparent; color: #cbd5e1; }
.ai-credits-dialog-close { position: absolute; top: 8px; right: 8px; min-width: 38px; padding: 0; background: transparent; color: #cbd5e1; font-size: 24px; }
.ai-credits-dialog-error { padding: 9px 11px; border: 1px solid #f87171; border-radius: 8px; background: rgba(127, 29, 29, .35); color: #fecaca; }


body.ai-credits-store-open {
  overflow: hidden;
}

.ai-credits-overlay.is-credit-store {
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(17, 24, 39, 0.72);
  backdrop-filter: blur(5px);
}

.ai-credit-store-dialog {
  display: grid;
  gap: 16px;
  width: min(560px, 100%);
  max-height: calc(100dvh - 32px);
  padding: clamp(18px, 4vw, 28px);
  overflow: auto;
  border-color: #9aa4b2;
  border-radius: 8px;
  background: #f8fafc;
  color: #172033;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.42);
}

.ai-credit-store-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.ai-credit-store-head > div {
  display: grid;
  gap: 4px;
}

.ai-credit-store-head span {
  color: #0f766e;
  font-size: 0.78rem;
  font-weight: 800;
}

.ai-credit-store-dialog h2 {
  margin: 0;
  color: #172033;
  font-size: 1.45rem;
  line-height: 1.25;
}

.ai-credit-store-dialog .ai-credits-dialog-close {
  position: static;
  flex: 0 0 auto;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-color: #94a3b8;
  border-radius: 50%;
  background: #ffffff;
  color: #334155;
}

.ai-credit-store-balance {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-block: 1px solid #cbd5e1;
  color: #475569;
}

.ai-credit-store-balance strong {
  color: #172033;
  font-size: 1.45rem;
}

.ai-credit-store-fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.ai-credit-store-fieldset legend {
  margin-bottom: 10px;
  color: #475569;
  font-size: 0.84rem;
  font-weight: 800;
}

.ai-credit-store-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ai-credit-store-option {
  position: relative;
  display: grid;
  place-items: center;
  gap: 2px;
  min-width: 0;
  min-height: 88px;
  padding: 12px 8px;
  border: 1px solid #aeb8c5;
  border-radius: 6px;
  background: #ffffff;
  color: #334155;
  cursor: pointer;
}

.ai-credit-store-option:hover {
  border-color: #0f766e;
  background: #f0fdfa;
}

.ai-credit-store-option.is-selected,
.ai-credit-store-option:has(input:checked) {
  border-color: #0f766e;
  background: #e6fffb;
  color: #0f4f4a;
  box-shadow: inset 0 0 0 2px #0f766e;
}

.ai-credit-store-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ai-credit-store-option:focus-within {
  outline: 3px solid #d59b16;
  outline-offset: 3px;
}

.ai-credit-store-option strong {
  font-size: 1.65rem;
  line-height: 1;
}

.ai-credit-store-option span {
  font-size: 0.78rem;
  font-weight: 700;
}

.ai-credit-store-selection {
  margin: 0;
  color: #0f4f4a;
  font-weight: 800;
}

.ai-credit-store-note {
  margin: 0;
  color: #5b6472;
  font-size: 0.84rem;
  line-height: 1.65;
}

.ai-credit-store-dialog [data-ai-credit-store-order] {
  width: 100%;
  min-height: 60px;
  padding: 12px 14px;
  border: 1px solid #7c8aa0;
  border-radius: 8px;
  background: #ffffff;
  color: #172033;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
}

.ai-credit-store-dialog [data-ai-credit-store-order]:focus-visible {
  outline: 3px solid #d59b16;
  outline-offset: 2px;
}

.ai-credit-store-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 0.85fr);
  gap: 10px;
}

.ai-credit-store-actions button {
  min-height: 48px;
  border-radius: 6px;
}

.ai-credit-store-actions .primary {
  border-color: #0b5f59;
  background: #0f766e;
  color: #ffffff;
}

.ai-credit-store-actions .primary:hover:not(:disabled) {
  border-color: #083f3b;
  background: #0b5f59;
}

.ai-credit-store-actions .secondary {
  border-color: #94a3b8;
  background: #ffffff;
  color: #334155;
}

@media (max-width: 560px) {
  .ai-credit-store-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ai-credit-store-option {
    min-height: 78px;
  }

  .ai-credit-store-actions {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ai-credits-widget { justify-content: flex-start; border-radius: 16px; }
  .ai-credits-model { margin-inline-start: 14px; }
}

/* Character design and OC arena route shell. */
.character-arena-panel {
  min-height: 36rem;
  padding: 1.1rem 1.35rem;
}

.character-arena-heading {
  margin-bottom: 0;
}

.character-arena-tabs {
  display: flex;
  gap: 0;
  margin: 0 -1.25rem 1.25rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid #cbd5e1;
  overflow-x: auto;
}

.character-arena-tab {
  min-height: 2.9rem;
  padding: 0.7rem 1rem;
  border: 0;
  border-bottom: 3px solid transparent;
  border-radius: 0;
  background: transparent;
  color: #475569;
  font-weight: 800;
  white-space: nowrap;
}

.character-arena-tab:hover {
  color: #0f4f4a;
  background: #f1f5f9;
}

.character-arena-tab.active {
  border-bottom-color: #0f766e;
  color: #0f4f4a;
  background: #ecfdf5;
}

.character-arena-tab:focus-visible,
.oc-ranking-tabs button:focus-visible {
  outline: 3px solid #d18a00;
  outline-offset: -3px;
}

.character-arena-view[hidden] {
  display: none !important;
}

[data-character-design-mount] > .jjk-battle-page {
  display: block;
}

.oc-lobby-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #dbe3ec;
}

.oc-lobby-toolbar h3,
.oc-lobby-toolbar p {
  margin: 0;
}

.oc-lobby-toolbar p {
  margin-top: 0.3rem;
}

.oc-lobby-controls {
  display: flex;
  align-items: end;
  gap: 0.65rem;
}

.oc-lobby-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem);
  gap: 1.5rem;
  margin-top: 1rem;
}

.oc-character-list {
  min-width: 0;
  min-height: 18rem;
}

.oc-ranking-rail {
  min-width: 0;
  padding-left: 1.25rem;
  border-left: 1px solid #dbe3ec;
}

.oc-ranking-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  overflow: hidden;
}

.oc-ranking-tabs button {
  min-height: 2.5rem;
  padding: 0.55rem 0.4rem;
  border: 0;
  border-right: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
  border-radius: 0;
  background: #f8fafc;
  color: #334155;
  font-weight: 750;
}

.oc-ranking-tabs button:nth-child(even) {
  border-right: 0;
}

.oc-ranking-tabs button:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.oc-ranking-tabs button.active {
  background: #0f766e;
  color: #fff;
}

.oc-ranking-list {
  padding-top: 0.85rem;
}

@media (max-width: 760px) {
  .character-arena-panel {
    padding: 0.8rem;
  }

  .character-arena-tabs {
    margin-right: -0.8rem;
    margin-left: -0.8rem;
    padding-right: 0.8rem;
    padding-left: 0.8rem;
  }

  .oc-lobby-toolbar,
  .oc-lobby-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .oc-lobby-layout {
    display: flex;
    flex-direction: column-reverse;
  }

  .oc-ranking-rail {
    padding: 0 0 1rem;
    border-left: 0;
    border-bottom: 1px solid #dbe3ec;
  }
}

.oc-publish-strip {
  display: grid;
  grid-template-columns: minmax(11rem, 1fr) minmax(14rem, 1.4fr) auto;
  gap: 0.75rem;
  align-items: end;
  margin-top: 1rem;
  padding: 0.9rem 0;
  border-top: 1px solid #dbe3ec;
  border-bottom: 1px solid #dbe3ec;
}

.oc-publish-strip > .muted {
  grid-column: 1 / -1;
  margin: 0;
}

.oc-publish-story {
  grid-column: 1 / -1;
}

.oc-publish-story textarea {
  min-height: 7.5rem;
  resize: vertical;
}

.oc-character-list {
  display: grid;
  align-content: start;
  gap: 0;
  border-top: 1px solid #dbe3ec;
}

.oc-character-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 0.95rem 0;
  border-bottom: 1px solid #dbe3ec;
}

.oc-character-row h4,
.oc-character-row p {
  margin: 0;
}

.oc-character-meta {
  margin-top: 0.25rem !important;
  color: #475569;
  font-size: 0.88rem;
}

.oc-character-message {
  margin-top: 0.4rem !important;
  color: #172033;
}

.oc-character-row-side {
  display: grid;
  justify-items: end;
  gap: 0.55rem;
}

.oc-character-metrics {
  color: #0f4f4a;
  font-size: 0.83rem;
  font-weight: 750;
  white-space: nowrap;
}

.oc-ranking-rows {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style-position: inside;
}

.oc-ranking-rows li {
  border-bottom: 1px solid #e2e8f0;
}

.oc-ranking-target {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.5rem;
  padding: 0.65rem 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.oc-ranking-target:hover {
  color: #0f4f4a;
}

.oc-ranking-target:focus-visible {
  outline: 2px solid #0f766e;
  outline-offset: -2px;
  border-radius: 0.3rem;
}

.oc-ranking-rows strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.oc-detail-dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(80vh, 48rem);
  padding: 1.1rem;
  border: 1px solid #94a3b8;
  border-radius: 7px;
  background: #f8fafc;
  color: #172033;
}

.oc-detail-dialog::backdrop {
  background: rgba(15, 23, 42, 0.64);
}

.oc-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #cbd5e1;
}

.oc-detail-head h3,
.oc-detail-head small {
  margin: 0;
}

.oc-detail-story {
  max-height: 50vh;
  margin-top: 1rem;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.75;
}

.oc-detail-commands {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-top: 1.1rem;
}

.oc-detail-commands button {
  min-height: 3rem;
}

.oc-detail-subnav,
.oc-interaction-toolbar,
.oc-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.oc-detail-subnav {
  margin: 0.85rem 0;
}

.oc-interactions {
  margin-top: 1.2rem;
  padding-top: 1rem;
  border-top: 1px solid #cbd5e1;
}

.oc-interactions h4,
.oc-comment-row p,
.oc-challenge-result h4,
.oc-challenge-result p,
.oc-detail-status {
  margin: 0;
}

.oc-story-editor {
  width: 100%;
  min-height: 18rem;
  resize: vertical;
}

.oc-challenge-turn {
  margin: 0.9rem 0;
  padding: 0.85rem 0;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

.oc-challenge-turn h4 {
  margin: 0;
}

.oc-turn-card-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0.8rem 0;
  padding: 0.75rem;
  border: 1px solid #cbd5e1;
}

.oc-turn-card-list legend {
  padding: 0 0.35rem;
  font-weight: 750;
}

.oc-turn-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: start;
  min-height: 3.75rem;
  padding: 0.6rem;
  border: 1px solid #dbe3ec;
  border-radius: 6px;
  background: #fff;
}

.oc-turn-card span,
.oc-turn-card strong,
.oc-turn-card small {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.oc-turn-card small {
  margin-top: 0.2rem;
  color: #475569;
}

.oc-turn-controls {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) minmax(7rem, 0.7fr) auto;
  gap: 0.65rem;
}

.oc-interaction-toolbar {
  margin: 0.65rem 0;
}

.oc-like-count {
  color: #0f4f4a;
  font-weight: 750;
}

.oc-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: end;
}

.oc-comment-form textarea {
  min-height: 4.5rem;
  resize: vertical;
}

.oc-comment-list {
  margin-top: 0.75rem;
  border-top: 1px solid #e2e8f0;
}

.oc-comment-row {
  padding: 0.7rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.oc-comment-row p {
  margin-top: 0.35rem;
  white-space: pre-wrap;
}

.oc-challenge-result {
  margin: 0.85rem 0;
  padding: 0.8rem 0;
  border-top: 1px solid #cbd5e1;
  border-bottom: 1px solid #cbd5e1;
}

.oc-challenge-result p {
  margin-top: 0.35rem;
}

.oc-detail-status {
  min-height: 1.5rem;
  padding-top: 0.75rem;
}

@media (max-width: 760px) {
  .oc-publish-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .oc-character-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .oc-character-row-side {
    justify-items: stretch;
  }

  .oc-character-metrics {
    white-space: normal;
  }

  .oc-detail-commands,
  .oc-comment-form,
  .oc-turn-card-list,
  .oc-turn-controls {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Non-blocking recovery entry for a user-dismissed online settlement dialog. */
.online-settlement-status-strip {
  position: fixed;
  z-index: 2147483000;
  right: 16px;
  bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(92vw, 420px);
  padding: 10px 12px;
  border: 1px solid rgba(255, 205, 116, .45);
  border-radius: 12px;
  background: rgba(25, 27, 38, .96);
  color: #fff4d4;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .28);
  font-size: 13px;
}

.online-settlement-status-strip button {
  flex: 0 0 auto;
}

/* All former browser modal calls use this isolated, high-contrast DOM layer. */
.jjk-dom-modal-root {
  position: relative;
  z-index: 2147483646;
}

.jjk-dom-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  display: grid;
  place-items: center;
  padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: rgba(16, 24, 32, .58);
  color: #1f252b;
  overscroll-behavior: contain;
}

.jjk-dom-modal-card {
  width: min(92vw, 520px);
  max-height: min(86dvh, 680px);
  overflow: auto;
  margin: 0;
  padding: 22px;
  border: 1px solid #a99f90;
  border-radius: 8px;
  background: #fffdf7;
  color: #1f252b;
  box-shadow: 0 22px 48px rgba(15, 23, 32, .28);
}

.jjk-dom-modal-header h2 {
  margin: 0;
  color: #1f252b;
  font-size: clamp(18px, 4vw, 24px);
  line-height: 1.35;
}

.jjk-dom-modal-body {
  margin-top: 14px;
  color: #34404a;
  line-height: 1.6;
}

.jjk-dom-modal-message {
  margin: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.jjk-dom-modal-input {
  display: block;
  width: 100%;
  min-height: 42px;
  margin-top: 14px;
  padding: 9px 11px;
  border: 1px solid #8f9aa3;
  border-radius: 6px;
  background: #ffffff;
  color: #1f252b;
  font: inherit;
}

.jjk-dom-modal-input:focus,
.jjk-dom-modal-actions button:focus-visible {
  outline: 3px solid rgba(47, 111, 104, .3);
  outline-offset: 2px;
}

.jjk-dom-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.jjk-dom-modal-actions button {
  min-width: 88px;
  min-height: 40px;
  padding: 8px 14px;
  border: 1px solid #7a1a15;
  border-radius: 6px;
  background: #b42318;
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.jjk-dom-modal-actions .jjk-dom-modal-cancel {
  border-color: #6c7680;
  background: #eef1f3;
  color: #1f252b;
}

.jjk-dom-modal-actions button:hover {
  filter: brightness(.94);
}

@media (max-width: 560px) {
  .jjk-dom-modal-card {
    width: min(94vw, 520px);
    padding: 18px;
  }

  .jjk-dom-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .jjk-dom-modal-actions button {
    width: 100%;
  }
}
