/* 一生パチンコ 〜閉店のない部屋〜 UI スタイル
   1920×1080 の #ui-stage を transform でフィットさせる。px はすべてこの基準座標。
   見た目は html[data-era] の CSS 変数で切り替える。素材 (assets/ui) が無くても成立させる。 */

@property --spin { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* ===== 1. テーマ（時代ごとの見た目）============================================ */
:root {
  --f-body: 'Noto Sans JP', 'Hiragino Sans', 'Yu Gothic UI', sans-serif;
  --f-round: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
  --f-disp: 'Dela Gothic One', 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
  --f-dot: 'DotGothic16', 'Noto Sans JP', monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-back: cubic-bezier(.34, 1.56, .64, 1);
  --user-glow: 1;               /* 設定の「光の強さ」 */

  /* rarity / 色の序列（白<青<黄<緑<赤<金<虹）は時代に関わらず固定 */
  --rar-n: #cfd6df; --rar-r: #3fa9ff; --rar-sr: #ffcb3d; --rar-ssr: #ff4fa3;
  --g-rainbow: linear-gradient(100deg, #ff4d6d, #ffb03a, #ffe94d, #4dff9a, #4dc3ff, #9a6bff, #ff4dcb);
  --g-gold: linear-gradient(180deg, #fff7d0 0%, #ffe07a 28%, #e9a81f 52%, #fff0a8 66%, #b8730c 100%);
  --g-silver: linear-gradient(180deg, #fff 0%, #dfe7ee 30%, #8f9cab 52%, #eef3f7 66%, #6d7a89 100%);
}

/* 白い部屋期: 白木と和紙。光らせない。ここからの落差が進化の気持ちよさになる */
:root, html[data-era='ancient'] {
  --bg: #efece4;
  --pn: rgba(255, 254, 251, .86);
  --pn2: rgba(244, 239, 229, .92);
  --pn3: rgba(232, 225, 211, .9);
  --ink: #2b2520; --ink2: #6d6356; --ink3: #9e9383;
  --line: rgba(70, 50, 30, .16);
  --acc: #8b5e34; --acc2: #b98a4e; --acc-ink: #fff;
  --good: #b5842a; --warn: #b5432c;
  --neon: rgba(190, 150, 90, 0);
  --glow: 0;
  --frame: linear-gradient(155deg, #f4eee2 0%, #c9b596 32%, #efe5d3 55%, #ad9472 100%);
  --frame-w: 2px;
  --g-disp: linear-gradient(180deg, #4b3a2b, #1d1712);
  --g-btn: linear-gradient(180deg, #a06f40, #7c5129);
  --g-btn-ghost: linear-gradient(180deg, #fffdf9, #efe8da);
  --dg-font: var(--f-disp);
  --dg-tile: linear-gradient(180deg, #fbf8f1, #efe7d7 48%, #e5dbc7 52%, #f4eee1);
  --dg-tile-line: rgba(80, 60, 40, .22);
  --dg-fill: linear-gradient(180deg, #4a3a2c 10%, #15100c 90%);
  --dg-shadow: 0 1px 0 rgba(255, 255, 255, .8);
  --r: 14px;
  --plate: linear-gradient(180deg, #fffefb, #f1eadc);
  --shadow: 0 6px 22px rgba(70, 50, 30, .16);
  --bg-img: radial-gradient(1200px 800px at 50% 30%, #fbfaf6, #e9e4d9 80%);
  --tab-on: #2b2520; --tab-on-ink: #fff;
  --hot-border: rgba(181, 132, 42, .95);
}

/* 昭和: ホーロー看板と真鍮、豆電球 */
html[data-era='showa'] {
  --bg: #2b1b12;
  --pn: rgba(250, 240, 217, .93);
  --pn2: rgba(240, 225, 192, .94);
  --pn3: rgba(226, 205, 165, .94);
  --ink: #33200f; --ink2: #6e4e2e; --ink3: #9b7c56;
  --line: rgba(70, 40, 10, .24);
  --acc: #c42f1c; --acc2: #127566; --acc-ink: #fff6e4;
  --good: #d99312; --warn: #b5281a;
  --neon: rgba(255, 170, 60, .5);
  --glow: .35;
  --frame: linear-gradient(155deg, #fff0b8 0%, #b78627 30%, #f8dc8a 52%, #8f6216 78%, #e6bf62 100%);
  --frame-w: 4px;
  --g-disp: linear-gradient(180deg, #e8492f 15%, #94180b 90%);
  --g-btn: linear-gradient(180deg, #e04a2f, #a81f10);
  --g-btn-ghost: linear-gradient(180deg, #fff6df, #ecd9b1);
  --dg-tile: linear-gradient(180deg, #2a2019, #120c08 48%, #000 52%, #2a1f17);
  --dg-tile-line: rgba(255, 220, 150, .22);
  --dg-fill: linear-gradient(180deg, #fff8e0 10%, #f3cf86 90%);
  --dg-shadow: 0 0 10px rgba(255, 200, 110, .35);
  --r: 10px;
  --plate: linear-gradient(180deg, #fbf0d6, #ecd7a9);
  --shadow: 0 8px 26px rgba(40, 20, 0, .4);
  --bg-img: radial-gradient(1400px 900px at 50% 20%, #5a3a22, #1d120a 80%);
  --tab-on: #c42f1c; --tab-on-ink: #fff6e4;
  --hot-border: #ffbf3f;
}

/* 平成: クローム、液晶、ネオン管 */
html[data-era='heisei'] {
  --bg: #070a22;
  --pn: rgba(10, 14, 46, .84);
  --pn2: rgba(20, 26, 78, .78);
  --pn3: rgba(32, 40, 110, .7);
  --ink: #eef4ff; --ink2: #aebbe6; --ink3: #7786bd;
  --line: rgba(130, 170, 255, .24);
  --acc: #ff2c9c; --acc2: #27dcff; --acc-ink: #fff;
  --good: #ffe14a; --warn: #ff5a4a;
  --neon: rgba(255, 44, 156, .75);
  --glow: .8;
  --frame: linear-gradient(155deg, #fff 0%, #8ea2c6 24%, #e6eefb 46%, #4a5a80 70%, #d9e4f7 100%);
  --frame-w: 4px;
  --g-disp: linear-gradient(180deg, #ffffff 15%, #6fe6ff 55%, #ff53b5 95%);
  --g-btn: linear-gradient(180deg, #ff4fae, #c4007c);
  --g-btn-ghost: linear-gradient(180deg, #2a3388, #151b56);
  --dg-font: var(--f-dot);
  --dg-tile: linear-gradient(180deg, #120205, #220409);
  --dg-tile-line: rgba(255, 60, 60, .22);
  --dg-fill: linear-gradient(180deg, #ffd9a0, #ff6a2c 55%, #ff2a1a);
  --dg-shadow: 0 0 14px rgba(255, 70, 30, .8);
  --r: 12px;
  --plate: linear-gradient(180deg, #171d5c, #0b0f38);
  --shadow: 0 10px 30px rgba(0, 0, 30, .6), 0 0 24px rgba(39, 220, 255, .12);
  --bg-img: radial-gradient(1400px 900px at 50% 10%, #1c2474, #05061a 80%);
  --tab-on: linear-gradient(180deg, #ff4fae, #c4007c); --tab-on-ink: #fff;
  --hot-border: #ffe14a;
}

/* 令和: 黒鏡面と金、全部入り */
html[data-era='modern'] {
  --bg: #050507;
  --pn: rgba(10, 9, 14, .86);
  --pn2: rgba(32, 26, 30, .78);
  --pn3: rgba(58, 42, 34, .66);
  --ink: #fff8ea; --ink2: #d9c6a4; --ink3: #94836a;
  --line: rgba(255, 210, 120, .22);
  --acc: #ff2436; --acc2: #ffc531; --acc-ink: #fff;
  --good: #ffd94a; --warn: #ff5a4a;
  --neon: rgba(255, 60, 40, .9);
  --glow: 1;
  --frame: linear-gradient(155deg, #fff4c2 0%, #b5780f 22%, #ffe89a 44%, #6b3f06 66%, #ffd76a 88%, #8f5c0d 100%);
  --frame-w: 5px;
  --g-disp: var(--g-gold);
  --g-btn: linear-gradient(180deg, #ff5a3c, #c8001e 60%, #7a0012);
  --g-btn-ghost: linear-gradient(180deg, #3b2e24, #18120e);
  --dg-font: var(--f-disp);
  --dg-tile: linear-gradient(180deg, #1c1208, #050302 48%, #000 52%, #1a1008);
  --dg-tile-line: rgba(255, 200, 90, .3);
  --dg-fill: var(--g-gold);
  --dg-shadow: 0 0 16px rgba(255, 180, 40, .75);
  --r: 12px;
  --plate: linear-gradient(180deg, #1f1712, #07060a);
  --shadow: 0 10px 36px rgba(0, 0, 0, .7), 0 0 30px rgba(255, 190, 60, .14);
  --bg-img: radial-gradient(1400px 900px at 50% 0%, #3a1608, #040306 75%);
  --tab-on: var(--g-gold); --tab-on-ink: #2a1600;
  --hot-border: #ffd94a;
}

/* 魔導温室: 深緑の硝子と金の蔓 */
html[data-era='magic'] {
  --bg: #04140d;
  --pn: rgba(8, 34, 22, .84);
  --pn2: rgba(18, 60, 38, .74);
  --pn3: rgba(34, 92, 56, .6);
  --ink: #f0ffe6; --ink2: #b6dfae; --ink3: #7aa877;
  --line: rgba(160, 255, 150, .22);
  --acc: #63e06a; --acc2: #ffd86b; --acc-ink: #06240f;
  --good: #fff07a; --warn: #ff8a5c;
  --neon: rgba(120, 255, 130, .75);
  --glow: .9;
  --frame: linear-gradient(155deg, #fff1b0 0%, #6f8c2a 26%, #f6e28a 48%, #1f6a36 72%, #d6e88a 100%);
  --frame-w: 4px;
  --g-disp: linear-gradient(180deg, #fffbd0, #b6f56a 55%, #2ea866);
  --g-btn: linear-gradient(180deg, #7bea62, #1f9a4a);
  --g-btn-ghost: linear-gradient(180deg, #1d5a38, #0d3320);
  --dg-font: var(--f-disp);
  --dg-tile: linear-gradient(180deg, #0c2c1b, #04150c);
  --dg-tile-line: rgba(170, 255, 150, .25);
  --dg-fill: linear-gradient(180deg, #fffbd0 10%, #a9f25f 60%, #36b86c);
  --dg-shadow: 0 0 14px rgba(140, 255, 120, .7);
  --r: 18px;
  --plate: linear-gradient(180deg, #123f27, #06200f);
  --shadow: 0 10px 30px rgba(0, 20, 10, .6), 0 0 26px rgba(120, 255, 130, .12);
  --bg-img: radial-gradient(1400px 900px at 50% 100%, #1f7a44, #03120b 75%);
  --tab-on: linear-gradient(180deg, #8cf06a, #2aa850); --tab-on-ink: #052010;
  --hot-border: #fff07a;
}

/* 曲率時空: ホログラムの線 */
html[data-era='sf'] {
  --bg: #02060e;
  --pn: rgba(4, 16, 32, .68);
  --pn2: rgba(10, 34, 62, .6);
  --pn3: rgba(20, 58, 100, .5);
  --ink: #dcf7ff; --ink2: #8fc8de; --ink3: #5b8ca3;
  --line: rgba(90, 225, 255, .3);
  --acc: #49e0ff; --acc2: #8a86ff; --acc-ink: #021018;
  --good: #b6ffef; --warn: #ff7a6a;
  --neon: rgba(73, 224, 255, .85);
  --glow: 1;
  --frame: linear-gradient(155deg, #baf6ff 0%, #1d6d8e 40%, #7ce9ff 60%, #1b3f7a 100%);
  --frame-w: 2px;
  --g-disp: linear-gradient(180deg, #fff, #7ce9ff 60%, #6d7bff);
  --g-btn: linear-gradient(180deg, #49e0ff, #1a78c0);
  --g-btn-ghost: linear-gradient(180deg, rgba(40, 110, 160, .5), rgba(10, 40, 70, .5));
  --dg-font: var(--f-dot);
  --dg-tile: linear-gradient(180deg, rgba(10, 50, 80, .55), rgba(3, 20, 34, .55));
  --dg-tile-line: rgba(100, 230, 255, .35);
  --dg-fill: linear-gradient(180deg, #fff, #8cecff 60%, #49a6ff);
  --dg-shadow: 0 0 14px rgba(70, 220, 255, .9);
  --r: 4px;
  --plate: linear-gradient(180deg, rgba(10, 40, 70, .78), rgba(3, 14, 28, .78));
  --shadow: 0 0 26px rgba(70, 220, 255, .16);
  --bg-img: radial-gradient(1200px 900px at 60% 40%, #0d2c58, #01040a 72%);
  --tab-on: linear-gradient(180deg, #49e0ff, #1a78c0); --tab-on-ink: #021018;
  --hot-border: #b6ffef;
}

/* 千手曼荼羅: 群青と金箔 */
html[data-era='mystic'] {
  --bg: #0e0620;
  --pn: rgba(24, 10, 52, .86);
  --pn2: rgba(48, 22, 90, .76);
  --pn3: rgba(84, 40, 130, .6);
  --ink: #fff4e4; --ink2: #dcc4f0; --ink3: #a184c4;
  --line: rgba(255, 210, 130, .24);
  --acc: #ffb547; --acc2: #d572ff; --acc-ink: #2a1200;
  --good: #ffe58a; --warn: #ff7a8a;
  --neon: rgba(255, 170, 70, .85);
  --glow: 1;
  --frame: linear-gradient(155deg, #fff4c2 0%, #a9731e 24%, #ffe38f 46%, #5d2b8a 72%, #ffd27a 100%);
  --frame-w: 4px;
  --g-disp: linear-gradient(180deg, #fff6d8, #ffc95e 50%, #e36bff);
  --g-btn: linear-gradient(180deg, #ffc65e, #d6761a);
  --g-btn-ghost: linear-gradient(180deg, #41206f, #231040);
  --dg-font: var(--f-disp);
  --dg-tile: linear-gradient(180deg, #2c1254, #110524);
  --dg-tile-line: rgba(255, 210, 120, .3);
  --dg-fill: linear-gradient(180deg, #fff6d8, #ffc95e 55%, #ff8d4d);
  --dg-shadow: 0 0 14px rgba(255, 180, 70, .8);
  --r: 16px;
  --plate: linear-gradient(180deg, #2c1254, #120628);
  --shadow: 0 10px 32px rgba(10, 0, 30, .6), 0 0 28px rgba(255, 170, 70, .14);
  --bg-img: radial-gradient(1200px 900px at 50% 45%, #4a1f86, #0a0318 72%);
  --tab-on: linear-gradient(180deg, #ffc65e, #d6761a); --tab-on-ink: #2a1200;
  --hot-border: #ffe58a;
}

/* 大銀河: 虹の干渉色 */
html[data-era='cosmic'] {
  --bg: #020208;
  --pn: rgba(5, 5, 16, .78);
  --pn2: rgba(20, 20, 50, .66);
  --pn3: rgba(44, 40, 96, .56);
  --ink: #fff; --ink2: #c5c8ee; --ink3: #8588b8;
  --line: rgba(200, 200, 255, .22);
  --acc: #9c7bff; --acc2: #52e6ff; --acc-ink: #fff;
  --good: #fff; --warn: #ff7a8a;
  --neon: rgba(156, 123, 255, .9);
  --glow: 1;
  --frame: conic-gradient(from 210deg, #ff6ad5, #ffd86b, #6bffb8, #52d6ff, #9c7bff, #ff6ad5);
  --frame-w: 3px;
  --g-disp: var(--g-rainbow);
  --g-btn: linear-gradient(120deg, #7f5bff, #d84dff 55%, #4dcbff);
  --g-btn-ghost: linear-gradient(180deg, rgba(60, 58, 130, .7), rgba(20, 20, 60, .7));
  --dg-font: var(--f-disp);
  --dg-tile: linear-gradient(180deg, rgba(30, 28, 80, .7), rgba(6, 6, 22, .7));
  --dg-tile-line: rgba(220, 210, 255, .28);
  --dg-fill: linear-gradient(180deg, #fff 8%, #cdbcff 45%, #6bd6ff 85%);
  --dg-shadow: 0 0 16px rgba(170, 140, 255, .9);
  --r: 14px;
  --plate: linear-gradient(180deg, rgba(26, 24, 70, .86), rgba(4, 4, 18, .86));
  --shadow: 0 10px 40px rgba(0, 0, 0, .7), 0 0 34px rgba(156, 123, 255, .18);
  --bg-img: radial-gradient(1000px 700px at 30% 30%, #2a1a6a, transparent 70%), radial-gradient(900px 700px at 80% 70%, #0d3f6a, transparent 70%), #020208;
  --tab-on: linear-gradient(120deg, #7f5bff, #d84dff); --tab-on-ink: #fff;
  --hot-border: #fff;
}

/* 本宮: もう一度、白。朱の鳥居だけが色を持つ */
html[data-era='final'] {
  --bg: #f6f5f1;
  --pn: rgba(255, 255, 255, .78);
  --pn2: rgba(248, 245, 238, .84);
  --pn3: rgba(236, 230, 218, .84);
  --ink: #1b1815; --ink2: #5f584e; --ink3: #968e80;
  --line: rgba(30, 20, 10, .2);
  --acc: #c8321f; --acc2: #8b5e34; --acc-ink: #fff;
  --good: #c8321f; --warn: #c8321f;
  --neon: rgba(200, 50, 31, .25);
  --glow: .2;
  --frame: linear-gradient(155deg, #fff 0%, #cfc7b6 40%, #fff 60%, #a79f8e 100%);
  --frame-w: 2px;
  --g-disp: linear-gradient(180deg, #d83a24, #7f1407);
  --g-btn: linear-gradient(180deg, #d83a24, #9c1d0d);
  --g-btn-ghost: linear-gradient(180deg, #fff, #f0ebe0);
  --dg-font: var(--f-disp);
  --dg-tile: linear-gradient(180deg, #fff, #f1ece1);
  --dg-tile-line: rgba(30, 20, 10, .18);
  --dg-fill: linear-gradient(180deg, #2a2219, #0f0c09);
  --dg-shadow: none;
  --r: 2px;
  --plate: linear-gradient(180deg, #fff, #f3efe6);
  --shadow: 0 6px 22px rgba(30, 20, 10, .14);
  --bg-img: radial-gradient(1200px 800px at 50% 40%, #fff, #e8e4da 85%);
  --tab-on: #c8321f; --tab-on-ink: #fff;
  --hot-border: #c8321f;
}

/* ===== 2. 土台 ================================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); overflow: hidden; }
body {
  font-family: var(--f-body); color: var(--ink); -webkit-font-smoothing: antialiased;
  user-select: none; -webkit-user-select: none; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; overscroll-behavior: none;
}
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; }
p { margin: 0; }
#view3d, #fx-overlay { position: fixed; inset: 0; }
#view3d { background: var(--bg-img); }
#fx-overlay { pointer-events: none; z-index: 5; }
#ui-root { position: fixed; inset: 0; z-index: 10; pointer-events: none; overflow: hidden; }
#ui-stage {
  position: absolute; left: 0; top: 0; width: 1920px; height: 1080px;
  transform-origin: 0 0; pointer-events: none; font-size: 18px; line-height: 1.45;
  --px: 0px; --bleed-x: 0px; --bleed-y: 0px;
}
html[data-layout='portrait'] #ui-stage { width: 1080px; height: calc(1920px + var(--px)); }
/* backdrop-filter は transform で縮めた #ui-stage の中だと Chromium が途中で鏡像を作るので使わず、
   後ろの面そのものを filter でぼかす */
#ui-backdrop { position: absolute; inset: calc(-1 * var(--bleed-y)) calc(-1 * var(--bleed-x)); z-index: 6; background-color: transparent; pointer-events: none; transition: background-color .25s; }
#ui-backdrop.on { background-color: rgba(6, 5, 12, .58); pointer-events: auto; }
html:has(#ui-backdrop.on) #hud, html:has(#ui-backdrop.on) #view3d { filter: blur(6px); }
html[data-quality='low']:has(#ui-backdrop.on) #hud, html[data-quality='low']:has(#ui-backdrop.on) #view3d { filter: none; }
html[data-era='ancient'] #ui-backdrop.on, html[data-era='final'] #ui-backdrop.on { background-color: rgba(60, 50, 40, .34); }
html[data-quality='low'] * { backdrop-filter: none !important; }
html[data-hud-hidden] #hud { opacity: 0; pointer-events: none; }
#hud { position: absolute; inset: 0; transition: opacity .4s; }
.scrolly { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--acc2) transparent; }
.scrolly::-webkit-scrollbar { width: 8px; }
.scrolly::-webkit-scrollbar-thumb { background: var(--acc2); border-radius: 4px; }
.scrolly::-webkit-scrollbar-track { background: transparent; }

/* ガラス＋金属枠のパネル */
.pn {
  position: relative; background: var(--pn); border-radius: var(--r);
  box-shadow: var(--shadow); backdrop-filter: blur(16px) saturate(1.2); pointer-events: auto;
}
.pn::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: var(--frame-w);
  background: var(--frame); pointer-events: none; z-index: 2;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
}
.pn::after { /* ガラスの反射 */
  content: ''; position: absolute; inset: var(--frame-w); border-radius: inherit; pointer-events: none; z-index: 1;
  background: linear-gradient(165deg, rgba(255, 255, 255, .16) 0%, rgba(255, 255, 255, .03) 26%, transparent 42%);
}

.disp { font-family: var(--f-disp); background: var(--g-disp); -webkit-background-clip: text; background-clip: text; color: transparent; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 8px 22px; border-radius: calc(var(--r) * .8); font-family: var(--f-round); font-weight: 800;
  background: var(--g-btn); color: var(--acc-ink); pointer-events: auto; white-space: nowrap;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .12s var(--ease-out), filter .12s, box-shadow .12s;
}
.btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .2); }
.btn[disabled] { filter: grayscale(.8) brightness(.9); opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: var(--g-btn-ghost); color: var(--ink); box-shadow: 0 2px 0 rgba(0, 0, 0, .14), inset 0 0 0 1px var(--line); }
.btn.big { min-height: 72px; font-size: 26px; padding: 10px 44px; }
.btn.danger { background: linear-gradient(180deg, #d9432c, #9c1d0d); color: #fff; }
.btn:focus-visible, .tab:focus-visible, .card:focus-visible { outline: 3px solid var(--acc2); outline-offset: 2px; }

/* ===== 3. 枠組み ============================================================== */
.col { position: absolute; top: 8px; bottom: 8px; width: 400px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
#hud-left { left: 8px; }
#hud-right { right: 8px; }
#board-slot { position: absolute; left: 592px; top: 128px; width: 736px; height: 944px; pointer-events: none; }
.rail { position: absolute; top: 128px; bottom: 8px; width: 168px; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
#rail-left { left: 420px; }
#rail-right { right: 420px; justify-content: flex-end; }
.off { display: none !important; }

/* 左: 箱庭の小窓 */
.room-win {
  flex: none; display: block; width: 400px; height: 225px; overflow: hidden; padding: 0; text-align: left;
  transition: transform .18s var(--ease-out);
}
.room-win:hover { transform: scale(1.012); }
.room-slot {
  position: absolute; inset: var(--frame-w); border-radius: calc(var(--r) - 2px); overflow: hidden;
  background:
    linear-gradient(180deg, transparent 62%, rgba(90, 70, 50, .14) 62.4%, rgba(90, 70, 50, .05) 63%, transparent 72%),
    linear-gradient(180deg, #ffffff 0%, #f5f2ea 62%, #e9e3d6 100%);
}
.room-slot canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }
.room-cap {
  position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 3; display: flex; align-items: center; gap: 8px;
  font-family: var(--f-dot); font-size: 16px; color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .75);
}
.room-cap-dot { width: 8px; height: 8px; border-radius: 50%; background: #5de38a; box-shadow: 0 0 6px #5de38a; }
.room-cap-zoom { margin-left: auto; padding: 0 8px; border-radius: 4px; background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .15s; }
.room-win:hover .room-cap-zoom { opacity: 1; }

/* 左: 通貨 */
.curs { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px; flex: none; }
.cur {
  position: relative; display: grid; grid-template-columns: 34px 1fr; grid-template-rows: 18px 28px; column-gap: 8px; align-items: center;
  padding: 7px 10px; border-radius: calc(var(--r) * .7); background: var(--pn); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); overflow: hidden; pointer-events: auto;
}
.cur-ico { grid-row: 1 / 3; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font: 800 19px/1 var(--f-round); color: #fff; text-shadow: 0 1px 1px rgba(0, 0, 0, .3); background: var(--acc); box-shadow: inset 0 2px 3px rgba(255, 255, 255, .4), inset 0 -3px 4px rgba(0, 0, 0, .25); }
.c-tickets .cur-ico { background: linear-gradient(180deg, #ffcf5e, #d48a12); }
.c-tickets .cur-ico::after { content: '券'; }
.c-inori .cur-ico { background: linear-gradient(180deg, #ff8fb1, #d6336b); }
.c-inori .cur-ico::after { content: '祈'; }
.c-fuda .cur-ico { background: linear-gradient(180deg, #ff6d5a, #b4210f); }
.c-fuda .cur-ico::after { content: '札'; }
.c-toku .cur-ico { background: linear-gradient(180deg, #d9b3ff, #7b3fd1); }
.c-toku .cur-ico::after { content: '徳'; }
.cur-l { font-size: 14px; color: var(--ink2); line-height: 1; }
.cur-v { font-family: var(--f-round); font-weight: 800; font-size: 25px; line-height: 1; white-space: nowrap; }
.cur.gain { animation: curGain .4s var(--ease-out); }
.cur.spend { animation: curSpend .3s; }
.cur.stopped .cur-v { color: var(--ink3); text-decoration: line-through; }
@keyframes curGain { 0% { box-shadow: inset 0 0 0 2px var(--good), 0 0 18px var(--good); } 100% { box-shadow: inset 0 0 0 1px var(--line), var(--shadow); } }
@keyframes curSpend { 30% { transform: translateX(-3px); } 60% { transform: translateX(3px); } }

/* 左: 立ち絵とセリフ */
.chara {
  flex: 1 1 auto; min-height: 0; overflow: hidden; background: linear-gradient(180deg, var(--pn2), var(--pn)); cursor: pointer;
}
.portrait { position: absolute; inset: var(--frame-w); overflow: hidden; border-radius: calc(var(--r) - 2px); }
.portrait::before { /* 素材が無いときの輪郭 */
  content: ''; position: absolute; left: 50%; bottom: -30px; width: 260px; height: 340px; transform: translateX(-50%);
  background: radial-gradient(70px 78px at 50% 84px, var(--pn3) 98%, transparent), radial-gradient(150px 190px at 50% 300px, var(--pn3) 98%, transparent);
  opacity: .7;
}
.portrait.has-art::before { display: none; }
.portrait img.art { position: absolute; left: 50%; bottom: 0; width: 620px; max-width: none; transform: translateX(-50%); transition: opacity .15s; object-fit: contain; }
.portrait img.art.stand { width: 300px; top: 8px; bottom: auto; }
.bubble {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 3; min-height: 66px; padding: 10px 16px; border-radius: 14px;
  font-family: var(--f-round); font-weight: 700; font-size: 19px; line-height: 1.4; color: #2b2520; background: rgba(255, 255, 255, .95);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .22); opacity: 0; transform: translateY(8px) scale(.97); transition: opacity .18s, transform .22s var(--ease-back); pointer-events: none;
}
.bubble.on { opacity: 1; transform: none; }
.bubble::after { content: ''; position: absolute; left: 66px; top: -11px; border: 12px solid transparent; border-top: 0; border-bottom-color: rgba(255, 255, 255, .95); }

/* 左: コンボとゲージ */
.status { flex: none; height: 120px; padding: 12px 16px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.combo { opacity: .42; transition: opacity .2s; }
.combo.live { opacity: 1; }
.combo-top { display: flex; align-items: baseline; gap: 10px; }
.combo-lab { font-family: var(--f-round); font-weight: 800; font-size: 15px; letter-spacing: .08em; color: var(--ink2); }
.combo-n { font-family: var(--f-disp); font-size: 42px; line-height: 1; display: inline-block; color: var(--ink); }
.combo-x { margin-left: auto; font-family: var(--f-round); font-weight: 800; font-size: 24px; color: var(--acc); }
.combo[data-lv='1'] .combo-n { color: var(--acc); }
.combo[data-lv='2'] .combo-n { color: var(--good); text-shadow: 0 0 12px var(--good); }
.combo[data-lv='3'] .combo-n { background: var(--g-rainbow); -webkit-background-clip: text; background-clip: text; color: transparent; }
.combo-bar { height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.combo-bar i { display: block; height: 100%; background: var(--acc); transform-origin: left; transform: scaleX(0); }
.gauges { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gauge { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--ink2); }
.gauge-b { flex: 1; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.gauge-b i { display: block; height: 100%; transform-origin: left; transform: scaleX(0); transition: transform .3s; }

/* ===== 4. 玉カウンター ========================================================= */
#ball-counter {
  position: absolute; left: 420px; right: 420px; top: 0; height: 120px; display: flex; align-items: center; gap: 14px; padding: 0 22px 6px;
  border-radius: 0 0 26px 26px; background: var(--plate); pointer-events: none; z-index: 3;
}
#ball-counter::after { border-radius: 0 0 24px 24px; }
.ctr-side { width: 34px; flex: none; }
.ctr-lab { writing-mode: vertical-rl; font-family: var(--f-round); font-weight: 800; font-size: 17px; letter-spacing: .24em; color: var(--ink2); }
.ctr-body { flex: 1; min-width: 0; height: 100%; display: flex; align-items: center; justify-content: flex-end; }
.ctr-digits { flex: none; transform-origin: right center; display: flex; align-items: center; gap: 4px; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .18)); }
.ctr-group { display: flex; gap: 3px; }
.dg {
  position: relative; display: block; width: 62px; height: 92px; overflow: hidden; border-radius: 7px; background: var(--dg-tile);
  box-shadow: inset 0 0 0 1px var(--dg-tile-line), inset 0 8px 10px -8px rgba(0, 0, 0, .4), inset 0 -8px 10px -8px rgba(0, 0, 0, .4);
}
.dg-strip { display: block; will-change: transform; font-family: var(--dg-font); font-size: 68px; text-shadow: none; }
.dg-strip i {
  display: block; height: 92px; line-height: 92px; text-align: center; font-style: normal;
  background: var(--dg-fill); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.dg.fast .dg-strip { filter: blur(1.4px); }
.ctr-digits { filter: drop-shadow(var(--dg-glow, 0 0 0 transparent)); }
.ctr-unit { font-family: var(--f-disp); font-size: 56px; line-height: 1; padding: 0 3px; background: var(--g-disp); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ctr-unit:empty { display: none; }
.ctr-body.long-unit .dg { width: 52px; }
.ctr-body.long-unit .ctr-unit { font-size: 34px; max-width: 150px; line-height: 1.05; }
.ctr-ball { flex: none; align-self: center; font-family: var(--f-disp); font-size: 36px; color: var(--ink); margin-left: -6px; }
.ctr-meta { flex: none; width: 200px; display: flex; flex-direction: column; gap: 8px; }
.ctr-rate { display: flex; align-items: baseline; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.ctr-rate-l { font-size: 14px; color: var(--ink2); }
.ctr-rate-v { font-family: var(--f-round); font-weight: 800; font-size: 24px; color: var(--ink); }
.ctr-next { display: flex; flex-direction: column; gap: 4px; }
.ctr-next-l { font-size: 13px; color: var(--ink2); text-align: right; line-height: 1; }
.ctr-next-b { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.ctr-next-b i { display: block; height: 100%; background: var(--acc); transform-origin: left; transform: scaleX(0); transition: transform .3s; }
.ctr-leds { /* 豆電球の帯。時代が進むと流れ出す */
  position: absolute; left: 24px; right: 24px; bottom: 5px; height: 6px; opacity: 0; pointer-events: none; z-index: 3;
  background: radial-gradient(circle at 5px 3px, var(--acc2) 0 2.2px, transparent 2.6px) 0 0 / 14px 6px;
  animation: ledRun 1s linear infinite;
}
html[data-era='showa'] .ctr-leds, html[data-era='heisei'] .ctr-leds, html[data-era='modern'] .ctr-leds,
html[data-era='mystic'] .ctr-leds, html[data-era='magic'] .ctr-leds, html[data-era='cosmic'] .ctr-leds { opacity: 1; }
@keyframes ledRun { to { background-position-x: 14px; } }
#ball-counter.kick .ctr-body { animation: kick .4s var(--ease-out); }
#ball-counter.kick-big .ctr-body { animation: kickBig .42s var(--ease-out); }
#ball-counter.spend .ctr-body { animation: curSpend .28s; }
@keyframes kick { 0% { transform: scale(1); } 28% { transform: scale(1.045) translateY(-3px); } 100% { transform: scale(1); } }
@keyframes kickBig { 0% { transform: scale(1); filter: brightness(1); } 25% { transform: scale(1.1) translateY(-6px); filter: brightness(1.5); } 55% { transform: scale(.985); } 100% { transform: scale(1); filter: brightness(1); } }
.stamp { animation: stamp .7s var(--ease-back); }
@keyframes stamp { 0% { transform: scale(2.4) rotate(-8deg); opacity: 0; } 50% { transform: scale(.9) rotate(1deg); opacity: 1; } 100% { transform: none; } }
.bump { animation: bump .28s var(--ease-back); }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.32); } 100% { transform: scale(1); } }
.float-gain {
  position: absolute; right: 250px; top: 86px; font-family: var(--f-disp); color: var(--good); white-space: nowrap; pointer-events: none; z-index: 5;
  text-shadow: 0 2px 0 rgba(0, 0, 0, .35); animation: floatUp 1s var(--ease-out) forwards;
}
@keyframes floatUp { 0% { transform: translate(var(--dx), 26px) scale(.7); opacity: 0; } 18% { opacity: 1; transform: translate(var(--dx), 0) scale(1.08); } 100% { transform: translate(var(--dx), -30px) scale(1); opacity: 0; } }
.unit-banner {
  position: absolute; left: 50%; top: 300px; transform: translateX(-50%); text-align: center; pointer-events: none; z-index: 8; animation: unitIn 1.7s var(--ease-out) forwards;
}
.unit-banner .disp { display: block; font-size: 240px; line-height: 1; filter: drop-shadow(0 6px 0 rgba(0, 0, 0, .25)) drop-shadow(0 0 calc(30px * var(--glow) * var(--user-glow)) var(--neon)); }
.unit-banner em { font-style: normal; font-family: var(--f-round); font-weight: 800; font-size: 30px; color: var(--ink); text-shadow: 0 0 8px var(--pn); }
@keyframes unitIn { 0% { transform: translateX(-50%) scale(3); opacity: 0; } 18% { transform: translateX(-50%) scale(.94); opacity: 1; } 28% { transform: translateX(-50%) scale(1); } 80% { opacity: 1; } 100% { transform: translateX(-50%) scale(1.04); opacity: 0; } }

/* 中央左レール: 台の銘板、保留、モード */
.m-plate { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; cursor: pointer; }
.mp-no { font-family: var(--f-disp); font-size: 28px; line-height: 1; color: var(--acc); }
.mp-name { font-family: var(--f-round); font-weight: 800; font-size: 16px; line-height: 1.3; }
.mp-nick { font-size: 14px; color: var(--ink2); }
.mp-bet { font-size: 14px; color: var(--acc); font-weight: 700; }
.mp-bet:empty { display: none; }
.hold-wrap { padding: 10px 12px; border-radius: 12px; background: var(--pn); box-shadow: inset 0 0 0 1px var(--line); pointer-events: auto; }
.hold-l { display: block; font-size: 14px; color: var(--ink2); margin-bottom: 6px; }
.holds { display: flex; justify-content: space-between; }
.hold { width: 28px; height: 28px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .15), rgba(0, 0, 0, .3)); box-shadow: inset 0 0 0 1px var(--line); transition: background .15s, box-shadow .15s; }
.hold[data-c='white'] { background: radial-gradient(circle at 35% 30%, #fff, #bcc6d2); box-shadow: 0 0 calc(10px * var(--user-glow)) #fff; }
.hold[data-c='blue'] { background: radial-gradient(circle at 35% 30%, #bfe4ff, #1f7fe0); box-shadow: 0 0 calc(12px * var(--user-glow)) #3fa9ff; }
.hold[data-c='yellow'] { background: radial-gradient(circle at 35% 30%, #fff5b0, #e6b400); box-shadow: 0 0 calc(12px * var(--user-glow)) #ffd23d; }
.hold[data-c='green'] { background: radial-gradient(circle at 35% 30%, #c9ffd9, #17a84d); box-shadow: 0 0 calc(12px * var(--user-glow)) #3de07d; }
.hold[data-c='red'] { background: radial-gradient(circle at 35% 30%, #ffc2b6, #dc1f12); box-shadow: 0 0 calc(14px * var(--user-glow)) #ff3b2e; }
.hold[data-c='gold'] { background: radial-gradient(circle at 35% 30%, #fff6c8, #d68e00); box-shadow: 0 0 calc(16px * var(--user-glow)) #ffc531; }
.hold[data-c='rainbow'] { background: conic-gradient(#ff4d6d, #ffb03a, #ffe94d, #4dff9a, #4dc3ff, #9a6bff, #ff4d6d); box-shadow: 0 0 calc(18px * var(--user-glow)) #fff; animation: spinHue 1.2s linear infinite; }
@keyframes spinHue { to { filter: hue-rotate(360deg); } }
.mode-badge {
  padding: 8px 10px; text-align: center; border-radius: 12px; font-family: var(--f-disp); font-size: 34px; line-height: 1.1; color: #fff; pointer-events: auto;
  background: linear-gradient(180deg, #ff5a3c, #c8001e); box-shadow: 0 0 calc(18px * var(--user-glow)) rgba(255, 60, 40, .7), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.mode-badge[data-mode='st'] { background: linear-gradient(180deg, #5a7bff, #2a2acc); box-shadow: 0 0 calc(18px * var(--user-glow)) rgba(80, 110, 255, .7); }
.mode-badge[data-mode='jitan'] { background: linear-gradient(180deg, #3cc28a, #0d7a56); box-shadow: none; }
.mode-badge[data-mode='rush'] { background: var(--g-rainbow); color: #2a0030; text-shadow: 0 1px 0 rgba(255, 255, 255, .6); }
.round-box { padding: 10px 12px; border-radius: 12px; text-align: center; background: var(--plate); box-shadow: inset 0 0 0 2px var(--good), 0 0 calc(16px * var(--user-glow)) var(--good); pointer-events: auto; }
.round-l { display: block; font-family: var(--f-round); font-weight: 800; font-size: 14px; letter-spacing: .12em; color: var(--good); }
.round-n { font-family: var(--f-disp); font-size: 52px; line-height: 1; }
.round-of { font-family: var(--f-round); font-weight: 800; font-size: 22px; color: var(--ink2); }
.round-t { display: block; font-family: var(--f-round); font-weight: 800; font-size: 19px; color: var(--good); }

/* ===== 5. ショップ ============================================================ */
.shop { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; padding: 8px; }
.tabs { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; position: relative; z-index: 3; }
.tab {
  position: relative; height: 54px; border-radius: calc(var(--r) * .7) calc(var(--r) * .7) 6px 6px; font-family: var(--f-round); font-weight: 800; font-size: 21px; color: var(--ink2);
  background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); transition: transform .12s, background .15s, color .15s;
}
.tab:hover:not(.on):not(.locked) { color: var(--ink); transform: translateY(-1px); }
.tab.on { background: var(--tab-on); color: var(--tab-on-ink); box-shadow: 0 3px 10px rgba(0, 0, 0, .2); }
.tab.locked { opacity: .36; cursor: not-allowed; }
.tab.locked span::after { content: ''; display: block; width: 0; }
.tab-badge {
  position: absolute; top: -6px; right: -3px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; display: none; font: 800 15px/24px var(--f-round); text-align: center; color: #fff;
  background: linear-gradient(180deg, #ff5a4a, #d4210f); box-shadow: 0 2px 4px rgba(0, 0, 0, .3);
}
.tab-badge.on { display: block; animation: badgeIn .3s var(--ease-back); }
@keyframes badgeIn { from { transform: scale(0); } }
.shop-head { display: flex; align-items: center; justify-content: space-between; height: 46px; padding: 2px 6px; position: relative; z-index: 3; }
.shop-head-l { display: flex; flex-direction: column; line-height: 1.15; }
.shop-title { font-family: var(--f-round); font-weight: 800; font-size: 17px; }
.shop-sum { font-size: 14px; color: var(--ink2); }
.mults { display: flex; gap: 3px; }
.mult { min-width: 46px; height: 32px; padding: 0 6px; border-radius: 7px; font: 800 15px var(--f-round); color: var(--ink2); box-shadow: inset 0 0 0 1px var(--line); }
.mult.on { background: var(--tab-on); color: var(--tab-on-ink); box-shadow: none; }
.shop-list { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 2px 3px 8px 0; position: relative; z-index: 3; }
.shop-list.tab-in { animation: tabIn .28s var(--ease-out); }
@keyframes tabIn { from { opacity: 0; transform: translateX(14px); } }
.shop-empty { padding: 40px 0; text-align: center; color: var(--ink3); }

.card {
  --bd: var(--line);
  position: relative; flex: none; display: grid; grid-template-columns: 58px 1fr 98px; align-items: center; gap: 10px; width: 100%; min-height: 96px; padding: 8px 10px; text-align: left;
  border-radius: calc(var(--r) * .8); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--bd); overflow: hidden; transition: transform .12s var(--ease-out), box-shadow .15s, filter .15s; pointer-events: auto;
}
.card-ico {
  position: relative; width: 58px; height: 58px; border-radius: 12px; display: grid; place-items: center; overflow: hidden; font-family: var(--f-disp); font-size: 28px; color: #fff;
  background: linear-gradient(160deg, var(--acc2), var(--acc)); box-shadow: inset 0 2px 2px rgba(255, 255, 255, .35), inset 0 -3px 5px rgba(0, 0, 0, .22);
}
.card-ico[data-kind='nail'] { background: linear-gradient(160deg, #9fb0c0, #4d5e70); }
.card-ico[data-kind='pay'] { background: linear-gradient(160deg, #ffd66b, #cf8a10); }
.card-ico[data-kind='rate'] { background: linear-gradient(160deg, #6fc3ff, #1f6fd0); }
.card-ico[data-kind='yaku'] { background: linear-gradient(160deg, #ff8f7a, #cc3320); }
.card-ico[data-kind='prob'] { background: linear-gradient(160deg, #d78bff, #7a33cc); }
.card-ico[data-kind='round'] { background: linear-gradient(160deg, #ff9fd0, #d02a84); }
.card-ico[data-kind='cont'] { background: linear-gradient(160deg, #7be0b0, #129063); }
.card-ico[data-kind='unique'] { background: var(--g-rainbow); }
.card-ico img.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.card-m { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.card-top { display: flex; align-items: baseline; gap: 6px; }
.card-name { font-family: var(--f-round); font-weight: 800; font-size: 18px; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-lv { margin-left: auto; flex: none; display: inline-block; font-family: var(--f-round); font-weight: 800; font-size: 14px; color: var(--ink2); }
.card-desc { font-size: 14px; line-height: 1.32; color: var(--ink2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-eff { font-family: var(--f-round); font-weight: 800; font-size: 14px; color: var(--acc); line-height: 1.2; }
.card-eff:empty { display: none; }
.card-buy {
  position: relative; height: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 10px; text-align: center; line-height: 1.1;
  background: var(--pn3); color: var(--ink2);
}
.card-price { font-family: var(--f-round); font-weight: 800; font-size: 20px; white-space: nowrap; }
.card-cur { font-size: 13px; }
.card-prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: transparent; }
.card-prog i { display: block; height: 100%; background: var(--acc2); opacity: .7; transform-origin: left; transform: scaleX(0); transition: transform .2s; }
.card:hover:not(.locked):not(.maxed) { transform: translateX(-2px); filter: brightness(1.04); }
.card:active:not(.locked):not(.maxed) { transform: scale(.985); }

/* 買える: 枠を光が回り、値札が点灯する */
.card.afford { box-shadow: inset 0 0 0 1px var(--hot-border), 0 0 calc(12px * var(--glow) * var(--user-glow)) var(--neon); }
.card.afford::before {
  content: ''; position: absolute; inset: 0; border-radius: inherit; padding: 2px; pointer-events: none;
  background: conic-gradient(from var(--spin), transparent 0 62%, var(--hot-border) 78%, #fff 84%, var(--hot-border) 90%, transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spinB 2.6s linear infinite;
}
@keyframes spinB { to { --spin: 360deg; } }
.card.afford .card-buy { background: var(--g-btn); color: var(--acc-ink); box-shadow: 0 2px 0 rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .4); }
.card.afford .card-buy::after {
  content: ''; position: absolute; inset: 0; border-radius: inherit; overflow: hidden;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .55) 50%, transparent 62%) -120px 0 / 240% 100% no-repeat; animation: glint 2.8s ease-in-out infinite;
}
@keyframes glint { 0%, 55% { background-position: 160% 0; } 100% { background-position: -80% 0; } }
.card.afford .card-prog { display: none; }
.card.locked { filter: saturate(.3); opacity: .62; }
.card.maxed { opacity: .72; }
.card.maxed .card-buy { background: none; box-shadow: inset 0 0 0 1px var(--line); }
.card.maxed .card-price { font-size: 17px; }
.card.nope { animation: nope .28s; }
.nope { animation: nope .28s; }
@keyframes nope { 20% { transform: translateX(-5px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } }
.card.bought { animation: cardBought .6s var(--ease-out); }
.card.bought::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; mix-blend-mode: screen;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .95) 50%, transparent 70%) 0 0 / 300% 100% no-repeat; animation: sweep .55s var(--ease-out) forwards;
}
html[data-era='ancient'] .card.bought::after, html[data-era='final'] .card.bought::after { mix-blend-mode: normal; background-image: linear-gradient(100deg, transparent 30%, rgba(230, 190, 110, .6) 50%, transparent 70%); }
@keyframes sweep { from { background-position: 130% 0; } to { background-position: -40% 0; } }
@keyframes cardBought { 0% { transform: scale(1); } 22% { transform: scale(1.03); } 100% { transform: scale(1); } }
.spark { position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); pointer-events: none; animation: spark .55s var(--ease-out) forwards; }
@keyframes spark { to { transform: translate(var(--x), var(--y)) scale(.1); opacity: 0; } }

.card-big { grid-template-columns: 96px 1fr 104px; min-height: 124px; background: var(--plate); }
.card-big .card-ico { width: 96px; height: 106px; border-radius: 8px; font-size: 40px; }
.card-big .card-name { font-size: 20px; white-space: normal; }

/* 右下: 交換所の帯と機能ボタン */
.dock { flex: none; padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.xq {
  position: relative; z-index: 3; height: 76px; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 0; border-radius: calc(var(--r) * .8); overflow: hidden; text-align: left;
  background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); transition: transform .12s;
}
.xq:hover { transform: translateY(-1px); }
.xq-bust { position: relative; width: 84px; height: 76px; flex: none; background: linear-gradient(180deg, #1d5a4a, #0b3029); overflow: hidden; }
.xq-bust img.art { position: absolute; left: 50%; top: -6px; width: 190px; max-width: none; transform: translateX(-50%); }
.xq-t { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.xq-t b { font-family: var(--f-round); font-size: 20px; font-weight: 800; }
.xq-rate { font-size: 14px; color: var(--ink2); }
.xq-go { flex: none; font: 800 19px var(--f-round); color: var(--ink3); }
.xq.hot { box-shadow: inset 0 0 0 1px var(--hot-border); }
.xq.hot .xq-go { color: var(--acc); }
.fbs { position: relative; z-index: 3; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; }
.fb {
  position: relative; height: 76px; border-radius: calc(var(--r) * .8); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); transition: transform .12s;
}
.fb b { font-family: var(--f-round); font-weight: 800; font-size: 15px; white-space: nowrap; }
.fb small { display: none; }
.fb:hover { transform: translateY(-1px); }
.fb-i { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-family: var(--f-disp); font-size: 18px; color: #fff; background: linear-gradient(160deg, var(--acc2), var(--acc)); }
.fb-i[data-id='gacha']::after { content: '籤'; }
.fb-i[data-id='codex']::after { content: '鑑'; }
.fb-i[data-id='prestige']::after { content: '遷'; }
.fb-i[data-id='settings']::after { content: '設'; }
.fb-badge { position: absolute; top: -6px; right: -2px; padding: 0 7px; height: 24px; border-radius: 12px; font: 800 14px/24px var(--f-round); color: #fff; background: linear-gradient(180deg, #ff5a4a, #d4210f); font-style: normal; }
.fb-badge:empty { display: none; }
.fb.hot { box-shadow: inset 0 0 0 1px var(--hot-border), 0 0 calc(10px * var(--glow) * var(--user-glow)) var(--neon); }

/* ===== 6. 発射 UI ============================================================= */
.lc { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 10px 10px; }
.lc > * { position: relative; z-index: 3; }
.lc-t { font-family: var(--f-round); font-weight: 800; font-size: 17px; text-align: center; line-height: 1.2; }
.lc-h { font-size: 13px; color: var(--ink2); text-align: center; line-height: 1.3; }
.lc-b { width: 100%; }
.lc.lc-in { animation: lcIn .45s var(--ease-back); }
@keyframes lcIn { from { opacity: 0; transform: translateY(26px) scale(.94); } }
.lc.kicked .lw { animation: kicked .2s; }
@keyframes kicked { 30% { transform: translateY(-4px); } }
.lw { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; }
.lw-pct { font-family: var(--f-disp); font-size: 26px; line-height: 1; }
.lw-sub {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; width: 100%; padding: 4px 8px; border-radius: 9px; font: 800 14px var(--f-round);
  background: var(--g-btn-ghost); box-shadow: inset 0 0 0 1px var(--line); transition: filter .12s, transform .1s;
}
.lw-sub.on { background: var(--g-btn); color: var(--acc-ink); }
.hit { animation: hitPress .18s; }
@keyframes hitPress { 40% { transform: scale(.9); } }

/* 棒突き */
.pl-track {
  position: relative; width: 104px; height: 330px; border-radius: 12px; cursor: grab; touch-action: none; overflow: hidden;
  background: linear-gradient(90deg, rgba(0, 0, 0, .1), transparent 30%, transparent 70%, rgba(0, 0, 0, .1)), var(--pn3);
  box-shadow: inset 0 0 0 1px var(--line), inset 0 4px 10px rgba(0, 0, 0, .12);
}
.pl-track:active { cursor: grabbing; }
.pl-fill { position: absolute; left: 0; bottom: 0; width: 7px; height: 100%; background: var(--acc); transform-origin: bottom; transform: scaleY(0); }
.pl-spring {
  position: absolute; left: 50%; top: 8px; width: 40px; height: 96px; margin-left: -20px; transform-origin: top; transform: scaleY(var(--sq, 1));
  background: repeating-linear-gradient(170deg, #8f98a3 0 4px, #e9edf1 4px 6px, transparent 6px 11px);
}
.pl-rod { position: absolute; left: 50%; top: 96px; width: 56px; margin-left: -28px; height: 210px; will-change: transform; transform: translateY(calc(var(--p, 0) * var(--pl-travel, 120px))); }
.pl-tip { position: absolute; left: 50%; top: 0; width: 26px; height: 26px; margin-left: -13px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #e7d3ae, #a57c49 70%); }
.pl-shaft { position: absolute; left: 50%; top: 20px; width: 14px; height: 64px; margin-left: -7px; background: linear-gradient(90deg, #6a4c2e, #c79c66 40%, #8a6339); }
.pl-knob { position: absolute; left: 0; top: 72px; width: 56px; height: 34px; border-radius: 10px; background: linear-gradient(180deg, #d2a874, #8a6036); box-shadow: 0 3px 5px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .5); }
.pl-track.shot .pl-spring { animation: springShot .2s; }
@keyframes springShot { 30% { transform: scaleY(1.2); } }

/* 縦ゲージ（バネ溜め／目押し／連発） */
.gg {
  position: relative; width: 84px; height: 330px; border-radius: 12px; overflow: hidden; cursor: pointer; touch-action: none;
  background: var(--pn3); box-shadow: inset 0 0 0 1px var(--line), inset 0 4px 10px rgba(0, 0, 0, .14);
}
.gg-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 100%; transform-origin: bottom; transform: scaleY(0); background: linear-gradient(0deg, var(--acc2), var(--acc) 70%, var(--good)); }
.gg-coil { position: absolute; inset: 14px 16px; display: flex; flex-direction: column; justify-content: space-evenly; transform-origin: bottom; pointer-events: none; }
.gg-coil i { display: block; height: 10px; border-radius: 5px; background: linear-gradient(180deg, #eef1f4, #8d97a3); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); }
.gg-mark { position: absolute; left: 0; right: 0; bottom: 74%; height: 3px; background: var(--ink); opacity: .8; }
.fk-band { position: absolute; left: 0; right: 0; transition: bottom .22s var(--ease-out), height .22s var(--ease-out); background: linear-gradient(90deg, var(--good), #fff 50%, var(--good)); opacity: .85; box-shadow: 0 0 calc(14px * var(--user-glow)) var(--good); }
.fk-needle { position: absolute; left: -2px; right: -2px; height: 6px; margin-bottom: -3px; background: var(--ink); box-shadow: 0 0 6px rgba(0, 0, 0, .4); }
.fk-judge { position: absolute; left: 0; right: 0; top: 50%; text-align: center; font: 800 18px var(--f-round); color: var(--acc); opacity: 0; }
.fk-judge.pop { animation: judgePop .42s var(--ease-out); }
@keyframes judgePop { 0% { opacity: 1; transform: translateY(0) scale(1.3); } 100% { opacity: 0; transform: translateY(-40px); } }
.fk-judge.miss { color: var(--ink2); }
.fk-mem { position: absolute; left: 0; width: 12px; height: 4px; margin-bottom: -2px; border-radius: 0 2px 2px 0; background: var(--acc); opacity: 0; }
.gg.fk.on { box-shadow: inset 0 0 0 2px var(--acc), 0 0 calc(10px * var(--user-glow)) var(--acc); }
.gg.fk.on .fk-mem { opacity: 1; }
.fk-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 110px; }
.fk-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--line); }
.fk-dots i.on { background: var(--good); box-shadow: 0 0 8px var(--good); }
.gg-thumb { position: absolute; left: 6px; right: 6px; height: 16px; margin-bottom: -8px; border-radius: 6px; background: var(--g-silver); box-shadow: 0 2px 4px rgba(0, 0, 0, .35); }
.gg.hd.on { box-shadow: inset 0 0 0 2px var(--acc), 0 0 calc(14px * var(--user-glow)) var(--acc); }

/* ダイヤル（電動ハンドル） */
.dl { position: relative; flex: none; width: 148px; height: 148px; touch-action: none; cursor: grab; }
.dl.grab { cursor: grabbing; }
.dl-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 225deg, var(--acc) 0 var(--p, 0deg), var(--line) var(--p, 0deg) 270deg, transparent 270deg);
  -webkit-mask: radial-gradient(circle, transparent 60px, #000 61px); mask: radial-gradient(circle, transparent 60px, #000 61px);
}
.dl-band {
  position: absolute; inset: 0; border-radius: 50%; pointer-events: none;
  background: conic-gradient(from 225deg, transparent 0 var(--b0, 0deg), #ffd23a var(--b0, 0deg) var(--b1, 0deg), transparent var(--b1, 0deg));
  -webkit-mask: radial-gradient(circle, transparent 66px, #000 67px); mask: radial-gradient(circle, transparent 66px, #000 67px);
  opacity: .8; filter: drop-shadow(0 0 calc(4px * var(--user-glow)) #ffd23a);
}
.dl-band.hit { opacity: 1; filter: brightness(1.25) drop-shadow(0 0 calc(9px * var(--user-glow)) #fff2a0); }
.dl-knob {
  position: absolute; inset: 15px; border-radius: 50%; background: conic-gradient(from 0deg, #eef2f6, #7e8a97, #f5f8fa, #66717e, #eef2f6, #7e8a97, #f5f8fa, #66717e, #eef2f6);
  box-shadow: 0 6px 12px rgba(0, 0, 0, .4), inset 0 2px 3px rgba(255, 255, 255, .8), inset 0 -3px 5px rgba(0, 0, 0, .35); will-change: transform;
}
.dl-grip { position: absolute; left: 50%; top: 4px; width: 10px; height: 26px; margin-left: -5px; border-radius: 5px; background: var(--acc); box-shadow: 0 0 calc(8px * var(--user-glow)) var(--acc); }
.dl-cap { position: absolute; inset: 30px; border-radius: 50%; background: var(--plate); box-shadow: inset 0 2px 4px rgba(0, 0, 0, .3), 0 1px 0 rgba(255, 255, 255, .6); }
.dl-pct { position: absolute; left: 0; right: 0; top: 50%; margin-top: -15px; text-align: center; font-family: var(--f-disp); font-size: 25px; line-height: 30px; color: var(--ink); pointer-events: none; }
.coin-i { width: 20px; height: 20px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #b8c0c8 70%); box-shadow: inset 0 0 0 2px #98a2ad; }
.lw-round {
  width: 118px; height: 118px; border-radius: 50%; font-family: var(--f-disp); font-size: 25px; color: #fff; touch-action: none; position: relative;
  background: radial-gradient(circle at 40% 30%, #ff8f7a, #e0301c 55%, #8a0f05);
  box-shadow: 0 7px 0 #5c0a03, 0 10px 18px rgba(0, 0, 0, .4), inset 0 3px 3px rgba(255, 255, 255, .55), 0 0 0 5px rgba(255, 255, 255, .12);
  transition: transform .08s, box-shadow .08s;
}
.lw-round:active { transform: translateY(5px); box-shadow: 0 2px 0 #5c0a03, 0 3px 6px rgba(0, 0, 0, .4), inset 0 3px 3px rgba(255, 255, 255, .4); }
.lw-round.stop { background: radial-gradient(circle at 40% 30%, #fff1a0, #eaa60c 55%, #8f5a04); box-shadow: 0 7px 0 #5e3a02, 0 10px 18px rgba(0, 0, 0, .4), inset 0 3px 3px rgba(255, 255, 255, .6); color: #4a2800; }
/* PUSH: 外周のリングがヘソのゲージ、下の点が拳の残数。窓の中は金に脈打つ */
.lw-round.push { transition: transform .08s, box-shadow .08s, filter .2s; }
.lw-round.push::before { content: ''; position: absolute; inset: -9px; border-radius: 50%; pointer-events: none; background: conic-gradient(#ffd23a var(--g, 0deg), rgba(255, 255, 255, .1) 0); -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 calc(100% - 4px)); }
.lw-round.push.empty { filter: saturate(.3) brightness(.68); }
.lw-round.push.hot { animation: push-hot .34s ease-in-out infinite alternate; }
@keyframes push-hot { from { box-shadow: 0 7px 0 #5c0a03, 0 0 0 5px #ffd23a, 0 0 calc(18px * var(--user-glow)) 6px #ffb020; } to { box-shadow: 0 7px 0 #5c0a03, 0 0 0 9px #ffe680, 0 0 calc(34px * var(--user-glow)) 14px #ffb020; } }
.push-pips { position: absolute; left: 0; right: 0; bottom: 17px; display: flex; justify-content: center; gap: 5px; pointer-events: none; }
.push-pips i { width: 10px; height: 10px; border-radius: 50%; background: rgba(0, 0, 0, .45); box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .4); }
.push-pips i.on { background: #ffd23a; box-shadow: 0 0 calc(7px * var(--user-glow)) #ffd23a, inset 0 0 0 1.5px #fff6c0; }
.lw-toggle { position: relative; display: grid; grid-template-columns: 1fr 1fr; width: 100%; height: 58px; border-radius: 12px; overflow: hidden; background: var(--pn3); box-shadow: inset 0 0 0 1px var(--line); font: 800 15px var(--f-round); }
.lw-toggle span { z-index: 1; align-self: center; text-align: center; transition: color .15s; }
.rt-l { color: var(--acc-ink); }
.rt-r { color: var(--ink2); }
.rt-k { position: absolute; left: 3px; top: 3px; bottom: 3px; width: calc(50% - 3px); border-radius: 9px; background: var(--g-btn); transition: transform .18s var(--ease-out); }
.lw-toggle.on .rt-k { transform: translateX(100%); }
.lw-toggle.on .rt-l { color: var(--ink2); }
.lw-toggle.on .rt-r { color: var(--acc-ink); }
.lw-toggle.want { animation: wantPulse .6s ease-in-out infinite alternate; }
@keyframes wantPulse { to { box-shadow: inset 0 0 0 3px var(--good), 0 0 calc(18px * var(--user-glow)) var(--good); } }

/* 盤面を触る台 */
.tool-card { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 6px; border-radius: 10px; background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); font-size: 14px; text-align: center; line-height: 1.3; }
.tool-ico { width: 54px; height: 54px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #c7f3ff, #2ea0e0); box-shadow: 0 0 calc(12px * var(--user-glow)) var(--acc); }
.tool-ico.orbit { background: radial-gradient(circle at 40% 35%, #fff 0 10%, #ffd66b 12%, transparent 30%), radial-gradient(circle, transparent 54%, var(--acc) 56% 60%, transparent 62%); box-shadow: none; }
.pw { width: 100%; display: flex; flex-direction: column; gap: 3px; font-size: 13px; color: var(--ink2); }
.pw-b { height: 26px; border-radius: 8px; overflow: hidden; background: var(--pn3); box-shadow: inset 0 0 0 1px var(--line); touch-action: none; cursor: ew-resize; }
.pw-b i { display: block; height: 100%; background: var(--g-btn); transform-origin: left; transform: scaleX(0); }
.lw-hold {
  width: 100%; height: 72px; border-radius: 12px; font: 800 22px var(--f-round); touch-action: none; color: var(--acc-ink); background: var(--g-btn);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .4); transition: transform .08s, box-shadow .08s;
}
.lw-hold.on { transform: translateY(3px); box-shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 0 calc(16px * var(--user-glow)) var(--acc); }
.lw-hold.heat { height: 100%; flex: 1; background: linear-gradient(180deg, #ff9a3c, #d43a10); color: #fff; }
.dp-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; width: 100%; }
.dp-s { height: 62px; border-radius: 10px; display: grid; place-items: center; background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.dp-s.on { box-shadow: inset 0 0 0 2px var(--acc); }
.dp-s i { width: var(--s); height: var(--s); border-radius: 50% 50% 50% 50% / 62% 62% 42% 42%; background: radial-gradient(circle at 35% 30%, #fff, #a8b4c0 60%, #5a6673); }
.dp-s { position: relative; }
.dp-k { position: absolute; left: 6px; top: 4px; font-size: 12px; line-height: 1; color: var(--ink2); font-weight: 700; }
html[data-layout='portrait'] .dp-k { display: none; }
.dp-heat { display: flex; gap: 6px; width: 100%; height: 96px; }
.thermo { position: relative; flex: none; width: 24px; border-radius: 12px; overflow: hidden; background: var(--pn3); box-shadow: inset 0 0 0 1px var(--line); }
.thermo i { position: absolute; inset: 0; transform-origin: bottom; transform: scaleY(0); background: linear-gradient(0deg, #ffb03a, #ff3a1a); }
.cd { position: relative; width: 148px; height: 148px; }
.cd-core { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; background: radial-gradient(circle, #fff, var(--acc)); box-shadow: 0 0 calc(14px * var(--user-glow)) var(--acc); }
.cd-f { position: absolute; width: 42px; height: 42px; margin: -21px 0 0 -21px; border-radius: 50%; font: 800 17px var(--f-round); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); touch-action: none; }
.cd-f.hot { background: var(--g-btn); color: var(--acc-ink); box-shadow: 0 0 calc(14px * var(--user-glow)) var(--acc); animation: wantPulse .5s infinite alternate; }
.cd-f.hv { font-size: 13px; letter-spacing: -.03em; color: #ffe9a8; box-shadow: inset 0 0 0 2px var(--acc); }
.cd-f.hot.hv { color: var(--acc-ink); box-shadow: inset 0 0 0 2px #fff, 0 0 calc(18px * var(--user-glow)) var(--acc); }
.cd-f.sat::after { content: ''; position: absolute; inset: -4px; border-radius: 50%; box-shadow: 0 0 0 2px #fff3c4, 0 0 calc(12px * var(--user-glow)) #ffd46a; pointer-events: none; }
.nv { position: relative; width: 136px; height: 136px; border-radius: 50%; background: var(--pn2); box-shadow: inset 0 0 0 2px var(--line); touch-action: none; cursor: crosshair; }
.nv-ring { position: absolute; inset: 10px; border-radius: 50%; background: repeating-conic-gradient(var(--line) 0 2deg, transparent 2deg 30deg); }
.nv-needle { position: absolute; left: 50%; top: 14px; bottom: 14px; width: 8px; margin-left: -4px; background: linear-gradient(180deg, var(--acc) 50%, var(--ink3) 50%); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.nv-n { position: absolute; top: -2px; left: 0; right: 0; text-align: center; font: 800 13px var(--f-round); color: var(--ink2); }
.nv-z { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; width: 100%; }
.tw { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; width: 100%; }
.tw-c { height: 36px; border-radius: 7px; font: 800 15px var(--f-round); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.tw-c.on { background: var(--tab-on); color: var(--tab-on-ink); }
.gg.tw-g { width: 100%; height: 150px; }

/* 中央の大ボタン: 祈り */
#prompt-slot { position: absolute; left: 50%; bottom: 40px; transform: translateX(-50%); pointer-events: none; z-index: 4; }
.big-btn {
  position: relative; width: 190px; height: 190px; border-radius: 50%; display: none; flex-direction: column; align-items: center; justify-content: center; color: #fff; touch-action: none; pointer-events: auto;
  background: radial-gradient(circle at 40% 28%, #ffd2e4, #ff4f98 42%, #b4004f 88%);
  box-shadow: 0 10px 0 #66002e, 0 14px 24px rgba(0, 0, 0, .5), inset 0 4px 4px rgba(255, 255, 255, .6), 0 0 calc(44px * var(--user-glow)) rgba(255, 79, 152, .8);
}
.big-btn.on { display: flex; animation: bigIn .3s var(--ease-back); }
.big-btn:active { transform: translateY(6px); box-shadow: 0 3px 0 #66002e, 0 5px 10px rgba(0, 0, 0, .5), inset 0 4px 4px rgba(255, 255, 255, .5); }
@keyframes bigIn { from { transform: scale(.3); opacity: 0; } }
.big-t { font-family: var(--f-disp); font-size: 80px; line-height: 1; text-shadow: 0 3px 0 rgba(120, 0, 60, .6); }
.big-btn small { font: 800 18px var(--f-round); }
.big-ring { position: absolute; inset: -14px; border-radius: 50%; box-shadow: 0 0 0 4px rgba(255, 150, 200, .9); animation: ringOut 1s ease-out infinite; }
@keyframes ringOut { from { transform: scale(.92); opacity: 1; } to { transform: scale(1.2); opacity: 0; } }
.rail-sp { flex: 1; }
.bang {
  height: 76px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; touch-action: none; pointer-events: auto;
  background: var(--pn); box-shadow: inset 0 0 0 1px var(--line), var(--shadow);
}
.bang b { font-family: var(--f-round); font-size: 19px; font-weight: 800; }
.bang small { font-size: 13px; color: var(--ink2); }
html[data-shake='1'] #ui-stage.bang-shake { animation: bangShake .24s; }
@keyframes bangShake { 20% { translate: 0 6px; } 50% { translate: 3px -4px; } 80% { translate: -2px 2px; } }
#board-slot.touchable { pointer-events: auto; touch-action: none; }

/* ===== 7. トースト =========================================================== */
#toasts { position: absolute; right: 424px; top: 132px; width: 340px; display: flex; flex-direction: column; gap: 6px; z-index: 60; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; overflow: hidden; opacity: 0; transform: translateX(30px); transition: opacity .22s, transform .26s var(--ease-back); cursor: pointer;
}
.toast.on { opacity: 1; transform: none; }
.toast-i { position: relative; z-index: 3; flex: none; width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font-family: var(--f-disp); font-size: 22px; color: #fff; background: var(--g-btn); }
.toast.t-ach .toast-i { background: linear-gradient(160deg, #6bd27a, #1f8a3e); }
.toast.t-unit .toast-i { background: var(--g-rainbow); }
.toast.t-warn .toast-i { background: linear-gradient(160deg, #ff9a5a, #d43a10); }
.toast-b { position: relative; z-index: 3; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.toast-b b { font-family: var(--f-round); font-weight: 800; font-size: 17px; }
.toast-b span { font-size: 14px; color: var(--ink2); }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--acc2); transform-origin: left; animation: toastBar linear forwards; }
@keyframes toastBar { to { transform: scaleX(0); } }

/* ===== 8. モーダル =========================================================== */
#modal-layer, #top-layer { position: absolute; inset: 0; pointer-events: none; }
#top-layer { z-index: 50; }
.modal-wrap { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: auto; opacity: 0; transition: opacity .2s; }
.modal-wrap.on { opacity: 1; }
.modal { display: flex; flex-direction: column; background: var(--pn); max-height: 1020px; transform: scale(.94) translateY(14px); transition: transform .28s var(--ease-back); }
.modal-wrap.on .modal { transform: none; }
.modal.m-large { width: 1240px; }
.modal.m-small { width: 720px; }
.modal.m-full { width: 1880px; height: 1040px; }
html[data-layout='portrait'] .modal.m-large, html[data-layout='portrait'] .modal.m-full { width: 1040px; height: auto; max-height: calc(1840px + var(--px)); }
html[data-layout='portrait'] .modal.m-small { width: 960px; }
.modal-h { position: relative; z-index: 3; display: flex; align-items: baseline; gap: 16px; padding: 22px 34px 8px; }
.modal-h h2 { margin: 0; font-size: 40px; font-weight: 400; line-height: 1.2; }
.modal-sub { font-size: 16px; color: var(--ink2); }
.modal-c { position: relative; z-index: 3; flex: 1; min-height: 0; padding: 12px 34px 30px; display: flex; flex-direction: column; }
.modal-c > * { min-height: 0; }
.modal-x { position: absolute; z-index: 6; right: 16px; top: 14px; width: 54px; height: 54px; border-radius: 50%; font-size: 34px; line-height: 1; color: var(--ink2); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); transition: transform .12s; }
.modal-x:hover { transform: rotate(90deg); }
.confirm { display: flex; flex-direction: column; gap: 16px; text-align: center; padding-top: 18px; }
.confirm-t { margin: 0; font-family: var(--f-round); font-weight: 800; font-size: 30px; }
.confirm-b { font-size: 19px; color: var(--ink2); }
.confirm-a { display: flex; justify-content: center; gap: 14px; margin-top: 10px; }
.era-veil { position: absolute; inset: -40px; background: #fff; animation: eraVeil .9s ease-in-out forwards; pointer-events: none; }
@keyframes eraVeil { 0% { opacity: 0; } 32% { opacity: calc(.4 + .6 * var(--user-glow)); } 100% { opacity: 0; } }

/* 交換所 */
.ex { display: grid; grid-template-columns: 420px 1fr; gap: 28px; min-height: 620px; }
.ex-left { position: relative; border-radius: var(--r); overflow: hidden; background: linear-gradient(180deg, #1c4d40, #0a2822); }
.ex-bust { position: absolute; inset: 0; overflow: hidden; }
.ex-bust img.art { position: absolute; left: 50%; top: 10px; width: 640px; max-width: none; transform: translateX(-50%); }
.ex-bust.blur-hands { animation: shinobuHands .5s steps(6); }
@keyframes shinobuHands { 50% { filter: contrast(1.1) brightness(1.05); transform: translateX(1px); } }
.ex-say { position: absolute; left: 14px; right: 14px; bottom: 14px; padding: 12px 18px; border-radius: 14px; color: #1b2a26; background: rgba(255, 255, 255, .95); font: 700 20px var(--f-round); }
.ex-right { display: flex; flex-direction: column; gap: 16px; justify-content: center; }
.ex-panel { position: relative; display: grid; grid-template-columns: 1fr 70px 1fr; align-items: center; padding: 34px 26px; border-radius: var(--r); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.ex-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 0; }
.ex-col small { font-size: 16px; color: var(--ink2); }
.ex-num { font-family: var(--f-disp); font-size: 54px; line-height: 1.1; white-space: nowrap; }
.ex-num.good { color: var(--acc); }
.ex-arrow { height: 30px; background: var(--acc); clip-path: polygon(0 32%, 62% 32%, 62% 0, 100% 50%, 62% 100%, 62% 68%, 0 68%); }
.ex-rate { font-size: 17px; color: var(--ink2); text-align: center; }
.ex-rs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ex-r { height: 56px; border-radius: 10px; font: 800 20px var(--f-round); background: var(--g-btn-ghost); box-shadow: inset 0 0 0 1px var(--line); }
.ex-r.on { background: var(--tab-on); color: var(--tab-on-ink); }
.ex-go { min-height: 88px; font-size: 32px; }
.ex-next { min-height: 26px; text-align: center; font: 700 18px var(--f-round); color: var(--acc); }
.ex-stack { position: absolute; right: 80px; top: 50%; pointer-events: none; }
.ex-ticket { position: absolute; width: 74px; height: 38px; border-radius: 4px; background: linear-gradient(135deg, #ffe9a8, #e9b23c); box-shadow: 0 2px 5px rgba(0, 0, 0, .3), inset 0 0 0 2px rgba(150, 90, 0, .5); animation: ticketFly .8s var(--d) var(--ease-out) both; }
@keyframes ticketFly { from { transform: translate(-340px, -20px) rotate(var(--r)) scale(.4); opacity: 0; } 40% { opacity: 1; } to { transform: translate(var(--x), 60px) rotate(var(--r)) scale(1); opacity: 0; } }

/* 部屋と台選択 */
.room-full-w { position: relative; flex: 1; border-radius: var(--r); overflow: hidden; }
#room-full { inset: 0; }
html[data-layout='portrait'] .room-full-w { flex: none; height: 560px; }  /* 縦画面のモーダルは高さ auto。flex: 1 だと 0 に潰れる */
.mc-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; max-height: 760px; overflow-y: auto; }
.mc { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: 12px; text-align: left; background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.mc:hover { filter: brightness(1.06); }
.mc.on { box-shadow: inset 0 0 0 3px var(--acc); }
.mc-t { height: 150px; border-radius: 8px; display: grid; place-items: center; font-family: var(--f-disp); font-size: 42px; color: var(--ink3); background: var(--pn3) center / cover; }
.mc-t.has-art { color: transparent; }
.mc b { font: 800 18px var(--f-round); }
.mc small { font-size: 13px; color: var(--ink2); line-height: 1.3; }

/* 式年遷宮 */
.pr { display: flex; flex-direction: column; gap: 18px; }
.pr-gain { text-align: center; padding: 20px; border-radius: var(--r); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.pr-gain small { display: block; font-size: 16px; color: var(--ink2); }
.pr-num { font-size: 92px; line-height: 1.15; }
.pr-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.pr-col { padding: 16px 24px; border-radius: var(--r); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.pr-col h3 { margin: 0 0 8px; font: 800 22px var(--f-round); }
.pr-col.lost h3 { color: var(--warn); }
.pr-col.kept h3 { color: var(--acc); }
.pr-col ul { margin: 0; padding: 0 0 0 22px; font-size: 18px; line-height: 1.7; }
.pr-note { text-align: center; color: var(--ink2); font-size: 17px; }
.pr-acts { display: flex; justify-content: center; gap: 14px; }
.pr-veil { position: absolute; inset: -40px; display: grid; place-content: center; text-align: center; opacity: 0; transition: opacity .9s; color: #3a2a18; background: radial-gradient(circle at 50% 45%, #fff, #f6efe0 60%, #e6d6b6); pointer-events: auto; }
.pr-veil[data-n='3'], .pr-veil[data-n='4'] { background: radial-gradient(circle at 50% 45%, #fffdf2, #f7e6b0 60%, #d9b45a); }
.pr-veil.on { opacity: 1; }
.pr-veil.out { opacity: 0; transition: opacity .8s; }
.pr-v-t span { display: block; font-family: var(--f-disp); font-size: 140px; line-height: 1.2; letter-spacing: .08em; }
.pr-v-t small { font-size: 30px; font-family: var(--f-round); font-weight: 800; }
.pr-v-g { font-size: 58px; margin-top: 20px; --g-disp: linear-gradient(180deg, #b98a2e, #6d4a10); }

/* オフライン帰還 */
.of { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.of-scene { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: linear-gradient(180deg, #223055, #39426e 60%, #52497c); image-rendering: pixelated; }
.of-window { position: absolute; left: 8%; top: 12%; width: 22%; height: 40%; background: linear-gradient(180deg, #0f1836, #27346a); box-shadow: 0 0 0 6px #1b2445; }
.of-window::after { content: ''; position: absolute; right: 18%; top: 16%; width: 20px; height: 20px; border-radius: 50%; background: #ffeeb0; box-shadow: 0 0 16px #ffeeb0; }
.of-art { position: absolute; inset: 0; }
.of-art img.art { position: absolute; left: 50%; bottom: -60%; width: 90%; transform: translateX(-30%); }
.of-z { position: absolute; right: 14%; top: 16%; font-family: var(--f-dot); font-size: 40px; color: #fff; animation: zzz 2.4s ease-in-out infinite; z-index: 2; }
@keyframes zzz { 0% { transform: translateY(14px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(-20px); opacity: 0; } }
.of-log { list-style: none; margin: 14px 0 0; padding: 12px 16px; border-radius: 10px; font-family: var(--f-dot); font-size: 19px; line-height: 1.6; background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.of-log li { opacity: 0; animation: logIn .4s calc(var(--i) * .35s + .3s) forwards; }
.of-log li::before { content: '・'; color: var(--acc); }
@keyframes logIn { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
.of-r { display: flex; flex-direction: column; justify-content: center; gap: 12px; }
.of-time { font: 800 26px var(--f-round); }
.of-cap { font-size: 16px; color: var(--warn); }
.of-big { padding: 20px 24px; border-radius: var(--r); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.of-big small { display: block; font-size: 16px; color: var(--ink2); }
.of-v { font-size: 76px; line-height: 1.2; }
.of-u { font-family: var(--f-disp); font-size: 30px; margin-left: 6px; }
.of-rows { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 0; font-size: 19px; }
.of-rows dt { color: var(--ink2); }
.of-rows dd { margin: 0; font: 800 20px var(--f-round); text-align: right; }
.of-go { align-self: stretch; }

/* 設定 */
.st-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 40px; }
.st-sec h3 { margin: 10px 0 6px; font: 800 20px var(--f-round); color: var(--acc); }
.st-wide { grid-column: 1 / -1; }
.st-row { display: grid; grid-template-columns: 200px 1fr 76px; align-items: center; gap: 12px; min-height: 58px; }
.st-l { font-size: 18px; line-height: 1.25; }
.st-l small { display: block; font-size: 13px; color: var(--ink2); }
.st-v { text-align: right; font: 800 18px var(--f-round); }
.st-range { appearance: none; -webkit-appearance: none; width: 100%; height: 12px; border-radius: 6px; background: linear-gradient(90deg, var(--acc) var(--p, 0), var(--pn3) var(--p, 0)); box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; }
.st-range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; border-radius: 50%; background: var(--g-silver); box-shadow: 0 2px 6px rgba(0, 0, 0, .4); }
.st-range::-moz-range-thumb { width: 30px; height: 30px; border: 0; border-radius: 50%; background: #cfd6de; }
.st-seg { grid-column: 2 / -1; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px; padding: 3px; border-radius: 10px; background: var(--pn3); }
.st-seg-b { height: 44px; border-radius: 7px; font: 800 17px var(--f-round); color: var(--ink2); }
.st-seg-b.on { background: var(--tab-on); color: var(--tab-on-ink); }
.st-save { width: 100%; height: 82px; padding: 10px 12px; border: 0; border-radius: 10px; resize: none; color: var(--ink); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); font-family: ui-monospace, monospace; font-size: 14px; user-select: text; -webkit-user-select: text; }
.st-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.st-reset { margin-left: auto; }

/* 図鑑 */
.cx { display: flex; flex-direction: column; flex: 1; gap: 12px; min-height: 0; }
.cx-tabs { flex: none; display: flex; gap: 6px; }
.cx-tab { min-width: 160px; height: 52px; padding: 0 22px; border-radius: 12px 12px 4px 4px; font: 800 20px var(--f-round); color: var(--ink2); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.cx-tab.on { background: var(--tab-on); color: var(--tab-on-ink); box-shadow: none; }
.cx-body { flex: 1; min-height: 0; padding-right: 8px; }
.cx-lead { margin-bottom: 10px; color: var(--ink2); }
.cx-empty { padding: 90px 0; text-align: center; font-size: 20px; color: var(--ink3); }
.cx-mgrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 12px; }
.cxm { display: flex; flex-direction: column; gap: 3px; padding: 10px; border-radius: 12px; background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.cxm-t { aspect-ratio: 1000 / 1120; border-radius: 6px; display: grid; place-items: center; font-family: var(--f-disp); font-size: 40px; color: var(--ink3); background: var(--pn3) center / cover; }
.cxm-t.has-art { color: transparent; }
.cxm b { font: 800 18px var(--f-round); }
.cxm small { font-size: 13px; line-height: 1.3; color: var(--ink2); }
.cxm p { font-size: 13px; line-height: 1.4; color: var(--ink2); }
.cxm.unk { opacity: .55; }
.cx-cgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.cxc { display: flex; gap: 14px; height: 300px; border-radius: 12px; overflow: hidden; background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.cxc-a { position: relative; flex: none; width: 220px; overflow: hidden; background: linear-gradient(180deg, color-mix(in srgb, var(--c) 40%, transparent), transparent); }
.cxc-a img.art { position: absolute; left: 50%; top: 8px; width: 330px; max-width: none; transform: translateX(-50%); }
.cxc-t { padding: 16px 16px 16px 0; display: flex; flex-direction: column; gap: 4px; }
.cxc-t b { font: 800 24px var(--f-round); color: var(--c); }
.cxc-t small { font-size: 15px; color: var(--ink2); }
.cxc-t p { font-size: 16px; line-height: 1.5; }
.cxc.unk { opacity: .5; }
.cx-tbl { width: 100%; border-collapse: collapse; font-size: 18px; }
.cx-tbl th { text-align: left; padding: 8px 12px; font-size: 15px; color: var(--ink2); border-bottom: 2px solid var(--line); }
.cx-tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.cx-tbl tr.unk td { color: var(--ink3); }
.cx-rel { position: relative; display: inline-block; min-width: 180px; padding: 1px 8px; border-radius: 5px; font-weight: 700; background: var(--pn3); overflow: hidden; }
.cx-rel i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--acc); opacity: .35; }
.cx-agrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cxa { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); opacity: .6; }
.cxa.done { opacity: 1; box-shadow: inset 0 0 0 1px var(--hot-border); }
.cxa-i { flex: none; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-family: var(--f-disp); color: #fff; background: var(--ink3); }
.cxa.done .cxa-i { background: linear-gradient(160deg, #6bd27a, #1f8a3e); }
.cxa b { display: block; font: 800 17px var(--f-round); }
.cxa small { display: block; font-size: 14px; color: var(--ink2); line-height: 1.3; }
.cxa em { font-style: normal; font-size: 13px; color: var(--acc); }
.cx-sgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cxs { padding: 16px 20px; border-radius: 12px; background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.cxs small { display: block; font-size: 15px; color: var(--ink2); }
.cxs b { font-family: var(--f-disp); font-weight: 400; font-size: 38px; }

/* ===== 9. ガチャ ============================================================= */
.modal[data-id='gacha'] { background: radial-gradient(1000px 600px at 28% 40%, #fff1, transparent 70%), linear-gradient(180deg, #2a1040, #5a1a3a 70%, #2a0d20); }
.modal[data-id='gacha'] .modal-c { padding: 0; }
.modal[data-id='gacha'] .modal-x { color: #fff; background: rgba(0, 0, 0, .4); }
.ga { position: relative; flex: 1; border-radius: inherit; overflow: hidden; color: #fff; }
.ga-scene { position: absolute; left: 0; top: 0; width: 1920px; height: 1080px; transform-origin: 0 0; transform: scale(calc(1880 / 1920), calc(1040 / 1080)); }
.ga-cv { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.ga-hako { position: absolute; left: 10px; bottom: 30px; width: 280px; height: 380px; pointer-events: none; }
.ga-hako img.art { position: absolute; left: 0; bottom: 0; width: 100%; height: 100%; object-fit: contain; object-position: bottom; }
.ga-say { position: absolute; left: 40px; top: 36px; max-width: 480px; padding: 12px 20px; border-radius: 16px; font: 700 21px var(--f-round); color: #3a1224; background: rgba(255, 255, 255, .94); }
.ga-panel { position: absolute; right: 36px; top: 76px; width: 500px; padding: 22px 26px; display: flex; flex-direction: column; gap: 12px; }
.ga-panel > * { position: relative; z-index: 3; }
.ga-panel h2 { margin: 0; font-size: 33px; font-weight: 400; }
.ga-stat { display: flex; align-items: baseline; gap: 8px; color: var(--ink2); }
.ga-stat b { font: 800 34px var(--f-round); color: var(--ink); margin-right: 14px; }
.ga-pity { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 16px; color: var(--ink2); }
.ga-pity-t { font-weight: 700; color: var(--ink); text-align: right; }
.ga-pity-b { grid-column: 1 / -1; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); }
.ga-pity-b i { display: block; height: 100%; background: var(--g-rainbow); transform-origin: left; transform: scaleX(0); }
.ga-rates { display: flex; justify-content: space-between; font-size: 15px; color: var(--ink2); }
.ga-rates b { margin-right: 4px; font-family: var(--f-round); }
.ga-rates [data-r='R'] b { color: var(--rar-r); }
.ga-rates [data-r='SR'] b { color: #d69a0a; }
.ga-rates [data-r='SSR'] b { color: var(--rar-ssr); }
.ga-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ga-b { flex-direction: column; gap: 0; min-height: 86px; font-size: 24px; padding: 6px; line-height: 1.2; }
.ga-b small { font-size: 14px; font-weight: 700; opacity: .85; }
.ga-after { position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%); }
.ga-cards { position: absolute; inset: 0; pointer-events: none; }
.gc {
  position: absolute; width: 300px; padding: 16px; transform: translate(-50%, -50%) scale(.3) rotateY(90deg); opacity: 0; text-align: center; border-radius: 16px; color: #2a1a12;
  display: flex; flex-direction: column; align-items: center; gap: 4px; background: linear-gradient(180deg, #fff, #eae4da); box-shadow: 0 10px 30px rgba(0, 0, 0, .45), inset 0 0 0 4px var(--rc, #c0c8d0); transition: transform .42s var(--ease-back), opacity .2s;
}
.gc.on { transform: translate(-50%, -50%); opacity: 1; }
.gc.small { width: 176px; padding: 8px 8px 10px; }
.gc.r-R { --rc: var(--rar-r); }
.gc.r-SR { --rc: var(--rar-sr); background: linear-gradient(180deg, #fffbe6, #ffe9a8); }
.gc.r-SSR { --rc: var(--rar-ssr); background: linear-gradient(180deg, #fff, #ffe0f4); box-shadow: 0 10px 40px rgba(255, 80, 200, .6), inset 0 0 0 4px var(--rc); }
.gc-r { font-family: var(--f-disp); font-size: 26px; color: var(--rc); line-height: 1; -webkit-text-stroke: .5px rgba(0, 0, 0, .3); }
.gc-ico { position: relative; width: 150px; height: 150px; border-radius: 14px; display: grid; place-items: center; font-family: var(--f-disp); font-size: 66px; color: #fff; background: linear-gradient(160deg, var(--rc, #aab), #6a5a70); overflow: hidden; }
.gc-ico img.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.gc.small .gc-ico { width: 84px; height: 84px; font-size: 38px; }
.gc-n { font: 800 20px var(--f-round); line-height: 1.25; }
.gc.small .gc-n { font-size: 15px; }
.gc-c { font-size: 13px; color: #6c5a50; }
.gc em { font-style: normal; font-family: var(--f-round); font-weight: 800; font-size: 14px; padding: 0 10px; border-radius: 10px; }
.gc-new { color: #fff; background: #ff3b5c; }
.gc-sh { color: #6c5a50; background: #e8e0d4; }

/* ===== 10. VN ダイアログ ===================================================== */
#vn { position: absolute; inset: 0; pointer-events: auto; opacity: 0; transition: opacity .24s; cursor: pointer; }
#vn.on { opacity: 1; }
/* 物語 CG。場面の絵は全画面で、立ち絵は重ねずセリフ枠だけを出す */
.vn-cg { position: absolute; left: calc(-1 * var(--bleed-x, 0px)); top: calc(-1 * var(--bleed-y, 0px)); width: calc(100% + 2 * var(--bleed-x, 0px)); height: calc(100% + 2 * var(--bleed-y, 0px)); object-fit: cover; opacity: 0; transition: opacity .5s; pointer-events: none; }
.vn-cg.on { opacity: 1; }
#vn.has-cg .vn-ch { opacity: 0; }
.vn-cg-bg { display: none; }
/* スマホ縦は横長の CG を切らず、枠の上に全体を見せる。余白は同じ絵のぼかしで埋める */
html[data-layout='portrait'] .vn-cg { object-fit: contain; object-position: 50% 50% !important; height: calc(100% - 280px); top: 0; }
html[data-layout='portrait'] #vn.has-cg .vn-cg-bg { display: block; position: absolute; inset: calc(-1 * var(--bleed-y) - 60px) calc(-1 * var(--bleed-x) - 60px); background: center / cover no-repeat; filter: blur(36px) brightness(.72); }
.vn-dim { position: absolute; inset: -40px; background: linear-gradient(180deg, rgba(20, 16, 12, .1) 40%, rgba(20, 16, 12, .5)); }
.vn-ch { position: absolute; bottom: 0; width: 760px; height: 1040px; opacity: 0; transition: opacity .22s, filter .22s, transform .3s var(--ease-out); pointer-events: none; }
.vn-ch.show { opacity: 1; }
.vn-L { left: 90px; transform: translateX(-30px); }
.vn-R { right: 90px; transform: translateX(30px); }
.vn-ch.show { transform: none; filter: brightness(.62) saturate(.7); }
.vn-ch.show.speak { filter: none; }
.vn-ch.hop { animation: vnHop .24s; }
.vn-ch.enter { animation: vnEnter .4s var(--ease-out); }
@keyframes vnHop { 40% { translate: 0 -12px; } }
@keyframes vnEnter { from { opacity: 0; translate: 0 40px; } }
.vn-img { position: absolute; left: 50%; bottom: 0; height: 100%; max-width: none; transform: translateX(-50%); object-fit: contain; object-position: bottom; display: none; filter: drop-shadow(0 6px 22px rgba(0, 0, 0, .3)); }
.vn-ch.has-art .vn-img { display: block; }
.vn-ch.has-art.stand .vn-img { top: 30px; bottom: auto; height: 1700px; }
.vn-ch.has-art.stand[data-who='tamakoro'] .vn-img, .vn-ch.has-art.stand[data-who='hako'] .vn-img, .vn-ch.has-art.stand[data-who='green'] .vn-img { top: auto; bottom: 230px; height: 680px; }
.vn-fallback { /* 素材待ちのシルエット */
  position: absolute; left: 50%; bottom: 200px; width: 420px; height: 700px; margin-left: -210px; display: grid; place-items: center; font-family: var(--f-disp); font-size: 130px; color: rgba(255, 255, 255, .9); border-radius: 210px 210px 40px 40px;
  background: linear-gradient(180deg, rgba(120, 110, 100, .5), rgba(60, 50, 40, .5));
}
.vn-ch.has-art .vn-fallback { display: none; }
.vn-box { position: absolute; left: 50%; bottom: 26px; width: 1460px; min-height: 232px; margin-left: -730px; padding: 46px 60px 26px; background: var(--pn); }
html[data-layout='portrait'] .vn-box { width: 1040px; margin-left: -520px; padding: 46px 36px 26px; }
.vn-box.narr { background: rgba(14, 12, 18, .84); --ink: #fff; }
.vn-box.narr .vn-text { text-align: center; }
.vn-name {
  position: absolute; left: 42px; top: -26px; min-width: 190px; padding: 6px 28px; border-radius: 10px; text-align: center; font: 800 30px var(--f-round); color: #fff; z-index: 4;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c) 86%, #fff), var(--c)); box-shadow: 0 4px 10px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(255, 255, 255, .45); text-shadow: 0 1px 2px rgba(0, 0, 0, .4);
}
.vn-text { position: relative; z-index: 3; min-height: 112px; font: 700 34px/1.6 var(--f-round); color: var(--ink); }
.vn-next { position: absolute; z-index: 4; right: 56px; bottom: 58px; width: 0; height: 0; border: 13px solid transparent; border-top: 18px solid var(--acc); border-bottom: 0; opacity: 0; }
.vn-next.on { opacity: 1; animation: vnNext .7s ease-in-out infinite alternate; }
@keyframes vnNext { to { transform: translateY(7px); } }
.vn-tools { position: absolute; z-index: 5; right: 30px; top: 12px; display: flex; gap: 6px; }
.vn-btn { min-width: 90px; height: 38px; padding: 0 12px; border-radius: 8px; font: 800 16px var(--f-round); color: var(--ink2); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.vn-box.narr .vn-btn { color: #ddd; background: rgba(255, 255, 255, .12); }
.vn-btn.on { background: var(--tab-on); color: var(--tab-on-ink); }
.vn-log { max-height: 740px; display: flex; flex-direction: column; gap: 10px; }
.vn-log-r { display: grid; grid-template-columns: 150px 1fr; gap: 12px; font-size: 19px; line-height: 1.5; }
.vn-log-r b { font-family: var(--f-round); font-weight: 800; text-align: right; }

/* ===== 11. 注意書きとタイトル ================================================= */
#caution {
  position: absolute; inset: -60px; display: grid; place-items: center; text-align: center; color: #2b2520; background: #f4f2ed; pointer-events: auto; transition: opacity .3s; z-index: 80;
}
#caution.out { opacity: 0; }
.ca-in { width: 1000px; display: flex; flex-direction: column; align-items: center; gap: 18px; }
html[data-layout='portrait'] .ca-in { width: 920px; }
.ca-mark { width: 92px; height: 82px; background: linear-gradient(180deg, #ffcf4a, #eaa10c); clip-path: polygon(50% 0, 100% 100%, 0 100%); position: relative; }
.ca-mark::after { content: '!'; position: absolute; left: 0; right: 0; top: 22px; text-align: center; font: 800 48px/1 var(--f-round); color: #3a2a10; }
#caution h1 { margin: 0; font: 800 44px var(--f-round); }
#caution p { font-size: 22px; line-height: 1.7; }
#caution .ca-sub { font-size: 19px; color: #6d6356; }
.ca-acts { display: flex; gap: 16px; margin-top: 18px; --g-btn: linear-gradient(180deg, #a06f40, #7c5129); --g-btn-ghost: linear-gradient(180deg, #fffdf9, #efe8da); --ink: #2b2520; --acc-ink: #fff; }

#title {
  position: absolute; inset: -60px; pointer-events: auto; overflow: hidden; z-index: 70; transition: opacity .6s, transform .6s var(--ease-out);
  background:
    linear-gradient(180deg, transparent 72%, rgba(120, 95, 60, .16) 72.2%, rgba(120, 95, 60, .05) 73%, transparent 84%),
    radial-gradient(1400px 900px at 50% 30%, #ffffff, #efe9dd 82%);
}
#title.out { opacity: 0; transform: scale(1.06); }
.ti-pins, .ti-art { position: absolute; left: 60px; top: 60px; width: 1920px; height: 1080px; }
html[data-layout='portrait'] .ti-pins { width: 1080px; height: 1920px; }
.ti-art { background: center / cover no-repeat; }
.ti-logo { position: absolute; left: 0; right: 0; top: 220px; display: flex; flex-direction: column; align-items: center; }
.ti-sign {
  padding: 6px 28px; margin-bottom: 18px; border-radius: 8px; font: 800 26px var(--f-round); color: #fff; letter-spacing: .1em;
  background: linear-gradient(180deg, #d83a24, #9c1d0d); box-shadow: 0 0 0 3px #f7e6b0, 0 0 0 5px #9c1d0d, 0 6px 16px rgba(120, 30, 10, .35);
}
.ti-sign.open { background: linear-gradient(180deg, #ffc531, #d4780a); color: #3a1c00; animation: signOn 3s ease-in-out infinite; }
@keyframes signOn { 50% { filter: brightness(1.2); } }
.ti-main { margin: 0; display: flex; font-family: var(--f-disp); font-weight: 400; font-size: 190px; line-height: 1.12; }
html[data-layout='portrait'] .ti-main { font-size: 150px; }
.ti-main span {
  display: inline-block; color: transparent; background: linear-gradient(180deg, #fff 8%, #ffe07a 26%, #e9a01a 50%, #fff3b4 58%, #b5650a 92%); -webkit-background-clip: text; background-clip: text;
  -webkit-text-stroke: 3px #5a2a06; paint-order: stroke fill; filter: drop-shadow(0 7px 0 #7d1c0c) drop-shadow(0 14px 18px rgba(90, 30, 10, .4));
  animation: logoIn .7s calc(var(--i) * .07s + .1s) var(--ease-back) both;
}
@keyframes logoIn { from { transform: translateY(-70px) scale(1.4); opacity: 0; } }
.ti-sub { margin-top: 10px; font-family: var(--f-disp); font-size: 54px; letter-spacing: .12em; color: #2b2520; animation: fadeUp .7s .7s both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } }
.ti-menu { position: absolute; left: 0; right: 0; top: 700px; display: flex; flex-direction: column; align-items: center; gap: 12px; animation: fadeUp .6s .95s both; }
html[data-layout='portrait'] .ti-menu { top: 1100px; }
html[data-layout='portrait'] .ti-logo { top: 420px; }
.ti-btn {
  width: 400px; height: 70px; border-radius: 12px; font: 800 28px var(--f-round); color: #2b2520; background: linear-gradient(180deg, #fffefb, #efe8da);
  box-shadow: 0 3px 0 rgba(90, 70, 40, .35), inset 0 0 0 1px rgba(90, 70, 40, .22); transition: transform .12s var(--ease-out), filter .12s;
}
.ti-btn:hover { transform: translateY(-2px) scale(1.02); }
.ti-btn.primary { height: 84px; font-size: 34px; color: #fff; background: linear-gradient(180deg, #e6492f, #a81f10); box-shadow: 0 5px 0 #6d1006, 0 10px 22px rgba(160, 40, 20, .35), inset 0 1px 0 rgba(255, 255, 255, .4); }
.ti-foot { position: absolute; left: 0; right: 0; bottom: 84px; text-align: center; font-size: 16px; color: #7c7264; }
#boot { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; background: #f4f2ed; color: #6d6356; font-family: var(--f-round); font-size: 20px; transition: opacity .3s; }
#boot.done { opacity: 0; pointer-events: none; }

/* ===== 12. 時代別の味付けと HUD の侵食 ======================================== */
html[data-era='sf'] .pn::after { background: repeating-linear-gradient(0deg, rgba(120, 230, 255, .05) 0 1px, transparent 1px 4px); }
html[data-era='magic'] #ball-counter::after, html[data-era='magic'] .shop::after {
  background: radial-gradient(60px 30px at 0 100%, rgba(120, 255, 130, .28), transparent 70%), radial-gradient(60px 30px at 100% 100%, rgba(120, 255, 130, .28), transparent 70%), linear-gradient(165deg, rgba(255, 255, 255, .1), transparent 40%);
}
html[data-era='cosmic'] .pn::before { animation: hueDrift 14s linear infinite; }
@keyframes hueDrift { to { filter: hue-rotate(360deg); } }
html[data-hud-damage='1'] #hud-right { transform: rotate(.25deg) translateY(2px); }
html[data-hud-damage='1'] #hud-left { transform: rotate(-.25deg); }
html[data-hud-damage='2'] #hud-right { transform: rotate(1.1deg) translate(4px, 10px); }
html[data-hud-damage='2'] #hud-left { transform: rotate(-.9deg) translate(-4px, 6px); }
html[data-hud-damage='2'] #ball-counter { transform: rotate(-.5deg); }
html[data-hud-damage='3'] #hud-right { transform: rotate(4deg) translate(14px, 60px); }
html[data-hud-damage='3'] #hud-left { transform: rotate(-3deg) translate(-12px, 40px); }
html[data-hud-damage='3'] #ball-counter { transform: rotate(-2deg) translateY(10px); clip-path: polygon(0 0, 100% 0, 100% 84%, 62% 100%, 58% 74%, 21% 96%, 0 70%); }

/* ===== 13. スマホ縦 ========================================================== */
html[data-layout='portrait'] #ball-counter { left: 8px; right: 8px; height: 150px; }
html[data-layout='portrait'] #board-slot { left: 110px; top: 240px; width: 860px; height: calc(1000px + var(--px) * .35); }
html[data-layout='portrait'] #hud-left { position: absolute; left: 8px; right: 8px; top: 158px; bottom: auto; width: auto; height: 78px; flex-direction: row; }
html[data-layout='portrait'] #hud-left .status { display: none; }
/* 部屋の小窓は台の下の段へ。棒突きと台の名札を詰めて横に並べる */
html[data-layout='portrait'] #hud-left .room-win { position: absolute; left: 0; top: calc(1092px + var(--px) * .35); width: 338px; height: 190px; }
html[data-layout='portrait'] #hud-left .room-cap { display: none; }
/* 立ち絵は置けないので、セリフの吹き出しだけを台の下端に重ねる */
html[data-layout='portrait'] #hud-left .chara { position: absolute; left: 0; right: 0; top: 0; height: 0; flex: none; overflow: visible; background: none; border: 0; box-shadow: none; pointer-events: none; }
html[data-layout='portrait'] #hud-left .chara::before, html[data-layout='portrait'] #hud-left .chara::after { display: none; }
html[data-layout='portrait'] #hud-left .chara .portrait { display: none; }
html[data-layout='portrait'] #hud-left .bubble { left: 40px; right: 40px; top: calc(950px + var(--px) * .35); bottom: auto; min-height: 0; padding: 14px 22px; font-size: 32px; }
html[data-layout='portrait'] #hud-left .bubble::after { display: none; }
html[data-layout='portrait'] .curs { flex: 1; grid-template-columns: repeat(4, 1fr); }
html[data-layout='portrait'] #hud-right { left: 8px; right: 8px; top: calc(1450px + var(--px) * .35); bottom: 8px; width: auto; }
html[data-layout='portrait'] #hud-right > * { zoom: 1.3; }
html[data-layout='portrait'] .dock { display: flex; flex-direction: row; order: -1; }
html[data-layout='portrait'] .dock .xq { flex: 1; }
html[data-layout='portrait'] .dock .fbs { flex: 1; }
html[data-layout='portrait'] #rail-left { left: 354px; top: calc(1250px + var(--px) * .35); bottom: auto; flex-direction: row; width: 340px; height: 190px; }
html[data-layout='portrait'] #rail-left .m-plate { flex: 1; }
html[data-layout='portrait'] .rail-sp { display: none; }
html[data-layout='portrait'] #rail-right { left: auto; right: 8px; top: calc(1250px + var(--px) * .35); bottom: auto; width: 370px; height: 190px; }
html[data-layout='portrait'] .lc { flex-direction: row; height: 190px; justify-content: space-between; padding: 8px 14px; }
html[data-layout='portrait'] .lc-h { display: none; }
html[data-layout='portrait'] .lc-t { width: 90px; }
html[data-layout='portrait'] .lw { flex-direction: row; justify-content: center; }
html[data-layout='portrait'] .gg, html[data-layout='portrait'] .pl-track { height: 170px; }
html[data-layout='portrait'] .pl-track { --pl-travel: 46px; }
html[data-layout='portrait'] .pl-spring { top: 4px; height: 36px; }
html[data-layout='portrait'] .pl-rod { top: 36px; height: 130px; }
html[data-layout='portrait'] .pl-shaft { top: 16px; height: 48px; }
html[data-layout='portrait'] .pl-knob { top: 54px; height: 30px; }
html[data-layout='portrait'] .lw-round { width: 96px; height: 96px; font-size: 19px; }
html[data-layout='portrait'] .lw-round.push { flex: none; width: 128px; height: 128px; font-size: 25px; }
html[data-layout='portrait'] .lw:has(.lw-round.push) .lw-sub.coin { flex: none; width: 44px; padding: 0; justify-content: center; }
html[data-layout='portrait'] .lw:has(.lw-round.push) .lw-sub.coin span { display: none; }
html[data-layout='portrait'] .lw-hold { height: 70px; width: 130px; }
html[data-layout='portrait'] .dp-row { flex: 2.4 1 0; width: auto; min-width: 0; height: 150px; }
html[data-layout='portrait'] .dp-heat { flex: 1 1 0; width: auto; min-width: 0; height: 150px; }
html[data-layout='portrait'] .dp-s { height: 150px; }
html[data-layout='portrait'] .dp-heat .lw-hold { height: 100%; width: 100%; }
/* 縦画面の滴下は盤面の長押しだけにして、枠を大きさと加熱に回す */
html[data-layout='portrait'] .dp-heat .thermo, html[data-layout='portrait'] .dp-heat ~ .lw-hold { display: none; }
html[data-layout='portrait'] #toasts { right: 24px; top: 250px; width: 620px; }
html[data-layout='portrait'] .ex, html[data-layout='portrait'] .of, html[data-layout='portrait'] .st-grid, html[data-layout='portrait'] .pr-cols { grid-template-columns: 1fr; }
html[data-layout='portrait'] .ex { min-height: 0; }
html[data-layout='portrait'] .ex-left { height: 420px; }
/* 画面が小さいので、モーダルの中身は拡大して組み直す */
html[data-layout='portrait'] .modal-h, html[data-layout='portrait'] .modal-c:not(:has(.ga)) { zoom: 1.4; }
html[data-layout='portrait'] .cx-mgrid { grid-template-columns: repeat(3, 1fr); }
html[data-layout='portrait'] .cx-cgrid, html[data-layout='portrait'] .cx-agrid { grid-template-columns: 1fr; }
html[data-layout='portrait'] .cx-sgrid { grid-template-columns: repeat(2, 1fr); }
html[data-layout='portrait'] .cx-tabs { flex-wrap: wrap; }
html[data-layout='portrait'] .cx-tab { min-width: 0; flex: 1; padding: 0 6px; }
html[data-layout='portrait'] .cx-rel { min-width: 90px; }
/* おみくじ: 上に筐体、下に操作盤 */
html[data-layout='portrait'] .modal.m-full:has(.ga) { height: 1240px; }
html[data-layout='portrait'] .ga-scene { transform: scale(.56); }
html[data-layout='portrait'] .ga-hako { left: 0; top: 300px; bottom: auto; width: 180px; height: 250px; }
html[data-layout='portrait'] .ga-say { left: 24px; top: 24px; max-width: 640px; font-size: 26px; }
html[data-layout='portrait'] .ga-after { bottom: auto; top: 530px; }
html[data-layout='portrait'] .ga-panel { left: 20px; right: 20px; top: auto; bottom: 20px; width: auto; zoom: 1.4; }

/* 動きを減らす設定 */
@media (prefers-reduced-motion: reduce) {
  .card.afford::before, .card.afford .card-buy::after, .ctr-leds, .big-ring { animation: none; }
}
html[data-shake='0'] .kick-big .ctr-body, html[data-shake='0'] .nope { animation: none !important; }

/* ===== 14. 追加画面 ========================================================== */
#modal-layer { z-index: 7; }
html.in-vn #hud { filter: brightness(.55) blur(3px); transition: filter .3s; }
#hud { transition: opacity .4s, filter .3s; }
#title, #caution { inset: 0; overflow: visible; background: none; }
#title::before, #caution::before { content: ''; position: absolute; inset: calc(-1 * var(--bleed-y)) calc(-1 * var(--bleed-x)); z-index: -1; }
#caution::before { background: #f4f2ed; }
#title::before {
  background:
    linear-gradient(180deg, transparent 72%, rgba(120, 95, 60, .16) 72.2%, rgba(120, 95, 60, .05) 73%, transparent 84%),
    radial-gradient(1400px 900px at 50% 30%, #ffffff, #efe9dd 82%);
}
.ti-pins { left: 0; top: 0; }
.ti-art { left: calc(-1 * var(--bleed-x)); top: calc(-1 * var(--bleed-y)); width: calc(1920px + 2 * var(--bleed-x)); height: calc(1080px + 2 * var(--bleed-y)); }
html[data-layout='portrait'] .ti-art { width: calc(1080px + 2 * var(--bleed-x)); height: calc(1920px + var(--px) + 2 * var(--bleed-y)); }
.ti-foot { bottom: 24px; }
html[data-layout='portrait'] .ti-foot { left: 50%; right: auto; transform: translateX(-50%); width: max-content; padding: 6px 20px; border-radius: 999px; font-size: 22px; color: #4a4238; background: rgba(255, 255, 255, .86); }
.ti-logo { top: 150px; }
.ti-menu { top: 640px; }
html[data-layout='portrait'] .ti-logo { top: 360px; }
.vn-dim { inset: calc(-1 * var(--bleed-y)) calc(-1 * var(--bleed-x)); background: rgba(20, 16, 12, .12); }
.era-veil { inset: calc(-1 * var(--bleed-y)) calc(-1 * var(--bleed-x)); }
.pr-veil { inset: 0; overflow: visible; background: none; }
.pr-veil::before { content: ''; position: absolute; inset: calc(-1 * var(--bleed-y)) calc(-1 * var(--bleed-x)); z-index: -1; background: radial-gradient(circle at 50% 45%, #fff, #f6efe0 60%, #e6d6b6); }
.pr-veil[data-n='3']::before, .pr-veil[data-n='4']::before { background: radial-gradient(circle at 50% 45%, #fffdf2, #f7e6b0 60%, #d9b45a); }
#closing { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; color: #efe9dd; opacity: 0; transition: opacity 1.4s; pointer-events: auto; }
#closing::before { content: ''; position: absolute; inset: calc(-1 * var(--bleed-y)) calc(-1 * var(--bleed-x)); z-index: -1; background: #0c0a08; }
#closing.on { opacity: 1; }
.cl-a { font: 800 58px var(--f-round); }
.cl-b { font-size: 26px; color: #b8ae9c; }

.card-ico, .fb-i { font-family: var(--f-round); font-weight: 800; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.card-ico[data-kind='ball'] { background: linear-gradient(160deg, #dfe6ee, #7a8896); }
.card-ico[data-kind='skill'] { background: linear-gradient(160deg, #8fd1ff, #2a7bd0); }
.card-ico[data-kind='service'] { background: linear-gradient(160deg, #a7e6c0, #1f8f5d); }
.card-ico[data-kind='room'] { background: linear-gradient(160deg, #ffd9a0, #cc7a2a); }
.card-ico[data-kind='room'].has-art { background: linear-gradient(160deg, #f6efe0, #e4d8c2); }
.card-ico[data-kind='room'] img.art { inset: 6px; width: calc(100% - 12px); height: calc(100% - 12px); image-rendering: pixelated; }
.card-ico[data-kind='drink'] { background: linear-gradient(160deg, #ffe66b, #e0a800); }
.card-ico[data-kind='fuda'] { background: linear-gradient(160deg, #ff8f7a, #b4210f); }
.card-ico[data-kind='machine'] { background: linear-gradient(160deg, var(--acc2), var(--acc)); font-family: var(--f-disp); }
.card { cursor: pointer; }
.card.locked, .card.maxed { cursor: default; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.card-alt { flex: none; height: 28px; padding: 0 12px; border-radius: 7px; font: 800 14px var(--f-round); color: var(--acc-ink); background: var(--g-btn); }
.card-alt[disabled] { opacity: .4; cursor: not-allowed; }
.lc.napping { filter: grayscale(.9); pointer-events: none; }
.lc.napping::before { z-index: 4; }
.lc.napping .lc-h::before { content: 'ふて寝中 / '; color: var(--warn); font-weight: 700; }
.auto-btn { height: 66px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.2; pointer-events: auto; background: var(--pn); box-shadow: inset 0 0 0 1px var(--line), var(--shadow); }
.auto-btn b { font: 800 18px var(--f-round); }
.auto-btn small { font-size: 13px; color: var(--ink2); }
.auto-btn.on { background: var(--g-btn); color: var(--acc-ink); }
.auto-btn.on small { color: inherit; }

/* 社格ツリー・コレクション */
.tr { flex: 1; display: grid; grid-template-columns: 1fr 420px; gap: 20px; min-height: 0; }
.tr-scroll { min-height: 0; overflow-y: auto; overflow-x: hidden; }
.tr-map { position: relative; margin: 0 auto; }
.tr-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.tr-lines line { stroke: var(--line); stroke-width: 3; }
.tr-lines line.on { stroke: var(--acc); }
.tr-h { position: absolute; top: 0; transform: translateX(-50%); text-align: center; line-height: 1.2; }
.tr-h b { display: block; font: 800 20px var(--f-round); color: var(--acc); }
.tr-h small { font-size: 13px; color: var(--ink2); }
.tr-n {
  position: absolute; width: 170px; height: 62px; padding: 2px 8px; transform: translate(-50%, -50%); border-radius: 12px; font: 700 14px/1.25 var(--f-round); color: var(--ink3); background: var(--pn2);
  box-shadow: inset 0 0 0 1px var(--line); transition: filter .12s; overflow: hidden;
}
.tr-n:hover { filter: brightness(1.12); }
.tr-n.avail { color: var(--ink); box-shadow: inset 0 0 0 2px var(--hot-border), 0 0 calc(10px * var(--user-glow)) var(--neon); }
.tr-n.owned { color: var(--acc-ink); background: var(--g-btn); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
.tr-n.sel { outline: 3px solid var(--acc2); outline-offset: 2px; }
.tr-side { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--r); background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.tr-bal { display: flex; align-items: baseline; justify-content: space-between; }
.tr-bal small { color: var(--ink2); }
.tr-have { font-family: var(--f-disp); font-weight: 400; font-size: 42px; }
.tr-d-n { margin: 8px 0 0; font: 800 28px/1.25 var(--f-round); }
.tr-d-e { font: 800 21px var(--f-round); color: var(--acc); }
.tr-d-f { font-size: 17px; line-height: 1.6; color: var(--ink2); flex: 1; }
.tr-d-c { font: 800 22px var(--f-round); }
.co { flex: 1; display: grid; grid-template-columns: 1fr 420px; gap: 20px; min-height: 0; }
.co-l { display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.co-sum { margin-left: auto; align-self: center; font-size: 17px; color: var(--ink2); }
.co-scroll { flex: 1; min-height: 0; }
.co-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; padding-right: 6px; }
.co-c { position: relative; height: 96px; padding: 8px 10px; border-radius: 10px; display: flex; flex-direction: column; justify-content: space-between; text-align: left; background: var(--pn2); box-shadow: inset 0 0 0 1px var(--line); }
.co-c i { font: 800 14px var(--f-round); font-style: normal; color: var(--ink2); }
.co-c.r-R i { color: var(--rar-r); }
.co-c.r-SR i { color: #c98f06; }
.co-c.r-SSR i { color: var(--rar-ssr); }
.co-c b { font: 700 15px/1.25 var(--f-round); }
.co-c small { position: absolute; right: 8px; top: 8px; font-size: 13px; color: var(--ink2); }
.co-c.unk { opacity: .45; }
.co-c.sel { box-shadow: inset 0 0 0 2px var(--acc); }
.co-c.eq::after { content: '装備中'; position: absolute; right: 6px; bottom: 6px; font-size: 12px; color: var(--acc); font-weight: 700; }
.co-r { font: 800 18px var(--f-round); color: var(--ink2); }
.co-acts { display: flex; flex-direction: column; gap: 8px; }
.ga-sub { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ga-buy { font-size: 17px; }
html[data-layout='portrait'] .tr, html[data-layout='portrait'] .co { grid-template-columns: 1fr; }

/* 会話中のログ、タイトルから開く設定と確認は top-layer より手前に出す */
html.in-vn #ui-backdrop, html:has(#title) #ui-backdrop { z-index: 55; }
html.in-vn #modal-layer, html:has(#title) #modal-layer { z-index: 60; }
