  :root {
    --bg:#0f172a; --panel:#1e293b; --line:#334155; --line2:#475569;
    --me:#0284c7; --me-h:#38bdf8; --opp:#ef4444; --opp-h:#f87171;
    --ok:#22c55e; --warn:#f59e0b; --txt:#f8fafc; --muted:#94a3b8;
    --pk-bg:#0b1222; --pk-panel:#151f38; --pk-panel2:#1b2745; --pk-panel3:#223054;
    --pk-line:#28365a; --pk-line2:#3a4c7a;
    --pk-gold:#ffcb05; --pk-red:#e3350d; --pk-accent:#4f8ef7;
    --r-md:12px; --r-lg:18px;
    --font-display:"Baloo 2","Noto Sans TC",system-ui,sans-serif;
    --font-body:"Noto Sans TC",system-ui,-apple-system,"Segoe UI",sans-serif;
    --shadow-panel:0 10px 30px rgba(2,8,20,.45);
  }
  * { box-sizing:border-box; }
  body { font-family:var(--font-body); background:var(--pk-bg); color:var(--txt); margin:0; padding:0; min-height:100vh; }
  h1 { font-size:18px; margin:0 0 8px; }
  h3 { font-size:13px; margin:8px 0 4px; color:var(--muted); }
  .row { display:flex; gap:16px; flex-wrap:wrap; align-items:flex-start; justify-content:center; }
  .panel { flex: 0 0 280px; max-width: 320px; background: #1e293b; border: 1px solid #334155; border-radius: 12px; padding: 16px; box-shadow: 0 8px 24px rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 10px; }
  .panel hr { border: 0; border-top: 1px solid #334155; margin: 6px 0; }
  .status-bar { width: 100%; background: #1e293b; border: 1px solid #334155; border-radius: 8px; padding: 8px 14px; font-size: 12px; font-weight: 600; color: #f8fafc; text-align: center; }

  /* ==========================================================================
     Pokémon TCG Pocket Native Vertical Mirror Stadium Layout
     ========================================================================== */
  .arena { flex: 1; max-width: 540px; min-width: 360px; display: flex; flex-direction: column; align-items: center; gap: 10px; }

  .stadium-mat {
    position: relative;
    width: 100%;
    max-width: 520px;
    border-radius: 36px;
    background: radial-gradient(ellipse at 50% 50%, #d4ebfc 0%, #a6d2f7 40%, #60a5fa 78%, #3b82f6 100%);
    border: 5px solid #ffffff;
    box-shadow: 0 25px 60px rgba(0,0,0,0.45), inset 0 0 70px rgba(255,255,255,0.6);
    padding: 14px 16px 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 840px;
    user-select: none;
    overflow: hidden;
  }

  .stadium-lines {
    position: absolute;
    inset: 12px;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 30px;
    pointer-events: none;
  }
  .stadium-lines::before {
    content: "";
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 180px; height: 180px;
    border-radius: 50%;
    border: 2.5px dashed rgba(255,255,255,0.45);
  }
  .stadium-lines::after {
    content: "";
    position: absolute;
    top: 50%; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 5%, rgba(255,255,255,0.45) 30%, rgba(255,255,255,0.45) 70%, transparent 95%);
    transform: translateY(-50%);
  }

  /* HUD Bars (Top & Bottom) */
  .stadium-hud {
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 9999px;
    padding: 6px 16px;
    color: #f8fafc;
    box-shadow: 0 4px 16px rgba(0,0,0,0.35);
  }
  .hud-user { display:flex; align-items:center; gap:8px; }
  .hud-avatar { width:26px; height:26px; border-radius:50%; background:#ef4444; color:#fff; display:grid; place-items:center; font-size:12px; font-weight:bold; box-shadow:0 2px 6px rgba(0,0,0,0.3); }
  .hud-avatar.me { background:#0284c7; color:#fff; }
  .hud-name { font-size:13px; font-weight:700; color:#f8fafc; letter-spacing:0.3px; }
  
  /* Prize Points (3 Dots) */
  .prize-dots { display:flex; gap:6px; align-items:center; }
  .prize-dot { width:13px; height:13px; border-radius:50%; background:rgba(255,255,255,0.2); border:1.5px solid rgba(255,255,255,0.4); transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); }
  .prize-dot.earned { background:#38bdf8; border-color:#fff; box-shadow:0 0 12px #38bdf8; transform:scale(1.15); }
  .prize-dot.earned-opp { background:#f87171; border-color:#fff; box-shadow:0 0 12px #f87171; transform:scale(1.15); }

  /* Hand Card Arcs */
  .opp-hand-arc { display:flex; justify-content:center; align-items:center; height:46px; margin:2px 0; z-index:8; }
  .opp-card-back { width:38px; height:52px; border-radius:4px; background:linear-gradient(135deg,#1e3a8a,#0f172a); border:1.5px solid #93c5fd; box-shadow:0 3px 8px rgba(0,0,0,0.5), inset 0 0 4px rgba(96,165,250,0.4); margin:0 2px; transform:rotate(var(--rot, 0deg)); transform-origin:bottom center; }

  /* Half Fields (Opponent & Player) */
  .stadium-half-field {
    display: grid;
    grid-template-columns: 90px 1fr 90px;
    align-items: center;
    width: 100%;
    z-index: 5;
    margin: 4px 0;
  }
  .field-side-zone { display:flex; flex-direction:column; gap:8px; }
  .field-side-zone.left { align-items:flex-start; }
  .field-side-zone.right { align-items:flex-end; }

  /* Deck 3D Box */
  .deck-3d-box {
    position: relative;
    width: 44px;
    height: 60px;
    background: linear-gradient(135deg, #1e3a8a, #0f172a);
    border: 1.5px solid #93c5fd;
    border-radius: 6px;
    box-shadow: 2px 3px 0 #1e293b, 4px 5px 0 #0f172a, 0 8px 16px rgba(0,0,0,0.35);
    display: grid;
    place-items: center;
    cursor: default;
  }
  .deck-3d-box.me { background: linear-gradient(135deg, #0369a1, #0f172a); border-color: #38bdf8; }
  .deck-3d-box .cnt-badge {
    position: absolute;
    bottom: -6px; right: -6px;
    background: #0284c7; color: #fff;
    font-size: 10px; font-weight: bold; font-family: monospace;
    padding: 1px 5px; border-radius: 999px;
    border: 1px solid #fff; box-shadow: 0 2px 4px rgba(0,0,0,0.3);
  }

  .discard-box {
    display: flex; align-items: center; justify-content: space-between; gap: 4px;
    background: rgba(15,23,42,0.85); border: 1px solid rgba(255,255,255,0.25);
    border-radius: 6px; padding: 3px 7px; color: #cbd5e1;
    font-size: 10px; cursor: pointer; min-width: 54px; transition: all 0.15s;
  }
  .discard-box:hover { border-color: #38bdf8; color: #fff; background: rgba(15,23,42,0.95); }
  .discard-box .badge { background: #475569; color: #fff; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 999px; }

  .concede-btn {
    background: rgba(239, 68, 68, 0.2); border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5; font-size: 10px; font-weight: 600; padding: 4px 8px;
    border-radius: 6px; cursor: pointer; transition: all 0.15s;
  }
  .concede-btn:hover { background: rgba(239, 68, 68, 0.85); color: #fff; }

  /* Bench Row & Slots */
  .stadium-bench-row { display: flex; justify-content: center; align-items: center; gap: 12px; width: 100%; z-index: 4; }

  /* Active Spot Arena (Opponent Active facing down, Player Active facing up) */
  .stadium-active-center {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin: 4px 0;
    z-index: 6;
  }
  .active-pokemon-box { display: flex; flex-direction: column; align-items: center; min-height: 185px; }

  /* Cards Styling */
  .stadium-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .stadium-card:hover { transform: translateY(-4px); }
  .stadium-card.active-card img { width: 125px; height: 175px; border-radius: 9px; object-fit: cover; box-shadow: 0 10px 25px rgba(0,0,0,0.35); border: 2.5px solid #fff; }
  .stadium-card.bench-card img { width: 82px; height: 115px; border-radius: 7px; object-fit: cover; box-shadow: 0 6px 16px rgba(0,0,0,0.3); border: 2px solid #fff; }
  
  .stadium-card.selected img { border-color: #f59e0b; box-shadow: 0 0 0 3px #f59e0b, 0 8px 24px rgba(245,158,11,0.5); }
  .stadium-card.attach-target-highlight img { border-color: #38bdf8; box-shadow: 0 0 0 4px #38bdf8, 0 0 24px rgba(56,189,248,0.85); animation: targetPulse 1s infinite alternate; }
  .stadium-card.drop-target img { border-color: #22c55e; box-shadow: 0 0 0 4px #22c55e, 0 0 20px rgba(34,197,94,0.85); }

  @keyframes targetPulse {
    0% { box-shadow: 0 0 0 3px #38bdf8, 0 0 12px #38bdf8; }
    100% { box-shadow: 0 0 0 5px #38bdf8, 0 0 26px #38bdf8; }
  }

  /* Attached Pokémon Tool Badge (PTCG Pocket style) */
  .attached-tool-badge {
    position: absolute;
    left: -22px;
    top: 46%;
    transform: translateY(-50%);
    z-index: 6;
    width: 48px;
    height: 36px;
    border-radius: 7px;
    border: 2px solid #facc15;
    box-shadow: 0 0 10px rgba(250, 204, 21, 0.85), 0 3px 8px rgba(0, 0, 0, 0.65);
    background: #0f172a;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease;
    animation: toolPulse 2.2s infinite alternate ease-in-out;
  }
  .attached-tool-badge:hover {
    transform: translateY(-50%) scale(1.18);
    box-shadow: 0 0 16px #fde047, 0 4px 12px rgba(0, 0, 0, 0.85);
    z-index: 10;
  }
  .attached-tool-badge img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    display: block;
  }
  .bench-card .attached-tool-badge {
    width: 32px;
    height: 24px;
    left: -12px;
    top: 46%;
    border-radius: 5px;
    border: 1.5px solid #facc15;
    box-shadow: 0 0 7px rgba(250, 204, 21, 0.8), 0 2px 5px rgba(0, 0, 0, 0.6);
  }
  .bench-card .attached-tool-badge:hover {
    transform: translateY(-50%) scale(1.22);
    z-index: 10;
  }
  .attached-tool-badge .tool-fallback {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1px;
    color: #facc15;
    font-size: 8px;
    font-weight: bold;
    text-align: center;
    line-height: 1;
  }
  .attached-tool-badge .tool-fallback .tool-icon {
    font-size: 11px;
  }
  .attached-tool-badge .tool-fallback .tool-name-text {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transform: scale(0.85);
  }
  @keyframes toolPulse {
    0% { box-shadow: 0 0 6px rgba(250, 204, 21, 0.65), 0 2px 6px rgba(0,0,0,0.55); }
    100% { box-shadow: 0 0 14px rgba(250, 204, 21, 0.95), 0 3px 10px rgba(0,0,0,0.8); }
  }

  /* HP Header Tag above Pokémon */
  .hp-header-tag {
    width: 100%;
    max-width: 125px;
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 6px;
    padding: 3px 6px;
    margin-bottom: 3px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  }
  .bench-card .hp-header-tag { max-width: 82px; padding: 2px 4px; }
  
  .hp-top-row { display:flex; justify-content:space-between; align-items:center; font-size:10px; font-weight:bold; }
  .bench-card .hp-top-row { font-size:9px; }
  .mon-name-text { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; color:#e2e8f0; max-width:70px; }
  .bench-card .mon-name-text { max-width:42px; }
  .hp-number-tag { font-family:monospace; font-weight:800; font-size:11px; }
  .hp-number-tag.hp-high { color:#4ade80; }
  .hp-number-tag.hp-mid { color:#facc15; }
  .hp-number-tag.hp-low { color:#f87171; }

  .hp-bar-track { width:100%; height:4px; background:#334155; border-radius:999px; overflow:hidden; margin-top:2px; }
  .hp-bar-fill { height:100%; border-radius:999px; transition: width 0.3s ease; }
  .hp-bar-fill.hp-high { background: linear-gradient(90deg, #22c55e, #4ade80); }
  .hp-bar-fill.hp-mid { background: linear-gradient(90deg, #eab308, #fde047); }
  .hp-bar-fill.hp-low { background: linear-gradient(90deg, #ef4444, #f87171); }

  /* Attached Energy Icons under Card */
  .attached-energy-bar { display:flex; gap:2px; flex-wrap:wrap; justify-content:center; margin-top:3px; max-width:125px; }
  .bench-card .attached-energy-bar { max-width:82px; }
  .attached-energy-dot { width:15px; height:15px; border-radius:50%; font-size:9px; font-weight:bold; display:grid; place-items:center; color:#fff; box-shadow:0 1px 4px rgba(0,0,0,0.3); }
  .attached-energy-dot.W { background:#2563eb; }
  .attached-energy-dot.F { background:#dc2626; }
  .attached-energy-dot.G { background:#16a34a; }
  .attached-energy-dot.L { background:#ca8a04; }
  .attached-energy-dot.P { background:#9333ea; }
  .attached-energy-dot.Fight { background:#b45309; }
  .attached-energy-dot.D { background:#334155; }
  .attached-energy-dot.M { background:#64748b; }
  .attached-energy-dot.Colorless { background:#cbd5e1; color:#1e293b; }
  .attached-energy-dot.Dragon { background:#6366f1; }

  /* Empty Slots */
  .stadium-slot.active-slot.empty {
    width: 125px; height: 175px; border-radius: 9px;
    border: 2px dashed rgba(255,255,255,0.5);
    background: rgba(255,255,255,0.12);
    display: grid; place-items: center;
    color: rgba(255,255,255,0.75); font-size: 11px; font-weight: 700;
  }
  .stadium-slot.active-slot.empty.setup-prompt {
    border-color: #38bdf8;
    border-width: 2.5px;
    background: rgba(56,189,248,0.22);
    color: #ffffff;
    box-shadow: 0 0 18px rgba(56,189,248,0.5);
    cursor: pointer;
    animation: targetPulse 1.2s infinite alternate;
  }
  .stadium-slot.bench-slot.empty {
    width: 82px; height: 115px; border-radius: 7px;
    border: 2px dashed rgba(255,255,255,0.45);
    background: rgba(255,255,255,0.1);
    display: grid; place-items: center;
    color: rgba(255,255,255,0.7); font-size: 10px; font-weight: 600;
  }

  /* Energy Zone Ring & 3D Glowing Orb */
  .energy-zone-ring {
    position: relative;
    width: 64px; height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.5) 0%, rgba(56,189,248,0.2) 65%, rgba(2,132,199,0.5) 100%);
    border: 3px solid #ffffff;
    box-shadow: 0 0 16px rgba(56,189,248,0.6), inset 0 0 10px rgba(255,255,255,0.5);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
  }
  .energy-zone-ring.ready {
    animation: energyRingPulse 1.8s infinite alternate;
  }
  @keyframes energyRingPulse {
    0% { box-shadow: 0 0 12px #38bdf8, inset 0 0 8px #fff; transform: scale(1); }
    100% { box-shadow: 0 0 24px #38bdf8, 0 0 35px rgba(56,189,248,0.85), inset 0 0 14px #fff; transform: scale(1.06); }
  }

  .energy-orb {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 900;
    color: #fff;
    box-shadow: 0 5px 14px rgba(0,0,0,0.35), inset 0 -3px 6px rgba(0,0,0,0.3), inset 0 3px 6px rgba(255,255,255,0.6);
    user-select: none;
    cursor: grab;
    transition: transform 0.15s, box-shadow 0.15s;
    position: relative;
  }
  .energy-orb:hover { transform: scale(1.1); }
  .energy-orb.W { background: radial-gradient(circle at 35% 35%, #60a5fa 0%, #2563eb 60%, #1e40af 100%); }
  .energy-orb.F { background: radial-gradient(circle at 35% 35%, #fb923c 0%, #dc2626 60%, #991b1b 100%); }
  .energy-orb.G { background: radial-gradient(circle at 35% 35%, #4ade80 0%, #16a34a 60%, #166534 100%); }
  .energy-orb.L { background: radial-gradient(circle at 35% 35%, #fde047 0%, #ca8a04 60%, #854d0e 100%); }
  .energy-orb.P { background: radial-gradient(circle at 35% 35%, #c084fc 0%, #9333ea 60%, #6b21a8 100%); }
  .energy-orb.Fight { background: radial-gradient(circle at 35% 35%, #f59e0b 0%, #b45309 60%, #78350f 100%); }
  .energy-orb.D { background: radial-gradient(circle at 35% 35%, #64748b 0%, #334155 60%, #0f172a 100%); }
  .energy-orb.M { background: radial-gradient(circle at 35% 35%, #e2e8f0 0%, #94a3b8 60%, #475569 100%); }
  .energy-orb.Colorless { background: radial-gradient(circle at 35% 35%, #f8fafc 0%, #cbd5e1 60%, #64748b 100%); color:#334155; }
  .energy-orb.Dragon { background: radial-gradient(circle at 35% 35%, #f472b6 0%, #818cf8 60%, #4338ca 100%); }

  /* Next-Turn Energy Preview Badge (When Zone is Empty) */
  .energy-preview-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.82;
    transition: opacity 0.2s;
    pointer-events: none;
  }
  .energy-preview-badge .next-label {
    font-size: 8px;
    font-weight: 800;
    color: #0369a1;
    letter-spacing: 0.5px;
    margin-bottom: 1px;
    text-shadow: 0 1px 2px rgba(255,255,255,0.8);
  }
  .energy-preview-orb {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: bold;
    color: rgba(255,255,255,0.9);
    border: 1.5px dashed rgba(255,255,255,0.85);
    box-shadow: inset 0 0 8px rgba(255,255,255,0.5);
  }
  .energy-preview-orb.W { background: radial-gradient(circle at 35% 35%, rgba(96,165,250,0.65) 0%, rgba(37,99,235,0.65) 100%); }
  .energy-preview-orb.F { background: radial-gradient(circle at 35% 35%, rgba(251,146,60,0.65) 0%, rgba(220,38,38,0.65) 100%); }
  .energy-preview-orb.G { background: radial-gradient(circle at 35% 35%, rgba(74,222,128,0.65) 0%, rgba(22,163,74,0.65) 100%); }
  .energy-preview-orb.L { background: radial-gradient(circle at 35% 35%, rgba(253,224,71,0.65) 0%, rgba(202,138,4,0.65) 100%); }
  .energy-preview-orb.P { background: radial-gradient(circle at 35% 35%, rgba(192,132,252,0.65) 0%, rgba(147,51,234,0.65) 100%); }
  .energy-preview-orb.Fight { background: radial-gradient(circle at 35% 35%, rgba(245,158,11,0.65) 0%, rgba(180,83,9,0.65) 100%); }
  .energy-preview-orb.D { background: radial-gradient(circle at 35% 35%, rgba(100,116,139,0.65) 0%, rgba(51,65,85,0.65) 100%); }
  .energy-preview-orb.M { background: radial-gradient(circle at 35% 35%, rgba(226,232,240,0.65) 0%, rgba(148,163,184,0.65) 100%); }
  .energy-preview-orb.Colorless { background: radial-gradient(circle at 35% 35%, rgba(248,250,252,0.65) 0%, rgba(203,213,225,0.65) 100%); color:#334155; }
  .energy-preview-orb.Dragon { background: radial-gradient(circle at 35% 35%, rgba(244,114,182,0.65) 0%, rgba(129,140,248,0.65) 100%); }

  /* Turn Highlight for Stadium HUD */
  .stadium-hud.active-turn {
    border-color: #38bdf8;
    box-shadow: 0 0 20px rgba(56,189,248,0.6), 0 4px 16px rgba(0,0,0,0.4);
  }
  .stadium-hud.active-turn#oppHud {
    border-color: #f87171;
    box-shadow: 0 0 20px rgba(248,113,113,0.6), 0 4px 16px rgba(0,0,0,0.4);
  }

  /* Frosted Glass Match Outcome Banner */
  .outcome-banner-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: bannerFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes bannerFadeIn {
    0% { opacity: 0; transform: scale(0.92); }
    100% { opacity: 1; transform: scale(1); }
  }
  .outcome-banner-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.96) 0%, rgba(15, 23, 42, 0.98) 100%);
    border: 2px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    padding: 28px 36px;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 40px rgba(56,189,248,0.35);
    max-width: 380px;
    width: 90%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .outcome-banner-card.win { border-color: #38bdf8; box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 45px rgba(56,189,248,0.5); }
  .outcome-banner-card.loss { border-color: #f87171; box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 45px rgba(248,113,113,0.5); }
  .outcome-banner-card.draw { border-color: #facc15; box-shadow: 0 25px 60px rgba(0,0,0,0.6), 0 0 45px rgba(250,204,21,0.5); }
  .outcome-trophy { font-size: 48px; line-height: 1; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.4)); }
  .outcome-title { font-size: 26px; font-weight: 900; letter-spacing: 1.5px; color: #fff; text-transform: uppercase; text-shadow: 0 2px 8px rgba(0,0,0,0.5); }
  .outcome-subtitle { font-size: 13px; color: #cbd5e1; font-weight: 600; }
  .outcome-score-box {
    display: flex; align-items: center; justify-content: center; gap: 14px;
    font-size: 20px; font-weight: 800; font-family: monospace;
    background: rgba(0,0,0,0.35); padding: 8px 20px; border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.1); width: 100%;
  }
  .outcome-reason-tag { font-size: 11px; color: #94a3b8; font-weight: 600; }
  .outcome-actions { display: flex; gap: 12px; width: 100%; margin-top: 6px; }
  .btn-outcome-primary {
    flex: 1; background: linear-gradient(135deg, #0284c7, #0369a1);
    color: #fff; border: 1px solid #38bdf8; border-radius: 10px;
    padding: 10px 16px; font-size: 13px; font-weight: 800; cursor: pointer;
    box-shadow: 0 4px 14px rgba(2,132,199,0.4);
  }
  .btn-outcome-primary:hover { background: linear-gradient(135deg, #0369a1, #0284c7); transform: translateY(-1px); }
  .btn-outcome-secondary {
    flex: 1; background: rgba(255,255,255,0.1);
    color: #cbd5e1; border: 1px solid rgba(255,255,255,0.2); border-radius: 10px;
    padding: 10px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  }
  .btn-outcome-secondary:hover { background: rgba(255,255,255,0.2); color:#fff; }

  /* Floating End Turn Pill Button */
  .floating-end-turn-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #ffffff 0%, #e0f2fe 100%);
    color: #0369a1;
    font-weight: 800;
    font-size: 13px;
    border: 2px solid #38bdf8;
    border-radius: 9999px;
    box-shadow: 0 4px 16px rgba(56,189,248,0.5);
    padding: 8px 18px;
    cursor: pointer;
    z-index: 30;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.15s, box-shadow 0.15s;
  }
  .floating-end-turn-btn:hover {
    transform: translateY(-50%) scale(1.06);
    box-shadow: 0 6px 22px rgba(56,189,248,0.75);
  }
  .floating-end-turn-btn small { font-size:9px; color:#0284c7; font-weight:600; }
  .floating-end-turn-btn.disabled { opacity:0.35; cursor:not-allowed; pointer-events:none; }

  /* Stadium Card Slot (Central Left Neutral Zone) */
  .field-stadium-slot {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 72px;
    height: 100px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 25;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    user-select: none;
    box-sizing: border-box;
  }
  .field-stadium-slot.empty {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    background: rgba(15, 23, 42, 0.45);
    cursor: pointer;
  }
  .field-stadium-slot.empty:hover {
    border-color: rgba(56, 189, 248, 0.7);
    background: rgba(15, 23, 42, 0.7);
    transform: translateY(-50%) scale(1.04);
  }
  .field-stadium-slot.empty.drop-target {
    border-color: #22c55e;
    border-style: solid;
    background: rgba(34, 197, 94, 0.25);
    box-shadow: 0 0 16px rgba(34, 197, 94, 0.7);
    transform: translateY(-50%) scale(1.08);
  }
  .field-stadium-slot.empty .stadium-slot-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: rgba(255, 255, 255, 0.5);
    font-size: 10px;
    font-weight: 700;
  }
  .field-stadium-slot.empty .stadium-slot-placeholder .stadium-slot-icon {
    font-size: 20px;
    opacity: 0.8;
  }
  .field-stadium-slot.has-card {
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
    cursor: pointer;
    background: #0f172a;
  }
  .field-stadium-slot.has-card:hover {
    transform: translateY(-50%) scale(1.12);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.65), 0 0 16px rgba(56, 189, 248, 0.6);
    z-index: 32;
  }
  .field-stadium-slot.has-card img {
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
    display: block;
  }
  .field-stadium-slot .stadium-badge {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff;
    font-size: 9px;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
    pointer-events: none;
    letter-spacing: 0.5px;
  }
  .field-stadium-slot.activatable {
    border-color: #facc15;
    box-shadow: 0 0 0 3px #facc15, 0 0 22px rgba(250, 204, 21, 0.8);
    animation: stadiumPulse 1.6s infinite alternate ease-in-out;
  }
  .field-stadium-slot.activatable .stadium-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.9);
  }
  .field-stadium-slot .stadium-act-badge {
    position: absolute;
    bottom: -9px;
    left: 50%;
    transform: translateX(-50%);
    background: #facc15;
    color: #0f172a;
    font-size: 9px;
    font-weight: 900;
    padding: 1px 6px;
    border-radius: 9999px;
    border: 1px solid #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    pointer-events: none;
    animation: stadiumBadgeBounce 1.2s infinite alternate;
  }
  @keyframes stadiumPulse {
    0% { box-shadow: 0 0 0 2px #facc15, 0 0 10px rgba(250, 204, 21, 0.5); }
    100% { box-shadow: 0 0 0 4px #facc15, 0 0 24px rgba(250, 204, 21, 0.95); }
  }
  @keyframes stadiumBadgeBounce {
    0% { transform: translateX(-50%) translateY(0); }
    100% { transform: translateX(-50%) translateY(-2px); }
  }

  /* Player Hand Arc Fan */
  .player-hand-fan-container {
    position: relative;
    width: 100%;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    margin-bottom: 4px;
    z-index: 15;
  }
  .hand-fan-card {
    position: relative;
    width: 76px;
    height: 106px;
    margin: 0 -10px;
    transform: rotate(var(--rot, 0deg)) translateY(var(--ty, 0px));
    transform-origin: bottom center;
    transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), z-index 0.1s, box-shadow 0.2s;
    cursor: pointer;
  }
  .hand-fan-card img {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 7px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.35);
    border: 1.5px solid rgba(255,255,255,0.75);
  }
  .hand-fan-card:hover {
    transform: translateY(-38px) scale(1.25) rotate(0deg) !important;
    z-index: 60 !important;
  }
  .hand-fan-card.playable-glow img {
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px #38bdf8, 0 0 18px rgba(56,189,248,0.95);
    animation: playablePulse 1.2s infinite alternate;
  }
  @keyframes playablePulse {
    0% { box-shadow: 0 0 0 2px #38bdf8, 0 0 8px rgba(56,189,248,0.7); }
    100% { box-shadow: 0 0 0 3px #38bdf8, 0 0 20px rgba(56,189,248,1); }
  }

  /* Discard List Modal/Popup */
  .discard-list { font-size:12px; padding:4px 0; max-height:220px; overflow-y:auto; }
  .discard-list .row { display:flex; justify-content:space-between; padding:3px 4px; border-bottom:1px solid var(--line); }
  .discard-list .row:last-child { border-bottom:0; }
  .discard-list .nm { color:var(--txt); }
  .discard-list .sub { color:var(--muted); font-size:10px; }

  /* Card Showcase Spotlight Overlay */
  .card-showcase-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 90;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: showcaseFadeIn 0.2s ease-out;
  }
  @keyframes showcaseFadeIn {
    0% { opacity: 0; }
    100% { opacity: 1; }
  }
  .card-showcase-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    animation: showcasePop 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }
  @keyframes showcasePop {
    0% { transform: scale(0.85) translateY(24px); opacity: 0; }
    100% { transform: scale(1) translateY(0); opacity: 1; }
  }
  .card-showcase-badge {
    background: linear-gradient(135deg, #0284c7, #38bdf8);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 3px 14px;
    border-radius: 999px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    text-transform: uppercase;
  }
  .card-showcase-card img {
    width: 160px;
    height: 224px;
    border-radius: 12px;
    border: 3px solid #ffffff;
    box-shadow: 0 16px 40px rgba(0,0,0,0.6), 0 0 32px rgba(56,189,248,0.7);
    object-fit: cover;
  }
  .card-showcase-name {
    font-size: 17px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.8);
  }
  .card-showcase-text {
    font-size: 11px;
    color: #cbd5e1;
    max-width: 260px;
    text-align: center;
    font-weight: 600;
  }

  /* Flying Energy Particle Orb */
  .energy-fly-orb {
    position: fixed;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    z-index: 1000;
    pointer-events: none;
    display: grid;
    place-items: center;
    font-size: 15px;
    font-weight: 900;
    color: #fff;
    box-shadow: 0 0 24px rgba(56,189,248,0.9), inset 0 0 10px #fff;
    transition: transform 0.52s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.52s ease;
  }

  /* Attack & Damage Animations */
  .mon-lunge-down { animation: lungeDown 0.38s cubic-bezier(0.34, 1.56, 0.64, 1); }
  .mon-lunge-up { animation: lungeUp 0.38s cubic-bezier(0.34, 1.56, 0.64, 1); }
  @keyframes lungeDown {
    0% { transform: translateY(0); }
    35% { transform: translateY(28px) scale(1.08); z-index: 40; }
    100% { transform: translateY(0); }
  }
  @keyframes lungeUp {
    0% { transform: translateY(0); }
    35% { transform: translateY(-28px) scale(1.08); z-index: 40; }
    100% { transform: translateY(0); }
  }
  .mon-damage-flash { animation: damageFlash 0.45s ease-out; }
  @keyframes damageFlash {
    0% { filter: brightness(1); }
    25% { filter: brightness(2.2) drop-shadow(0 0 18px #ef4444); transform: translateX(-6px); }
    50% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    100% { filter: brightness(1); transform: translateX(0); }
  }
  .damage-popup-badge {
    position: absolute;
    top: 25%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #dc2626;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    font-family: monospace;
    padding: 3px 12px;
    border-radius: 999px;
    border: 2px solid #fff;
    box-shadow: 0 4px 16px rgba(0,0,0,0.6);
    z-index: 50;
    pointer-events: none;
    animation: damagePopUp 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  @keyframes damagePopUp {
    0% { transform: translate(-50%, -10px) scale(0.7); opacity: 0; }
    30% { transform: translate(-50%, -32px) scale(1.25); opacity: 1; }
    100% { transform: translate(-50%, -58px) scale(1); opacity: 0; }
  }

  /* Sabrina / Promote Switch Highlights */
  .stadium-card.switching-out {
    opacity: 0.72;
    filter: grayscale(0.25) brightness(0.85);
    border: 2px dashed #f59e0b !important;
  }
  .stadium-card.switch-candidate {
    border: 2.5px solid #facc15 !important;
    box-shadow: 0 0 0 2px #facc15, 0 0 20px rgba(250, 204, 21, 0.95);
    animation: switchCandidatePulse 1s infinite alternate;
    cursor: pointer !important;
  }
  @keyframes switchCandidatePulse {
    0% { transform: scale(1); box-shadow: 0 0 0 2px #facc15, 0 0 8px rgba(250, 204, 21, 0.6); }
    100% { transform: scale(1.05); box-shadow: 0 0 0 3px #facc15, 0 0 24px rgba(250, 204, 21, 1); }
  }

  /* 3D Coin Flip Overlay */
  .coin-flip-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.76);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 95;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: showcaseFadeIn 0.2s ease-out;
  }
  .coin-flip-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    animation: showcasePop 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .coin-flip-badge {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
    color: #1e293b;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.2px;
    padding: 4px 16px;
    border-radius: 999px;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
    text-transform: uppercase;
  }
  .coin-3d-stage {
    width: 100px;
    height: 100px;
    perspective: 800px;
    margin: 8px 0;
  }
  .coin-3d-coin {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.65s cubic-bezier(0.2, 0.9, 0.3, 1);
  }
  .coin-side {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 4px solid #fef08a;
    box-shadow: 0 10px 28px rgba(0,0,0,0.5), inset 0 0 16px rgba(255,255,255,0.6);
  }
  .coin-front {
    background: radial-gradient(circle at 35% 35%, #fef08a 0%, #eab308 55%, #ca8a04 100%);
    color: #713f12;
    transform: rotateX(0deg);
  }
  .coin-back {
    background: radial-gradient(circle at 35% 35%, #e2e8f0 0%, #94a3b8 55%, #475569 100%);
    color: #0f172a;
    border-color: #f1f5f9;
    transform: rotateX(180deg);
  }
  .coin-symbol {
    font-size: 34px;
    line-height: 1;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
  }
  .coin-sub {
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1px;
    margin-top: 2px;
  }
  .coin-flip-title {
    font-size: 22px;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.8);
    letter-spacing: 0.5px;
  }
  .coin-flip-history {
    display: flex;
    gap: 6px;
    max-width: 280px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .coin-history-pill {
    font-size: 10px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.2);
  }
  .coin-history-pill.heads {
    background: rgba(234, 179, 8, 0.35);
    color: #fef08a;
    border-color: #eab308;
  }
  .coin-history-pill.tails {
    background: rgba(148, 163, 184, 0.25);
    color: #cbd5e1;
    border-color: #94a3b8;
  }
  .coin-flipping {
    animation: coinSpinKeyframes 0.65s cubic-bezier(0.2, 0.8, 0.3, 1);
  }
  @keyframes coinSpinKeyframes {
    0% { transform: translateY(0) rotateX(0deg) scale(1); }
    40% { transform: translateY(-50px) rotateX(720deg) scale(1.15); }
    100% { transform: translateY(0) rotateX(1440deg) scale(1); }
  }

  /* Controls & Action Buttons */
  button { font-family:var(--font-body); background:var(--me); color:white; border:0; border-radius:8px; padding:8px 13px; margin:2px; cursor:pointer; font-size:12px; font-weight:700; }
  button:hover { background:var(--me-h); }
  button:disabled { background:#3a4460; cursor:default; }
  button.opp-btn { background:var(--opp); }
  button.opp-btn:hover { background:var(--opp-h); }
  select, input { background:var(--panel); color:var(--txt); border:1px solid var(--line); border-radius:6px; padding:6px; }
  .log { font-family:monospace; font-size:11px; color:var(--muted); max-height:140px; overflow-y:auto; background:#0f172a; padding:8px; border-radius:8px; border:1px solid var(--line); }
  
  /* Action Menu (Floating Context Menu) */
  .menu { position:absolute; background:var(--panel); border:1px solid var(--line2); border-radius:8px; padding:8px; z-index:100; box-shadow:0 8px 24px rgba(0,0,0,.6); min-width:160px; }
  .menu button { display:block; width:100%; text-align:left; margin:3px 0; padding:6px 10px; border-radius:4px; font-size:12px; }
  .menu .menu-title { font-size:11px; font-weight:bold; color:var(--muted); padding:2px 4px 6px; border-bottom:1px solid var(--line); margin-bottom:4px; }
 /* ==========================================================================
     App shell — Pokémon chrome（深墨藍 + 精靈球紅/皮卡丘金）
     ========================================================================== */
 body { padding:0; background:var(--pk-bg); overflow-x:hidden; }

 .masthead { display:flex; align-items:center; justify-content:space-between; gap:18px; padding:14px 24px; border-bottom:1px solid var(--pk-line); background:linear-gradient(180deg,#121c34 0%,#0e1628 100%); position:sticky; top:0; z-index:500; }
 .brand { display:flex; align-items:center; gap:12px; }
 .brand-mark { position:relative; width:38px; height:38px; border-radius:50%;
   background:linear-gradient(180deg,#e3350d 0%,#e3350d 45%,#1c2438 45%,#1c2438 55%,#f4f7fb 55%,#f4f7fb 100%);
   border:2px solid #0b1222; box-shadow:0 0 0 2px rgba(255,255,255,.22), 0 4px 12px rgba(0,0,0,.55); }
 .brand-mark::after { content:""; position:absolute; inset:0; margin:auto; width:12px; height:12px; border-radius:50%; background:#f4f7fb; border:3px solid #1c2438; box-shadow:0 1px 3px rgba(0,0,0,.4); }
 .brand h1 { margin:0; font:800 20px/1.1 var(--font-display); letter-spacing:.02em; color:#fff; }
 .brand small { display:block; margin-top:3px; color:#8fa2c6; font:600 10px/1.2 var(--font-body); letter-spacing:.22em; text-transform:uppercase; }
 .tabs { display:flex; padding:3px; gap:2px; border:1px solid var(--pk-line); border-radius:12px; background:#0c1425; }
 .tabs .tablink { display:inline-block; padding:8px 14px; border-radius:9px; color:#aebdd8; background:transparent; font-size:12.5px; font-weight:700; text-decoration:none; transition:background .18s ease, color .18s ease, transform .12s ease; }
 .tabs .tablink:hover { color:#fff; background:rgba(255,255,255,.07); }
 .tabs .tablink:active { transform:scale(.96); }
 .tabs .tablink.active { color:#142033; background:linear-gradient(180deg,#ffd83d,#ffcb05); box-shadow:0 2px 10px rgba(255,203,5,.35); }

 .view { display:none; padding:22px 18px 48px; }
 .view.active { display:block; animation:viewIn .4s cubic-bezier(.16,1,.3,1) both; }
 @keyframes viewIn { from { opacity:0; transform:translateY(16px) scale(.996); } to { opacity:1; transform:none; } }

 /* Shared input polish */
 select, input { font-family:var(--font-body); }
 select:focus, input:focus { border-color:var(--pk-gold); outline:none; }

 /* ==========================================================================
     AI Learning Lab
     ========================================================================== */
 .lab-shell { max-width:1180px; margin:0 auto; color:var(--txt); }
 .lab-hero { display:grid; grid-template-columns:minmax(0,1.4fr) minmax(290px,.6fr); gap:18px; margin-bottom:18px; }
 .lab-intro { position:relative; overflow:hidden; padding:28px; border-radius:var(--r-lg); color:#ecf3fd; background:linear-gradient(150deg,#1d2f5e 0%,#152246 55%,#101a36 100%); border:1px solid #2b3d6e; box-shadow:var(--shadow-panel); }
 .lab-intro:after { content:"GA"; position:absolute; right:-12px; bottom:-35px; color:rgba(255,203,5,.09); font:900 150px/1 var(--font-display); }
 .eyebrow { color:var(--pk-gold); font:700 11px/1 var(--font-body); letter-spacing:.16em; text-transform:uppercase; }
 .lab-intro h2 { max-width:620px; margin:10px 0 8px; font:800 32px/1.12 var(--font-display); letter-spacing:-.01em; color:#fff; }
 .lab-intro p { max-width:640px; margin:0; color:#b9c8e4; font-size:14px; line-height:1.65; }
 .lab-controls { padding:18px; border-radius:var(--r-lg); background:var(--pk-panel); border:1px solid var(--pk-line); box-shadow:var(--shadow-panel); }
 .lab-controls h3 { margin:0 0 12px; color:var(--txt); font-size:14px; }
 .btn-preset { padding:5px 10px; font-size:11px; font-weight:700; border-radius:8px; border:1px solid var(--pk-line2); background:var(--pk-panel3); color:#cdd9f2; cursor:pointer; transition:all .15s ease; }
 .btn-preset:hover { background:#2a3a66; border-color:var(--pk-gold); color:#fff; }
 .control-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
 .control-grid label { color:var(--muted); font:600 10px/1.2 var(--font-body); text-transform:uppercase; letter-spacing:.07em; }
 .control-grid input,.control-grid select { width:100%; margin-top:4px; color:var(--txt); background:#0e1730; border-color:var(--pk-line); padding:7px; border-radius:8px; }
 .run-btn { width:100%; margin:12px 0 0; padding:11px; color:#fff; background:linear-gradient(180deg,#f0451c,#d53108); font-weight:800; font-family:var(--font-display); font-size:14px; letter-spacing:.04em; border-radius:10px; box-shadow:0 4px 16px rgba(227,53,13,.4); }
 .run-btn:hover { background:linear-gradient(180deg,#ff5a2e,#e3350d); }
 .run-btn:disabled { background:#3a4460; box-shadow:none; }
 .quick-note { margin:9px 0 0; color:var(--muted); font-size:11px; line-height:1.5; }
 .progress-wrap { display:none; margin-top:12px; }
 .progress-track { height:8px; overflow:hidden; border-radius:10px; background:#1b2745; border:1px solid var(--pk-line); }
 .progress-fill { width:0; height:100%; background:linear-gradient(90deg,#ffcb05,#ff9f1a); transition:width .25s ease; }
 .progress-copy { display:flex; justify-content:space-between; margin-top:5px; color:var(--muted); font:600 10px/1.3 var(--font-body); }
 .metric-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-bottom:12px; }
 .metric { padding:14px 16px; border-top:4px solid #4f8ef7; border-radius:10px; background:var(--pk-panel); border:1px solid var(--pk-line); border-top-width:4px; box-shadow:var(--shadow-panel); }
 .metric:nth-child(1) { border-top-color:#4f8ef7; }
 .metric:nth-child(2) { border-top-color:#e3350d; }
 .metric:nth-child(3) { border-top-color:#ffcb05; }
 .metric:nth-child(4) { border-top-color:#8b5cf6; }
 .metric .k { color:var(--muted); font:700 10px/1 var(--font-body); text-transform:uppercase; letter-spacing:.09em; }
 .metric .v { margin-top:6px; color:#fff; font:800 26px/1 var(--font-display); }
 .metric .hint { margin-top:5px; color:var(--muted); font-size:10px; }
 .lab-grid { display:grid; grid-template-columns:minmax(0,1.35fr) minmax(320px,.65fr); gap:12px; }
 .lab-card { padding:18px; border-radius:14px; background:var(--pk-panel); border:1px solid var(--pk-line); box-shadow:var(--shadow-panel); }
 .lab-card h3 { margin:0; color:var(--txt); font-size:14px; }
 .card-sub { margin:5px 0 12px; color:var(--muted); font-size:11px; line-height:1.5; }
 .chart-wrap { min-height:260px; }
 .chart-wrap svg { width:100%; height:auto; display:block; overflow:visible; }
 .chart-label { fill:#8299c2; font:600 10px var(--font-body); }
 .chart-grid { stroke:#243356; stroke-width:1; }
 .chart-line { fill:none; stroke-width:3; stroke-linecap:round; stroke-linejoin:round; }
 .chart-dot { stroke:var(--pk-panel); stroke-width:2; }
 .legend { display:flex; flex-wrap:wrap; gap:12px; color:var(--muted); font-size:10px; }
 .legend i { display:inline-block; width:14px; height:3px; margin-right:5px; vertical-align:middle; border-radius:2px; }
 .generation-strip { display:flex; gap:7px; overflow-x:auto; padding:4px 1px 10px; }
 .gen-node { min-width:72px; padding:9px 10px; color:#9db0d0; text-align:left; background:#16213e; border:1px solid #26355c; border-radius:10px; cursor:pointer; transition:all .15s ease; }
 .gen-node:hover { border-color:var(--pk-line2); transform:translateY(-2px); }
 .gen-node.active { color:#fff; background:#24355f; border-color:var(--pk-gold); box-shadow:0 0 12px rgba(255,203,5,.25); }
 .gen-node b { display:block; font:800 15px/1 var(--font-display); color:inherit; }
 .gen-node span { font-size:9px; }
 .deck-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(82px,1fr)); gap:8px; max-height:360px; overflow:auto; }
 .deck-card { position:relative; min-width:0; padding:6px; border:1px solid #2c3d66; border-radius:10px; background:#16213e; cursor:pointer; transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
 .deck-card:hover { transform:translateY(-3px); box-shadow:0 6px 14px rgba(0,0,0,.4); border-color:var(--pk-gold); }
 .deck-card img { width:100%; aspect-ratio:5/7; object-fit:cover; border-radius:6px; background:#101a30; }
 .deck-card .name { margin-top:4px; overflow:hidden; color:#cfe0f5; font-size:10px; white-space:nowrap; text-overflow:ellipsis; }
 .copies { position:absolute; right:2px; top:2px; min-width:22px; padding:3px; border-radius:10px; color:#142033; background:var(--pk-gold); text-align:center; font:800 10px var(--font-display); box-shadow:0 2px 5px rgba(0,0,0,.4); }
 .rank-table { width:100%; border-collapse:collapse; color:#cfe0f5; font-size:11px; }
 .rank-table th { padding:7px 5px; color:var(--muted); text-align:left; font:600 10px var(--font-body); border-bottom:1px solid #2c3d66; }
 .rank-table td { padding:8px 5px; border-bottom:1px solid #223054; }
 .fitness-bar { width:100%; height:5px; border-radius:4px; background:#223054; }
 .fitness-bar i { display:block; height:100%; border-radius:4px; background:linear-gradient(90deg,#4f8ef7,#7db4ff); }
 .learn-steps { display:grid; grid-template-columns:repeat(5,1fr); gap:7px; margin-top:12px; }
 .learn-step { position:relative; padding:10px; color:#9db0d0; background:#16213e; border:1px solid #26355c; border-radius:10px; font-size:10px; line-height:1.5; }
 .learn-step b { display:block; margin-bottom:3px; color:var(--pk-gold); font:800 11px var(--font-display); }
 .empty-lab { grid-column:1/-1; padding:38px; color:#8fa2c6; text-align:center; border:1px dashed #3a4c7a; border-radius:14px; background:rgba(21,31,56,.5); }

 /* MCTS Inspector */
 .mcts-inspector { margin-top:12px; padding:12px; border:1px solid var(--pk-line); border-radius:12px; background:#101a30; }
 .mcts-inspector h3 { margin:0 0 4px; color:var(--pk-gold); }
 .mcts-copy { color:#9fb2cc; font-size:11px; line-height:1.5; }
 .mcts-row { display:grid; grid-template-columns:minmax(110px,1fr) 54px 1fr 44px; gap:7px; align-items:center; margin-top:7px; font-size:10px; }
 .mcts-meter { height:6px; overflow:hidden; border-radius:4px; background:#223054; }
 .mcts-meter i { display:block; height:100%; background:linear-gradient(90deg,#2f8fd8,#38bdf8); border-radius:4px; }
 .mcts-row.selected { color:var(--pk-gold); }

 /* ==========================================================================
     Card & Deck Guide
     ========================================================================== */
 .guide-shell { max-width:1280px; margin:0 auto; color:var(--txt); }
 .guide-head { display:flex; justify-content:space-between; gap:18px; align-items:end; margin-bottom:14px; padding:20px 22px; border-radius:var(--r-lg); background:linear-gradient(150deg,#1d2f5e 0%,#152246 60%,#101a36 100%); border:1px solid #2b3d6e; box-shadow:var(--shadow-panel); }
 .guide-head h2 { margin:5px 0 0; font:800 26px/1.15 var(--font-display); color:#fff; }
 .guide-head p { max-width:660px; margin:7px 0 0; color:#b9c8e4; font-size:12px; line-height:1.55; }
 .db-count { flex:none; color:var(--pk-gold); text-align:right; font:800 26px/1 var(--font-display); }
 .db-count small { display:block; margin-top:5px; color:var(--muted); font:600 10px/1.2 var(--font-body); text-transform:uppercase; letter-spacing:.08em; }
 .guide-tabs { display:flex; gap:7px; margin-bottom:10px; }
 .guide-tabs button { color:#aebdd8; background:#16213e; border:1px solid var(--pk-line); }
 .guide-tabs button:hover { background:#24355f; color:#fff; }
 .guide-tabs button.active { color:#142033; background:linear-gradient(180deg,#ffd83d,#ffcb05); border-color:transparent; }
 .catalog-filters { display:grid; grid-template-columns:minmax(200px,1.2fr) repeat(3,minmax(110px,.3fr)); gap:8px; padding:10px; border-radius:12px; background:var(--pk-panel); border:1px solid var(--pk-line); }
 .catalog-filters input,.catalog-filters select { width:100%; color:var(--txt); background:#0e1730; border-color:var(--pk-line); padding:8px; border-radius:8px; }
 .catalog-meta { display:flex; justify-content:space-between; gap:12px; margin:8px 2px; color:var(--muted); font:600 11px var(--font-body); }
 .catalog-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:10px; }
 .catalog-card { display:grid; grid-template-columns:86px 1fr; gap:10px; min-height:150px; padding:10px; border-radius:12px; color:#cfe0f5; background:var(--pk-panel); border:1px solid var(--pk-line); cursor:pointer; transition:transform .15s ease, box-shadow .2s ease, border-color .15s ease; }
 .catalog-card:hover { transform:translateY(-3px); border-color:var(--pk-gold); box-shadow:0 8px 20px rgba(0,0,0,.45), 0 0 0 1px rgba(255,203,5,.35); }
 .catalog-card>img { width:86px; min-height:120px; border-radius:7px; background:#101a30; object-fit:cover; }
 .catalog-card h3 { margin:0; color:#fff; font-size:13px; }
 .card-code { color:#7f93b8; font:600 9px var(--font-body); }
 .card-tags { display:flex; flex-wrap:wrap; gap:4px; margin:5px 0; }
 .card-tag { padding:2px 5px; border-radius:4px; color:#a9bcdc; background:#22335a; border:1px solid #2c3d66; font:600 9px var(--font-body); }
 .card-rule { margin-top:5px; color:#9db0d0; font-size:9px; line-height:1.4; }
 .attack-line { margin-top:5px; padding-top:5px; border-top:1px solid #26355c; font-size:9px; line-height:1.4; color:#9db0d0; }
 .pager { display:flex; justify-content:center; gap:7px; margin:14px 0; }
 .deck-codex { display:grid; grid-template-columns:repeat(auto-fit,minmax(340px,1fr)); gap:14px; }
 .codex-entry { padding:18px; border-radius:14px; color:#cfe0f5; background:var(--pk-panel); border:1px solid var(--pk-line); box-shadow:var(--shadow-panel); display:flex; flex-direction:column; gap:10px; }
 .codex-header { display:flex; justify-content:space-between; align-items:center; }
 .codex-title { font-family:var(--font-display); font-size:16px; font-weight:800; color:#fff; margin:0; }
 .codex-badges { display:flex; gap:6px; align-items:center; }
 .codex-badge { padding:3px 8px; border-radius:6px; font:700 11px var(--font-body); background:#22335a; color:var(--pk-gold); border:1px solid #3a4c7a; }
 .codex-entry p { margin:0; min-height:34px; color:#9db0d0; font-size:11px; line-height:1.5; }
 .energy-list { color:var(--pk-gold); font:700 11px var(--font-body); }
 .energy-dist-bar { display:flex; height:10px; border-radius:5px; overflow:hidden; background:#223054; margin:4px 0; border:1px solid #2c3d66; }
 .energy-dist-bar .seg { height:100%; transition:width .3s ease; }
 .energy-dist-legend { display:flex; flex-wrap:wrap; gap:8px; font-size:10px; color:var(--muted); font-family:var(--font-body); margin-top:2px; }
 .energy-dist-legend span { display:flex; align-items:center; gap:4px; }
 .energy-dist-legend i { width:8px; height:8px; border-radius:2px; display:inline-block; }
 .deck-summary-stats { display:flex; justify-content:space-between; font-size:11px; color:var(--muted); padding:4px 0; border-top:1px solid #26355c; border-bottom:1px solid #26355c; font-family:var(--font-body); }
 .deck-codex-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(72px,1fr)); gap:7px; margin-top:4px; }
 .deck-codex-card { position:relative; border-radius:8px; overflow:hidden; background:#16213e; border:1px solid #2c3d66; cursor:pointer; transition:transform .12s, box-shadow .12s, border-color .12s; display:flex; flex-direction:column; padding:3px; }
 .deck-codex-card:hover { transform:translateY(-3px); box-shadow:0 6px 14px rgba(0,0,0,.4); border-color:var(--pk-gold); }
 .deck-codex-card img { width:100%; aspect-ratio:5/7; object-fit:cover; border-radius:5px; background:#101a30; display:block; }
 .deck-codex-card .name { font-size:9px; font-weight:bold; color:#cfe0f5; margin-top:3px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:center; }
 .deck-codex-card .copies-badge { position:absolute; top:2px; right:2px; background:var(--pk-gold); color:#142033; font:800 10px/1 var(--font-display); padding:2px 4px; border-radius:8px; box-shadow:0 2px 4px rgba(0,0,0,.35); }
 .deck-codex-card .stage-badge { position:absolute; bottom:18px; left:3px; background:rgba(11,18,34,.9); color:#cfe0f5; font:700 8px/1 var(--font-body); padding:1px 3px; border-radius:3px; }
 .deck-list { display:grid; grid-template-columns:1fr 1fr; gap:3px 10px; margin-top:10px; }
 .deck-list div { display:flex; justify-content:space-between; gap:6px; padding:4px 0; border-bottom:1px solid #223054; font-size:10px; color:#cfe0f5; }

 /* Card Modal（原本已經係深色，加入場動畫） */
 .modal-overlay { position:fixed; inset:0; background:rgba(5,10,20,0.82); display:flex; align-items:center; justify-content:center; z-index:1000; backdrop-filter:blur(4px); padding:16px; animation:overlayIn .22s ease-out both; }
 .modal-dialog { background:#141d36; border:1px solid #35477a; border-radius:16px; max-width:680px; width:100%; max-height:90vh; overflow-y:auto; box-shadow:0 24px 70px rgba(0,0,0,.65); position:relative; padding:22px; color:#e8edf4; animation:dialogIn .32s cubic-bezier(.16,1,.3,1) both; }
 @keyframes overlayIn { from { opacity:0; } to { opacity:1; } }
 @keyframes dialogIn { from { opacity:0; transform:translateY(20px) scale(.94); } to { opacity:1; transform:none; } }
 .modal-close { position:absolute; right:14px; top:14px; background:#22335a; color:#bed0d9; border:1px solid #35477a; border-radius:50%; width:32px; height:32px; display:flex; align-items:center; justify-content:center; cursor:pointer; font-size:16px; font-weight:bold; line-height:1; padding:0; }
 .modal-close:hover { background:var(--pk-red); color:white; border-color:var(--pk-red); }
 .modal-body { display:grid; grid-template-columns:190px 1fr; gap:20px; }
 .modal-img-col { display:flex; flex-direction:column; align-items:center; gap:8px; }
 .modal-img-col img { width:100%; max-width:190px; aspect-ratio:5/7; object-fit:cover; border-radius:10px; box-shadow:0 8px 24px rgba(0,0,0,.4); background:#22335a; }
 .modal-info-col { display:flex; flex-direction:column; gap:8px; font-size:12px; }
 .modal-title { font-family:var(--font-display); font-size:18px; font-weight:800; color:#fff; margin:0; }
 .modal-subtitle { color:var(--pk-gold); font-size:11px; }
 .modal-stats { display:flex; flex-wrap:wrap; gap:6px; margin:4px 0; }
 .modal-stat-pill { padding:3px 7px; border-radius:5px; background:#22335a; border:1px solid #35477a; font-size:11px; color:#c4d7e6; }
 .modal-section-title { font-weight:bold; color:var(--pk-gold); font-size:12px; margin-top:8px; border-bottom:1px solid #26355c; padding-bottom:3px; }
 .modal-attack-item { background:#0e1730; border:1px solid #26355c; border-radius:8px; padding:8px 10px; margin-top:6px; }
 .modal-attack-header { display:flex; justify-content:space-between; align-items:center; font-weight:bold; color:#fff; }
 .modal-attack-cost { display:flex; gap:2px; align-items:center; }
 .modal-attack-desc { margin-top:4px; color:#b0c4de; font-size:11px; line-height:1.4; }
 .modal-ability-box { background:#221d3d; border:1px solid #7852a9; border-radius:8px; padding:8px 10px; margin-top:6px; }
 .modal-rule-box { background:#101a30; border:1px solid #2c3d66; border-radius:8px; padding:8px 10px; margin-top:6px; color:#b0c4de; font-size:11px; line-height:1.45; }

 /* ==========================================================================
     Deck Editor
     ========================================================================== */
 .editor-shell { display:grid; grid-template-columns:minmax(0,1.2fr) minmax(360px,.8fr); gap:16px; max-width:1380px; margin:0 auto; color:var(--txt); }
 .editor-lib-pane, .editor-tray-pane { background:var(--pk-panel); border:1px solid var(--pk-line); border-radius:16px; padding:16px; box-shadow:var(--shadow-panel); display:flex; flex-direction:column; gap:10px; }
 .editor-lib-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(128px,1fr)); gap:8px; max-height:560px; overflow-y:auto; padding:4px; }
 .editor-card-item { background:#16213e; border:1px solid #2c3d66; border-radius:10px; padding:6px; display:flex; flex-direction:column; gap:4px; transition:border-color .15s, transform .12s, box-shadow .15s; }
 .editor-card-item:hover { border-color:var(--pk-gold); transform:translateY(-2px); box-shadow:0 5px 14px rgba(0,0,0,.35); }
 .editor-card-item img { width:100%; aspect-ratio:5/7; object-fit:cover; border-radius:6px; cursor:pointer; background:#101a30; }
 .editor-card-item .c-name { font-size:11px; font-weight:bold; color:var(--txt); white-space:nowrap; overflow:hidden; text-overflow:ellipsis; cursor:pointer; }
 .editor-card-item .c-sub { font-size:9px; color:var(--muted); }
 .editor-card-stepper { display:flex; justify-content:space-between; align-items:center; margin-top:auto; background:#101a30; border-radius:7px; padding:2px; }
 .editor-card-stepper button { width:26px; height:24px; padding:0; font-size:14px; font-weight:bold; line-height:1; display:grid; place-items:center; border-radius:6px; }
 .editor-card-stepper span { font-size:11px; font-weight:bold; color:#cdd9f2; }
 .energy-selector-grid { display:flex; flex-wrap:wrap; gap:5px; }
 .energy-checkbox-lbl { display:flex; align-items:center; gap:4px; background:#16213e; border:1px solid #2c3d66; border-radius:7px; padding:4px 8px; font-size:10px; color:#cdd9f2; cursor:pointer; user-select:none; transition:all .15s ease; }
 .energy-checkbox-lbl:hover { border-color:var(--pk-line2); }
 .energy-checkbox-lbl.checked { background:linear-gradient(180deg,#ffd83d,#ffcb05); color:#142033; border-color:var(--pk-gold); font-weight:bold; box-shadow:0 2px 8px rgba(255,203,5,.3); }
 .energy-checkbox-lbl input { display:none; }
 .validation-box { padding:10px 12px; border-radius:10px; font-size:11px; line-height:1.5; background:rgba(59,78,128,.16); border:1px dashed #3a4c7a; color:var(--muted); }
 .validation-box.valid { background:rgba(34,197,94,.12); color:#4ade80; border:1px solid rgba(74,222,128,.45); font-weight:bold; }
 .validation-box.invalid { background:rgba(227,53,13,.12); color:#fca5a5; border:1px solid rgba(248,113,113,.45); }
 .validation-box ul { margin:4px 0 0; padding-left:18px; }
 .editor-tray-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(72px,1fr)); gap:6px; min-height:160px; max-height:280px; overflow-y:auto; background:#0e1730; border:1px solid #2c3d66; border-radius:10px; padding:8px; }
 .tray-card-item { position:relative; background:#16213e; border:1px solid #2c3d66; border-radius:8px; padding:3px; display:flex; flex-direction:column; cursor:pointer; transition:border-color .15s ease, transform .12s ease; }
 .tray-card-item:hover { border-color:var(--pk-red); transform:translateY(-2px); }
 .tray-card-item img { width:100%; aspect-ratio:5/7; object-fit:cover; border-radius:5px; background:#101a30; }
 .tray-card-item .t-copies { position:absolute; top:2px; right:2px; background:var(--pk-gold); color:#142033; font:800 10px/1 var(--font-display); padding:1px 4px; border-radius:6px; }
 .tray-card-item .t-del { position:absolute; top:2px; left:2px; background:rgba(227,53,13,.92); color:#fff; font:800 10px/1 var(--font-display); width:16px; height:16px; border-radius:50%; display:grid; place-items:center; }
 .tray-card-item .t-name { font-size:9px; font-weight:bold; color:#cfe0f5; margin-top:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; text-align:center; }
 .editor-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
 .btn-primary { background:linear-gradient(180deg,#3f8ef7,#2a6bd0)!important; font-weight:bold; box-shadow:0 3px 12px rgba(63,142,247,.35); }
 .btn-primary:hover { background:linear-gradient(180deg,#559ef8,#3579dd)!important; }
 .btn-battle { background:linear-gradient(180deg,#2fae4e,#238a3c)!important; font-weight:bold; box-shadow:0 3px 12px rgba(47,174,78,.3); }
 .btn-battle:hover { background:linear-gradient(180deg,#3cc35d,#2a9c48)!important; }
 .btn-danger { background:linear-gradient(180deg,#f0451c,#d53108)!important; }
 .btn-danger:hover { background:linear-gradient(180deg,#ff5a2e,#e3350d)!important; }
 .saved-decks-list { display:flex; flex-direction:column; gap:6px; max-height:180px; overflow-y:auto; }
 .saved-deck-row { display:flex; justify-content:space-between; align-items:center; background:#16213e; border:1px solid #2c3d66; border-radius:9px; padding:6px 10px; font-size:11px; transition:border-color .15s ease; }
 .saved-deck-row:hover { border-color:var(--pk-line2); }
 .saved-deck-row .title { font-weight:bold; color:var(--txt); }
 .saved-deck-row .meta { color:var(--muted); font-size:10px; }
 .saved-deck-btns { display:flex; gap:4px; }

 /* ==========================================================================
     Game feel：按鈕按壓、焦點、modal 由 display 切換重新觸發動畫
     ========================================================================== */
 button { transition:transform .12s ease, box-shadow .2s ease, background .15s ease, filter .15s ease, border-color .15s ease; }
 button:active:not(:disabled) { transform:translateY(1px) scale(.97); }
 button:disabled { opacity:.5; }
 :focus-visible { outline:3px solid var(--pk-gold); outline-offset:2px; border-radius:4px; }
 .hand-fan-card, .stadium-card { will-change:transform; }

 /* ==========================================================================
     Responsive
     ========================================================================== */
 @media (max-width: 900px) {
   .masthead { flex-direction:column; align-items:stretch; gap:10px; padding:12px 14px; }
   .tabs { width:100%; overflow-x:auto; scrollbar-width:none; }
   .tabs::-webkit-scrollbar { display:none; }
   .tabs .tablink { flex:1 0 auto; text-align:center; white-space:nowrap; }
   .view { padding:12px 10px 40px; }
   .lab-hero, .lab-grid { grid-template-columns:1fr; }
   .metric-grid { grid-template-columns:1fr 1fr; }
   .learn-steps { grid-template-columns:1fr 1fr; }
   .row { flex-direction:column; align-items:center; }
   .panel { flex:1 1 auto; width:100%; max-width:560px; }
   .arena { min-width:0; width:100%; }
   .editor-shell { grid-template-columns:1fr; }
   .catalog-filters { grid-template-columns:1fr 1fr; }
   .catalog-grid { grid-template-columns:repeat(auto-fill,minmax(150px,1fr)); }
   .catalog-card { grid-template-columns:72px 1fr; min-height:130px; }
   .catalog-card>img { width:72px; min-height:100px; }
   .deck-codex { grid-template-columns:1fr; }
   .guide-head { flex-direction:column; align-items:flex-start; }
   .guide-head .db-count { text-align:left; }
   .lab-intro { padding:20px; } .lab-intro h2 { font-size:26px; }
   /* Battle mat 縮放入屏 */
   .stadium-mat { min-height:0; border-radius:26px; border-width:3px; padding:10px 8px 8px; }
   .stadium-card.active-card img { width:92px; height:129px; }
   .stadium-slot.active-slot.empty { width:92px; height:129px; }
   .stadium-card.bench-card img { width:60px; height:84px; }
   .stadium-slot.bench-slot.empty { width:60px; height:84px; }
   .active-pokemon-box { min-height:148px; }
   .hand-fan-card { width:56px; height:80px; margin:0 -7px; }
   .hand-fan-card:hover { transform:translateY(-22px) scale(1.18) rotate(0deg) !important; }
   .player-hand-fan-container { height:96px; }
   .attached-energy-bar { max-width:92px; }
   .bench-card .attached-energy-bar { max-width:60px; }
   .hp-header-tag { max-width:92px; }
   .bench-card .hp-header-tag { max-width:60px; }
   .bench-card .mon-name-text { max-width:34px; }
   .energy-zone-ring { width:50px; height:50px; }
   .energy-orb { width:34px; height:34px; font-size:14px; }
   .energy-preview-orb { width:28px; height:28px; font-size:12px; }
   .deck-3d-box { width:36px; height:50px; }
   .field-stadium-slot { width:54px; height:76px; }
   .floating-end-turn-btn { padding:6px 12px; font-size:11px; right:6px; }
   .floating-end-turn-btn small { font-size:8px; }
   .opp-hand-arc { height:34px; }
   .opp-card-back { width:28px; height:40px; margin:0 1px; }
   .attached-tool-badge { width:36px; height:27px; left:-14px; }
   .bench-card .attached-tool-badge { width:24px; height:18px; left:-9px; }
   .stadium-half-field { grid-template-columns:64px 1fr 64px; }
   .mcts-row { grid-template-columns:minmax(84px,1fr) 44px 1fr 38px; }
   .outcome-banner-card { padding:20px 22px; }
 }
 @media (max-width: 480px) {
   .control-grid { grid-template-columns:1fr; }
   .learn-steps { grid-template-columns:1fr; }
   .modal-body { grid-template-columns:1fr; }
   .editor-actions button { flex:1 1 44%; }
   .lab-controls { padding:14px; }
   .brand small { letter-spacing:.12em; }
   .stadium-hud { padding:5px 10px; }
   .hud-avatar { width:22px; height:22px; font-size:10px; }
   .hud-name { font-size:11px; }
 }
 @media (prefers-reduced-motion: reduce) {
   *, *::before, *::after { scroll-behavior:auto!important; transition-duration:0.01ms!important; animation-duration:0.01ms!important; animation-iteration-count:1!important; }
 }

  /* Toast Notifications */
  #toastContainer {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
    pointer-events: none;
    max-width: 90vw;
  }
  .toast {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.4;
    box-shadow: 0 8px 24px rgba(0,0,0,0.35);
    backdrop-filter: blur(8px);
    animation: toastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.25s, transform 0.25s;
  }
  .toast.error {
    background: rgba(45, 14, 14, 0.95);
    border: 1px solid #ef4444;
    color: #fecaca;
  }
  .toast.warn {
    background: rgba(45, 34, 14, 0.95);
    border: 1px solid #f59e0b;
    color: #fde68a;
  }
  .toast.success {
    background: rgba(14, 45, 24, 0.95);
    border: 1px solid #10b981;
    color: #d1fae5;
  }
  .toast.info {
    background: rgba(15, 30, 50, 0.95);
    border: 1px solid #38bdf8;
    color: #e0f2fe;
  }
  .toast-icon { font-size: 16px; flex-shrink: 0; }
  .toast-msg { word-break: break-word; }
  .toast-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    cursor: pointer;
    font-size: 14px;
    padding: 0 4px;
    margin-left: 6px;
    line-height: 1;
  }
  .toast-close:hover { opacity: 1; }
  @keyframes toastIn {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
