:root {
    --bg: #050811;
    --bg-panel: rgba(8, 13, 26, 0.64);
    --bg-card: #131c31;
    --border: rgba(78, 114, 184, 0.65);
    --text: #f1f5ff;
    --muted: #9eb2d8;
    --blue: #38bdf8;
    --green: #34d399;
    --gold: #fbbf24;
    --red: #fb7185;
    --purple: #c084fc;
    --glow-gold: 0 0 36px rgba(251, 191, 36, 0.65);
    --glow-rainbow: 0 0 42px rgba(236, 72, 153, 0.65), 0 0 24px rgba(56, 189, 248, 0.6);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body {
    height: 100%;
    font-family: "Segoe UI", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
    background: var(--bg);
    color: var(--text);
  }

  /* 1-Screen Full Viewport Game Shell on Desktop */
  body {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    position: relative;
  }
  @media (max-width: 1180px), (max-height: 660px) {
    body { height: auto; min-height: 100vh; overflow-y: auto; }
  }

  /* ===== Dynamic Field Background ===== */
  .field-bg-wrap {
    position: fixed; inset: 0; z-index: -2; overflow: hidden; background: #04070f;
  }
  .field-bg-img {
    position: absolute; inset: -16px;
    background-size: cover; background-position: center;
    opacity: 0.56; filter: blur(1px) saturate(1.3);
    transition: opacity 0.5s ease, background-image 0.5s ease;
    transform: scale(1.03);
  }
  .field-bg-overlay {
    position: absolute; inset: 0;
    background:
      radial-gradient(circle at 50% 18%, rgba(56, 189, 248, 0.14), rgba(4, 7, 15, 0.6) 70%),
      linear-gradient(180deg, rgba(4, 7, 15, 0.32) 0%, rgba(4, 7, 15, 0.78) 100%);
    transition: background 0.5s ease;
  }
  body.theme-storm .field-bg-overlay {
    background:
      radial-gradient(circle at 50% 15%, rgba(56, 189, 248, 0.25), rgba(6, 10, 26, 0.58) 65%),
      linear-gradient(180deg, rgba(12, 22, 46, 0.28), rgba(4, 7, 15, 0.78));
  }
  body.theme-omura .field-bg-overlay {
    background:
      radial-gradient(circle at 50% 15%, rgba(251, 191, 36, 0.26), rgba(8, 12, 22, 0.56) 65%),
      linear-gradient(180deg, rgba(28, 20, 8, 0.26), rgba(4, 7, 15, 0.76));
  }
  body.theme-ai .field-bg-overlay {
    background:
      radial-gradient(circle at 50% 20%, rgba(168, 85, 247, 0.3), rgba(6, 8, 22, 0.58) 65%),
      linear-gradient(180deg, rgba(28, 12, 48, 0.28), rgba(4, 7, 15, 0.78));
  }

  /* Sunburst Beams on FEVER */
  .sunburst {
    position: fixed; top: 34%; left: 50%; width: 150vmax; height: 150vmax;
    transform: translate(-50%, -50%);
    background: repeating-conic-gradient(from 0deg, rgba(251, 191, 36, 0.11) 0deg 8deg, transparent 8deg 20deg);
    z-index: -1; opacity: 0; pointer-events: none; transition: opacity 0.4s;
    animation: spinRays 24s linear infinite;
  }
  body.state-fever .sunburst { opacity: 1; }
  body.state-god .sunburst {
    opacity: 1;
    background: repeating-conic-gradient(from 0deg, rgba(251,191,36,0.16) 0deg 6deg, rgba(236,72,153,0.12) 6deg 12deg, rgba(56,189,248,0.12) 12deg 18deg, transparent 18deg 24deg);
    animation-duration: 12s;
  }
  @keyframes spinRays { to { transform: translate(-50%, -50%) rotate(360deg); } }

  /* Screen Flash, Shake, Cut-in */
  .screen-flash {
    position: fixed; inset: 0;
    background: radial-gradient(circle, rgba(255,255,255,0.92), rgba(251,191,36,0.55));
    pointer-events: none; opacity: 0; z-index: 1500;
  }
  .screen-flash.bang { animation: flashBang 0.52s ease-out; }
  @keyframes flashBang { 0% { opacity: 0.92; } 100% { opacity: 0; } }
  body.shake { animation: screenShake 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97); }
  @keyframes screenShake {
    10%, 90% { transform: translate3d(-3px, 1px, 0); }
    20%, 80% { transform: translate3d(5px, -2px, 0); }
    30%, 50%, 70% { transform: translate3d(-6px, 2px, 0); }
    40%, 60% { transform: translate3d(6px, -2px, 0); }
  }
  .cutin-banner {
    position: fixed; top: 32%; left: 50%; transform: translate(-50%, -50%) scale(0.7);
    z-index: 1400; pointer-events: none; opacity: 0;
    width: min(90vw, 720px); padding: 14px 26px; text-align: center;
    border-top: 3px solid #fde047; border-bottom: 3px solid #fde047;
    background: linear-gradient(90deg, transparent, rgba(10,14,28,0.95) 14%, rgba(30,18,48,0.96) 50%, rgba(10,14,28,0.95) 86%, transparent);
    box-shadow: 0 0 50px rgba(251, 191, 36, 0.6);
  }
  .cutin-banner.show { animation: cutinAnim 1.3s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
  .cutin-banner.rainbow {
    border-color: #f472b6;
    background: linear-gradient(90deg, transparent, rgba(236,72,153,0.94) 16%, rgba(251,191,36,0.96) 50%, rgba(56,189,248,0.94) 84%, transparent);
    box-shadow: 0 0 70px rgba(236, 72, 153, 0.85);
  }
  .cutin-sub { font-size: 11px; font-weight: 900; letter-spacing: 3px; color: #fef08a; text-transform: uppercase; }
  .cutin-main { font-size: 30px; font-weight: 900; letter-spacing: 2px; color: #fff; text-shadow: 0 3px 14px rgba(0,0,0,0.9); }
  .cutin-banner.rainbow .cutin-sub, .cutin-banner.rainbow .cutin-main { color: #111827; text-shadow: 0 1px 10px rgba(255,255,255,0.85); }
  @keyframes cutinAnim {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(1.25) skewX(-8deg); }
    14% { opacity: 1; transform: translate(-50%, -50%) scale(1) skewX(-6deg); }
    78% { opacity: 1; transform: translate(-50%, -50%) scale(1.02) skewX(-6deg); }
    100% { opacity: 0; transform: translate(-50%, -56%) scale(0.95) skewX(-6deg); }
  }

  /* ===== Compact Top Header + Presets ===== */
  header {
    flex-shrink: 0;
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 14px;
    background: rgba(6, 10, 20, 0.9);
    border-bottom: 1px solid rgba(251, 191, 36, 0.28);
    backdrop-filter: blur(8px);
    gap: 8px; flex-wrap: wrap;
    z-index: 40;
  }
  .brand { display: flex; align-items: center; gap: 8px; }
  .brand-logo {
    width: 42px; height: 42px; border-radius: 11px;
    display: grid; place-items: center; overflow: hidden;
    flex-shrink: 0;
  }
  .brand-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .brand h1 { font-size: 18px; letter-spacing: 0.8px; font-weight: 900; }
  .brand .sub { font-size: 10px; color: var(--muted); }
  .header-controls { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
  .pill {
    font-size: 10.5px; padding: 3px 8px; border-radius: 999px;
    background: rgba(19, 28, 49, 0.9); border: 1px solid var(--border); color: var(--muted);
    white-space: nowrap; flex-shrink: 0;
  }
  .pill strong { color: var(--blue); }
  .btn {
    cursor: pointer; border: 1px solid var(--border);
    background: rgba(19, 28, 49, 0.92); color: var(--text);
    padding: 4px 9px; border-radius: 7px; font-size: 11px; font-weight: 700;
    transition: all 0.15s; display: inline-flex; align-items: center; gap: 4px;
    white-space: nowrap; flex-shrink: 0; line-height: 1.25;
  }
  .btn:hover { border-color: var(--blue); transform: translateY(-1px); }
  .btn-gold { background: linear-gradient(135deg, #f59e0b, #fde047); color: #111827; border-color: #fef08a; font-weight: 900; }
  .btn-danger { border-color: rgba(251, 113, 133, 0.45); color: var(--red); }

  .presets-bar {
    flex-shrink: 0;
    padding: 5px 14px; display: flex; align-items: center; gap: 6px;
    overflow-x: auto;
    border-bottom: 1px solid rgba(56, 82, 138, 0.4);
    background: rgba(8, 13, 26, 0.72);
  }
  .presets-bar::-webkit-scrollbar { height: 4px; }
  .disclaimer-strip {
    flex-shrink: 0;
    padding: 2px 14px;
    font-size: 9.5px;
    color: rgba(148, 163, 184, 0.78);
    background: rgba(5, 8, 17, 0.85);
    border-bottom: 1px solid rgba(56, 82, 138, 0.22);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
  }
  .disclaimer-strip a { color: #7dd3fc; text-decoration: none; border-bottom: 1px dotted #38bdf8; }
  .risk-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 6px;
    padding: 4px 9px;
    border-radius: 7px;
    background: rgba(5, 9, 18, 0.52);
    border: 1px solid rgba(70, 102, 168, 0.35);
    font-size: 10px;
    color: #9eb2d8;
  }
  .risk-strip strong { color: #e2e8f0; font-variant-numeric: tabular-nums; }
  .presets-label { font-size: 10.5px; font-weight: 800; color: var(--gold); white-space: nowrap; }
  .preset-chip {
    cursor: pointer; white-space: nowrap; padding: 3px 10px; border-radius: 999px;
    background: rgba(20, 30, 54, 0.9); border: 1px solid rgba(251, 191, 36, 0.35);
    color: var(--text); font-size: 11px; font-weight: 700; transition: all 0.14s;
    display: inline-flex; align-items: center; gap: 4px;
  }
  .preset-chip:hover { border-color: var(--gold); background: rgba(251, 191, 36, 0.2); }

  /* ===== MIDDLE 3-COLUMN ARENA (with Direct Full-Area Field Background!) ===== */
  .arena-3col {
    position: relative;
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(270px, 1.02fr) minmax(460px, 1.85fr) minmax(350px, 1.3fr);
    gap: 10px;
    padding: 8px 12px;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    transition: background-image 0.55s ease;
  }
  .arena-3col::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 9, 20, 0.42) 0%, rgba(5, 9, 20, 0.62) 100%);
    pointer-events: none;
    z-index: 0;
    transition: background 0.5s ease;
  }
  body.theme-storm .arena-3col::before {
    background: linear-gradient(180deg, rgba(8, 16, 36, 0.36) 0%, rgba(5, 9, 20, 0.62) 100%);
  }
  body.theme-omura .arena-3col::before {
    background: linear-gradient(180deg, rgba(28, 19, 6, 0.32) 0%, rgba(5, 9, 20, 0.6) 100%);
  }
  body.theme-ai .arena-3col::before {
    background: linear-gradient(180deg, rgba(28, 12, 52, 0.38) 0%, rgba(5, 9, 20, 0.64) 100%);
  }
  .arena-3col > * {
    position: relative;
    z-index: 2;
  }
  canvas#ambientCanvas {
    position: absolute !important;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1 !important;
  }
  @media (min-width: 1600px) {
    .arena-3col {
      grid-template-columns: minmax(320px, 0.92fr) minmax(680px, 1.45fr) minmax(420px, 1.15fr);
    }
  }
  @media (max-width: 1180px) and (min-width: 1025px), (max-height: 660px) and (min-width: 1025px) {
    .arena-3col { grid-template-columns: 1fr; overflow: visible; flex: none; }
  }

  /* WQHDスケーリング時やFHD等（縦980px以下）でもDECKが縦に見切れず1画面に収まる最適化 */
  @media (min-width: 1025px) and (max-height: 980px) {
    .arena-3col { padding: 6px 10px; gap: 8px; }
    .col-panel { padding: 8px; gap: 6px; }
    .field-stage { height: 42px; padding: 0 11px; }
    .field-stage-name { font-size: 13.5px; }
    .hero-box { padding: 7px 11px; }
    .roi-value { font-size: 38px; }
    .rank-badge { width: 48px; height: 48px; font-size: 22px; }
    .kpi-strip { margin-top: 5px; gap: 5px; }
    .kpi { padding: 4px 6px; }
    .solidity-row { margin-top: 5px; padding: 4px 8px; }
    .deck-board { min-height: 210px; padding: 7px 10px; }
    .deck-board-head { margin-bottom: 5px; }
    .board-card { width: 134px; min-width: 134px; height: 176px; }
    .board-art-wrap { height: 112px; }
    .empty-slot { width: 130px; min-width: 130px; height: 176px; }
    .synergy-box { padding: 6px 10px; }
    .hand-dock { min-height: 212px; padding: 6px 14px 8px; }
    .hand-tray { padding: 14px 12px 10px; }
  }
  @media (min-width: 1025px) and (max-height: 820px) {
    .field-stage { height: 36px; }
    .hero-box { padding: 6px 10px; }
    .roi-value { font-size: 33px; }
    .deck-board { min-height: 192px; padding: 6px 9px; }
    .board-card { width: 122px; min-width: 122px; height: 160px; }
    .board-art-wrap { height: 100px; }
    .empty-slot { width: 118px; min-width: 118px; height: 160px; }
    .hand-dock { min-height: 198px; padding: 5px 12px 6px; }
    .hand-tray.size-mid .tcg-card { height: 144px; }
  }

  .col-panel {
    background: var(--bg-panel);
    border: 1px solid var(--border);
    border-radius: 13px;
    padding: 10px;
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
  }
  .col-panel::-webkit-scrollbar { width: 5px; }
  .col-panel::-webkit-scrollbar-thumb { background: #2c3e66; border-radius: 3px; }

  .sec-title {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 12px; font-weight: 800; flex-shrink: 0;
  }
  .sec-title .hint { font-size: 10px; font-weight: 500; color: var(--muted); }

  /* ===== LEFT COLUMN: Kuro Live Character + Speech Bubble + 3-Choice Rewards ===== */
  .nav-stage {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    flex-shrink: 0;
  }
  .cat-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
  }
  .cat-avatar {
    width: 72px; height: 72px; border-radius: 16px;
    background: radial-gradient(circle at 35% 30%, #2a1c4d, #0a0e1d);
    border: 2px solid var(--purple);
    box-shadow: 0 0 18px rgba(192, 132, 252, 0.5);
    overflow: hidden;
    display: grid; place-items: center;
    animation: kuroFloat 2.8s ease-in-out infinite;
  }
  .cat-avatar img {
    width: 100%; height: 100%; object-fit: cover; object-position: center 20%;
    display: block; transition: transform 0.18s ease;
  }
  .cat-avatar.talking {
    animation: kuroTalk 0.28s ease-in-out infinite;
    border-color: var(--gold);
    box-shadow: 0 0 24px rgba(251, 191, 36, 0.7);
  }
  .cat-avatar.talking img { transform: scale(1.06); }
  @keyframes kuroFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-4px); }
  }
  @keyframes kuroTalk {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.06); }
  }
  .cat-name-tag {
    font-size: 9.5px; font-weight: 900; color: var(--purple);
    background: rgba(15, 23, 42, 0.85); padding: 1px 6px; border-radius: 999px;
    border: 1px solid rgba(192, 132, 252, 0.45);
  }
  /* Speech Bubble with Tail */
  .speech-bubble {
    position: relative;
    flex: 1;
    padding: 9px 11px;
    border-radius: 13px;
    background: linear-gradient(155deg, rgba(28, 22, 54, 0.96), rgba(14, 19, 36, 0.96));
    border: 1.5px solid rgba(192, 132, 252, 0.68);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    min-height: 68px;
  }
  .speech-bubble::before {
    content: "";
    position: absolute;
    left: -9px;
    top: 16px;
    border-width: 7px 9px 7px 0;
    border-style: solid;
    border-color: transparent rgba(192, 132, 252, 0.72) transparent transparent;
  }
  .speech-bubble::after {
    content: "";
    position: absolute;
    left: -6.5px;
    top: 17.5px;
    border-width: 5.5px 7.5px 5.5px 0;
    border-style: solid;
    border-color: transparent #1a1636 transparent transparent;
  }
  .nav-msg {
    font-size: 11.2px;
    line-height: 1.48;
    color: #eef4ff;
    white-space: pre-wrap;
  }
  .typing-cursor {
    display: inline-block;
    width: 6px; height: 11px;
    background: var(--gold);
    margin-left: 2px;
    vertical-align: middle;
    animation: blinkCur 0.6s steps(1) infinite;
  }
  @keyframes blinkCur { 50% { opacity: 0; } }

  .reward-list { display: flex; flex-direction: column; gap: 7px; flex: 0 0 auto; overflow-y: visible; }
  .reward-card {
    cursor: pointer; border-radius: 11px; flex-shrink: 0;
    background: linear-gradient(135deg, rgba(16, 24, 43, 0.92), rgba(10, 15, 30, 0.92));
    border: 1px solid rgba(96, 138, 224, 0.42);
    padding: 6px;
    transition: all 0.16s ease;
    display: grid; grid-template-columns: 86px 1fr; gap: 9px; align-items: stretch;
  }
  .reward-card:hover { transform: translateX(3px); border-color: var(--gold); box-shadow: 0 6px 20px rgba(251, 191, 36, 0.3); }
  .reward-mini-tcg {
    position: relative; width: 86px; height: 112px; border-radius: 9px; overflow: hidden;
    background: #0b1020; display: flex; flex-direction: column; flex-shrink: 0;
  }
  .reward-mini-tcg.rarity-bronze { border: 2px solid #9c6637; }
  .reward-mini-tcg.rarity-silver { border: 2px solid #94a3b8; }
  .reward-mini-tcg.rarity-gold { border: 2px solid #f59e0b; box-shadow: 0 0 12px rgba(245,158,11,0.35); }
  .reward-mini-tcg.rarity-legend { border: 2px solid #fde047; box-shadow: 0 0 14px rgba(192,132,252,0.55); }
  .reward-mini-art-wrap { position: relative; height: 74px; width: 100%; overflow: hidden; }
  .reward-art { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
  .reward-mini-body {
    flex: 1; padding: 3px 4px; background: linear-gradient(180deg, #0c1224, #141e38);
    display: flex; align-items: center; justify-content: center; text-align: center;
  }
  .reward-mini-name {
    font-size: 9px; font-weight: 900; line-height: 1.15; color: #fff;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .reward-info { padding: 2px 2px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
  .reward-badge {
    display: inline-block; width: fit-content;
    font-size: 9.5px; font-weight: 900; padding: 2px 7px; border-radius: 999px;
    background: rgba(251, 191, 36, 0.18); color: var(--gold); border: 1px solid rgba(251, 191, 36, 0.38);
  }
  .reward-roi-row {
    display: flex; align-items: baseline; justify-content: space-between; gap: 6px; margin-top: 4px;
  }
  .reward-delta { font-size: 18px; font-weight: 900; color: var(--green); line-height: 1.05; font-variant-numeric: tabular-nums; }
  .reward-delta.neg { color: var(--red); }
  .reward-new-roi { font-size: 12px; font-weight: 800; color: var(--muted); white-space: nowrap; }
  .reward-stats-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 4px;
  }
  .reward-stat-pill {
    font-size: 9.5px; color: #cbd5e1; padding: 3px 6px; border-radius: 6px;
    background: rgba(5, 9, 18, 0.68); border: 1px solid rgba(71, 85, 105, 0.4);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }

  /* ===== CENTER COLUMN: Active Field + ROI Slot + VISUAL TCG DECK BOARD ===== */
  .field-stage {
    position: relative; height: 54px; flex-shrink: 0;
    border-radius: 10px; overflow: hidden;
    border: 1.5px solid rgba(56, 189, 248, 0.55);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 13px; background: #080e1d;
  }
  .field-stage-bg {
    position: absolute; inset: 0; background-size: cover; background-position: center 35%;
    opacity: 0.82; transition: background-image 0.45s ease;
  }
  .field-stage::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(5,8,17,0.82) 0%, rgba(5,8,17,0.22) 50%, rgba(5,8,17,0.8) 100%);
    pointer-events: none;
  }
  .field-stage-info { position: relative; z-index: 3; }
  .field-stage-tag { font-size: 9px; font-weight: 900; letter-spacing: 1.4px; color: var(--gold); }
  .field-stage-name { font-size: 15px; font-weight: 900; color: #fff; text-shadow: 0 2px 10px #000; }
  .field-stage-effect {
    position: relative; z-index: 3; font-size: 10px; font-weight: 800;
    padding: 3px 9px; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
    background: rgba(8, 13, 28, 0.82); border: 1px solid rgba(251, 191, 36, 0.55); color: #fde68a;
  }

  /* Hero ROI Box */
  .hero-box {
    position: relative; flex-shrink: 0;
    border-radius: 12px; padding: 10px 14px;
    background: linear-gradient(135deg, rgba(16, 26, 48, 0.9), rgba(8, 13, 26, 0.94));
    border: 2px solid var(--border); transition: all 0.25s;
  }
  .hero-box.reach {
    border-color: #fb923c;
    box-shadow: 0 0 26px rgba(251, 146, 60, 0.5);
    animation: reachPulse 0.85s ease-in-out infinite;
  }
  @keyframes reachPulse { 0%,100% { box-shadow: 0 0 18px rgba(251,146,60,0.35); } 50% { box-shadow: 0 0 38px rgba(239,68,68,0.75); } }
  .hero-box.fever {
    border-color: var(--gold); box-shadow: var(--glow-gold);
    background: linear-gradient(135deg, rgba(52, 34, 8, 0.92), rgba(22, 16, 42, 0.95));
  }
  .hero-box.god {
    border: 2.5px solid #fde047; box-shadow: var(--glow-rainbow);
    background: linear-gradient(125deg, rgba(76,18,64,0.92), rgba(45,30,8,0.92), rgba(14,42,74,0.94));
    animation: rainbowBorder 2.2s linear infinite;
  }
  @keyframes rainbowBorder { 0% { border-color: #fde047; } 33% { border-color: #f472b6; } 66% { border-color: #38bdf8; } 100% { border-color: #fde047; } }

  .hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  .roi-label { font-size: 10px; font-weight: 800; color: var(--muted); letter-spacing: 0.7px; }
  .roi-wrap { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
  .roi-value { font-size: 46px; font-weight: 900; line-height: 1; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
  .roi-value.god {
    background: linear-gradient(90deg, #fde047, #f472b6, #38bdf8, #34d399, #fde047);
    background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: shineText 1.8s linear infinite;
    filter: drop-shadow(0 0 18px rgba(251, 191, 36, 0.7));
  }
  @keyframes shineText { to { background-position: 200% center; } }
  .roi-value.over100 { color: var(--gold); text-shadow: 0 0 24px rgba(251, 191, 36, 0.7); }
  .roi-value.reach { color: #fb923c; }
  .roi-value.mid { color: var(--green); }
  .roi-value.low { color: var(--red); }
  .roi-value.insufficient { color: #94a3b8; text-shadow: none; }

  /* Prominent Sample Shortage Warning Banner inside Hero Box */
  .sample-warning-banner {
    display: none;
    margin-top: 7px;
    padding: 7px 11px;
    border-radius: 9px;
    font-size: 11.5px;
    font-weight: 800;
    line-height: 1.45;
    border: 1.5px solid rgba(251, 146, 60, 0.7);
    background: linear-gradient(90deg, rgba(124, 45, 18, 0.72), rgba(30, 20, 12, 0.85));
    color: #fed7aa;
  }
  .sample-warning-banner.show { display: block; }
  .sample-warning-banner.critical {
    border-color: rgba(251, 113, 133, 0.85);
    background: repeating-linear-gradient(
      -45deg,
      rgba(136, 19, 55, 0.65),
      rgba(136, 19, 55, 0.65) 12px,
      rgba(45, 10, 24, 0.78) 12px,
      rgba(45, 10, 24, 0.78) 24px
    );
    color: #ffe4e6;
    box-shadow: 0 0 18px rgba(244, 63, 94, 0.35);
  }

  /* Game-Style Hazard WARNING Alert Overlay (Triggers after combo when N < 50) */
  .warning-alert-overlay {
    position: fixed;
    left: 50%;
    top: 22%;
    transform: translate(-50%, -20px) scale(0.92);
    z-index: 1420;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
    min-width: 300px;
    max-width: 90vw;
    padding: 12px 22px;
    border-radius: 12px;
    border: 2px solid #fbbf24;
    background: repeating-linear-gradient(
      -45deg,
      rgba(30, 18, 6, 0.96),
      rgba(30, 18, 6, 0.96) 14px,
      rgba(56, 26, 8, 0.96) 14px,
      rgba(56, 26, 8, 0.96) 28px
    );
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.85), 0 0 28px rgba(251, 191, 36, 0.5);
    text-align: center;
  }
  .warning-alert-overlay.show {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
  .warning-alert-kicker {
    font-size: 11px; font-weight: 900; letter-spacing: 2.5px; color: #fbbf24;
  }
  .warning-alert-main {
    font-size: 17px; font-weight: 900; color: #fff; margin-top: 2px;
  }
  .warning-alert-sub {
    font-size: 11px; color: #fde68a; margin-top: 3px;
  }

  /* Roman Hit State (ROI >= 100% but low sample / outlier dependent) */
  .hero-box.roman {
    border-color: #c084fc;
    box-shadow: 0 0 24px rgba(192, 132, 252, 0.45);
    background: linear-gradient(135deg, rgba(42, 19, 64, 0.92), rgba(15, 20, 38, 0.94));
  }
  .hero-box.roman .ribbon-roman { display: inline-block; background: linear-gradient(90deg, #a855f7, #f97316); color: #fff; }
  .roi-value.roman { color: #e879f9; text-shadow: 0 0 20px rgba(232, 121, 249, 0.55); }

  /* Strategy Solidity Gauge Bar */
  .solidity-row {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin-top: 7px; padding: 5px 9px; border-radius: 8px;
    background: rgba(5, 9, 18, 0.65); border: 1px solid rgba(70, 102, 168, 0.45);
    font-size: 10.5px;
  }
  .solidity-stars { color: var(--gold); letter-spacing: 1px; font-weight: 900; }
  .solidity-track { flex: 0 0 95px; height: 7px; border-radius: 999px; background: #1e293b; overflow: hidden; }
  .solidity-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #38bdf8, #34d399, #fbbf24); transition: width 0.35s ease; }
  .solidity-goal { color: #cbd5e1; font-size: 10px; margin-left: auto; }

  .status-ribbon { display: none; padding: 2px 9px; border-radius: 999px; font-size: 10px; font-weight: 900; }
  .hero-box.reach .ribbon-reach { display: inline-block; background: linear-gradient(90deg, #f97316, #ef4444); color: #fff; animation: pulse 0.65s infinite; }
  .hero-box.fever .ribbon-fever { display: inline-block; background: linear-gradient(90deg, #f59e0b, #fde047); color: #111827; animation: pulse 0.9s infinite; }
  .hero-box.god .ribbon-god { display: inline-block; background: linear-gradient(90deg, #ec4899, #fde047, #38bdf8); color: #111827; animation: pulse 0.7s infinite; }
  @keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }

  .rank-badge {
    width: 56px; height: 56px; border-radius: 12px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 25px; font-weight: 900;
    border: 2px solid var(--border); background: var(--bg-card);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  }
  .rank-badge.pop { transform: scale(1.2) rotate(-6deg); }
  .rank-Splus { background: linear-gradient(135deg, #f59e0b, #ec4899, #38bdf8); border-color: #fef08a; color: #fff; box-shadow: var(--glow-rainbow); }
  .rank-S { background: linear-gradient(135deg, #eab308, #f97316); border-color: #fef08a; color: #111827; box-shadow: var(--glow-gold); }
  .rank-A { background: linear-gradient(135deg, #10b981, #06b6d4); border-color: #6ee7b7; color: #052e16; }
  .rank-B { background: linear-gradient(135deg, #3b82f6, #6366f1); border-color: #93c5fd; color: #fff; }
  .rank-C, .rank-D { background: #1e293b; border-color: #475569; color: #94a3b8; }

  .kpi-strip {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 8px;
  }
  .kpi {
    background: rgba(5, 9, 18, 0.65); border: 1px solid rgba(56, 82, 138, 0.55);
    border-radius: 8px; padding: 5px 7px;
  }
  .kpi.jackpot-kpi { border-color: rgba(251, 191, 36, 0.55); background: rgba(45, 31, 9, 0.55); }
  .kpi .k-label { font-size: 9px; color: var(--muted); }
  .kpi .k-val { font-size: 13px; font-weight: 900; margin-top: 1px; font-variant-numeric: tabular-nums; }
  .k-val.gold { color: var(--gold); }

  /* ===== VISUAL TCG DECK BOARD (Direct Field Background Stage!) ===== */
  .deck-board {
    position: relative;
    flex: 1 0 auto;
    min-height: 236px;
    border: 2px solid rgba(251, 191, 36, 0.48);
    border-radius: 13px;
    padding: 9px 12px;
    background-color: #070d1d;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center 42%;
    display: flex;
    flex-direction: column;
    transition: background-image 0.55s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    box-shadow: inset 0 0 36px rgba(0, 0, 0, 0.65);
  }
  .deck-board::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
      radial-gradient(circle at 50% 45%, rgba(8, 14, 30, 0.18), rgba(5, 8, 18, 0.74) 85%),
      linear-gradient(180deg, rgba(5, 8, 18, 0.52) 0%, rgba(5, 8, 18, 0.16) 45%, rgba(5, 8, 18, 0.55) 100%);
    pointer-events: none;
    z-index: 0;
  }
  .deck-board > * {
    position: relative;
    z-index: 1;
  }
  .deck-board.drag-over {
    border-color: var(--gold);
    box-shadow: inset 0 0 40px rgba(251, 191, 36, 0.45), 0 0 24px rgba(251, 191, 36, 0.45);
  }

  /* ===== 2-Stage Synergy Insight Box (Hint first -> Expand Why!) ===== */
  .synergy-box {
    flex-shrink: 0;
    border-radius: 11px;
    padding: 8px 11px;
    background: linear-gradient(135deg, rgba(22, 28, 52, 0.88), rgba(11, 16, 32, 0.88));
    border: 1px solid rgba(251, 191, 36, 0.42);
    display: flex; flex-direction: column; gap: 5px;
  }
  .synergy-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  }
  .synergy-tag { font-size: 12px; font-weight: 900; color: var(--gold); }
  .synergy-why-btn {
    cursor: pointer; border: 1px solid rgba(56, 189, 248, 0.55);
    background: rgba(56, 189, 248, 0.14); color: #bae6fd;
    padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800;
    transition: all 0.14s; white-space: nowrap; flex-shrink: 0;
  }
  .synergy-why-btn:hover { background: rgba(56, 189, 248, 0.28); color: #fff; }
  .synergy-body {
    display: none;
    padding-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 11px; line-height: 1.48; color: #dbeafe;
  }
  .synergy-body.open { display: block; }
  .synergy-reasons {
    list-style: none;
    display: flex; flex-direction: column; gap: 3px;
    margin-top: 4px;
  }
  .synergy-reasons li {
    font-size: 10.5px; line-height: 1.42; color: #e2e8f0;
    padding: 3px 7px; border-radius: 6px;
    background: rgba(15, 23, 42, 0.7);
    border-left: 2.5px solid var(--gold);
  }
  .synergy-metrics {
    margin-top: 5px; font-family: monospace; font-size: 10px;
    color: #fde68a; background: rgba(5, 8, 17, 0.65);
    padding: 4px 8px; border-radius: 6px;
  }

  /* Clickable Monthly Row */
  .log-table tr.month-row { cursor: pointer; transition: background 0.12s; }
  .log-table tr.month-row:hover td { background: rgba(251, 191, 36, 0.16); }

  /* ===== Pachislot BONUS Combo Explanation Popup ===== */
  .bonus-backdrop {
    position: fixed; inset: 0;
    background: rgba(4, 6, 16, 0.72);
    backdrop-filter: blur(5px);
    display: none; place-items: center;
    z-index: 1450;
    padding: 16px;
  }
  .bonus-backdrop.open { display: grid; animation: fadeInFast 0.18s ease; }
  @keyframes fadeInFast { from { opacity: 0; } to { opacity: 1; } }
  .bonus-modal {
    position: relative;
    width: 100%; max-width: 600px;
    border-radius: 18px;
    padding: 20px 24px 18px;
    background:
      radial-gradient(circle at 50% 0%, rgba(251, 191, 36, 0.25), transparent 55%),
      linear-gradient(165deg, #211538 0%, #10172b 55%, #090e1c 100%);
    border: 3px solid #fde047;
    box-shadow: 0 0 65px rgba(251, 191, 36, 0.65), inset 0 0 30px rgba(251, 191, 36, 0.18);
    animation: bonusPop 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  }
  .bonus-modal.god-bonus {
    border-color: #f472b6;
    background:
      radial-gradient(circle at 50% 0%, rgba(236, 72, 153, 0.34), transparent 55%),
      linear-gradient(165deg, #32123c 0%, #1d1430 50%, #0b162c 100%);
    box-shadow: 0 0 80px rgba(236, 72, 153, 0.72), 0 0 38px rgba(56, 189, 248, 0.55);
  }
  @keyframes bonusPop {
    0% { opacity: 0; transform: scale(0.72) translateY(24px); }
    70% { opacity: 1; transform: scale(1.03) translateY(-4px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
  }
  .bonus-kicker {
    text-align: center; font-size: 12px; font-weight: 900; letter-spacing: 3px;
    color: #fde047; text-transform: uppercase;
  }
  .bonus-roi {
    text-align: center; font-size: 52px; font-weight: 900; line-height: 1.05;
    margin: 4px 0;
    background: linear-gradient(90deg, #fde047, #f97316, #f472b6, #38bdf8, #fde047);
    background-size: 200% auto; -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    animation: shineText 1.6s linear infinite;
  }
  .bonus-combo-title {
    text-align: center; font-size: 16px; font-weight: 900; color: #fff;
    margin-bottom: 10px;
  }
  .bonus-summary {
    text-align: center; font-size: 12.5px; color: #fef3c7; margin-bottom: 12px; line-height: 1.5;
  }
  .bonus-reasons {
    list-style: none; display: flex; flex-direction: column; gap: 6px;
    margin-bottom: 12px; max-height: 220px; overflow-y: auto;
  }
  .bonus-reasons li {
    font-size: 12px; line-height: 1.5; color: #eef4ff;
    padding: 7px 10px; border-radius: 9px;
    background: rgba(8, 13, 28, 0.78);
    border-left: 3px solid #fbbf24;
  }
  .bonus-metrics {
    font-family: monospace; font-size: 11px; color: #bae6fd;
    background: rgba(5, 8, 17, 0.72); border: 1px solid rgba(56,189,248,0.35);
    padding: 7px 10px; border-radius: 8px; text-align: center; margin-bottom: 14px;
  }

  /* Month Detail Modal */
  .month-modal {
    width: 100%; max-width: 860px; max-height: 88vh;
    display: flex; flex-direction: column; gap: 10px;
    background: linear-gradient(180deg, #121b33, #0a1020);
    border: 2px solid var(--blue); border-radius: 16px; padding: 18px 20px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.9);
  }
  .month-table-scroll {
    flex: 1; min-height: 220px; max-height: 55vh; overflow-y: auto;
    border: 1px solid var(--border); border-radius: 10px; background: rgba(5, 9, 18, 0.7);
  }
  .hit-row td { background: rgba(251, 191, 36, 0.12); }
  .top-hits-strip {
    display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0;
  }
  .hit-chip {
    font-size: 10.5px; font-weight: 800; padding: 3px 8px; border-radius: 7px;
    background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.42);
    color: #fde68a; display: inline-flex; align-items: center; gap: 4px;
  }
  .hit-chip strong { color: #fff; }
  .deck-board-head {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 8px; font-size: 11px; font-weight: 800; color: var(--muted); flex-shrink: 0;
  }
  .deck-slots {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px;
  }
  .deck-slots::-webkit-scrollbar { height: 5px; }
  .deck-slots::-webkit-scrollbar-thumb { background: #304574; border-radius: 3px; }

  /* Placed Board Card (Large Shadowverse Battlefield Card + Idle Breathing & Auto Hologram Shimmer!) */
  .board-card {
    position: relative;
    width: 148px;
    min-width: 148px;
    height: 198px;
    border-radius: 12px;
    overflow: hidden;
    background: #0b1020;
    display: flex; flex-direction: column;
    animation: cardSlam 0.28s cubic-bezier(0.22, 1, 0.36, 1), boardFloat 3.6s ease-in-out 0.3s infinite;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.16s ease, box-shadow 0.2s ease;
  }
  .board-card:nth-child(2n) { animation-delay: 0s, 0.9s; }
  .board-card:nth-child(3n) { animation-delay: 0s, 1.8s; }
  .board-card:hover { animation-play-state: paused; transform: translateY(-8px) scale(1.05); z-index: 10; }
  @keyframes boardFloat {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-5px); }
  }
  @keyframes cardSlam {
    0% { opacity: 0; transform: translateY(34px) scale(1.22); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
  }
  /* Premium Auto-Shimmer on Gold & Legend Cards (Shadowverse Animated Card Feel!) */
  .board-card.rarity-legend::before,
  .board-card.rarity-gold::before,
  .tcg-card.rarity-legend::before {
    content: "";
    position: absolute;
    inset: -45%;
    background: linear-gradient(
      115deg,
      transparent 35%,
      rgba(255, 255, 255, 0.22) 47%,
      rgba(192, 132, 252, 0.28) 51%,
      rgba(56, 189, 248, 0.22) 55%,
      transparent 66%
    );
    animation: autoShimmer 4.2s ease-in-out infinite;
    pointer-events: none;
    z-index: 5;
  }
  @keyframes autoShimmer {
    0%, 55% { transform: translateX(-85%) rotate(12deg); }
    100% { transform: translateX(85%) rotate(12deg); }
  }

  /* Empty Placeholder Slot (Yu-Gi-Oh! Monster Zone Spinning Magic Ring!) */
  .empty-slot {
    position: relative;
    width: 142px; min-width: 142px; height: 198px; flex-shrink: 0;
    border-radius: 12px;
    border: 2px dashed rgba(96, 138, 224, 0.48);
    background: radial-gradient(circle at 50% 50%, rgba(56, 189, 248, 0.08), rgba(10, 16, 32, 0.45));
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 8px; text-align: center;
    color: #7c93ba; font-size: 10.5px; font-weight: 700;
    overflow: hidden;
    animation: slotBreath 3s ease-in-out infinite;
  }
  @keyframes slotBreath {
    0%, 100% { border-color: rgba(96, 138, 224, 0.35); box-shadow: inset 0 0 12px rgba(56, 189, 248, 0.06); }
    50% { border-color: rgba(251, 191, 36, 0.55); box-shadow: inset 0 0 22px rgba(251, 191, 36, 0.14); }
  }
  .empty-slot .magic-ring {
    width: 46px; height: 46px; border-radius: 50%;
    border: 2px dashed rgba(56, 189, 248, 0.6);
    display: grid; place-items: center; font-size: 20px; color: var(--blue);
    animation: spinSlow 10s linear infinite;
  }
  @keyframes spinSlow { to { transform: rotate(360deg); } }

  /* Summon Shockwave Ring when Card Placed */
  .summon-ring {
    position: fixed;
    width: 140px; height: 140px;
    border-radius: 50%;
    border: 3px solid #fde047;
    box-shadow: 0 0 28px rgba(251, 191, 36, 0.8), inset 0 0 20px rgba(56, 189, 248, 0.6);
    pointer-events: none;
    z-index: 1240;
    transform: translate(-50%, -50%) scale(0.2);
    animation: summonWave 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes summonWave {
    0% { opacity: 0.95; transform: translate(-50%, -50%) scale(0.2); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.9); }
  }
  .board-card.is-attack {
    border: 2.5px solid #fb7185;
    box-shadow: 0 0 22px rgba(251, 113, 133, 0.55);
  }
  .board-card.rarity-bronze { border: 2px solid #cd7f32; box-shadow: 0 6px 14px rgba(0,0,0,0.6); }
  .board-card.rarity-silver { border: 2px solid #cbd5e1; box-shadow: 0 6px 16px rgba(148,163,184,0.3); }
  .board-card.rarity-gold { border: 2px solid #fbbf24; box-shadow: 0 0 20px rgba(251,191,36,0.45); }
  .board-card.rarity-legend { border: 2.5px solid #fde047; box-shadow: 0 0 24px rgba(192,132,252,0.65); }

  .board-art-wrap { position: relative; height: 126px; width: 100%; overflow: hidden; }
  .board-art { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; display: block; }
  .board-art-fade {
    position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(5,8,17,0.15) 0%, transparent 45%, rgba(11,16,32,0.96) 100%);
  }
  .board-tag {
    position: absolute; bottom: 5px; left: 6px;
    font-size: 9px; font-weight: 900; padding: 2px 6px; border-radius: 4px;
    background: rgba(5, 8, 17, 0.88); color: var(--gold); border: 1px solid rgba(251,191,36,0.45);
  }
  .board-card.is-attack .board-tag { background: #fb7185; color: #fff; border: none; }
  .board-rm {
    position: absolute; top: 5px; right: 5px; z-index: 8;
    width: 22px; height: 22px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.45);
    background: rgba(15, 23, 42, 0.9); color: #fff;
    font-size: 13px; font-weight: 900; cursor: pointer; display: grid; place-items: center;
  }
  .board-rm:hover { background: var(--red); border-color: #fff; }
  .board-body {
    flex: 1; padding: 5px 7px;
    background: linear-gradient(180deg, #0c1224, #141e38);
    display: flex; align-items: center; justify-content: center; text-align: center;
  }
  .board-name { font-size: 11.5px; font-weight: 900; line-height: 1.25; color: #fff; }

  /* ===== RIGHT COLUMN: Profit Evidence (Reliability + Money Bar + Chart + Real Hit Logs) ===== */
  .reliability-bar {
    padding: 7px 10px; border-radius: 9px; font-size: 11px; font-weight: 800; flex-shrink: 0;
    display: flex; flex-direction: column; gap: 2px;
  }
  .reliability-bar.rel-HIGH { background: rgba(52, 211, 153, 0.14); border: 1px solid rgba(52, 211, 153, 0.55); color: #a7f3d0; }
  .reliability-bar.rel-MID { background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.55); color: #fde68a; }
  .reliability-bar.rel-LOW, .reliability-bar.rel-TINY { background: rgba(251, 113, 133, 0.16); border: 1px solid rgba(251, 113, 133, 0.55); color: #fecdd3; }
  .rel-note { font-size: 10px; font-weight: 500; opacity: 0.92; line-height: 1.35; }

  .money-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; flex-shrink: 0; }
  .money-card {
    background: rgba(15, 23, 42, 0.85); border: 1px solid var(--border);
    border-radius: 8px; padding: 6px 8px;
  }
  .money-card .m-lbl { font-size: 9px; color: var(--muted); font-weight: 700; }
  .money-card .m-val { font-size: 14px; font-weight: 900; margin-top: 2px; font-variant-numeric: tabular-nums; }
  .money-card.net-pos { border-color: var(--green); background: rgba(16, 185, 129, 0.14); }
  .money-card.net-neg { border-color: var(--red); background: rgba(244, 63, 94, 0.12); }

  .bar-visual { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; }
  .bar-row { display: grid; grid-template-columns: 44px 1fr 78px; align-items: center; gap: 6px; font-size: 10px; font-weight: 800; }
  .bar-track { height: 10px; background: rgba(30, 41, 59, 0.9); border-radius: 999px; overflow: hidden; }
  .bar-fill { height: 100%; border-radius: 999px; transition: width 0.35s ease; }
  .bar-staked { background: linear-gradient(90deg, #64748b, #94a3b8); }
  .bar-return-pos { background: linear-gradient(90deg, #10b981, #fbbf24); }
  .bar-return-neg { background: linear-gradient(90deg, #f43f5e, #fb7185); }

  .chart-wrap {
    position: relative; height: 122px; flex-shrink: 0;
    background: rgba(5, 9, 18, 0.78); border: 1px solid var(--border);
    border-radius: 10px; padding: 6px;
  }
  canvas#equityChart { width: 100%; height: 100%; display: block; }

  .ev-controls {
    display: flex; align-items: center; justify-content: space-between;
    gap: 5px; flex-wrap: wrap; flex-shrink: 0;
  }
  .ev-tabs { display: flex; gap: 4px; }
  .ev-tab {
    cursor: pointer; padding: 4px 8px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--muted); font-size: 10px; font-weight: 800;
    white-space: nowrap; flex-shrink: 0;
  }
  .ev-tab.active { border-color: var(--gold); color: var(--gold); background: rgba(251, 191, 36, 0.16); }

  .toggle-wrap { display: flex; align-items: center; gap: 5px; cursor: pointer; font-size: 10px; font-weight: 700; color: var(--muted); }
  .toggle-wrap input { accent-color: var(--purple); width: 13px; height: 13px; cursor: pointer; }

  .log-table-wrap {
    flex: 1; min-height: 95px; overflow-y: auto;
    border-radius: 8px; border: 1px solid var(--border); background: rgba(5, 9, 18, 0.6);
  }
  .log-table-wrap::-webkit-scrollbar { width: 5px; }
  .log-table-wrap::-webkit-scrollbar-thumb { background: #2c3e66; border-radius: 3px; }
  .log-table { width: 100%; border-collapse: collapse; font-size: 10.5px; }
  .log-table th {
    position: sticky; top: 0; background: #131e36; color: var(--muted);
    text-align: left; padding: 5px 6px; font-size: 9.5px; border-bottom: 1px solid var(--border);
  }
  .log-table td { padding: 4px 6px; border-bottom: 1px solid rgba(56, 82, 138, 0.25); font-variant-numeric: tabular-nums; white-space: nowrap; }
  .badge-combo {
    display: inline-block; padding: 1px 5px; border-radius: 4px;
    background: rgba(251, 191, 36, 0.16); color: #fde68a; font-weight: 900; font-family: monospace;
  }

  /* ===== BOTTOM FIXED HAND DOCK (Always Visible Without Scrolling!) ===== */
  .hand-dock {
    flex-shrink: 0;
    min-height: 236px;
    background: linear-gradient(180deg, rgba(11, 17, 34, 0.94), rgba(5, 8, 17, 0.99));
    border-top: 2px solid rgba(251, 191, 36, 0.42);
    padding: 10px 16px 12px;
    backdrop-filter: blur(10px);
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.6);
    z-index: 30;
  }
  .hand-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
  }
  .tabs {
    display: flex; gap: 4px; flex-wrap: wrap;
    background: rgba(5, 8, 17, 0.8); padding: 3px; border-radius: 8px; border: 1px solid var(--border);
  }
  .tab {
    padding: 4px 10px; font-size: 11px; font-weight: 800; border-radius: 6px;
    cursor: pointer; color: var(--muted); transition: all 0.14s; border: none; background: transparent;
    white-space: nowrap; flex-shrink: 0;
  }
  .tab.active { background: #1e2d52; color: #fff; }
  .tab[data-cat="ai"].active { color: #fde047; background: linear-gradient(135deg, #43206c, #5c3a14); }
  .tab[data-cat="attack"].active { color: var(--red); }
  .tab[data-cat="field"].active { color: var(--blue); }
  .tab[data-cat="condition"].active { color: var(--green); }
  .tab[data-cat="special"].active { color: var(--gold); }

  .density-controls { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--muted); }
  .dens-btn {
    cursor: pointer; padding: 3px 8px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg-card);
    color: var(--muted); font-size: 10.5px; font-weight: 800;
  }
  .dens-btn.active { border-color: var(--gold); color: var(--gold); background: rgba(251, 191, 36, 0.16); }

  .hand-tray {
    display: flex; gap: 10px; overflow-x: auto; padding: 20px 14px 14px;
    scroll-behavior: smooth;
  }
  .hand-tray::-webkit-scrollbar { height: 6px; }
  .hand-tray::-webkit-scrollbar-thumb { background: #304574; border-radius: 3px; }
  .hand-tray.mode-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
    max-height: 230px; overflow-y: auto; overflow-x: hidden; padding: 18px 12px 14px;
  }
  .hand-tray.size-wide .tcg-card { width: 156px; min-width: 156px; height: 178px; }
  .hand-tray.size-mid .tcg-card { width: 132px; min-width: 132px; height: 158px; }
  .hand-tray.size-compact .tcg-card { width: 110px; min-width: 110px; height: 140px; }
  .hand-tray.mode-grid .tcg-card { width: auto; min-width: 0; height: 146px; }

  .tcg-card {
    position: relative; cursor: grab; border-radius: 10px; overflow: hidden;
    background: #0b1020; display: flex; flex-direction: column; flex-shrink: 0;
    transition: transform 0.16s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.16s ease;
    user-select: none;
  }
  .tcg-card:hover { transform: translateY(-10px) scale(1.06); z-index: 25; }
  .tcg-card:active { cursor: grabbing; transform: scale(0.97); }
  .tcg-card.rarity-bronze { border: 2px solid #9c6637; }
  .tcg-card.rarity-silver { border: 2px solid #94a3b8; }
  .tcg-card.rarity-gold { border: 2px solid #f59e0b; box-shadow: 0 4px 16px rgba(245,158,11,0.3); }
  .tcg-card.rarity-legend { border: 2px solid #fde047; box-shadow: 0 0 18px rgba(192,132,252,0.5); }

  .tcg-card.selected { opacity: 0.42; filter: saturate(0.45); }
  .tcg-card.selected::after {
    content: "IN DECK"; position: absolute; top: 44%; left: 50%;
    transform: translate(-50%, -50%) rotate(-12deg);
    font-size: 11px; font-weight: 900; padding: 2px 7px; border-radius: 5px;
    background: rgba(10, 15, 29, 0.94); border: 1.5px solid var(--blue); color: var(--blue); z-index: 8;
  }
  .tcg-card.active-attack { box-shadow: 0 0 20px rgba(251, 113, 133, 0.75); border-color: #fb7185; }
  .tcg-card.active-attack::after {
    content: "EQUIP"; position: absolute; bottom: 5px; right: 5px;
    font-size: 8px; font-weight: 900; padding: 1px 5px; border-radius: 4px;
    background: #fb7185; color: #fff; z-index: 8;
  }

  .tcg-art-wrap { position: relative; flex: 1; min-height: 76px; width: 100%; overflow: hidden; }
  .tcg-art { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; display: block; }
  .tcg-art-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,8,17,0.12) 0%, transparent 45%, rgba(11,16,32,0.96) 100%); }
  .boat-orb {
    position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; border-radius: 50%;
    display: grid; place-items: center; font-size: 10.5px; font-weight: 900;
    border: 1.5px solid rgba(255,255,255,0.85); box-shadow: 0 2px 6px rgba(0,0,0,0.75); z-index: 4;
  }
  .boat-0 { background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff; }
  .boat-1 { background: linear-gradient(135deg, #ffffff, #cbd5e1); color: #0f172a; border-color: #94a3b8; }
  .boat-2 { background: linear-gradient(135deg, #27272a, #09090b); color: #f8fafc; border-color: #a1a1aa; }
  .boat-3 { background: linear-gradient(135deg, #ef4444, #991b1b); color: #fff; }
  .boat-4 { background: linear-gradient(135deg, #2563eb, #1e3a8a); color: #fff; }
  .boat-5 { background: linear-gradient(135deg, #facc15, #ca8a04); color: #111827; }
  .boat-6 { background: linear-gradient(135deg, #22c55e, #15803d); color: #fff; }

  .rarity-gem {
    position: absolute; top: 5px; right: 5px;
    font-size: 7.5px; font-weight: 900; padding: 1.5px 5px; border-radius: 999px;
    text-transform: uppercase; z-index: 4;
  }
  .gem-bronze { background: rgba(143,92,48,0.9); color: #ffedd5; }
  .gem-silver { background: rgba(100,116,139,0.92); color: #f8fafc; }
  .gem-gold { background: linear-gradient(135deg, #d97706, #fbbf24); color: #111827; }
  .gem-legend { background: linear-gradient(135deg, #a855f7, #f59e0b, #38bdf8); color: #fff; }

  .tcg-body {
    padding: 4px 6px 6px; background: linear-gradient(180deg, #0c1224, #121b33);
    border-top: 1px solid rgba(251, 191, 36, 0.2);
  }
  .tcg-name { font-size: 10.5px; font-weight: 900; line-height: 1.2; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tcg-desc { font-size: 9px; line-height: 1.25; color: #b4c4e4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 2px; }

  /* Floating Hover Zoom Card */
  .card-zoom-preview {
    position: fixed; width: 286px; border-radius: 16px; overflow: hidden; background: #0a0f1f;
    pointer-events: none; opacity: 0; transform: scale(0.92);
    transition: opacity 0.12s ease, transform 0.14s cubic-bezier(0.22, 1, 0.36, 1);
    z-index: 1100; box-shadow: 0 24px 65px rgba(0, 0, 0, 0.9);
  }
  .card-zoom-preview.visible { opacity: 1; transform: scale(1); }
  .card-zoom-preview.rarity-bronze { border: 3px solid #cd7f32; }
  .card-zoom-preview.rarity-silver { border: 3px solid #cbd5e1; }
  .card-zoom-preview.rarity-gold { border: 3px solid #fbbf24; box-shadow: 0 24px 65px rgba(0,0,0,0.9), 0 0 36px rgba(251,191,36,0.5); }
  .card-zoom-preview.rarity-legend { border: 3px solid #fde047; box-shadow: 0 24px 65px rgba(0,0,0,0.92), 0 0 46px rgba(192,132,252,0.7); }
  .zoom-art-wrap { position: relative; height: 215px; width: 100%; overflow: hidden; }
  .zoom-art { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; display: block; }
  .zoom-art-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,8,17,0.12) 0%, transparent 50%, rgba(10,15,31,0.98) 100%); }
  .zoom-body { padding: 10px 14px 14px; background: linear-gradient(180deg, #0b1123, #141e38); border-top: 1px solid rgba(251,191,36,0.28); }
  .zoom-title { font-size: 15px; font-weight: 900; color: #fff; margin-bottom: 5px; }
  .zoom-desc { font-size: 12px; line-height: 1.48; color: #dbeafe; margin-bottom: 8px; }
  .zoom-tip { font-size: 11px; line-height: 1.42; padding: 7px 9px; border-radius: 8px; background: rgba(56,189,248,0.13); border: 1px solid rgba(56,189,248,0.35); color: #bae6fd; }
  .zoom-tip strong { color: #fde047; }

  /* Help Modal */
  .modal-backdrop {
    position: fixed; inset: 0; background: rgba(3,6,14,0.8); backdrop-filter: blur(6px);
    display: none; place-items: center; z-index: 1300; padding: 16px;
  }
  .modal-backdrop.open { display: grid; }
  .modal {
    width: 100%; max-width: 700px; max-height: 88vh; overflow-y: auto;
    background: linear-gradient(180deg, #121b33, #0b1020);
    border: 2px solid var(--gold); border-radius: 16px; padding: 20px 24px;
    box-shadow: 0 24px 70px rgba(0,0,0,0.88), var(--glow-gold);
  }
  .modal h2 { font-size: 18px; font-weight: 900; color: var(--gold); margin-bottom: 8px; }
  .modal h3 { font-size: 13.5px; font-weight: 800; color: var(--blue); margin: 12px 0 5px; }
  .modal p, .modal li { font-size: 12.5px; line-height: 1.6; color: #dbeafe; }
  .modal ul { padding-left: 18px; display: flex; flex-direction: column; gap: 4px; }
  .boat-color-legend { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0; }
  .bc-item { padding: 5px 4px; border-radius: 7px; text-align: center; font-size: 10.5px; font-weight: 900; border: 1px solid rgba(255,255,255,0.2); }

  canvas#fxCanvas { position: fixed; inset: 0; pointer-events: none; z-index: 1250; }
  .toast {
    position: fixed; top: 54px; right: 18px; background: #111827; border: 1px solid var(--gold);
    color: var(--text); padding: 8px 14px; border-radius: 9px; font-size: 12px; font-weight: 700;
    box-shadow: var(--glow-gold); opacity: 0; transform: translateY(-8px);
    transition: all 0.2s; pointer-events: none; z-index: 1350;
  }
  .toast.show { opacity: 1; transform: translateY(0); }

  /* Today Deploy & Saved Decks Modals */
  .btn-deploy {
    background: linear-gradient(135deg, #0ea5e9, #6366f1);
    border-color: #7dd3fc; color: #fff; font-weight: 900;
    box-shadow: 0 0 14px rgba(56, 189, 248, 0.45);
  }
  .btn-deploy:hover { filter: brightness(1.12); transform: translateY(-1px); }
  .deploy-modal {
    width: 100%; max-width: 940px; max-height: 88vh;
    display: flex; flex-direction: column; gap: 10px;
    background: linear-gradient(180deg, #101930, #080d1a);
    border: 2px solid var(--blue); border-radius: 16px; padding: 18px 20px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.92), 0 0 36px rgba(56, 189, 248, 0.28);
  }
  .deploy-alert {
    padding: 8px 12px; border-radius: 10px;
    background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.55);
    color: #fef3c7; font-size: 11.5px; line-height: 1.5;
  }
  .deploy-list {
    flex: 1; min-height: 220px; max-height: 54vh; overflow-y: auto;
    display: flex; flex-direction: column; gap: 8px; padding-right: 4px;
  }
  .deploy-race-card {
    background: rgba(15, 23, 42, 0.88); border: 1px solid var(--border);
    border-radius: 11px; padding: 10px 12px;
    display: flex; flex-direction: column; gap: 6px;
  }
  .deploy-race-head {
    display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
  }
  .deploy-entries {
    display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px;
  }
  .entry-pill {
    padding: 4px 5px; border-radius: 7px; font-size: 10px; line-height: 1.25;
    background: rgba(5, 9, 18, 0.72); border: 1px solid rgba(71, 85, 105, 0.45);
  }
  .entry-pill .e-top { display: flex; align-items: center; gap: 4px; font-weight: 900; }
  .entry-pill .e-no {
    width: 16px; height: 16px; border-radius: 50%; display: inline-grid; place-items: center;
    font-size: 9.5px; font-weight: 900; flex-shrink: 0;
  }
  .deck-item-row {
    display: flex; justify-content: space-between; align-items: center; gap: 10px;
    padding: 10px 12px; border-radius: 10px;
    background: rgba(15, 23, 42, 0.88); border: 1px solid var(--border);
  }
  .deck-item-row:hover { border-color: var(--gold); }
  .custom-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 9px; border-radius: 999px; font-size: 10.5px; font-weight: 800;
    background: linear-gradient(135deg, rgba(168,85,247,0.28), rgba(56,189,248,0.25));
    border: 1px solid rgba(192,132,252,0.65); color: #f3e8ff;
  }
  .custom-chip button {
    background: none; border: none; color: #fda4af; cursor: pointer; font-weight: 900; font-size: 12px;
  }

  /* Visual Attack Card Formation Diagram (Replaces Beginner Memo!) */
  .formation-box {
    display: flex; flex-direction: column; gap: 6px;
    padding: 8px 10px; border-radius: 9px;
    background: rgba(8, 13, 28, 0.85); border: 1px solid rgba(251, 191, 36, 0.38);
  }
  .fm-row { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 800; color: #cbd5e1; }
  .fm-orbs { display: inline-flex; align-items: center; gap: 3px; flex-wrap: wrap; }
  .fm-orb {
    width: 20px; height: 20px; border-radius: 50%; display: inline-grid; place-items: center;
    font-size: 10.5px; font-weight: 900; border: 1.5px solid rgba(255,255,255,0.75);
  }
  .fm-tickets {
    font-family: monospace; font-size: 10px; color: #fde68a; line-height: 1.4;
    padding-top: 4px; border-top: 1px dashed rgba(148,163,184,0.28);
  }

  /* Left-Column Bet-Type Preset Card Grid (Max 3x3 -> Min 1x9 Responsive!) */
  .bet-preset-tabs {
    display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px; flex-shrink: 0;
  }
  .bp-tab {
    flex: 1; min-width: 44px; padding: 4px 6px; border-radius: 6px; cursor: pointer;
    border: 1px solid var(--border); background: rgba(15,23,42,0.85);
    color: var(--muted); font-size: 10px; font-weight: 800; text-align: center;
    white-space: nowrap; flex-shrink: 0;
  }
  .bp-tab.active { border-color: var(--gold); color: var(--gold); background: rgba(251,191,36,0.16); }
  .bet-preset-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(max(114px, calc((100% - 14px) / 3)), 1fr));
    gap: 7px;
    flex: 1;
    min-height: 150px;
    overflow-y: auto;
    align-content: start;
    padding: 2px 4px 4px 0;
    scrollbar-width: thin;
    scrollbar-color: #304574 transparent;
  }
  .bet-preset-list::-webkit-scrollbar,
  .deploy-list::-webkit-scrollbar,
  .month-table-scroll::-webkit-scrollbar,
  #savedDecksList::-webkit-scrollbar,
  .modal::-webkit-scrollbar {
    width: 6px;
    height: 6px;
  }
  .bet-preset-list::-webkit-scrollbar-track,
  .deploy-list::-webkit-scrollbar-track,
  .month-table-scroll::-webkit-scrollbar-track,
  #savedDecksList::-webkit-scrollbar-track,
  .modal::-webkit-scrollbar-track {
    background: rgba(5, 9, 18, 0.35);
    border-radius: 999px;
  }
  .bet-preset-list::-webkit-scrollbar-thumb,
  .deploy-list::-webkit-scrollbar-thumb,
  .month-table-scroll::-webkit-scrollbar-thumb,
  #savedDecksList::-webkit-scrollbar-thumb,
  .modal::-webkit-scrollbar-thumb {
    background: #304574;
    border-radius: 999px;
  }
  .bet-preset-list::-webkit-scrollbar-thumb:hover,
  .deploy-list::-webkit-scrollbar-thumb:hover,
  .month-table-scroll::-webkit-scrollbar-thumb:hover,
  #savedDecksList::-webkit-scrollbar-thumb:hover,
  .modal::-webkit-scrollbar-thumb:hover {
    background: rgba(251, 191, 36, 0.7);
  }
  .bp-card {
    position: relative; cursor: pointer; border-radius: 10px; overflow: hidden; text-align: left;
    background: #0c1326; border: 1.5px solid rgba(78, 114, 184, 0.55);
    display: flex; flex-direction: column; min-height: 112px;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    padding: 0;
  }
  .bp-card:hover {
    transform: translateY(-3px); border-color: var(--gold);
    box-shadow: 0 6px 18px rgba(251, 191, 36, 0.35);
  }
  .bp-card-art-wrap { position: relative; height: 54px; width: 100%; overflow: hidden; flex-shrink: 0; }
  .bp-card-art { width: 100%; height: 100%; object-fit: cover; object-position: center 25%; display: block; }
  .bp-card-fade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(5,8,17,0.15), rgba(12,19,38,0.95)); }
  .bp-card-tag {
    position: absolute; top: 4px; left: 4px; font-size: 8.5px; font-weight: 900;
    padding: 1px 5px; border-radius: 4px; background: rgba(5,8,17,0.86);
    color: var(--gold); border: 1px solid rgba(251,191,36,0.45);
  }
  .bp-card-body { padding: 5px 6px 6px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
  .bp-title {
    font-size: 10px; font-weight: 900; color: #fff; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .bp-sub {
    font-size: 8.8px; color: #9eb2d8; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }

  /* Synergy Energy Link Line & Floating Chain Pop (Game Juice!) */
  .deck-slots { position: relative; }
  .deck-slots.has-chain::before {
    content: "";
    position: absolute;
    left: 24px; right: 24px; top: 50%;
    height: 3px;
    background: linear-gradient(90deg, rgba(56,189,248,0.0), rgba(56,189,248,0.75), rgba(192,132,252,0.85), rgba(251,191,36,0.75), rgba(56,189,248,0.0));
    box-shadow: 0 0 14px rgba(56,189,248,0.7);
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 0;
    animation: linkPulse 1.8s ease-in-out infinite;
  }
  body.state-fever .deck-slots.has-chain::before,
  body.state-god .deck-slots.has-chain::before {
    background: linear-gradient(90deg, transparent, #fde047, #f472b6, #38bdf8, #fde047, transparent);
    height: 4px;
    box-shadow: 0 0 22px rgba(251,191,36,0.9);
  }
  @keyframes linkPulse { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
  .chain-pop {
    position: fixed; left: 50%; top: 38%;
    transform: translate(-50%, -50%) scale(0.7);
    font-size: 28px; font-weight: 900; letter-spacing: 2px;
    color: #fde047; text-shadow: 0 0 22px rgba(251,191,36,0.9), 0 4px 12px #000;
    pointer-events: none; z-index: 1260;
    animation: chainFloat 0.85s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  }
  @keyframes chainFloat {
    0% { opacity: 0; transform: translate(-50%, -20%) scale(0.6); }
    25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -95%) scale(1.0); }
  }

  /* 3D Holo Glare Overlay (Balatro / Pokemon TCG Foil Sheen) */
  .holo-glare {
    position: absolute; inset: 0; pointer-events: none; z-index: 6;
    opacity: 0; transition: opacity 0.16s ease;
    mix-blend-mode: screen;
  }

  /* PlayStation / Steam Style Achievement Trophy Banner */
  .trophy-banner {
    position: fixed; top: 56px; right: 18px; z-index: 1380;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 15px; border-radius: 13px;
    background: linear-gradient(135deg, rgba(19, 28, 52, 0.97), rgba(40, 26, 8, 0.96));
    border: 2px solid #fbbf24;
    box-shadow: 0 12px 38px rgba(0,0,0,0.85), 0 0 28px rgba(251,191,36,0.5);
    transform: translateX(130%); opacity: 0;
    transition: transform 0.36s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.28s ease;
    pointer-events: none;
  }
  .trophy-banner.show { transform: translateX(0); opacity: 1; }
  .trophy-icon {
    width: 38px; height: 38px; border-radius: 50%;
    background: radial-gradient(circle, #fde047, #d97706);
    display: grid; place-items: center; font-size: 20px; flex-shrink: 0;
    box-shadow: 0 0 14px rgba(251,191,36,0.75);
  }
  .trophy-kicker { font-size: 9px; font-weight: 900; letter-spacing: 1.5px; color: #fde047; }
  .trophy-title { font-size: 13px; font-weight: 900; color: #fff; }
  .trophy-desc { font-size: 10.5px; color: #dbeafe; }

  /* Pack-Open Card Craft Burst Flash */
  .pack-flash {
    position: fixed; inset: 0; z-index: 1340; pointer-events: none;
    background: radial-gradient(circle at 50% 50%, rgba(253, 224, 71, 0.85), rgba(168, 85, 247, 0.55) 45%, transparent 72%);
    opacity: 0; transform: scale(0.35);
    animation: packBurst 0.65s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes packBurst {
    0% { opacity: 0.95; transform: scale(0.3); }
    45% { opacity: 0.8; transform: scale(1.15); }
    100% { opacity: 0; transform: scale(1.6); }
  }

  .craft-venue-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }

  /* ===== MOBILE / TABLET RESPONSIVE LAYOUT =====
     Order: 1.Header -> 2.Onboarding -> 3.Presets -> 4.Disclaimer -> 5.ROI & DECK -> 6.Hand Dock -> 7.Kuro/3-Choice -> 8.Profit Evidence */
  @media (max-width: 1024px) {
    html, body { height: auto; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
    body { padding-bottom: 24px; }
    header { order: 1; padding: 8px 10px; gap: 6px; }
    .onboarding-strip { order: 2; }
    .presets-bar { order: 3; padding: 6px 10px; }
    .disclaimer-strip { order: 4; }

    /* Flatten #mainArena so hand-dock sits right below DECK on mobile */
    #mainArena { display: contents !important; }
    #ambientCanvas {
      position: fixed !important; inset: 0; width: 100vw; height: 100vh;
      z-index: 0 !important; opacity: 0.45;
    }

    #mainArena > section { order: 5; margin: 8px 10px 0; overflow: visible !important; }
    section.hand-dock {
      order: 6; margin: 10px 10px 0; border-radius: 13px;
      border: 1.5px solid rgba(251, 191, 36, 0.52);
      min-height: auto; padding: 10px 10px 12px;
      box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
    }
    #mainArena > aside:first-of-type { order: 7; margin: 10px 10px 0; }
    #mainArena > aside:last-of-type { order: 8; margin: 10px 10px 14px; }

    .col-panel {
      position: relative; z-index: 2;
      overflow: visible !important; height: auto; min-height: auto;
      padding: 10px;
    }
    .deck-board { min-height: 215px; background-size: cover; background-position: center; }
    .bet-preset-list { max-height: none; overflow: visible; }
    .log-table-wrap { max-height: 300px; overflow-x: auto; }
    .hand-tray.mode-grid { max-height: 340px; }
  }

  @media (max-width: 640px) {
    header { flex-direction: column; align-items: stretch; }
    .brand { width: 100%; }
    .brand h1 { font-size: 14px; }
    .brand .sub { font-size: 9.5px; line-height: 1.35; }
    .header-controls {
      width: 100%; display: flex; flex-wrap: wrap; gap: 5px;
    }
    .header-controls .btn, .header-controls .pill {
      font-size: 10.5px; padding: 5px 8px;
    }

    .field-stage {
      height: auto; min-height: 48px; padding: 7px 10px; gap: 6px; flex-wrap: wrap;
    }
    .field-stage-name { font-size: 13.5px; }
    .field-stage-effect { font-size: 9.5px; padding: 2px 8px; }

    .hero-box { padding: 10px 11px; }
    .hero-top { align-items: flex-start; gap: 8px; }
    .roi-value { font-size: 36px; }
    .rank-badge { width: 48px; height: 48px; font-size: 24px; flex-shrink: 0; }
    .status-ribbon { white-space: nowrap; font-size: 9.5px; padding: 2px 7px; }

    .kpi-strip { grid-template-columns: repeat(2, 1fr); gap: 6px; }
    .kpi { padding: 6px 8px; }
    .kpi .k-val { font-size: 12.5px; white-space: nowrap; }

    .solidity-row { gap: 6px; padding: 6px 8px; }
    .solidity-track { flex: 1 1 80px; min-width: 70px; }
    .solidity-goal { width: 100%; margin-left: 0; font-size: 10px; line-height: 1.4; }

    .deck-board { min-height: 196px; padding: 8px 9px; }
    .deck-board-head { flex-wrap: wrap; gap: 6px; font-size: 10.5px; }
    .board-card { width: 122px; min-width: 122px; height: 168px; }
    .board-art-wrap { height: 106px; }
    .board-name { font-size: 10.5px; }
    .empty-slot { width: 118px; min-width: 118px; height: 168px; font-size: 10px; }

    .synergy-head { gap: 6px; }
    .synergy-tag { font-size: 11.5px; }
    .synergy-why-btn { font-size: 10px; padding: 4px 8px; }

    /* Left Panel (Kuro, 3-Choice, Bet Presets) */
    .cat-avatar { width: 60px; height: 60px; }
    .nav-msg { font-size: 11px; }
    .reward-card { grid-template-columns: 76px 1fr; gap: 8px; padding: 6px; }
    .reward-mini-tcg { width: 76px; height: 104px; }
    .reward-mini-art-wrap { height: 68px; }
    .reward-delta { font-size: 15px; white-space: nowrap; }
    .reward-new-roi { font-size: 11px; }
    .reward-stats-grid { grid-template-columns: 1fr; gap: 3px; }
    .reward-stat-pill { font-size: 9.5px; }

    .bet-preset-tabs { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; }
    .bp-tab { flex: 0 0 auto; padding: 5px 10px; font-size: 10.5px; }
    .bet-preset-list { grid-template-columns: repeat(2, 1fr); gap: 7px; }

    /* Hand Dock */
    .hand-toolbar { flex-direction: column; align-items: stretch; gap: 6px; }
    .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .density-controls { flex-wrap: wrap; gap: 5px; font-size: 10px; }
    .dens-btn { white-space: nowrap; padding: 4px 8px; }
    .hand-tray { padding: 14px 8px 10px; gap: 8px; }
    .hand-tray.size-mid .tcg-card { width: 118px; min-width: 118px; height: 148px; }
    .hand-tray.size-wide .tcg-card { width: 136px; min-width: 136px; height: 164px; }

    /* Right Panel (Profit Evidence) */
    .money-grid { gap: 5px; }
    .money-card { padding: 6px; }
    .money-card .m-lbl { font-size: 8.8px; white-space: nowrap; }
    .money-card .m-val { font-size: 12px; white-space: nowrap; }
    .bar-row { grid-template-columns: 40px 1fr 68px; font-size: 9.5px; }
    .ev-controls { flex-direction: column; align-items: flex-start; gap: 6px; }
    .ev-tabs { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; }

    /* Modals */
    .modal, .deploy-modal, .month-modal { padding: 14px 12px; }
    .deploy-entries { grid-template-columns: repeat(2, 1fr); }
    .boat-color-legend { grid-template-columns: repeat(3, 1fr); }
    .craft-venue-grid { grid-template-columns: repeat(3, 1fr); }
    .trophy-banner { top: auto; bottom: 14px; right: 10px; left: 10px; }
  }

  @media (max-width: 375px) {
    .money-grid { grid-template-columns: 1fr 1fr; }
    #evNetCard { grid-column: 1 / -1; }
    .bet-preset-list { grid-template-columns: 1fr; }
  }

  /* Touch devices: prevent stuck hover zoom tooltip on tap */
  @media (hover: none) {
    .card-zoom-preview { display: none !important; }
    .tcg-card:hover { transform: none; }
  }

  /* Border Odds & Forward Tracking Badges */
  .ev-banner {
    padding: 8px 12px; border-radius: 10px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(14, 165, 233, 0.14));
    border: 1px solid rgba(52, 211, 153, 0.5);
    color: #d1fae5; font-size: 11.5px; line-height: 1.5;
  }
  .ticket-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 7px; border-radius: 6px;
    background: rgba(15, 23, 42, 0.92); border: 1px solid rgba(251, 191, 36, 0.45);
    font-family: monospace; font-size: 10.5px;
  }
  .ticket-chip .tc-combo { color: #fde68a; font-weight: 900; }
  .ticket-chip .tc-odds { color: #34d399; font-weight: 800; font-size: 9.8px; }
  .fwd-badge {
    display: inline-block; margin-top: 4px; padding: 3px 8px; border-radius: 7px;
    font-size: 10.5px; font-weight: 800; line-height: 1.35;
  }
  .fwd-winning { background: rgba(16,185,129,0.16); border: 1px solid rgba(52,211,153,0.55); color: #a7f3d0; }
  .fwd-caution { background: rgba(244,63,94,0.16); border: 1px solid rgba(251,113,133,0.55); color: #fecdd3; }
  .fwd-pending { background: rgba(56,189,248,0.14); border: 1px solid rgba(56,189,248,0.45); color: #bae6fd; }

  /* Mobile Floating Mini-ROI Bar (Shows live ROI while tapping Hand Cards on Mobile!) */
  .mobile-mini-bar {
    display: none;
  }
  @media (max-width: 1024px) {
    .mobile-mini-bar {
      position: fixed; top: 0; left: 0; right: 0; z-index: 1150;
      display: flex; align-items: center; justify-content: space-between; gap: 8px;
      padding: 7px 12px;
      background: rgba(8, 13, 26, 0.96);
      border-bottom: 1.5px solid rgba(251, 191, 36, 0.55);
      backdrop-filter: blur(10px);
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.7);
      transform: translateY(-110%);
      transition: transform 0.22s ease;
    }
    .mobile-mini-bar.visible { transform: translateY(0); }
  }

  /* ===== UX/UI AUDIT v3 OVERRIDES: Clarity, A11y, Contrast, Mobile & Pro UX ===== */
  body.modal-open { overflow: hidden !important; }

  /* Focus Rings (Keyboard A11y) */
  button:focus-visible, a:focus-visible, [tabindex="0"]:focus-visible,
  input:focus-visible, select:focus-visible {
    outline: 2px solid var(--gold) !important;
    outline-offset: 2px !important;
  }

  /* Header Info Navigation Links */
  .top-info-links {
    display: inline-flex; align-items: center; gap: 5px;
    margin-left: 10px; padding-left: 10px;
    border-left: 1px solid rgba(148, 163, 184, 0.28);
  }
  .info-nav-link {
    font-size: 11.5px; font-weight: 700; color: #cbd5e1;
    padding: 4px 8px; border-radius: 7px; text-decoration: none;
    background: rgba(15, 23, 42, 0.72); border: 1px solid rgba(96, 138, 224, 0.28);
    white-space: nowrap; transition: all 0.15s ease;
  }
  .info-nav-link:hover { color: #fff; border-color: var(--blue); background: rgba(56, 189, 248, 0.16); }
  .info-nav-pro {
    color: #fde68a; border-color: rgba(251, 191, 36, 0.48); background: rgba(251, 191, 36, 0.12);
  }
  .info-nav-pro:hover { background: rgba(251, 191, 36, 0.24); color: #fff; }
  .hdr-sep { width: 1px; height: 18px; background: rgba(148, 163, 184, 0.3); margin: 0 2px; }

  /* First-Time 3-Step Onboarding Strip */
  .onboarding-strip {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
    padding: 6px 14px;
    background: linear-gradient(90deg, rgba(16, 36, 72, 0.96), rgba(14, 24, 50, 0.96));
    border-bottom: 1px solid rgba(56, 189, 248, 0.35);
    font-size: 12px; color: #e2e8f0; flex-shrink: 0; position: relative; z-index: 9;
  }
  .onboarding-strip.hidden { display: none !important; }
  .ob-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .ob-badge {
    font-size: 11px; font-weight: 900; color: #0b1020;
    background: var(--gold); padding: 2px 8px; border-radius: 999px; white-space: nowrap;
  }
  .ob-step strong { color: #fde68a; }
  .ob-arrow { color: var(--blue); font-weight: 900; }
  .ob-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
  .ob-link {
    font-size: 11.5px; font-weight: 800; color: #7dd3fc; text-decoration: none;
    padding: 3px 8px; border-radius: 6px; border: 1px solid rgba(56, 189, 248, 0.4);
  }
  .ob-link:hover { background: rgba(56, 189, 248, 0.18); color: #fff; }
  .ob-close {
    background: rgba(30, 41, 59, 0.85); color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35); border-radius: 6px;
    padding: 3px 8px; font-size: 11px; font-weight: 700; cursor: pointer;
  }
  .ob-close:hover { color: #fff; border-color: var(--gold); }

  /* Clear Role Tag on Each Column */
  .col-role-tag {
    font-size: 11px; font-weight: 800; letter-spacing: 0.03em;
    color: #93c5fd; background: rgba(30, 58, 138, 0.35);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 7px; padding: 3px 9px;
    align-self: flex-start; flex-shrink: 0;
  }

  /* Pro Mini Pill on Gated Buttons */
  .pro-mini-pill {
    display: inline-block; margin-left: 4px;
    font-size: 10px; font-weight: 900; color: #0b1020;
    background: linear-gradient(135deg, #fde047, #f59e0b);
    padding: 1px 6px; border-radius: 999px; vertical-align: middle;
  }

  /* Loading Spinner & Init Error Banner */
  .mini-spinner {
    display: inline-block; width: 12px; height: 12px;
    border: 2px solid rgba(251, 191, 36, 0.3); border-top-color: var(--gold);
    border-radius: 50%; animation: spin360 0.7s linear infinite; vertical-align: middle;
  }
  @keyframes spin360 { to { transform: rotate(360deg); } }
  .init-error-banner {
    position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
    z-index: 9999; display: flex; align-items: center; gap: 12px;
    padding: 10px 16px; border-radius: 12px;
    background: rgba(127, 29, 29, 0.96); border: 1.5px solid #fb7185;
    color: #fff; font-size: 13px; font-weight: 700;
    box-shadow: 0 12px 32px rgba(0,0,0,0.7);
  }
  .btn:disabled { opacity: 0.55; cursor: not-allowed; filter: grayscale(0.3); }

  /* Card Detail Button (Essential for Touch/Mobile Users) */
  .tcg-info-btn {
    position: absolute; bottom: 4px; right: 4px; z-index: 6;
    width: 24px; height: 24px; border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.65);
    background: rgba(15, 23, 42, 0.92); color: #e2e8f0;
    font-size: 12px; font-weight: 900; line-height: 1;
    display: grid; place-items: center; cursor: pointer;
    padding: 0; transition: all 0.15s ease;
  }
  .tcg-info-btn:hover { background: var(--blue); color: #071020; border-color: #fff; }

  /* Typography & WCAG AA Contrast Improvements */
  .disclaimer-strip { font-size: 11px !important; color: #cbd5e1 !important; }
  .empty-slot { color: #94a3b8 !important; font-size: 12px !important; }
  .tcg-desc { font-size: 10.5px !important; color: #cbd5e1 !important; line-height: 1.35 !important; }
  .tcg-name { font-size: 11.5px !important; }
  .board-card .board-name { font-size: 11px !important; }
  .oos-strip {
    display: flex; justify-content: space-between; gap: 6px; flex-wrap: wrap;
    font-size: 11px; color: #cbd5e1; flex-shrink: 0;
    padding: 4px 8px; border-radius: 6px;
    background: rgba(5, 9, 18, 0.65); border: 1px solid rgba(56, 82, 138, 0.35);
  }

  /* Reduced Motion / Accessibility */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.01ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.01ms !important;
    }
    .screen-flash, .sunburst { display: none !important; }
  }

  /* Mobile Touch Target & Info Links Refinement */
  @media (max-width: 1024px) {
    .brand { flex-wrap: wrap; max-width: 100%; }
    .top-info-links { margin-left: 0; padding-left: 0; border-left: none; margin-top: 4px; width: 100%; flex-wrap: wrap; }
    .header-controls { max-width: 100%; }
    .onboarding-strip { max-width: 100%; overflow-wrap: anywhere; }
    .field-stage, .hero-box, .deck-board, .col-panel { max-width: 100%; min-width: 0; }
    .board-rm { width: 30px !important; height: 30px !important; font-size: 14px !important; }
    .tcg-info-btn { width: 30px; height: 30px; font-size: 14px; }
    .btn, .tab, .ev-tab, .bp-tab { min-height: 34px; }
    .onboarding-strip { padding: 8px 10px; font-size: 11.5px; }
  }

  /* ===== CLEAR 3-ZONE VISUAL IDENTITY (ROI = Gold | DECK = Cyan | HAND = Purple) ===== */
  .zone-header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; flex-wrap: wrap;
    padding: 5px 10px; margin: -4px -4px 7px;
    border-radius: 9px;
  }
  .zone-badge {
    display: inline-flex; align-items: center; gap: 5px;
    font-size: 11.5px; font-weight: 900; letter-spacing: 0.03em;
    padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  }
  .zone-sub { font-size: 11px; color: #cbd5e1; font-weight: 600; }

  /* 1. ROI Result Zone (Gold Identity) */
  .hero-box {
    border: 1.5px solid rgba(251, 191, 36, 0.52) !important;
    border-left: 4px solid #fbbf24 !important;
    background: linear-gradient(160deg, rgba(28, 24, 14, 0.92) 0%, rgba(12, 19, 36, 0.96) 38%) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }
  .zone-roi {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.18), rgba(251, 191, 36, 0.03));
    border-bottom: 1px solid rgba(251, 191, 36, 0.28);
  }
  .zone-badge-roi {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #0b1020;
  }

  /* 2. Equipped DECK Zone (Cyan / Emerald Identity) */
  .deck-board {
    margin-top: 4px;
    border: 2px solid rgba(34, 211, 238, 0.65) !important;
    border-left: 4px solid #22d3ee !important;
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.14), inset 0 0 24px rgba(8, 28, 46, 0.55) !important;
  }
  .deck-board-head.zone-deck {
    background: linear-gradient(90deg, rgba(14, 116, 144, 0.52), rgba(15, 23, 42, 0.78));
    border: 1px solid rgba(34, 211, 238, 0.35);
    margin: 0 0 8px 0;
    padding: 6px 10px;
    border-radius: 9px;
  }
  .zone-badge-deck {
    background: linear-gradient(135deg, #22d3ee, #0ea5e9);
    color: #061320;
  }
  .deck-count-pill {
    font-size: 11.5px; font-weight: 900; color: #e0f2fe;
    background: rgba(14, 165, 233, 0.25);
    border: 1px solid rgba(56, 189, 248, 0.55);
    padding: 3px 9px; border-radius: 999px; white-space: nowrap;
  }

  /* 3. Hand Card Pool Dock (Purple / Elevated Dock Identity) */
  .hand-dock {
    border-top: 3px solid #a855f7 !important;
    background: linear-gradient(180deg, rgba(22, 16, 44, 0.98) 0%, rgba(9, 13, 26, 0.99) 28%) !important;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.65), 0 -2px 18px rgba(168, 85, 247, 0.22) !important;
  }
  .hand-zone-label {
    display: inline-flex; align-items: center; gap: 8px;
    margin-right: 6px; padding-right: 10px;
    border-right: 1px solid rgba(192, 132, 252, 0.35);
    flex-shrink: 0;
  }
  .zone-badge-hand {
    background: linear-gradient(135deg, #c084fc, #7c3aed);
    color: #ffffff;
  }
  .hand-zone-hint {
    font-size: 11px; color: #ddd6fe; font-weight: 700; white-space: nowrap;
  }
  @media (max-width: 1024px) {
    .hand-dock {
      border: 2px solid rgba(192, 132, 252, 0.7) !important;
      border-top: 4px solid #a855f7 !important;
    }
    .hand-zone-label {
      border-right: none; padding-right: 0; width: 100%; margin-bottom: 4px;
    }
    .zone-sub { font-size: 10.5px; }
  }

  /* Compact vertical rhythm on <=980px height screens so ROI + DECK cards + HAND all stay visible */
  @media (min-width: 1025px) and (max-height: 980px) {
    .col-role-tag { display: none; }
    .zone-header { padding: 3px 8px; margin: -3px -3px 5px; }
    .zone-badge { font-size: 11px; padding: 2px 8px; }
    .deck-board-head.zone-deck { padding: 4px 8px; margin-bottom: 5px; }
    .field-stage { height: 34px !important; }
    .hero-box { padding: 7px 10px !important; }
    .kpi-strip { margin-top: 4px !important; gap: 5px !important; }
    .kpi { padding: 4px 7px !important; }
    .risk-strip { padding: 3px 7px !important; margin-top: 4px !important; }
    .solidity-row { margin-top: 4px !important; padding: 3px 7px !important; }
    .hand-dock { min-height: 186px !important; padding: 6px 12px 7px !important; }
  }

  /* ===== v4 PRODUCTION: TCG FOIL, ARC-SWIPE CAROUSEL & MOBILE DUEL ARENA ===== */
  @keyframes bdFoilSweep {
    0% { background-position: -140% 0%; }
    55% { background-position: 180% 0%; }
    100% { background-position: 180% 0%; }
  }
  @keyframes bdSparkleTwinkle {
    0%, 100% { opacity: 0.28; }
    50% { opacity: 0.85; }
  }

  /* TCGキラ加工レイヤー（PC・スマホ共通でレアリティ別に輝く） */
  .foil-layer {
    position: absolute; inset: 0; z-index: 3; pointer-events: none;
    mix-blend-mode: color-dodge;
  }
  .rarity-legend .foil-layer, .r-legend .foil-layer {
    background-image: linear-gradient(118deg,
      transparent 18%,
      rgba(255, 64, 160, 0.34) 32%,
      rgba(255, 232, 74, 0.40) 44%,
      rgba(56, 248, 255, 0.40) 56%,
      rgba(192, 120, 255, 0.36) 68%,
      transparent 82%);
    background-size: 260% 260%;
    animation: bdFoilSweep 3.4s ease-in-out infinite;
  }
  .sparkle-layer {
    position: absolute; inset: 0; z-index: 3; pointer-events: none;
    background-image:
      radial-gradient(circle at 22% 28%, rgba(255,255,255,0.95) 0 1.2px, transparent 2.4px),
      radial-gradient(circle at 76% 22%, rgba(254,240,138,0.95) 0 1.5px, transparent 3px),
      radial-gradient(circle at 64% 58%, rgba(125,211,252,0.95) 0 1.3px, transparent 2.8px),
      radial-gradient(circle at 30% 66%, rgba(233,213,255,0.95) 0 1.2px, transparent 2.5px),
      radial-gradient(circle at 82% 48%, rgba(255,255,255,0.9) 0 1.1px, transparent 2.2px);
    animation: bdSparkleTwinkle 2.1s ease-in-out infinite;
  }
  .rarity-gold .foil-layer, .r-gold .foil-layer, .active-attack .foil-layer {
    background-image: linear-gradient(115deg,
      transparent 24%,
      rgba(255, 224, 110, 0.26) 42%,
      rgba(255, 252, 220, 0.44) 50%,
      rgba(245, 158, 11, 0.26) 58%,
      transparent 76%);
    background-size: 260% 260%;
    animation: bdFoilSweep 4.2s ease-in-out infinite;
  }
  .rarity-silver .foil-layer, .r-silver .foil-layer {
    background-image: linear-gradient(115deg,
      transparent 32%,
      rgba(226, 232, 240, 0.20) 50%,
      transparent 68%);
    background-size: 260% 260%;
    animation: bdFoilSweep 5.5s ease-in-out infinite;
  }

  /* 参謀クロのタップヒント（PC/スマホ共通） */
  .nav-stage { cursor: pointer; }
  .kuro-tap-meta {
    margin-top: 4px; display: flex; justify-content: space-between; align-items: center;
    font-size: 10px; color: #c4b5fd; font-weight: 700;
  }

  /* PCではスマホ専用ボトムタブ＆メニューパネルを隠す */
  .mobile-bottom-nav, .mobile-menu-pane { display: none; }

  /* ===== 緩やかな弧を描くスワイプ詳細カルーセル ===== */
  .arc-modal-bg {
    position: fixed; inset: 0; z-index: 1200;
    background: rgba(5, 9, 18, 0.42); backdrop-filter: blur(3px);
    display: none; flex-direction: column; justify-content: center; align-items: center;
    overflow: hidden;
  }
  .arc-modal-bg.open { display: flex; }
  .arc-topbar {
    width: 100%; max-width: 440px; padding: 12px 16px 4px;
    display: flex; align-items: center; justify-content: space-between; gap: 8px; z-index: 10;
  }
  .arc-counter {
    font-size: 12px; font-weight: 800; color: #fde68a;
    background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.35);
    padding: 4px 11px; border-radius: 999px; white-space: nowrap;
  }
  .arc-swipe-hint { font-size: 11px; color: #cbd5e1; font-weight: 600; }
  .arc-close {
    width: 34px; height: 34px; border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.28); background: rgba(15, 23, 42, 0.88);
    color: #fff; font-size: 16px; display: grid; place-items: center; cursor: pointer; flex-shrink: 0;
  }
  .arc-stage {
    position: relative; width: 100%; max-width: 100vw; height: 490px;
    touch-action: pan-y; user-select: none; cursor: grab; overflow: hidden;
  }
  .arc-stage:active { cursor: grabbing; }
  .arc-card {
    position: absolute; top: 14px; left: 50%; width: 256px; margin-left: -128px;
    border-radius: 20px; overflow: hidden;
    background: linear-gradient(180deg, #141e38, #0a1020);
    border: 2px solid #64748b; box-shadow: 0 22px 54px rgba(0, 0, 0, 0.8);
    transform-origin: center 140%; will-change: transform, opacity;
  }
  .arc-card.r-legend { border-color: #fde047; box-shadow: 0 22px 54px rgba(0,0,0,0.82), 0 0 32px rgba(192, 132, 252, 0.48); }
  .arc-card.r-gold { border-color: #fbbf24; box-shadow: 0 22px 54px rgba(0,0,0,0.82), 0 0 24px rgba(251, 191, 36, 0.38); }
  .arc-card.r-silver { border-color: #94a3b8; }
  .arc-art-wrap { position: relative; height: 196px; overflow: hidden; }
  .arc-art-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
  .arc-art-fade {
    position: absolute; inset: 0; z-index: 2;
    background: linear-gradient(180deg, rgba(10,16,32,0.18) 0%, rgba(10,16,32,0) 45%, #0e162b 100%);
  }
  .arc-card .foil-layer {
    background-position: var(--foil-x, 50%) 50% !important;
    animation: none !important; opacity: 0.92;
  }
  .arc-body { padding: 4px 15px 15px; position: relative; z-index: 4; }
  .arc-cat { font-size: 10.5px; font-weight: 800; color: var(--gold); }
  .arc-name { font-size: 17px; font-weight: 900; margin: 3px 0 6px; color: #fff; line-height: 1.25; }
  .arc-desc { font-size: 12px; color: #cbd5e1; line-height: 1.5; margin: 0 0 8px; max-height: 60px; overflow-y: auto; }
  .arc-guide { margin-bottom: 10px; max-height: 76px; overflow-y: auto; }
  .arc-summon-btn {
    width: 100%; height: 42px; border-radius: 11px; border: none;
    background: linear-gradient(135deg, #fde047, #f59e0b); color: #070b14;
    font-size: 13.5px; font-weight: 900; cursor: pointer;
    box-shadow: 0 6px 18px rgba(251, 191, 36, 0.35);
  }
  .arc-summon-btn.remove {
    background: rgba(244, 63, 94, 0.18); color: #fda4af;
    border: 1.5px solid rgba(244, 63, 94, 0.55); box-shadow: none;
  }
  .arc-summon-btn:disabled { opacity: 0.55; cursor: default; box-shadow: none; }
  .arc-dots { display: flex; gap: 5px; margin-top: 2px; z-index: 10; flex-wrap: wrap; justify-content: center; max-width: 320px; }
  .arc-dot { width: 6px; height: 6px; border-radius: 999px; background: rgba(148, 163, 184, 0.35); transition: all 0.2s ease; }
  .arc-dot.active { width: 18px; background: var(--gold); }

  /* ===== MOBILE DUEL ARENA PRODUCTION LAYOUT (<=1024px) =====
     Exact Order: 1.Header -> 2.Preset -> 3.ROI -> 4.Kuro(Speech) -> 5.Next 3 -> 6.Deck -> 7.Hand -> Bottom Tab */
  @media (max-width: 1024px) {
    html, body { height: auto !important; min-height: 100%; overflow-x: hidden !important; overflow-y: auto !important; }
    body {
      display: flex !important; flex-direction: column !important;
      padding-bottom: 86px !important;
    }

    /* スリムヘッダー（モックv5準拠：ロゴ＋アカウントのみ、他はボトムタブへ集約） */
    header {
      order: 1 !important;
      flex-direction: row !important; align-items: center !important; justify-content: space-between !important;
      padding: 8px 12px !important; gap: 8px !important;
      position: sticky; top: 0; z-index: 40;
      background: rgba(7, 11, 20, 0.94) !important; backdrop-filter: blur(12px);
    }
    .brand { width: auto !important; flex-wrap: nowrap !important; }
    .brand .sub, .top-info-links { display: none !important; }
    .header-controls { width: auto !important; justify-content: flex-end !important; gap: 6px !important; }
    .header-controls .pill,
    #deployTodayBtn, #myDecksBtn, #shareBtn, #helpBtn, #fxToggle, #soundToggle, .hdr-sep, #clearBtn {
      display: none !important;
    }
    #authBtn { padding: 6px 11px !important; font-size: 11.5px !important; min-height: 32px !important; }

    /* スマホで不要な重複UIを隠す */
    .onboarding-strip, .mobile-mini-bar, .col-role-tag, #fieldStage, .bet-preset-block,
    .zone-header.zone-roi, .zone-sub, .hand-zone-hint, .density-controls, .tcg-info-btn {
      display: none !important;
    }

    /* コンテナを平坦化して正確な順番に並べる */
    #mainArena, #leftCol, #centerCol {
      display: contents !important;
    }

    /* ① プリセット */
    .presets-bar {
      order: 2 !important;
      margin: 8px 10px 0 !important; padding: 4px 2px !important;
      background: transparent !important; border: none !important;
    }

    /* ② ROI */
    #heroBox {
      order: 3 !important;
      margin: 8px 10px 0 !important; padding: 12px 14px !important;
      border-radius: 15px !important;
    }
    #heroBox .kpi-strip { grid-template-columns: repeat(2, 1fr) !important; gap: 6px !important; }
    #heroBox .risk-strip { font-size: 10.5px !important; flex-wrap: wrap !important; gap: 6px !important; }

    /* ③ 参謀クロ（吹き出しあり） */
    #kuroNavStage {
      order: 4 !important;
      margin: 10px 10px 0 !important;
      display: flex !important; align-items: center !important; gap: 10px !important;
    }
    #kuroNavStage .cat-avatar { width: 58px !important; height: 58px !important; }
    #kuroNavStage .speech-bubble { min-height: 60px !important; padding: 9px 11px !important; }
    #kuroNavStage .nav-msg { font-size: 12px !important; line-height: 1.45 !important; }

    /* ④ 次の1枚（クロのおすすめ3択 — 3列横並びコンパクトカード） */
    #nextThreeWrap {
      order: 5 !important;
      margin: 10px 10px 0 !important;
      display: flex !important; flex-direction: column !important; gap: 6px !important;
    }
    #rewardList {
      display: grid !important; grid-template-columns: repeat(3, 1fr) !important; gap: 7px !important;
    }
    #rewardList .reward-card {
      display: flex !important; flex-direction: column !important; padding: 0 !important; overflow: hidden !important;
      border-radius: 11px !important; gap: 0 !important;
    }
    #rewardList .reward-mini-tcg {
      width: 100% !important; min-width: 0 !important; border: none !important; border-radius: 0 !important;
    }
    #rewardList .reward-mini-art-wrap { height: 58px !important; }
    #rewardList .reward-info { padding: 6px 6px 7px !important; gap: 3px !important; }
    #rewardList .reward-top, #rewardList .reward-chips, #rewardList .reward-tag, #rewardList .reward-badges, #rewardList .reward-roi-sub { display: none !important; }
    #rewardList .reward-roi-row { font-size: 11px !important; justify-content: center !important; }
    #rewardList .reward-roi-row .r-from, #rewardList .reward-roi-row .r-arrow { display: none !important; }

    /* ⑤ デッキ（BATTLE FIELD） */
    #deckZone {
      order: 6 !important;
      margin: 10px 10px 0 !important;
      min-height: 175px !important; border-radius: 15px !important;
      position: relative; z-index: 2;
    }
    #deckZone .board-card { width: 88px !important; min-width: 88px !important; height: 122px !important; }

    /* ⑥ 手札（横並びTCGカード — アート＋名前だけでスッキリ） */
    #handDock {
      order: 7 !important;
      margin: 10px 10px 0 !important; border-radius: 15px !important;
      padding: 10px 10px 10px !important;
      position: relative; z-index: 2;
    }
    #handDock .hand-toolbar { flex-direction: column !important; align-items: stretch !important; gap: 6px !important; margin-bottom: 8px !important; }
    #handDock .hand-tray {
      display: flex !important; flex-wrap: nowrap !important; overflow-x: auto !important;
      gap: 8px !important; padding: 2px 0 4px !important;
    }
    #handDock .tcg-card {
      flex: 0 0 94px !important; width: 94px !important; min-width: 94px !important; height: 134px !important;
    }
    #handDock .tcg-art-wrap { height: 100% !important; }
    #handDock .tcg-body {
      position: absolute !important; left: 0; right: 0; bottom: 0; z-index: 4;
      background: linear-gradient(180deg, transparent 0%, rgba(6,10,20,0.92) 40%, rgba(6,10,20,0.98) 100%) !important;
      padding: 12px 6px 6px !important;
    }
    #handDock .tcg-desc { display: none !important; }
    #handDock .tcg-name { font-size: 10.5px !important; color: #fff !important; text-shadow: 0 1px 4px rgba(0,0,0,0.95); }

    .disclaimer-strip {
      order: 9 !important;
      margin: 12px 10px 4px !important; border-radius: 9px;
      background: rgba(10, 15, 30, 0.72); border: 1px solid rgba(96, 138, 224, 0.2);
      padding: 6px 10px !important;
    }

    /* スマホ タブ切替制御（デフォルトは 'deck' タブ：収支明細とメニューは隠す） */
    #rightCol, #synergyBox, #topHitsBar, #mobileMenuPane { display: none !important; }

    /* '収支・明細' タブ選択時 */
    body.mob-tab-evidence .presets-bar,
    body.mob-tab-evidence #heroBox,
    body.mob-tab-evidence #kuroNavStage,
    body.mob-tab-evidence #nextThreeWrap,
    body.mob-tab-evidence #deckZone,
    body.mob-tab-evidence #handDock { display: none !important; }
    body.mob-tab-evidence #rightCol {
      display: flex !important; order: 2 !important; margin: 10px 10px 0 !important;
    }
    body.mob-tab-evidence #synergyBox {
      display: block !important; order: 3 !important; margin: 10px 10px 0 !important;
    }
    body.mob-tab-evidence #topHitsBar {
      display: flex !important; order: 4 !important; margin: 10px 10px 0 !important;
    }

    /* 'ガイド・Pro' タブ選択時 */
    body.mob-tab-menu .presets-bar,
    body.mob-tab-menu #heroBox,
    body.mob-tab-menu #kuroNavStage,
    body.mob-tab-menu #nextThreeWrap,
    body.mob-tab-menu #deckZone,
    body.mob-tab-menu #handDock,
    body.mob-tab-menu #rightCol,
    body.mob-tab-menu #synergyBox,
    body.mob-tab-menu #topHitsBar { display: none !important; }
    body.mob-tab-menu #mobileMenuPane {
      display: flex !important; flex-direction: column; gap: 12px;
      order: 2 !important; margin: 12px 12px 0; position: relative; z-index: 2;
    }

    /* スマホ メニューパネルスタイル */
    .mob-menu-card {
      background: linear-gradient(155deg, rgba(251, 191, 36, 0.12), rgba(14, 21, 38, 0.96) 45%);
      border: 1.5px solid rgba(251, 191, 36, 0.52); border-radius: 15px; padding: 14px;
    }
    .mob-menu-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .mob-menu-btn {
      background: rgba(14, 21, 38, 0.94); border: 1px solid var(--border);
      border-radius: 12px; padding: 11px 12px; color: var(--text); text-align: left;
      display: flex; flex-direction: column; gap: 3px; cursor: pointer;
    }
    .mob-menu-btn strong { font-size: 13px; color: #fff; }
    .mob-menu-btn span { font-size: 10.5px; color: var(--muted); }
    .mob-menu-links {
      background: rgba(14, 21, 38, 0.94); border: 1px solid var(--border);
      border-radius: 13px; overflow: hidden; display: flex; flex-direction: column;
    }
    .mob-menu-link {
      display: flex; justify-content: space-between; align-items: center;
      padding: 12px 14px; color: #e2e8f0; text-decoration: none;
      font-size: 13px; font-weight: 700; border-bottom: 1px solid rgba(96, 138, 224, 0.18);
    }
    .mob-menu-link:last-child { border-bottom: none; }

    /* ゲームイラスト付きボトムタブナビ（下部固定） */
    .mobile-bottom-nav {
      display: grid !important; grid-template-columns: repeat(4, 1fr);
      position: fixed; bottom: 0; left: 0; right: 0; height: 74px;
      background: linear-gradient(180deg, rgba(13, 18, 32, 0.97), rgba(7, 10, 18, 0.99));
      backdrop-filter: blur(16px);
      border-top: 1px solid rgba(251, 191, 36, 0.32);
      padding: 6px 6px 8px; z-index: 600;
    }
    .mob-nav-item {
      background: none; border: none; color: #64748b;
      display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
      font-size: 10.5px; font-weight: 800; cursor: pointer; padding: 0;
    }
    .mob-nav-art {
      width: 38px; height: 38px; border-radius: 11px; overflow: hidden;
      border: 1.5px solid rgba(255, 255, 255, 0.14); background: #0b0f19;
      transition: all 0.18s ease; filter: brightness(0.76) saturate(0.82);
    }
    .mob-nav-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
    .mob-nav-item.active { color: #fde68a; }
    .mob-nav-item.active .mob-nav-art {
      transform: translateY(-4px) scale(1.08);
      border-color: #fbbf24;
      box-shadow: 0 4px 16px rgba(251, 191, 36, 0.48);
      filter: brightness(1.08) saturate(1.18);
    }
  }

  /* PCではスマホ専用1行サマリーを隠す */
  .mob-roi-sub { display: none; }

  /* ===== MOBILE MOCK-EXACT SLIM OVERRIDES (<=1024px) ===== */
  @media (max-width: 1024px) {
    /* ② ROI: モック通り「ROI数字＋ランク盾＋1行サマリー＋細バー」だけにする */
    #heroBox { padding: 11px 13px !important; }
    #heroBox .roi-label,
    #heroBox .status-ribbon,
    #heroBox .roi-wrap > div:last-child,
    #heroBox .kpi-strip,
    #heroBox .risk-strip,
    #heroBox .solidity-row > span,
    #heroBox .solidity-row > strong,
    #heroBox .solidity-goal {
      display: none !important;
    }
    #heroBox .roi-value { font-size: 36px !important; line-height: 1 !important; }
    #heroBox .rank-badge { width: 38px !important; height: 38px !important; font-size: 19px !important; border-radius: 10px !important; }
    #heroBox .mob-roi-sub {
      display: flex !important; justify-content: space-between; align-items: center;
      margin-top: 8px; padding-top: 7px; border-top: 1px solid rgba(255,255,255,0.09);
      font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums;
    }
    #heroBox .mob-roi-sub strong { color: #f8fafc; font-weight: 800; }
    #heroBox .solidity-row {
      margin-top: 7px !important; padding: 0 !important;
      background: transparent !important; border: none !important;
    }
    #heroBox .solidity-track { height: 4px !important; flex: 1 !important; }

    /* ④ 次の1枚（3択）: アート＋カード名＋上昇幅(+XX.Xpt)だけに極限スリム化 */
    #rewardList .reward-top-row,
    #rewardList .reward-tag-row,
    #rewardList .reward-pill-row,
    #rewardList .reward-sub-chips,
    #rewardList .reward-meta-row,
    #rewardList .reward-sample-warn,
    #rewardList .reward-cat-badge,
    #rewardList .reward-stat-line {
      display: none !important;
    }
    #rewardList .reward-info > *:not(.reward-roi-row) {
      display: none !important;
    }
    #rewardList .reward-roi-row {
      display: flex !important; justify-content: center !important; align-items: center !important;
      padding: 2px 0 0 !important; font-size: 11.5px !important; font-weight: 900 !important;
    }
    #rewardList .reward-roi-row > span:not(:last-child) { display: none !important; }

    /* ⑤ デッキヘッダー: タイトルと枚数だけ（カスタム錬成はメニュータブへ） */
    #deckZone #openCraftBtn { display: none !important; }
  }

  /* ===== v6 PRODUCTION: MOCK v5 PIXEL PARITY & DE-EMOJI REFINEMENT ===== */
  .brand-logo {
    background: transparent !important;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.35) !important;
  }
  .presets-label {
    font-size: 10px !important; font-weight: 900 !important; color: var(--gold) !important;
    letter-spacing: 0.06em; padding: 3px 7px; border-radius: 6px;
    background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.35);
  }
  .preset-chip.active {
    border-color: var(--gold) !important;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.24), rgba(217, 119, 6, 0.18)) !important;
    color: #fef3c7 !important; box-shadow: 0 0 10px rgba(251, 191, 36, 0.24) !important;
  }
  .mob-roi-tag, .mob-next-delta, .mob-next-sub, .mob-empty-txt { display: none; }

  /* 参謀クロはPC/スマホ共通で正円＋3色グラデ発光リングに統一 */
  .cat-avatar {
    border-radius: 50% !important; padding: 2.5px !important; border: none !important;
    background: linear-gradient(135deg, #fde047, #c084fc, #22d3ee) !important;
    box-shadow: 0 0 16px rgba(192, 132, 252, 0.48) !important;
  }
  .cat-avatar img {
    border-radius: 50% !important; border: 2px solid #090e1c !important;
  }
  .cat-name-tag {
    background: transparent !important; border: none !important;
    color: #e9d5ff !important; font-size: 10.5px !important; padding: 0 !important;
  }

  /* 手札の装備済スタンプをPC/スマホ共通で洗練された緑回転スタンプに */
  .tcg-card.selected::after {
    content: "場に召喚済" !important;
    top: 46% !important; left: 50% !important;
    transform: translate(-50%, -50%) rotate(-8deg) !important;
    background: rgba(16, 185, 129, 0.94) !important; color: #052e16 !important;
    border: none !important; font-size: 9px !important; font-weight: 900 !important;
    padding: 2px 7px !important; border-radius: 5px !important;
    white-space: nowrap !important; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.7) !important;
  }
  .tcg-card.selected { opacity: 0.72 !important; filter: none !important; }

  /* ===== MOBILE MOCK v5 100% PARITY (<=1024px) ===== */
  @media (max-width: 1024px) {
    .pc-only { display: none !important; }

    /* ヘッダー: 金B 22px + BOAT DECK + 28px SVG人型アイコンのみ */
    header { height: 46px !important; padding: 0 12px !important; }
    .brand-logo { width: 30px !important; height: 30px !important; border-radius: 8px !important; font-size: 11px !important; }
    .brand h1 { font-size: 14px !important; letter-spacing: 0.06em !important; color: #fef3c7 !important; }
    .brand-ver { display: none !important; }
    #authBtn {
      width: 28px !important; height: 28px !important; min-height: 28px !important; padding: 0 !important;
      border-radius: 8px !important; border: 1px solid rgba(148, 163, 184, 0.22) !important;
      background: rgba(15, 23, 42, 0.85) !important; color: #cbd5e1 !important;
      display: grid !important; place-items: center !important;
    }
    #authBtn .auth-label-txt { display: none !important; }

    /* ① プリセット: 角丸8px四角ピル＋短縮名 */
    .presets-bar { margin: 8px 12px 0 !important; gap: 6px !important; }
    .preset-chip {
      border-radius: 8px !important; padding: 5px 11px !important;
      font-size: 11.5px !important; border-color: rgba(96, 138, 224, 0.38) !important;
      background: rgba(15, 23, 42, 0.88) !important;
    }

    /* ② ROI: 均一1.5px金枠 + ROIバッジ + 白銀/金グラデ数値 + 暗背景細枠ランク盾 */
    #heroBox {
      margin: 8px 12px 0 !important; padding: 11px 14px !important;
      border: 1.5px solid rgba(251, 191, 36, 0.45) !important;
      border-left: 1.5px solid rgba(251, 191, 36, 0.45) !important;
      background: linear-gradient(145deg, rgba(18, 26, 48, 0.94), rgba(10, 15, 30, 0.96)) !important;
      box-shadow: 0 8px 22px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255,255,255,0.08) !important;
    }
    #heroBox .roi-wrap { display: flex !important; align-items: baseline !important; gap: 7px !important; }
    .mob-roi-tag {
      display: inline-block !important;
      font-size: 10px; font-weight: 900; color: #fde68a; letter-spacing: 0.08em;
      background: rgba(251, 191, 36, 0.15); border: 1px solid rgba(251, 191, 36, 0.38);
      padding: 2px 6px; border-radius: 5px;
    }
    #heroBox .roi-value {
      font-size: 36px !important; font-weight: 900 !important; line-height: 1 !important;
      background: linear-gradient(180deg, #ffffff 15%, #cbd5e1 100%) !important;
      -webkit-background-clip: text !important; -webkit-text-fill-color: transparent !important;
      text-shadow: none !important;
    }
    #heroBox .roi-value.over100, #heroBox .roi-value.god {
      background: linear-gradient(180deg, #fef08a 10%, #f59e0b 100%) !important;
      -webkit-background-clip: text !important; -webkit-text-fill-color: transparent !important;
      filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.45)) !important;
    }
    #heroBox .rank-badge {
      width: 36px !important; height: 36px !important; font-size: 18px !important;
      border-radius: 10px !important;
      background: linear-gradient(145deg, #1e293b, #0f172a) !important;
      border: 1.5px solid #38bdf8 !important; color: #7dd3fc !important;
      box-shadow: 0 0 10px rgba(56, 189, 248, 0.28) !important;
    }
    #heroBox .rank-badge.rank-S, #heroBox .rank-badge.rank-Sp, #heroBox .rank-badge.rank-A {
      border-color: #fde047 !important; color: #fde047 !important;
      box-shadow: 0 0 14px rgba(251, 191, 36, 0.48) !important;
    }

    /* ③ 参謀クロ: 60px正円＋3色グラデリング＋中央テール吹き出し */
    #kuroNavStage { margin: 10px 12px 0 !important; gap: 11px !important; }
    #kuroNavStage .cat-avatar { width: 60px !important; height: 60px !important; }
    #kuroNavStage .speech-bubble {
      background: linear-gradient(145deg, rgba(28, 24, 58, 0.94), rgba(15, 21, 42, 0.95)) !important;
      border: 1.5px solid rgba(192, 132, 252, 0.58) !important;
      border-radius: 14px !important; padding: 9px 12px !important;
    }
    #kuroNavStage .speech-bubble::before,
    #kuroNavStage .speech-bubble::after { top: 50% !important; transform: translateY(-50%) !important; }

    /* ④ 次の1枚（3択）: 横溢れ完全防止 minmax(0,1fr) + アート右下 +XX.Xpt 緑バッジ */
    #nextThreeWrap { margin: 10px 12px 0 !important; }
    #nextThreeWrap .sec-title { font-size: 11.5px !important; color: #fde68a !important; }
    #nextThreeWrap #recMs { font-size: 10.5px !important; color: var(--muted) !important; }
    #rewardList {
      display: grid !important; grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 7px !important; width: 100% !important;
    }
    #rewardList .reward-card {
      min-width: 0 !important; width: 100% !important;
      display: flex !important; flex-direction: column !important; padding: 0 !important;
      border: 1.5px solid rgba(251, 191, 36, 0.45) !important;
      border-radius: 11px !important; background: rgba(13, 19, 36, 0.94) !important;
      overflow: hidden !important;
    }
    #rewardList .reward-mini-tcg { width: 100% !important; background: transparent !important; }
    #rewardList .reward-mini-art-wrap { height: 56px !important; position: relative !important; }
    #rewardList .reward-mini-art-wrap .boat-orb,
    #rewardList .reward-mini-art-wrap .rarity-gem,
    #rewardList .reward-mini-name { display: none !important; }
    #rewardList .mob-next-delta {
      display: inline-block !important;
      position: absolute; bottom: 4px; right: 4px; z-index: 4;
      background: rgba(6, 78, 59, 0.94); color: #6ee7b7;
      border: 1px solid rgba(52, 211, 153, 0.55);
      font-size: 10px; font-weight: 900; padding: 1px 5px; border-radius: 5px;
      font-variant-numeric: tabular-nums;
    }
    #rewardList .reward-info {
      padding: 6px 7px 7px !important; gap: 2px !important; min-width: 0 !important;
    }
    #rewardList .reward-info > * { display: none !important; }
    #rewardList .reward-info > .mob-next-title {
      display: block !important; font-size: 10.5px; font-weight: 800; color: #fff;
      line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }
    #rewardList .reward-info > .mob-next-sub {
      display: block !important; font-size: 9.5px; color: var(--muted);
      overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    }

    /* ⑤ デッキ（BATTLE FIELD）: 均一1.5pxシアン枠 + 3D魔法陣 + 素のタイポヘッダー + 86x120全面アート */
    #deckZone {
      margin: 10px 12px 0 !important; padding: 9px 10px 11px !important;
      min-height: 162px !important;
      border: 1.5px solid rgba(34, 211, 238, 0.5) !important;
      border-left: 1.5px solid rgba(34, 211, 238, 0.5) !important;
      background:
        radial-gradient(circle at 50% 55%, rgba(34, 211, 238, 0.15) 0%, rgba(8, 15, 32, 0.9) 68%),
        linear-gradient(180deg, rgba(12, 22, 46, 0.92), rgba(7, 12, 24, 0.96)) !important;
      box-shadow: inset 0 0 28px rgba(34, 211, 238, 0.12), 0 8px 20px rgba(0, 0, 0, 0.45) !important;
    }
    #deckZone::before {
      content: ""; position: absolute; top: 54%; left: 50%;
      width: 220px; height: 220px;
      transform: translate(-50%, -50%) perspective(240px) rotateX(62deg);
      border-radius: 50%; border: 1.5px dashed rgba(56, 189, 248, 0.3);
      pointer-events: none; z-index: 1;
    }
    #deckZone .deck-board-head.zone-deck {
      background: transparent !important; border: none !important;
      padding: 0 0 7px 0 !important; margin: 0 !important;
    }
    #deckZone .zone-badge-deck {
      background: transparent !important; color: #67e8f9 !important;
      padding: 0 !important; font-size: 11px !important; letter-spacing: 0.05em !important;
      border-radius: 0 !important;
    }
    #deckZone .deck-count-pill {
      background: transparent !important; border: none !important; padding: 0 !important;
      color: #cbd5e1 !important; font-size: 10.5px !important; font-weight: 700 !important;
    }
    #deckZone .board-card {
      width: 86px !important; min-width: 86px !important; height: 120px !important;
      border-radius: 11px !important; position: relative !important; overflow: hidden !important;
    }
    #deckZone .board-card.attack-card { border-color: #fbbf24 !important; box-shadow: 0 0 14px rgba(251,191,36,0.45) !important; }
    #deckZone .board-card.attack-card .board-tag { background: linear-gradient(135deg, #fbbf24, #d97706) !important; color: #070b14 !important; border-color: #fef08a !important; }
    #deckZone .board-art-wrap { height: 100% !important; }
    #deckZone .board-body {
      position: absolute !important; left: 0; right: 0; bottom: 0; z-index: 4;
      background: linear-gradient(180deg, transparent 0%, rgba(6,10,20,0.92) 40%, rgba(6,10,20,0.98) 100%) !important;
      padding: 12px 6px 5px !important;
    }
    #deckZone .board-name { font-size: 10.5px !important; color: #fff !important; line-height: 1.24 !important; white-space: normal !important; }
    #deckZone .board-rm { display: none !important; }
    #deckZone .empty-slot {
      width: 86px !important; min-width: 86px !important; height: 120px !important;
      border-radius: 11px !important; padding: 6px !important;
    }
    #deckZone .empty-slot .magic-ring { width: 26px !important; height: 26px !important; font-size: 13px !important; }
    #deckZone .empty-slot .pc-empty-txt { display: none !important; }
    #deckZone .empty-slot .mob-empty-txt { display: inline !important; font-size: 10px !important; color: rgba(125,211,252,0.8); }

    /* ⑥ 手札: 均一1.5px紫枠 + 素の薄紫見出し + 枠なし丸ピルタブ + 2行カード名 */
    #handDock {
      margin: 10px 12px 0 !important; padding: 9px 10px 8px !important;
      border: 1.5px solid rgba(192, 132, 252, 0.36) !important;
      border-top: 1.5px solid rgba(192, 132, 252, 0.36) !important;
      background: linear-gradient(180deg, rgba(18, 15, 36, 0.92), rgba(9, 13, 25, 0.96)) !important;
      box-shadow: none !important;
    }
    #handDock .zone-badge-hand {
      background: transparent !important; color: #e9d5ff !important;
      padding: 0 !important; font-size: 11.5px !important; border-radius: 0 !important;
    }
    #handDock .tabs {
      background: transparent !important; border: none !important; padding: 0 !important; gap: 5px !important;
    }
    #handDock .tab {
      border-radius: 999px !important; padding: 4px 10px !important; min-height: 28px !important;
      font-size: 11px !important; border: 1px solid rgba(148, 163, 184, 0.25) !important;
      background: rgba(15, 23, 42, 0.85) !important; color: var(--muted) !important;
    }
    #handDock .tab.active {
      background: linear-gradient(135deg, #c084fc, #7c3aed) !important;
      color: #fff !important; border-color: #e9d5ff !important;
    }
    #handDock .tcg-card {
      flex: 0 0 92px !important; width: 92px !important; min-width: 92px !important; height: 130px !important;
    }
    #handDock .tcg-name {
      white-space: normal !important; display: -webkit-box !important;
      -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
      line-height: 1.24 !important;
    }
    #handDock .tcg-card.active-attack::after {
      content: "場に召喚済" !important;
      top: 46% !important; left: 50% !important; right: auto !important; bottom: auto !important;
      transform: translate(-50%, -50%) rotate(-8deg) !important;
      background: rgba(16, 185, 129, 0.94) !important; color: #052e16 !important;
      border-radius: 5px !important; padding: 2px 7px !important; font-size: 9px !important;
    }
  }

  /* スマホ幅 100vw 厳格ロック（右端見切れを物理的にゼロ化） */
  @media (max-width: 1024px) {
    html, body { width: 100% !important; max-width: 100vw !important; overflow-x: hidden !important; }
    header { width: 100% !important; max-width: 100vw !important; }
    .presets-bar, #heroBox, #kuroNavStage, #nextThreeWrap, #deckZone, #handDock, .disclaimer-strip, #rightCol, #mobileMenuPane {
      width: auto !important;
      max-width: calc(100vw - 24px) !important;
      min-width: 0 !important;
    }
    #heroBox .hero-top { width: 100%; min-width: 0; }
    #kuroNavStage .speech-bubble { min-width: 0 !important; overflow: hidden; }
    .mob-next-title, .mob-next-sub { max-width: 100%; }
  }

  /* ===== v8 MOBILE POLISH: Flashy ROI + Tap Detail, Full-Bleed Next-3, Static Kuro, Disclaimer in Guide Only ===== */
  @media (max-width: 1024px) {
    /* 1. 参謀クロ: 上下浮遊アニメーション停止 & 「タップで次のセリフ」行を非表示 */
    #kuroNavStage .cat-avatar { animation: none !important; }
    #kuroNavStage .kuro-tap-meta { display: none !important; }
    #kuroNavStage .speech-bubble { min-height: 48px !important; display: flex !important; align-items: center !important; }

    /* 2. 免責帯(/html/body/div[22]): メイン画面では隠し「ガイド・Pro」タブでのみ表示 */
    .disclaimer-strip { display: none !important; }
    body.mob-tab-menu .disclaimer-strip {
      display: flex !important; order: 3 !important;
      margin: 12px 12px 4px !important;
    }

    /* 3. 次の1枚（3択）: 下段の真っ黒を廃止し、カード全面アート＋下部グラデ直載せ */
    #rewardList .reward-card {
      position: relative !important;
      height: 112px !important;
      display: block !important;
      overflow: hidden !important;
      border: 1.5px solid rgba(251, 191, 36, 0.55) !important;
      box-shadow: 0 6px 16px rgba(0, 0, 0, 0.55) !important;
    }
    #rewardList .reward-mini-tcg {
      position: absolute !important; inset: 0 !important;
      width: 100% !important; height: 100% !important;
    }
    #rewardList .reward-mini-art-wrap {
      position: absolute !important; inset: 0 !important;
      width: 100% !important; height: 100% !important;
    }
    #rewardList .reward-art {
      width: 100% !important; height: 100% !important; object-fit: cover !important;
    }
    #rewardList .reward-mini-art-wrap .tcg-art-fade {
      background: linear-gradient(180deg, rgba(6,10,20,0.22) 0%, rgba(6,10,20,0.12) 38%, rgba(6,10,20,0.92) 82%, rgba(6,10,20,0.98) 100%) !important;
    }
    #rewardList .reward-mini-body { display: none !important; }
    #rewardList .mob-next-delta {
      top: 5px !important; right: 5px !important; bottom: auto !important;
      background: rgba(6, 78, 59, 0.94) !important;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
    }
    #rewardList .reward-info {
      position: absolute !important; left: 0; right: 0; bottom: 0; z-index: 5;
      padding: 6px 7px 6px !important;
      background: transparent !important;
    }
    #rewardList .reward-info > .mob-next-title {
      font-size: 10.5px !important; text-shadow: 0 1px 4px rgba(0,0,0,0.95);
    }
    #rewardList .reward-info > .mob-next-sub {
      font-size: 9.5px !important; color: #fde68a !important; text-shadow: 0 1px 3px rgba(0,0,0,0.95);
    }

    /* 4. ROIエリア: もっと派手に＋タップで詳細アコーディオン展開 */
    #heroBox {
      position: relative !important; overflow: hidden !important; cursor: pointer !important;
      border: 1.5px solid rgba(251, 191, 36, 0.72) !important;
      background:
        radial-gradient(ellipse at 18% 0%, rgba(251, 191, 36, 0.24) 0%, transparent 56%),
        radial-gradient(ellipse at 92% 100%, rgba(56, 189, 248, 0.22) 0%, transparent 54%),
        linear-gradient(145deg, rgba(24, 30, 58, 0.96), rgba(10, 15, 32, 0.98)) !important;
      box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55), 0 0 22px rgba(251, 191, 36, 0.22), inset 0 1px 0 rgba(254, 240, 138, 0.25) !important;
    }
    #heroBox::after {
      content: ""; position: absolute; inset: 0; pointer-events: none;
      background: linear-gradient(115deg, transparent 22%, rgba(254, 240, 138, 0.12) 45%, rgba(56, 189, 248, 0.1) 52%, transparent 74%);
      background-size: 240% 240%;
      animation: bdFoilSweep 4.8s ease-in-out infinite;
    }
    #heroBox .roi-value {
      font-size: 40px !important;
      background: linear-gradient(180deg, #ffffff 8%, #fef08a 52%, #f59e0b 100%) !important;
      -webkit-background-clip: text !important; -webkit-text-fill-color: transparent !important;
      filter: drop-shadow(0 0 14px rgba(251, 191, 36, 0.45)) !important;
    }
    #heroBox .rank-badge {
      width: 42px !important; height: 42px !important; font-size: 21px !important;
      border: 2px solid #38bdf8 !important;
      background: linear-gradient(145deg, rgba(30, 58, 138, 0.85), rgba(15, 23, 42, 0.96)) !important;
      color: #e0f2fe !important;
      box-shadow: 0 0 16px rgba(56, 189, 248, 0.5), inset 0 1px 0 rgba(255,255,255,0.25) !important;
    }
    #heroBox .rank-badge.rank-S, #heroBox .rank-badge.rank-Sp, #heroBox .rank-badge.rank-A {
      border-color: #fde047 !important;
      background: linear-gradient(145deg, rgba(180, 83, 9, 0.9), rgba(24, 18, 8, 0.96)) !important;
      color: #fef08a !important;
      box-shadow: 0 0 20px rgba(251, 191, 36, 0.65) !important;
    }
    #heroBox .hp-bar, #heroBox .solidity-track { height: 5px !important; }
    .mob-roi-expand-hint {
      font-size: 10.5px; font-weight: 800; color: #fde68a;
      background: rgba(251, 191, 36, 0.14); border: 1px solid rgba(251, 191, 36, 0.35);
      padding: 1px 7px; border-radius: 999px; white-space: nowrap;
    }

    /* ROIタップ展開時（.mob-expanded）に4KPI・連敗リスク・堅さ目標を表示 */
    #heroBox.mob-expanded .kpi-strip {
      display: grid !important; grid-template-columns: repeat(2, 1fr) !important;
      gap: 6px !important; margin-top: 10px !important;
    }
    #heroBox.mob-expanded .risk-strip {
      display: flex !important; flex-wrap: wrap !important; gap: 6px 10px !important;
      margin-top: 8px !important;
    }
    #heroBox.mob-expanded .solidity-goal {
      display: block !important; margin-top: 4px !important; font-size: 10.5px !important;
    }
  }

  /* ===== v9: PC-IDENTICAL ROI ON MOBILE, COMBO BAR UNDER DECK, AI NOTE ===== */
  .arc-ai-note {
    font-size: 10.5px; color: #bae6fd; line-height: 1.45;
    background: rgba(56, 189, 248, 0.1); border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 8px; padding: 6px 8px; margin-bottom: 8px;
  }

  @media (max-width: 1024px) {
    /* 1. スマホ版ROIをPCサイズと完全同一デザインに復元 */
    #heroBox {
      cursor: default !important;
      padding: 12px 13px !important;
      border: 1.5px solid rgba(251, 191, 36, 0.52) !important;
      border-left: 4px solid #fbbf24 !important;
      background: linear-gradient(160deg, rgba(28, 24, 14, 0.92) 0%, rgba(12, 19, 36, 0.96) 38%) !important;
      box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35) !important;
    }
    #heroBox::after { display: none !important; }
    #heroBox .mob-roi-tag, #heroBox .mob-roi-sub { display: none !important; }
    #heroBox .roi-label { display: inline !important; }
    #heroBox .roi-wrap { display: flex !important; align-items: baseline !important; gap: 10px !important; flex-wrap: wrap !important; }
    #heroBox .roi-wrap > div:last-child { display: block !important; }
    #heroBox .roi-value {
      font-size: 38px !important;
      background: none !important; -webkit-background-clip: border-box !important; -webkit-text-fill-color: currentColor !important;
      filter: none !important;
    }
    #heroBox .rank-badge {
      width: 46px !important; height: 46px !important; font-size: 23px !important;
      border: none !important; box-shadow: 0 6px 16px rgba(0,0,0,0.45) !important;
    }
    #heroBox .kpi-strip {
      display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 6px !important; margin-top: 8px !important;
    }
    #heroBox .risk-strip {
      display: flex !important; flex-wrap: wrap !important; gap: 6px 10px !important;
      margin-top: 7px !important;
    }
    #heroBox .solidity-row {
      display: flex !important; flex-wrap: wrap !important; align-items: center !important; gap: 6px !important;
      margin-top: 7px !important; padding: 6px 8px !important;
      background: rgba(5, 9, 18, 0.55) !important; border: 1px solid rgba(56, 82, 138, 0.35) !important;
    }
    #heroBox .solidity-row > span, #heroBox .solidity-row > strong { display: inline !important; }
    #heroBox .solidity-goal { display: block !important; width: 100%; font-size: 10.5px !important; }
    #heroBox .solidity-track { height: 7px !important; min-width: 80px; }

    /* 2. コンボ名・因果分析(#synergyBox)をメイン画面のデッキ(#deckZone)直下へ配置 */
    #synergyBox {
      display: block !important;
      order: 7 !important;
      margin: 8px 12px 0 !important;
      max-width: calc(100vw - 24px) !important;
      position: relative; z-index: 2;
    }
    #handDock { order: 8 !important; }
    body.mob-tab-evidence #synergyBox { display: none !important; }
    body.mob-tab-menu #synergyBox { display: none !important; }
  }

  /* ===== v10: KURO NO-DARKEN, MONTH MODAL MOBILE FIT, CHART TOOLTIP ===== */
  .nav-stage, #kuroNavStage { -webkit-tap-highlight-color: transparent; }
  .cat-avatar, .cat-avatar.talking { filter: none !important; opacity: 1 !important; }
  .cat-avatar img { filter: brightness(1.1) contrast(1.04) !important; opacity: 1 !important; }
  @media (max-width: 1024px) {
    #kuroNavStage .cat-avatar.talking { animation: none !important; box-shadow: 0 0 16px rgba(192, 132, 252, 0.48) !important; }
    #kuroNavStage .cat-avatar.talking img { transform: none !important; }
  }

  /* 収支グラフのタップ／ホバー小窓ツールチップ（PC・スマホ全画面共通） */
  .chart-wrap { position: relative !important; }
  #equityChart { cursor: crosshair; touch-action: none; }
  .chart-tooltip {
    position: absolute; top: 6px; left: 56px; z-index: 12;
    pointer-events: none; opacity: 0; transition: opacity 0.12s ease;
    background: rgba(9, 14, 28, 0.95);
    border: 1px solid rgba(251, 191, 36, 0.55);
    border-radius: 8px; padding: 5px 9px;
    font-size: 11px; line-height: 1.4; color: #f8fafc;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.65);
    white-space: nowrap; font-variant-numeric: tabular-nums;
  }
  .chart-tooltip.visible { opacity: 1; }
  .chart-tooltip .ct-date { font-size: 10px; color: #94a3b8; font-weight: 700; }
  .chart-tooltip .ct-val { font-size: 13px; font-weight: 900; }
  .chart-tooltip .ct-val.pos { color: #34d399; }
  .chart-tooltip .ct-val.neg { color: #fb7185; }

  /* 月次収支詳細モーダル（スマホで見切れない完全フィット） */
  @media (max-width: 1024px) {
    #monthModal.modal-backdrop { padding: 8px !important; align-items: center !important; }
    #monthModal .month-modal {
      width: calc(100vw - 16px) !important; max-width: 100% !important;
      max-height: 88dvh !important; padding: 12px 10px !important;
      overflow: hidden !important; box-sizing: border-box !important;
    }
    #monthModal .month-table-scroll {
      width: 100% !important; max-width: 100% !important;
      overflow-x: auto !important; overflow-y: auto !important;
      -webkit-overflow-scrolling: touch;
      max-height: 62dvh !important;
    }
    #monthModal .month-table-scroll table {
      width: 100% !important; min-width: 440px; font-size: 11px !important;
    }
    #monthModal .month-table-scroll th,
    #monthModal .month-table-scroll td {
      padding: 5px 6px !important; white-space: nowrap !important;
    }
  }

  /* ===== v11: MOBILE INLINE DEPLOY PAGE (Same page feel as Evidence tab) ===== */
  @media (max-width: 1024px) {
    body.mob-tab-deploy .presets-bar,
    body.mob-tab-deploy #heroBox,
    body.mob-tab-deploy #kuroNavStage,
    body.mob-tab-deploy #nextThreeWrap,
    body.mob-tab-deploy #deckZone,
    body.mob-tab-deploy #synergyBox,
    body.mob-tab-deploy #handDock,
    body.mob-tab-deploy #rightCol,
    body.mob-tab-deploy #mobileMenuPane,
    body.mob-tab-deploy .disclaimer-strip {
      display: none !important;
    }

    body.mob-tab-deploy #deployModal {
      display: block !important;
      position: static !important;
      inset: auto !important;
      background: transparent !important;
      backdrop-filter: none !important;
      padding: 0 !important;
      z-index: 2 !important;
      order: 2 !important;
      width: 100% !important;
      max-width: 100vw !important;
    }
    body.mob-tab-deploy #deployModal .deploy-modal {
      width: auto !important;
      max-width: calc(100vw - 24px) !important;
      max-height: none !important;
      margin: 10px 12px 16px !important;
      padding: 14px 12px !important;
      border-radius: 15px !important;
      border: 1.5px solid rgba(56, 189, 248, 0.45) !important;
      background: rgba(12, 19, 36, 0.94) !important;
      box-shadow: none !important;
    }
    body.mob-tab-deploy #deployModal .deploy-list {
      max-height: none !important;
      overflow: visible !important;
    }
    body.mob-tab-deploy #closeDeployBtn {
      display: none !important;
    }
  }

  /* === Tap-to-Explain Term Underline & Kuro Inline Glossary Popover === */
  .term-tip {
    display: inline-block;
    cursor: pointer;
    border-bottom: 1px dashed rgba(147, 197, 253, 0.65);
    padding-bottom: 1px;
    transition: color 0.15s, border-color 0.15s;
  }
  .term-tip:hover, .term-tip:focus-visible {
    color: #fde68a !important;
    border-bottom-color: #fde68a;
  }
  .kuro-glossary-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 980;
    background: rgba(5, 9, 18, 0.34);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
  }
  .kuro-glossary-backdrop.open { display: block; }
  .kuro-glossary-pop {
    display: none;
    position: fixed;
    left: 50%;
    bottom: 84px;
    transform: translateX(-50%);
    z-index: 990;
    width: min(420px, calc(100vw - 24px));
    background: linear-gradient(155deg, rgba(16, 24, 48, 0.98), rgba(9, 14, 28, 0.98));
    border: 1.5px solid rgba(251, 191, 36, 0.65);
    border-radius: 16px;
    padding: 14px 16px;
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.65), 0 0 24px rgba(251, 191, 36, 0.16);
    color: #e2e8f0;
  }
  .kuro-glossary-pop.open {
    display: block;
    animation: kgPopIn 0.18s ease-out;
  }
  @keyframes kgPopIn {
    from { opacity: 0; transform: translate(-50%, 10px) scale(0.97); }
    to { opacity: 1; transform: translate(-50%, 0) scale(1); }
  }
  .kg-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }
  .kg-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(251, 191, 36, 0.78);
    flex-shrink: 0;
  }
  .kg-kicker {
    font-size: 10.5px;
    font-weight: 800;
    color: #93c5fd;
    letter-spacing: 0.04em;
  }
  .kg-title {
    font-size: 15px;
    font-weight: 900;
    color: #fde68a;
    line-height: 1.3;
  }
  .kg-close {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.85);
    color: #cbd5e1;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
  }
  .kg-close:hover { border-color: #fb7185; color: #fff; }
  .kg-summary {
    font-size: 13px;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 6px;
    line-height: 1.55;
  }
  .kg-body {
    font-size: 12.5px;
    color: #cbd5e1;
    line-height: 1.65;
    margin-bottom: 11px;
  }
  .kg-foot {
    border-top: 1px solid rgba(96, 138, 224, 0.22);
    padding-top: 9px;
    display: flex;
    justify-content: flex-end;
  }
  .kg-more-link {
    font-size: 12px;
    font-weight: 800;
    color: #7dd3fc;
    text-decoration: none;
  }
  .kg-more-link:hover { color: #fde68a; text-decoration: underline; }
  @media (min-width: 1025px) {
    .kuro-glossary-pop {
      bottom: 28px;
    }
  }

  /* === Structural Odds Distortion Analysis (Beta) === */
  .distortion-box {
    margin-top: 9px;
    padding: 9px 11px;
    border-radius: 9px;
    background: rgba(7, 12, 26, 0.78);
    border: 1px solid rgba(56, 189, 248, 0.35);
    font-size: 11.5px;
    line-height: 1.55;
    color: #cbd5e1;
  }
  .distortion-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
  }
  .distortion-title {
    font-size: 11px;
    font-weight: 800;
    color: #7dd3fc;
    letter-spacing: 0.03em;
  }
  .dist-badge {
    font-size: 10.5px;
    font-weight: 900;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(30, 41, 59, 0.9);
    color: #e2e8f0;
  }
  .dist-badge.dist-BLIND_SPOT {
    background: rgba(6, 78, 59, 0.85);
    border-color: rgba(52, 211, 153, 0.7);
    color: #6ee7b7;
  }
  .dist-badge.dist-DECOY_BIAS {
    background: rgba(120, 53, 15, 0.72);
    border-color: rgba(251, 191, 36, 0.7);
    color: #fde68a;
  }
  .dist-badge.dist-CROWDED {
    background: rgba(127, 29, 29, 0.65);
    border-color: rgba(248, 113, 113, 0.65);
    color: #fecaca;
  }
  .dist-badge.dist-MILD_EDGE {
    background: rgba(30, 58, 138, 0.72);
    border-color: rgba(96, 165, 250, 0.65);
    color: #bfdbfe;
  }
  .dist-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin: 5px 0 6px;
    padding: 5px 8px;
    border-radius: 7px;
    background: rgba(15, 23, 42, 0.85);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
  }
  .dist-metrics strong { color: #f8fafc; }
  .dist-warn {
    margin-top: 5px;
    color: #fda4af;
    font-size: 11px;
    font-weight: 700;
  }

  /* === Hero ROI Panel Share Button (Option A: beside Rank Badge) === */
  .hero-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
  }
  .hero-share-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px;
    border-radius: 9px;
    border: 1px solid rgba(251, 191, 36, 0.55);
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(15, 23, 42, 0.92));
    color: #fde68a;
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    transition: transform 0.12s, border-color 0.15s, background 0.15s;
  }
  .hero-share-btn:hover {
    border-color: #fde047;
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.28), rgba(30, 41, 59, 0.95));
    transform: translateY(-1px);
  }
  .hero-share-btn:active { transform: scale(0.96); }
  @media (max-width: 1024px) {
    .hero-top-actions { gap: 6px; }
    .hero-share-btn {
      padding: 5px 8px;
      font-size: 11px;
      border-radius: 8px;
    }
  }

  /* === PC 3-Zone Game Command Header & Dropdown Menu === */
  @media (min-width: 1025px) {
    header {
      display: grid !important;
      grid-template-columns: 1fr auto 1fr !important;
      align-items: center !important;
      gap: 12px !important;
      min-height: 52px;
      padding: 6px 18px !important;
      position: sticky;
      top: 0;
      z-index: 90;
      background: rgba(7, 11, 22, 0.94);
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
    }
    header .brand {
      justify-self: start;
      min-width: 0;
    }
    header .brand h1 {
      font-size: 16px;
      letter-spacing: 0.06em;
    }
    header .brand .sub {
      font-size: 10.5px;
      color: var(--muted);
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      max-width: 340px;
    }
    .hdr-center {
      display: flex;
      align-items: center;
      gap: 4px;
      padding: 3px;
      border-radius: 11px;
      background: rgba(15, 23, 42, 0.92);
      border: 1px solid rgba(96, 138, 224, 0.3);
      justify-self: center;
    }
    .pc-mode-tab {
      border: none;
      background: transparent;
      color: var(--muted);
      font-size: 12.5px;
      font-weight: 800;
      padding: 6px 15px;
      border-radius: 8px;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      gap: 6px;
      white-space: nowrap;
      transition: color 0.15s, background 0.15s;
    }
    .pc-mode-tab:hover { color: #fff; }
    .pc-mode-tab.active {
      background: linear-gradient(135deg, rgba(56, 189, 248, 0.28), rgba(124, 58, 237, 0.36));
      color: #fff;
      box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.55);
    }
    .pc-live-dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--green);
      box-shadow: 0 0 8px var(--green);
      display: inline-block;
    }
    header .header-controls {
      justify-self: end;
      flex-wrap: nowrap;
      gap: 8px;
    }
    .pc-menu-wrap {
      position: relative;
    }
    .pc-menu-trigger {
      border-color: rgba(96, 138, 224, 0.42);
      color: #e2e8f0;
      padding: 5px 12px;
      font-size: 12px;
    }
    .pc-menu-dropdown {
      display: none;
      position: absolute;
      top: calc(100% + 8px);
      right: 0;
      width: 248px;
      background: rgba(9, 15, 30, 0.98);
      border: 1.5px solid rgba(96, 138, 224, 0.48);
      border-radius: 13px;
      padding: 8px;
      box-shadow: 0 20px 44px rgba(0, 0, 0, 0.72);
      z-index: 260;
    }
    .pc-menu-dropdown.open { display: block; }
    .pc-menu-sec {
      font-size: 10px;
      font-weight: 800;
      color: var(--muted);
      padding: 5px 10px 3px;
      letter-spacing: 0.06em;
    }
    .pc-menu-item {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%;
      padding: 8px 10px;
      border-radius: 8px;
      border: none;
      background: transparent;
      color: #e2e8f0;
      font-size: 12.5px;
      font-weight: 700;
      text-decoration: none;
      cursor: pointer;
      text-align: left;
    }
    .pc-menu-item:hover {
      background: rgba(56, 189, 248, 0.16);
      color: #fff;
    }
    .pc-menu-item.pc-menu-danger { color: #fda4af; }
    .pc-menu-item.pc-menu-danger:hover {
      background: rgba(244, 63, 94, 0.18);
      color: #fecdd3;
    }
    .pc-menu-sep {
      height: 1px;
      background: rgba(96, 138, 224, 0.22);
      margin: 6px 4px;
    }
    .pc-menu-meta {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 4px 10px 2px;
      font-size: 11px;
      color: var(--muted);
    }
    .pc-menu-meta strong { color: var(--gold); }
  }
  @media (max-width: 1024px) {
    .hdr-center, .pc-menu-wrap { display: none !important; }
  }

  /* === Tablet Portrait Optimization (768px - 1024px, e.g. iPad Portrait) === */
  @media (min-width: 768px) and (max-width: 1024px) {
    #presetsBar,
    #heroBox,
    #kuroNavStage,
    #nextThreeWrap,
    #deckZone,
    #synergyBox,
    #handDock,
    #rightCol,
    #mobileMenuPane,
    body.mob-tab-deploy #deployModal .deploy-modal {
      width: calc(100% - 36px) !important;
      max-width: 760px !important;
      margin-left: auto !important;
      margin-right: auto !important;
    }
    header {
      padding: 0 20px !important;
      height: 52px !important;
    }
    #rewardList {
      grid-template-columns: repeat(3, minmax(0, 184px)) !important;
      justify-content: center !important;
      gap: 14px !important;
    }
    #rewardList .reward-card { height: 144px !important; }
    #rewardList .reward-mini-art-wrap { height: 100% !important; }
    #rewardList .reward-info { padding: 8px 9px 8px !important; }
    #rewardList .reward-info > .mob-next-title { font-size: 12px !important; }
    #rewardList .reward-info > .mob-next-sub { font-size: 10.5px !important; }
    #deckZone {
      padding: 12px 14px 14px !important;
      min-height: 192px !important;
    }
    #deckZone .board-card,
    #deckZone .empty-slot {
      width: 108px !important;
      min-width: 108px !important;
      height: 150px !important;
    }
    #deckZone .board-name { font-size: 11.5px !important; }
    #handDock .tcg-card {
      flex: 0 0 112px !important;
      width: 112px !important;
      min-width: 112px !important;
      height: 156px !important;
    }
    #handDock .tcg-name { font-size: 11.5px !important; }
    .mobile-bottom-nav {
      justify-content: center !important;
      gap: 28px !important;
    }
    .mob-nav-item {
      max-width: 140px !important;
    }
    #heroBox .kpi-strip {
      grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
      gap: 8px !important;
    }
    #rightCol .chart-wrap {
      height: 196px !important;
    }
    #rightCol #equityChart {
      height: 184px !important;
    }
  }

  /* === Tablet Landscape Optimization (1025px - 1240px, e.g. iPad Landscape) === */
  @media (min-width: 1025px) and (max-width: 1240px) {
    header {
      padding: 6px 12px !important;
      gap: 8px !important;
    }
    header .brand .sub { max-width: 210px !important; }
    .pc-mode-tab {
      padding: 6px 11px !important;
      font-size: 12px !important;
    }
    .arena-3col {
      grid-template-columns: 268px minmax(0, 1fr) 288px !important;
      gap: 10px !important;
      padding: 8px 10px !important;
    }
    .reward-mini-tcg { width: 64px !important; flex: 0 0 64px !important; }
    .reward-mini-art-wrap { height: 68px !important; }
    .reward-info { min-width: 0 !important; }
    .reward-roi-row { font-size: 11px !important; flex-wrap: wrap !important; }
    #heroBox .roi-value { font-size: 38px !important; }
    .kpi-strip { gap: 5px !important; }
    .kpi { padding: 6px 7px !important; }
    #handDock { padding: 8px 12px !important; }
    #handDock .tcg-card {
      flex: 0 0 106px !important;
      width: 106px !important;
      min-width: 106px !important;
      height: 148px !important;
    }
  }

  /* === Touch Device Ergonomics (iPad Landscape & Touch Tablets) === */
  @media (hover: none), (pointer: coarse) {
    .tcg-info-btn { display: none !important; }
    .pc-mode-tab, .btn, .tab, .preset-btn { min-height: 34px; }
    .hand-zone-hint { display: none !important; }
  }

  /* === Arc Card Detail Modal: Tablet & PC Full-Width Sizing (No Clipping) === */
  @media (min-width: 768px) {
    .arc-topbar { max-width: 760px; padding: 14px 20px 6px; }
    .arc-stage { height: min(560px, calc(100vh - 130px)); }
    .arc-card {
      width: 316px;
      margin-left: -158px;
      top: 16px;
    }
    .arc-art-wrap { height: 224px; }
    .arc-title { font-size: 17px; }
    .arc-desc { font-size: 13px; }
  }

  /* === Collapsible Hand Dock (PC & Tablet Landscape) === */
  .hand-collapse-btn {
    display: none;
    margin-left: auto;
    padding: 4px 11px;
    font-size: 11.5px;
    font-weight: 800;
    border-color: rgba(192, 132, 252, 0.55);
    color: #e9d5ff;
    background: rgba(124, 58, 237, 0.22);
    white-space: nowrap;
  }
  .hand-collapse-btn:hover {
    border-color: #fde047;
    color: #fde68a;
  }
  @media (min-width: 1025px) {
    .hand-collapse-btn { display: inline-flex; align-items: center; }
    #handDock {
      position: sticky;
      bottom: 0;
      z-index: 80;
    }
    #handDock.collapsed {
      min-height: 0 !important;
      padding: 6px 14px !important;
      height: auto !important;
    }
    #handDock.collapsed .tabs,
    #handDock.collapsed .density-controls,
    #handDock.collapsed .hand-tray,
    #handDock.collapsed .hand-zone-hint {
      display: none !important;
    }
    #handDock.collapsed .hand-toolbar {
      margin-bottom: 0 !important;
    }
    body.hand-collapsed .arena-3col {
      padding-bottom: 58px !important;
    }
  }

  /* === Preset Preview & Confirm Modal (All Screen Sizes) === */
  .preset-preview-bg {
    background: rgba(5, 9, 18, 0.45) !important;
    backdrop-filter: blur(3px) !important;
    -webkit-backdrop-filter: blur(3px) !important;
  }
  .preset-modal {
    width: min(560px, calc(100vw - 24px));
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: linear-gradient(155deg, rgba(14, 22, 44, 0.98), rgba(8, 13, 26, 0.98));
    border: 1.5px solid rgba(251, 191, 36, 0.62);
    border-radius: 18px;
    padding: 16px 18px;
    box-shadow: 0 22px 54px rgba(0, 0, 0, 0.72), 0 0 28px rgba(251, 191, 36, 0.14);
    color: var(--text);
  }
  .pp-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
  }
  .pp-kicker {
    font-size: 10px;
    font-weight: 900;
    color: #93c5fd;
    letter-spacing: 0.08em;
    margin-bottom: 2px;
  }
  .pp-title {
    margin: 0;
    font-size: 17px;
    font-weight: 900;
    color: #fde68a;
    line-height: 1.3;
  }
  .pp-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
  }
  .pp-cards-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }
  .pp-card {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.88);
    border: 1px solid rgba(96, 138, 224, 0.32);
  }
  .pp-card.is-atk {
    border-color: rgba(251, 191, 36, 0.62);
    background: rgba(30, 26, 14, 0.55);
  }
  .pp-card.is-ai {
    border-color: rgba(192, 132, 252, 0.62);
    background: rgba(34, 18, 56, 0.55);
  }
  .pp-art {
    width: 56px;
    height: 56px;
    border-radius: 9px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
  }
  .pp-info {
    flex: 1;
    min-width: 0;
  }
  .pp-role {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 5px;
    margin-right: 5px;
    background: rgba(56, 189, 248, 0.22);
    color: #bae6fd;
  }
  .pp-card.is-atk .pp-role {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #070b14;
  }
  .pp-card.is-ai .pp-role {
    background: linear-gradient(135deg, #c084fc, #7e22ce);
    color: #fff;
  }
  .pp-name {
    font-size: 13px;
    font-weight: 800;
    color: #fff;
  }
  .pp-desc {
    font-size: 11.5px;
    color: #cbd5e1;
    margin-top: 3px;
    line-height: 1.45;
  }
  .pp-warn {
    font-size: 11.5px;
    color: #fde68a;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.32);
    border-radius: 9px;
    padding: 8px 11px;
    margin-bottom: 12px;
    text-align: center;
  }
  .pp-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
  }
    .pp-actions .btn {
      padding: 8px 16px;
      font-size: 12.5px;
    }

  /* === Mobile Strict No-Overflow Fix (ROI & Hand Category Tabs on 360px-430px) === */
  @media (max-width: 1024px) {
    html, body {
      max-width: 100vw !important;
      overflow-x: clip !important;
    }
    #heroBox {
      max-width: calc(100vw - 20px) !important;
      overflow: hidden !important;
      box-sizing: border-box !important;
    }
    #heroBox .hero-top {
      display: flex !important;
      flex-wrap: nowrap !important;
      align-items: flex-start !important;
      justify-content: space-between !important;
      gap: 6px !important;
      max-width: 100% !important;
    }
    #heroBox .hero-top > div:first-child {
      min-width: 0 !important;
      flex: 1 1 auto !important;
    }
    #heroBox .roi-wrap {
      flex-wrap: wrap !important;
      gap: 4px 8px !important;
      max-width: 100% !important;
    }
    #heroBox .roi-value {
      font-size: 34px !important;
      line-height: 1.05 !important;
    }
    #heroBox .hero-top-actions {
      flex-shrink: 0 !important;
      gap: 5px !important;
    }
    #heroBox .hero-share-btn {
      padding: 5px 7px !important;
      font-size: 10.5px !important;
    }
    #heroBox .kpi-strip {
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 6px !important;
      max-width: 100% !important;
    }
    #heroBox .kpi {
      min-width: 0 !important;
      padding: 6px 8px !important;
      overflow: hidden !important;
    }
    #heroBox .kpi .k-val {
      font-size: 13px !important;
      white-space: normal !important;
      word-break: break-word !important;
    }
    #heroBox .risk-strip {
      display: flex !important;
      flex-wrap: wrap !important;
      gap: 4px 10px !important;
      font-size: 10.5px !important;
      white-space: normal !important;
      max-width: 100% !important;
    }
    #heroBox .solidity-row {
      display: flex !important;
      flex-wrap: wrap !important;
      gap: 4px 8px !important;
      max-width: 100% !important;
    }
    #heroBox .solidity-track {
      min-width: 70px !important;
      flex: 1 1 80px !important;
    }
    #handDock {
      max-width: calc(100vw - 20px) !important;
      overflow: hidden !important;
      box-sizing: border-box !important;
    }
    #handDock .hand-toolbar {
      max-width: 100% !important;
      min-width: 0 !important;
    }
    #handDock .tabs {
      display: flex !important;
      flex-wrap: wrap !important;
      max-width: 100% !important;
      gap: 5px !important;
    }
    #handDock .tab {
      flex: 0 0 auto !important;
      padding: 4px 9px !important;
      font-size: 11px !important;
    }
  }
  @media (min-width: 768px) and (max-width: 1024px) {
    #heroBox .kpi-strip {
      grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
  }
  @media (min-width: 1025px) and (hover: hover) {
    .mob-only-hand-hint { display: none !important; }
  }

  /* === Deploy Header Deck Selector Bar === */
  .deploy-deck-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding: 7px 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(56, 189, 248, 0.35);
  }
  .deploy-deck-lbl {
    font-size: 11px;
    font-weight: 800;
    color: #93c5fd;
    white-space: nowrap;
  }
  .deploy-deck-select {
    flex: 1;
    min-width: 190px;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(96, 138, 224, 0.42);
    background: #070c18;
    color: #f8fafc;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
  }
  .deploy-deck-select:focus {
    outline: none;
    border-color: var(--gold);
  }

  /* === All Presets Modal & Trigger Pill === */
  .preset-chip.preset-all-btn {
    border-color: rgba(56, 189, 248, 0.55) !important;
    color: #7dd3fc !important;
    background: rgba(56, 189, 248, 0.14) !important;
    font-weight: 800 !important;
  }
  .all-preset-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 10px;
  }
  .ap-tab {
    padding: 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.88);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 800;
    cursor: pointer;
  }
  .ap-tab.active {
    background: linear-gradient(135deg, #38bdf8, #2563eb);
    color: #fff;
    border-color: #93c5fd;
  }
  .all-presets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 8px;
    max-height: 54vh;
    overflow-y: auto;
    padding-right: 2px;
  }
  .ap-card {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(96, 138, 224, 0.32);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, transform 0.12s;
  }
  .ap-card:hover {
    border-color: var(--gold);
    transform: translateY(-1px);
  }
  .ap-card-art {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
  }
  .ap-card-info {
    flex: 1;
    min-width: 0;
  }
  .ap-card-grp {
    display: inline-block;
    font-size: 9.5px;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(251, 191, 36, 0.18);
    color: #fde68a;
    margin-bottom: 2px;
  }
  .ap-card-title {
    font-size: 12.5px;
    font-weight: 800;
    color: #fff;
    line-height: 1.3;
  }
  .ap-card-sub {
    font-size: 10.5px;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* === Today Deploy Readability Overhaul (Larger Type & Spacious Grid) === */
  #deployModal .ev-banner {
    padding: 11px 14px;
    font-size: 12.5px;
    line-height: 1.65;
  }
  #deployModal .deploy-list {
    gap: 14px;
  }
  #deployModal .deploy-race-card {
    padding: 14px 16px;
    gap: 11px;
    border-radius: 14px;
    border: 1.5px solid rgba(96, 138, 224, 0.36);
    background: rgba(13, 21, 40, 0.94);
  }
  #deployModal .deploy-race-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .dp-title-row {
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
  }
  .dp-time {
    font-family: monospace;
    font-size: 13.5px;
    font-weight: 900;
    color: #fde047;
    background: rgba(251, 191, 36, 0.14);
    border: 1px solid rgba(251, 191, 36, 0.35);
    padding: 2px 8px;
    border-radius: 7px;
  }
  .dp-venue {
    font-size: 17px;
    font-weight: 900;
    color: #ffffff;
    letter-spacing: 0.02em;
  }
  .dp-grade {
    font-size: 11.5px;
    font-weight: 700;
    color: #cbd5e1;
    background: rgba(30, 41, 59, 0.9);
    padding: 2px 8px;
    border-radius: 6px;
  }
  .dp-badges-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
  }
  .dp-badge {
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 999px;
    line-height: 1.35;
  }
  .dp-badge-ai {
    background: rgba(168, 85, 247, 0.22);
    border: 1px solid rgba(192, 132, 252, 0.55);
    color: #f3e8ff;
  }
  .dp-badge-ev {
    background: rgba(16, 185, 129, 0.18);
    border: 1px solid rgba(52, 211, 153, 0.5);
    color: #a7f3d0;
  }
  .deploy-tickets-box {
    background: rgba(6, 11, 24, 0.78);
    border: 1px solid rgba(251, 191, 36, 0.26);
    border-radius: 10px;
    padding: 10px 12px;
  }
  .dp-tickets-lbl {
    font-size: 11.5px;
    font-weight: 700;
    color: #94a3b8;
    margin-bottom: 7px;
  }
  .dp-tickets-row {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
  }
  #deployModal .ticket-chip {
    padding: 5px 10px;
    border-radius: 8px;
    gap: 6px;
    font-size: 13px;
    border-color: rgba(251, 191, 36, 0.52);
  }
  #deployModal .ticket-chip .tc-combo {
    font-size: 13.5px;
  }
  #deployModal .ticket-chip .tc-odds {
    font-size: 12px;
    color: #6ee7b7;
  }
  .dp-more-cnt {
    font-size: 12px;
    color: var(--muted);
    font-weight: 700;
  }
  #deployModal .deploy-entries {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  #deployModal .entry-pill {
    padding: 8px 10px;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1.45;
    background: rgba(7, 12, 26, 0.86);
    border: 1px solid rgba(71, 85, 105, 0.52);
  }
  #deployModal .entry-pill .e-top {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 4px;
  }
  #deployModal .entry-pill .e-no {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
  .e-name {
    font-size: 13.5px;
    font-weight: 900;
    color: #f8fafc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .e-cls {
    margin-left: auto;
    font-size: 10.5px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 5px;
    background: rgba(30, 41, 59, 0.95);
    color: #cbd5e1;
    flex-shrink: 0;
  }
  .e-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    font-size: 12px;
    color: #94a3b8;
    font-variant-numeric: tabular-nums;
  }
  .e-stats strong {
    color: #e2e8f0;
  }
  .e-stats .e-ai {
    color: #d8b4fe;
  }
  .e-stats .e-ai strong {
    color: #c084fc;
  }
  @media (max-width: 900px) {
    #deployModal .deploy-entries {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }
  @media (max-width: 520px) {
    #deployModal .deploy-race-card {
      padding: 12px;
    }
    #deployModal .deploy-entries {
      grid-template-columns: 1fr;
      gap: 7px;
    }
    #deployModal .entry-pill {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      padding: 8px 10px;
    }
    #deployModal .entry-pill .e-top {
      margin-bottom: 0;
      min-width: 0;
    }
    .e-stats {
      justify-content: flex-end;
      gap: 4px 8px;
      font-size: 11.5px;
    }
  }
