    @font-face {
      font-family: 'Space Grotesk';
      font-style: normal;
      font-weight: 400;
      src: url('/fonts/SpaceGrotesk-400.woff2') format('woff2');
      font-display: swap;
    }
    @font-face {
      font-family: 'Space Grotesk';
      font-style: normal;
      font-weight: 600;
      src: url('/fonts/SpaceGrotesk-600.woff2') format('woff2');
      font-display: swap;
    }
    @font-face {
      font-family: 'Space Grotesk';
      font-style: normal;
      font-weight: 700;
      src: url('/fonts/SpaceGrotesk-700.woff2') format('woff2');
      font-display: swap;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
    }

    body, html {
      width: 100%;
      height: 100dvh;
      overflow: hidden;
      overscroll-behavior: none;
      overscroll-behavior-y: none;
      -webkit-tap-highlight-color: transparent;
      -webkit-text-size-adjust: 100%;
      background: #04060a;
      font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
      color: #e6edf8;
    }

    #webgl-canvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 1;
      display: block;
    }

    /* Full HUD Layer */
    .hud-layer {
      position: absolute;
      inset: 0;
      z-index: 10;
      pointer-events: none;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 0.75rem 1.25rem;
    }

    .interactive {
      pointer-events: auto;
    }

    /* Top HUD (Opponent Bar) */
    .top-bar {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 1rem;
    }

    .brand-pill {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      background: rgba(10, 14, 22, 0.85);
      border: 1px solid rgba(230, 168, 23, 0.35);
      backdrop-filter: blur(14px);
      padding: 0.4rem 0.9rem;
      border-radius: 9999px;
    }
    .brand-title {
      font-size: 1rem;
      font-weight: 700;
      letter-spacing: 0.06em;
      color: #ffd76a;
      text-transform: uppercase;
      text-decoration: none;
    }
    .rules-tag {
      font-size: 0.7rem;
      background: rgba(230, 168, 23, 0.15);
      color: #f7df94;
      padding: 0.15rem 0.45rem;
      border-radius: 4px;
      border: 1px solid rgba(230, 168, 23, 0.3);
      font-weight: 600;
    }

    /* Player Status Cards */
    .player-card {
      display: flex;
      align-items: center;
      gap: 1.25rem;
      background: rgba(10, 15, 24, 0.88);
      border: 1px solid rgba(255, 255, 255, 0.15);
      backdrop-filter: blur(16px);
      border-radius: 0.85rem;
      padding: 0.5rem 1rem;
      box-shadow: 0 10px 25px rgba(0,0,0,0.6);
    }
    .player-card.p1 {
      border-color: rgba(230, 168, 23, 0.5);
    }
    .player-card.p2 {
      border-color: rgba(168, 85, 247, 0.5);
    }
    .player-card.active-turn {
      box-shadow: 0 0 16px rgba(255, 215, 106, 0.45);
      border-color: #ffd76a !important;
    }
    .mode-toggle-btn.hotseat-active {
      background: rgba(168, 85, 247, 0.25);
      border-color: #c084fc;
      color: #e9d5ff;
    }

    .player-info {
      display: flex;
      flex-direction: column;
    }
    .player-name {
      font-size: 0.85rem;
      font-weight: 700;
      color: #fff;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }
    .player-quelled {
      font-size: 0.75rem;
      color: #ffd76a;
      font-weight: 600;
    }

    /* Reward Meter Crystals */
    .reward-meter-group {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.2rem;
    }
    .meter-label {
      font-size: 0.65rem;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: #8da2c0;
    }
    .gem-pips-row {
      display: flex;
      gap: 0.35rem;
    }
    .gem-pip {
      width: 14px;
      height: 14px;
      border-radius: 50%;
      background: rgba(255, 255, 255, 0.12);
      border: 1px solid rgba(255, 255, 255, 0.25);
      transition: all 0.3s ease;
    }
    .gem-pip.lit-p1 {
      background: #ffd76a;
      box-shadow: 0 0 12px #ffd76a, 0 0 20px #e6a817;
      border-color: #fff;
      transform: scale(1.2);
    }
    .gem-pip.lit-p2 {
      background: #c084fc;
      box-shadow: 0 0 12px #c084fc, 0 0 20px #a855f7;
      border-color: #fff;
      transform: scale(1.2);
    }

    .seal-pile-badge {
      display: flex;
      flex-direction: column;
      align-items: center;
      border-left: 1px solid rgba(255, 255, 255, 0.12);
      padding-left: 0.85rem;
    }
    .seal-count {
      font-size: 0.95rem;
      font-weight: 700;
      color: #5bb5d6;
    }
    .seal-label {
      font-size: 0.65rem;
      color: #8da2c0;
      text-transform: uppercase;
    }

    /* Center Match Status Header */
    .center-hud-bar {
      display: flex;
      align-items: center;
      gap: 1.5rem;
      background: rgba(8, 12, 18, 0.9);
      border: 1px solid rgba(91, 181, 214, 0.35);
      backdrop-filter: blur(16px);
      border-radius: 0.85rem;
      padding: 0.45rem 1.4rem;
      box-shadow: 0 8px 30px rgba(0,0,0,0.6);
    }

    .hud-stat {
      display: flex;
      flex-direction: column;
      align-items: center;
    }
    .hud-stat .stat-label {
      font-size: 0.65rem;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #8da2c0;
    }
    .hud-stat .stat-value {
      font-size: 1.05rem;
      font-weight: 700;
      color: #5bb5d6;
    }
    .hud-stat .stat-value.gold {
      color: #ffd76a;
      text-shadow: 0 0 10px rgba(255, 215, 106, 0.4);
    }
    .hud-stat .stat-value.red {
      color: #f43f5e;
      font-weight: 700;
    }

    /* Mode Toggle */
    .mode-toggle-btn {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #f0f4fc;
      padding: 0.35rem 0.85rem;
      border-radius: 9999px;
      font-size: 0.75rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.25s ease;
      display: flex;
      align-items: center;
      gap: 0.35rem;
    }
    .mode-toggle-btn:hover {
      border-color: #5bb5d6;
      background: rgba(91, 181, 214, 0.15);
      color: #5bb5d6;
    }
    .mode-toggle-btn.active {
      border-color: #ffd76a;
      background: rgba(230, 168, 23, 0.2);
      color: #ffd76a;
    }

    /* Bottom Control Bar */
    .bottom-bar {
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
      align-items: center;
      position: fixed !important;
      bottom: 0.35rem !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      z-index: 100 !important;
      pointer-events: none !important;
    }
    .bottom-bar > * {
      pointer-events: auto !important;
    }

        .p1-actions-dock {
      display: inline-flex !important;
      align-items: center !important;
      gap: 0.5rem !important;
      margin-left: 0.5rem !important;
      padding-left: 0.75rem !important;
      border-left: 1px solid rgba(255, 255, 255, 0.18) !important;
    }
    .p1-actions-dock .action-btn {
      padding: 0.3rem 0.85rem !important;
      font-size: 0.78rem !important;
      font-weight: 700 !important;
      border-radius: 9999px !important;
      white-space: nowrap !important;
    }

    .main-controls {
      display: flex;
      align-items: center;
      gap: 0.75rem;
      background: rgba(8, 12, 20, 0.9);
      border: 1px solid rgba(255, 255, 255, 0.18);
      backdrop-filter: blur(18px);
      padding: 0.45rem 1rem;
      border-radius: 9999px;
      box-shadow: 0 15px 40px rgba(0,0,0,0.7);
    }

    .action-btn {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.22);
      color: #f0f4fc;
      padding: 0.45rem 1.15rem;
      border-radius: 9999px;
      font-size: 0.8rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.25s ease;
      display: flex;
      align-items: center;
      gap: 0.4rem;
    }
    .action-btn:hover {
      background: rgba(255, 255, 255, 0.18);
      border-color: #ffd76a;
      color: #ffd76a;
      transform: translateY(-2px);
      box-shadow: 0 4px 15px rgba(255, 215, 106, 0.25);
    }
    .action-btn.clash {
      background: linear-gradient(135deg, #f43f5e, #be123c);
      color: #fff;
      border-color: #fda4af;
      font-weight: 700;
      box-shadow: 0 4px 15px rgba(244, 63, 94, 0.35);
    }
    .action-btn.clash:hover {
      background: linear-gradient(135deg, #fb7185, #f43f5e);
      box-shadow: 0 6px 20px rgba(244, 63, 94, 0.6);
    }
    .action-btn.end-turn {
      background: linear-gradient(135deg, #e6a817, #d48b0a);
      color: #06080d;
      border-color: #ffd76a;
      font-weight: 700;
    }
    .action-btn.end-turn:hover {
      background: linear-gradient(135deg, #ffd76a, #e6a817);
      box-shadow: 0 6px 20px rgba(230, 168, 23, 0.5);
    }

    /* Hand Dock (Bottom) */
    .hand-dock {
      display: flex;
      justify-content: center;
      gap: 0.85rem;
      padding: 0.6rem 1.25rem;
      background: rgba(8, 12, 18, 0.85);
      border: 1px solid rgba(230, 168, 23, 0.35);
      backdrop-filter: blur(20px);
      border-radius: 1.25rem;
      max-width: 92vw;
      box-shadow: 0 15px 50px rgba(0,0,0,0.8);
      min-height: 185px;
      align-items: flex-end;
    }

    .hand-card-el {
      width: 120px;
      height: 170px;
      background: linear-gradient(160deg, #162030 0%, #0c121d 100%);
      border: 1px solid rgba(91, 181, 214, 0.45);
      border-radius: 0.65rem;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      padding: 0.55rem;
      cursor: grab;
      transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, border-color 0.25s ease;
      position: relative;
      touch-action: none;
    }
    .hand-card-el:hover {
      transform: translateY(-24px) scale(1.1);
      border-color: #ffd76a;
      box-shadow: 0 20px 35px rgba(0,0,0,0.9), 0 0 20px rgba(255, 215, 106, 0.5);
      z-index: 30;
    }
    .hand-card-el.dragging {
      opacity: 0.25;
      cursor: grabbing;
    }
    .hand-card-el.aeon {
      border-color: rgba(56, 189, 248, 0.45);
      background: linear-gradient(160deg, #0c1b2b 0%, #050a12 100%);
      border-radius: 8px;
    }
    .hand-card-el.aeon:hover {
      border-color: #38bdf8;
      box-shadow: 0 20px 35px rgba(0,0,0,0.9), 0 0 20px rgba(56, 189, 248, 0.5);
    }
    .hand-card-el.relic {
      border-color: rgba(245, 158, 11, 0.55);
      background: linear-gradient(160deg, #241706 0%, #0c0802 100%);
      clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 8px, 100% calc(100% - 8px), calc(100% - 8px) 100%, 8px 100%, 0 calc(100% - 8px), 0 8px);
    }
    .hand-card-el.relic:hover {
      border-color: #f59e0b;
      box-shadow: 0 20px 35px rgba(0,0,0,0.9), 0 0 20px rgba(245, 158, 11, 0.5);
    }
    .hand-card-el.arcana {
      border-color: rgba(192, 132, 252, 0.55);
      background: linear-gradient(160deg, #1c0d2e 0%, #080212 100%);
      clip-path: polygon(50% 0, 100% 8px, 100% 100%, 0 100%, 0 8px);
    }
    .hand-card-el.arcana:hover {
      border-color: #c084fc;
      box-shadow: 0 20px 35px rgba(0,0,0,0.9), 0 0 20px rgba(192, 132, 252, 0.5);
    }
    .hand-card-el.talent {
      border-color: rgba(255, 215, 106, 0.7);
      background: linear-gradient(160deg, #2b1f0c 0%, #120c04 100%);
      border-radius: 6px;
    }
    .hand-card-el.talent:hover {
      border-color: #ffd76a;
      box-shadow: 0 20px 35px rgba(0,0,0,0.9), 0 0 20px rgba(255, 215, 106, 0.5);
    }
    .hand-card-el.buffering-selected {
      border-color: #ffd76a !important;
      box-shadow: 0 0 25px rgba(255, 215, 106, 0.75), 0 0 5px #ffd76a !important;
      transform: translateY(-24px) scale(1.06);
    }
    .buffer-check-badge {
      position: absolute;
      top: -10px;
      right: -8px;
      padding: 0.15rem 0.5rem;
      border-radius: 9999px;
      background: linear-gradient(135deg, #ffd76a, #e6a817);
      color: #06080d;
      font-weight: 800;
      font-size: 0.7rem;
      letter-spacing: 0.04em;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 4px 12px rgba(0,0,0,0.7), 0 0 10px rgba(255, 215, 106, 0.5);
      border: 1px solid #fff;
      display: none;
      z-index: 40;
    }
    .hand-card-el.buffering-selected .buffer-check-badge {
      display: flex;
    }

    .card-head {
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .card-pot-badge, .card-float-badge {
      background: #090e17;
      color: #38bdf8;
      font-weight: 800;
      font-size: 0.8rem;
      width: 24px;
      height: 24px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 6px rgba(0,0,0,0.6);
      border: 1.5px solid #38bdf8;
    }
    .hand-card-el.relic .card-float-badge {
      border-radius: 4px;
    }
    .hand-card-el.arcana .card-float-badge {
      border-radius: 4px;
    }
    .hand-card-el.talent .card-float-badge {
      border-color: #ffd76a;
      color: #ffd76a;
    }

    .card-waell-tray {
      display: flex;
      align-items: center;
      gap: 5px;
      margin: 0.2rem 0;
    }
    .waell-socket-dot {
      width: 11px;
      height: 11px;
      border-radius: 50%;
      transition: all 0.2s ease;
    }
    .waell-socket-dot.empty {
      background: #090e17;
      border: 1.5px solid rgba(56, 189, 248, 0.35);
    }
    .waell-socket-dot.filled {
      background: radial-gradient(circle at 35% 35%, #ffffff 0%, #38bdf8 55%, #0369a1 100%);
      box-shadow: 0 0 7px #38bdf8;
      border: 1px solid #7dd3fc;
    }
    .card-type-lbl {
      font-size: 0.6rem;
      text-transform: uppercase;
      font-weight: 600;
      color: #8da2c0;
    }
    .card-title-lbl {
      font-size: 0.75rem;
      font-weight: 700;
      color: #fff;
      line-height: 1.2;
      margin: 0.35rem 0;
    }
    .card-kw-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0.2rem;
    }
    .card-kw-tag {
      font-size: 0.55rem;
      text-transform: uppercase;
      background: rgba(91, 181, 214, 0.2);
      color: #5bb5d6;
      padding: 0.1rem 0.3rem;
      border-radius: 3px;
      font-weight: 600;
    }
    .drag-prompt-hint {
      font-size: 0.6rem;
      color: rgba(255, 255, 255, 0.4);
      text-align: center;
      margin-top: 0.2rem;
    }

    /* In-Scene Floating Rift Recruitment Banner */
    #rift-calling-banner {
      position: absolute;
      top: 9.75rem;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(14, 20, 32, 0.92);
      border: 1px solid #ffd76a;
      backdrop-filter: blur(16px);
      border-radius: 9999px;
      padding: 0.5rem 1.4rem;
      z-index: 130;
      box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 20px rgba(255, 215, 106, 0.35);
      display: flex;
      align-items: center;
      gap: 1.25rem;
      pointer-events: auto;
      animation: bannerSlideDown 0.3s ease;
    }
    @keyframes bannerSlideDown {
      from { opacity: 0; transform: translate(-50%, -15px); }
      to { opacity: 1; transform: translate(-50%, 0); }
    }
    .banner-title {
      font-weight: 700;
      color: #ffd76a;
      font-size: 0.85rem;
    }
    .banner-tally {
      font-size: 0.75rem;
      color: #cbd5e1;
    }
    .banner-btn-cancel {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #f87171;
      padding: 0.25rem 0.65rem;
      border-radius: 9999px;
      font-size: 0.7rem;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .banner-btn-cancel:hover {
      background: rgba(248, 113, 113, 0.2);
      border-color: #f87171;
    }

    /* Arcana Targeting Mode Floating Banner */
    #arcana-targeting-banner {
      position: absolute;
      top: 9.75rem;
      left: 50%;
      transform: translateX(-50%);
      background: rgba(26, 12, 42, 0.95);
      border: 1.5px solid #c084fc;
      backdrop-filter: blur(16px);
      border-radius: 9999px;
      padding: 0.55rem 1.4rem;
      z-index: 135;
      box-shadow: 0 10px 30px rgba(0,0,0,0.85), 0 0 25px rgba(192, 132, 252, 0.45);
      display: flex;
      align-items: center;
      gap: 1.25rem;
      pointer-events: auto;
      animation: bannerSlideDown 0.3s ease;
    }
    .banner-btn-cancel:hover {
      background: rgba(248, 113, 113, 0.2);
      border-color: #f87171;
    }

    /* Zone Inspector Drawer (Forgotten / Lost Piles) */
    #zone-inspector-drawer {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 780px;
      max-width: 92vw;
      max-height: 85vh;
      background: rgba(10, 15, 24, 0.96);
      border: 1px solid rgba(91, 181, 214, 0.5);
      backdrop-filter: blur(25px);
      border-radius: 1rem;
      padding: 1.25rem;
      z-index: 1000;
      box-shadow: 0 25px 60px rgba(0,0,0,0.9);
      pointer-events: auto;
      flex-direction: column;
    }
    .inspector-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-bottom: 1px solid rgba(255, 255, 255, 0.12);
      padding-bottom: 0.4rem;
      margin-bottom: 0.75rem;
    }
    .inspector-title {
      font-size: 0.95rem;
      font-weight: 700;
      color: #ffd76a;
    }
    .inspector-close {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.2);
      color: #cbd5e1;
      padding: 0.2rem 0.6rem;
      border-radius: 9999px;
      font-size: 0.75rem;
      cursor: pointer;
    }
    .inspector-close:hover {
      background: rgba(255, 255, 255, 0.2);
      color: #fff;
    }
    .inspector-cards-list {
      display: flex;
      gap: 0.75rem;
      overflow-x: auto;
      padding-bottom: 0.5rem;
      min-height: 120px;
    }

    /* Play-by-Play Combat Breakdown Drawer */
    #play-by-play-drawer {
      position: absolute;
      top: 50%;
      left: 50%;
      transform: translate(-50%, -50%);
      width: 760px;
      max-width: 92vw;
      background: rgba(10, 15, 26, 0.96);
      border: 1.5px solid rgba(56, 189, 248, 0.6);
      backdrop-filter: blur(24px);
      border-radius: 1rem;
      padding: 1.25rem 1.5rem;
      z-index: 150;
      box-shadow: 0 25px 60px rgba(0,0,0,0.9), 0 0 35px rgba(56, 189, 248, 0.25);
      pointer-events: auto;
    }
    .pbp-lane-card {
      background: rgba(15, 23, 42, 0.85);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 0.75rem;
      padding: 0.75rem 1rem;
    }
    .pbp-lane-header {
      font-weight: 700;
      font-size: 0.85rem;
      color: #ffd76a;
      border-bottom: 1px solid rgba(255, 255, 255, 0.08);
      padding-bottom: 0.35rem;
      margin-bottom: 0.5rem;
      display: flex;
      justify-content: space-between;
    }
    .pbp-step-item {
      font-size: 0.78rem;
      color: #cbd5e1;
      padding: 0.25rem 0;
      display: flex;
      align-items: flex-start;
      gap: 0.5rem;
      line-height: 1.4;
    }
    .pbp-step-badge {
      font-size: 0.65rem;
      font-weight: 700;
      text-transform: uppercase;
      padding: 0.1rem 0.4rem;
      border-radius: 4px;
      white-space: nowrap;
    }
    .pbp-badge-impart { background: rgba(56, 189, 248, 0.2); color: #38bdf8; border: 1px solid rgba(56, 189, 248, 0.4); }
    .pbp-badge-clash { background: rgba(244, 63, 94, 0.2); color: #f43f5e; border: 1px solid rgba(244, 63, 94, 0.4); }
    .pbp-badge-absorb { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }
    .pbp-badge-reward { background: rgba(230, 168, 23, 0.2); color: #ffd76a; border: 1px solid rgba(230, 168, 23, 0.4); }

    /* Initiative Top Banner */
    .call-right-badge {
      font-size: 0.75rem;
      font-weight: 700;
      letter-spacing: 0.05em;
      padding: 0.35rem 0.85rem;
      border-radius: 9999px;
      display: flex;
      align-items: center;
      gap: 0.4rem;
      transition: all 0.3s ease;
    }
    .call-right-badge.p1 {
      color: #ffd76a;
      border: 1px solid rgba(255, 215, 106, 0.4);
      background: rgba(230, 168, 23, 0.15);
      box-shadow: 0 0 15px rgba(255, 215, 106, 0.2);
    }
    .call-right-badge.p2 {
      color: #c084fc;
      border: 1px solid rgba(192, 132, 252, 0.4);
      background: rgba(168, 85, 247, 0.15);
      box-shadow: 0 0 15px rgba(192, 132, 252, 0.2);
    }

    /* Undo Button styling */
    .action-btn.undo:disabled {
      opacity: 0.3;
      cursor: not-allowed;
      border-color: rgba(255, 255, 255, 0.1);
      box-shadow: none;
      transform: none;
    }

    /* Floating Tooltip */
    #tooltip-popup {
      position: absolute;
      z-index: 9999;
      pointer-events: none;
      background: rgba(10, 15, 25, 0.96);
      border: 1px solid #ffd76a;
      backdrop-filter: blur(20px);
      border-radius: 0.75rem;
      padding: 0.85rem 1.15rem;
      width: 320px;
      box-shadow: 0 15px 40px rgba(0,0,0,0.85), 0 0 25px rgba(255, 215, 106, 0.35);
      display: none;
      font-size: 0.8rem;
      line-height: 1.4;
      transition: opacity 0.15s ease;
    }
    .tt-title {
      font-size: 0.95rem;
      font-weight: 700;
      color: #ffd76a;
      margin-bottom: 0.2rem;
    }
    .tt-type {
      font-size: 0.65rem;
      text-transform: uppercase;
      font-weight: 600;
      color: #8da2c0;
      margin-bottom: 0.5rem;
    }
    .tt-stat-row {
      display: flex;
      justify-content: space-between;
      border-top: 1px solid rgba(255, 255, 255, 0.12);
      border-bottom: 1px solid rgba(255, 255, 255, 0.12);
      padding: 0.4rem 0;
      margin: 0.4rem 0;
    }
    .tt-stat-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 0.1rem;
    }
    .tt-stat-item .lbl {
      font-size: 0.55rem;
      color: #8da2c0;
      text-transform: uppercase;
      font-weight: 600;
    }
    .tt-stat-item .val {
      font-size: 0.85rem;
      font-weight: 700;
      color: #fff;
    }
    .tt-stat-item .val.power {
      color: #f43f5e;
      font-weight: 800;
    }
    .tt-stat-item .val.highlight {
      color: #ffd76a;
    }
    .tt-stat-item .val.cae {
      color: #5bb5d6;
    }
    .tt-text {
      color: #cbd5e1;
      font-size: 0.75rem;
      margin-top: 0.35rem;
    }
    .tt-kw-box {
      margin-top: 0.5rem;
      background: rgba(255, 215, 106, 0.1);
      border-left: 2px solid #ffd76a;
      padding: 0.3rem 0.5rem;
      font-size: 0.7rem;
      color: #fef08a;
    }

    /* Embedded Combat Feed Ticker (inside Playtest Tools Drawer) */
    .combat-feed {
      width: 100%;
      max-height: 190px;
      min-height: 130px;
      background: rgba(6, 9, 15, 0.92);
      border: 1px solid rgba(91, 181, 214, 0.25);
      border-radius: 0.55rem;
      padding: 0.6rem 0.7rem;
      overflow-y: auto;
      font-size: 0.72rem;
      line-height: 1.4;
      display: flex;
      flex-direction: column;
      gap: 0.3rem;
      scrollbar-width: thin;
      pointer-events: auto;
    }
    .feed-title {
      font-weight: 700;
      color: #5bb5d6;
      text-transform: uppercase;
      font-size: 0.65rem;
      letter-spacing: 0.05em;
      border-bottom: 1px solid rgba(255, 255, 255, 0.1);
      padding-bottom: 0.25rem;
      margin-bottom: 0.2rem;
    }
    .feed-msg { color: #cbd5e1; }
    .feed-msg.combat { color: #f43f5e; font-weight: 600; }
    .feed-msg.highlight { color: #ffd76a; font-weight: 600; }

    /* Dragging Ghost */
    #drag-ghost {
      position: fixed;
      width: 110px;
      height: 155px;
      border: 2px solid #ffd76a;
      border-radius: 0.6rem;
      background: rgba(22, 32, 48, 0.85);
      backdrop-filter: blur(8px);
      box-shadow: 0 15px 35px rgba(0,0,0,0.8), 0 0 25px rgba(255, 215, 106, 0.6);
      pointer-events: none;
      z-index: 1000;
      display: none;
      transform: translate(-50%, -50%);
      padding: 0.5rem;
    }

    /* Multiplayer & Lobby Modal */
    .net-modal-backdrop {
      position: fixed;
      inset: 0;
      background: rgba(4, 6, 10, 0.82);
      backdrop-filter: blur(12px);
      display: none;
      align-items: center;
      justify-content: center;
      z-index: 500;
      pointer-events: auto;
    }
    .net-modal-card {
      background: #090e18;
      border: 1.5px solid rgba(56, 189, 248, 0.45);
      border-radius: 1rem;
      width: 94%;
      max-width: 580px;
      max-height: 88vh;
      overflow-y: auto;
      padding: 1.5rem;
      color: #e6edf8;
      box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(56, 189, 248, 0.25);
    }
    .net-input {
      background: rgba(15, 23, 42, 0.8);
      border: 1px solid rgba(255, 255, 255, 0.2);
      border-radius: 0.5rem;
      padding: 0.5rem 0.85rem;
      color: #fff;
      font-family: inherit;
      font-size: 0.9rem;
      outline: none;
    }
    .net-input:focus {
      border-color: #38bdf8;
      box-shadow: 0 0 10px rgba(56, 189, 248, 0.3);
    }

    /* Chat & Emotes Drawer */
    #chat-drawer {
      position: fixed;
      top: 4.8rem;
      right: 1.2rem;
      width: 320px;
      height: 440px;
      max-height: 65vh;
      background: rgba(9, 14, 24, 0.94);
      border: 1.5px solid rgba(192, 132, 252, 0.35);
      border-radius: 1rem;
      backdrop-filter: blur(18px);
      z-index: 450;
      display: none;
      flex-direction: column;
      box-shadow: 0 15px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(192, 132, 252, 0.2);
      pointer-events: auto;
    }
    .chat-messages-box {
      flex: 1;
      overflow-y: auto;
      padding: 0.75rem;
      display: flex;
      flex-direction: column;
      gap: 0.45rem;
      font-size: 0.82rem;
    }
    .chat-msg {
      background: rgba(255, 255, 255, 0.04);
      border-radius: 0.45rem;
      padding: 0.35rem 0.55rem;
      border-left: 2px solid #c084fc;
    }
    .chat-msg.mine {
      border-left-color: #ffd76a;
      background: rgba(255, 215, 106, 0.05);
    }

    /* Floating Toast */
    #toast-notification {
      position: fixed;
      top: 1.25rem;
      left: 50%;
      transform: translateX(-50%) translateY(-20px);
      background: rgba(15, 23, 42, 0.96);
      border: 1.5px solid #38bdf8;
      color: #fff;
      padding: 0.55rem 1.35rem;
      border-radius: 9999px;
      z-index: 1200;
      font-size: 0.85rem;
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 0.5rem;
      box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 20px rgba(56, 189, 248, 0.4);
      pointer-events: none;
      opacity: 0;
      transition: opacity 0.25s ease, transform 0.25s ease;
    }
    #toast-notification.show {
      opacity: 1;
      transform: translateX(-50%) translateY(0);
    }

    /* Card Subtypes & Strain Pill in 2D Hand Dock */
    .card-subtypes-lbl {
      font-size: 0.56rem;
      font-weight: 600;
      color: #cbd5e1;
      line-height: 1.15;
      margin-bottom: 0.25rem;
      opacity: 0.9;
    }
    .card-strain-pill {
      font-size: 0.52rem;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      padding: 0.08rem 0.35rem;
      border-radius: 9999px;
      border: 1px solid rgba(255, 255, 255, 0.35);
      color: #fff;
      display: inline-block;
    }

    /* Consolidated Playtest Tools Slide-Out Drawer */
    #playtest-tools-drawer {
      position: fixed;
      top: 4.5rem;
      right: 1.25rem;
      width: 350px;
      max-width: 92vw;
      max-height: calc(100dvh - 10rem); overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
      overflow-y: auto;
      background: linear-gradient(165deg, rgba(12, 18, 30, 0.97), rgba(6, 9, 16, 0.98));
      border: 1.5px solid rgba(255, 215, 106, 0.55);
      backdrop-filter: blur(22px);
      border-radius: 1rem;
      z-index: 220;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 30px rgba(255, 215, 106, 0.2);
      display: none;
      flex-direction: column;
      pointer-events: auto;
      animation: ptDrawerIn 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    }
    #playtest-tools-drawer.open {
      display: flex !important;
    }
    @keyframes ptDrawerIn {
      from { opacity: 0; transform: translateX(24px); }
      to { opacity: 1; transform: translateX(0); }
    }
    .pt-drawer-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.75rem 1rem;
      border-bottom: 1px solid rgba(255, 215, 106, 0.22);
      background: rgba(255, 215, 106, 0.06);
    }
    .pt-drawer-title {
      font-size: 0.88rem;
      font-weight: 800;
      color: #ffd76a;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      display: flex;
      align-items: center;
      gap: 0.45rem;
    }
    .pt-drawer-body {
      padding: 0.85rem 1rem;
      display: flex;
      flex-direction: column;
      gap: 0.85rem;
    }
    .pt-section {
      background: rgba(15, 23, 42, 0.65);
      border: 1px solid rgba(255, 255, 255, 0.1);
      border-radius: 0.65rem;
      padding: 0.65rem 0.75rem;
      display: flex;
      flex-direction: column;
      gap: 0.5rem;
    }
    .pt-section-label {
      font-size: 0.68rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.06em;
      color: #94a3b8;
    }
    .pt-btn-grid {
      display: flex;
      flex-wrap: wrap;
      gap: 0.45rem;
    }
    .pt-select {
      background: rgba(8, 12, 20, 0.95);
      border: 1px solid rgba(255, 215, 106, 0.35);
      color: #e2e8f0;
      border-radius: 0.45rem;
      padding: 0.35rem 0.5rem;
      font-family: inherit;
      font-size: 0.75rem;
      font-weight: 600;
      flex: 1;
    }
    /* Liquid Glass Queller Floating HUD Pills (z >= 4dp Functional Layer) */
    .queller-hud-pill {
      display: inline-flex;
      align-items: center;
      gap: 0.35rem;
      padding: 0.22rem 0.65rem;
      border-radius: 9999px;
      font-family: inherit;
      font-size: 0.68rem;
      font-weight: 700;
      letter-spacing: 0.02em;
      cursor: pointer;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.14);
      transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    }
    .queller-hud-pill.flourish {
      color: #ffd76a;
      background: rgba(230, 168, 23, 0.16);
      border: 1px solid rgba(255, 215, 106, 0.45);
    }
    .queller-hud-pill.ability {
      color: #67e8f9;
      background: rgba(6, 182, 212, 0.16);
      border: 1px solid rgba(56, 189, 248, 0.45);
    }
    .queller-hud-pill:not(:disabled):hover,
    .queller-hud-pill:not(:disabled):focus-visible {
      transform: translateY(-1px);
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45), 0 0 12px rgba(255, 215, 106, 0.28);
      outline: none;
    }
    .queller-hud-pill.targeting-active {
      background: rgba(16, 185, 129, 0.24);
      border-color: rgba(52, 211, 153, 0.85);
      color: #a7f3d0;
      box-shadow: 0 0 14px rgba(16, 185, 129, 0.38);
    }
    .queller-hud-pill:disabled {
      opacity: 0.42;
      cursor: not-allowed;
      filter: grayscale(0.5);
      box-shadow: none;
      transform: none;
    }
  
    
    
    
    /* ==========================================================================
       RESPONSIVE MOBILE & TABLET LAYOUT ENGINE (Marvel Snap & Hearthstone Style)
       ========================================================================== */

    html, body {
      width: 100%;
      height: 100dvh;
      overflow: hidden;
      overscroll-behavior: none;
      overscroll-behavior-y: none;
      -webkit-tap-highlight-color: transparent;
      -webkit-text-size-adjust: 100%;
      margin: 0;
      padding: 0;
      touch-action: manipulation;
    }

    /* Base hand dock container */
    .hand-dock {
      overflow-x: auto;
      overflow-y: hidden;
      -webkit-overflow-scrolling: touch;
      touch-action: pan-x;
      scrollbar-width: none;
    }
    .hand-dock::-webkit-scrollbar {
      display: none;
    }

    /* TABLET (max-width: 1024px) */
    @media (max-width: 1024px) {
      .hud-layer {
        padding: 0.5rem 0.75rem;
      }
      .brand-title {
        font-size: 0.82rem;
      }
      .rules-tag {
        font-size: 0.6rem;
        padding: 0.1rem 0.35rem;
      }
      .call-right-badge {
        font-size: 0.68rem;
        padding: 0.2rem 0.55rem;
      }
      .center-hud-bar {
        gap: 0.5rem;
        padding: 0.25rem 0.75rem;
      }
      .hud-stat .stat-label {
        font-size: 0.55rem;
      }
      .hud-stat .stat-value {
        font-size: 0.8rem;
      }
      .player-card {
        padding: 0.25rem 0.6rem;
        gap: 0.6rem;
      }
      .player-name {
        font-size: 0.75rem;
      }
      .player-quelled {
        font-size: 0.65rem;
      }
      .main-controls {
        gap: 0.4rem;
        padding: 0.3rem 0.75rem;
      }
      .action-btn {
        padding: 0.35rem 0.75rem;
        font-size: 0.75rem;
      }
      .hand-dock {
        min-height: 140px;
        max-width: 96vw;
        padding: 0.4rem 0.65rem;
        gap: 0.6rem;
      }
      .hand-card-el {
        width: 95px;
        height: 135px;
        padding: 0.4rem;
        flex-shrink: 0;
      }
    }

    /* ALL MOBILE PHONES & PORTRAIT TABLETS (max-width: 768px) */
    @media (max-width: 768px) {
      .hud-layer {
        padding: 0.3rem 0.4rem !important;
        justify-content: space-between !important;
      }

      /* 1. TOP HEADER: Responsive stacking and scaling cleanly delegated to design-system.css?v=1.8.12 */
      .top-bar {
        width: 100% !important;
      }

      /* 2. BOTTOM CONTROLS & HAND CARDS: Responsive stacking cleanly delegated to design-system.css?v=1.8.12 */
      .bottom-bar {
        position: fixed !important;
        bottom: 0.35rem !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: auto !important;
        max-width: calc(100vw - 0.7rem) !important;
        gap: 0.25rem !important;
      }
      .bottom-controls-row {
        width: 100% !important;
        max-width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 0.25rem !important;
      }

      /* Hand Dock: Canonical scaling delegated to design-system.css + arena.js */
      .hand-dock {
        max-width: 100vw !important;
        width: 100% !important;
        padding: 0.25rem 0.45rem !important;
        gap: 0.4rem !important;
        border-radius: 0.65rem !important;
      }
      .card-head {
        margin-bottom: 0.08rem !important;
      }
      .card-type-lbl {
        font-size: 0.48rem !important;
      }
      .card-strain-pill {
        display: none !important;
      }
      .card-float-badge {
        width: 17px !important;
        height: 17px !important;
        font-size: 0.6rem !important;
        border-width: 1px !important;
      }
      .card-title-lbl {
        font-size: 0.58rem !important;
        line-height: 1.1 !important;
        margin: 0.1rem 0 !important;
      }
      .card-subtypes-lbl {
        display: none !important;
      }
      .card-kw-row {
        gap: 0.08rem !important;
      }
      .card-kw-tag {
        font-size: 0.44rem !important;
        padding: 0.03rem 0.15rem !important;
      }
      .card-waell-tray {
        gap: 2px !important;
        margin: 0.08rem 0 !important;
      }
      .waell-socket-dot {
        width: 6px !important;
        height: 6px !important;
      }
      .drag-prompt-hint {
        font-size: 0.44rem !important;
        margin-top: 0.05rem !important;
      }

      /* Playtest Drawer Responsive Width */
      #playtest-tools-drawer {
        width: calc(100vw - 1rem) !important;
        max-width: 320px !important;
        top: 3.2rem !important;
        right: 0.5rem !important;
        max-height: calc(100dvh - 4.5rem) !important;
      }
    }

  
    /* ==========================================================================
       Replay Theater: Collapsible Left Drawer & Replay Control Dock
       ========================================================================== */
    
    /* Collapsible Left Drawer: Turn State Inspector */
    #jev-inspector-drawer {
      position: fixed;
      top: 4.5rem;
      left: 1.25rem;
      width: 380px;
      max-width: 90vw;
      max-height: calc(100dvh - 10.5rem); overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
      overflow-y: auto;
      background: linear-gradient(165deg, rgba(12, 16, 28, 0.96), rgba(6, 8, 16, 0.98));
      border: 1.5px solid rgba(168, 85, 247, 0.5);
      backdrop-filter: blur(24px);
      border-radius: 1rem;
      z-index: 230;
      box-shadow: 0 24px 60px rgba(0, 0, 0, 0.9), 0 0 35px rgba(168, 85, 247, 0.25);
      display: none;
      flex-direction: column;
      pointer-events: auto;
      transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1);
      transform: translateX(0);
      opacity: 1;
    }

    #jev-inspector-drawer.collapsed {
      transform: translateX(calc(-100% - 1.5rem)) !important;
      opacity: 0 !important;
      pointer-events: none !important;
    }

    .jev-drawer-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 0.75rem 1rem;
      border-bottom: 1px solid rgba(168, 85, 247, 0.25);
      background: rgba(168, 85, 247, 0.08);
    }

    .jev-drawer-title {
      font-size: 0.88rem;
      font-weight: 800;
      letter-spacing: 0.05em;
      color: #e9d5ff;
      display: flex;
      align-items: center;
      gap: 0.5rem;
    }

    .jev-drawer-body {
      padding: 0.85rem;
      display: flex;
      flex-direction: column;
      gap: 0.75rem;
    }

    .jev-card {
      background: rgba(255, 255, 255, 0.035);
      border: 1px solid rgba(255, 255, 255, 0.08);
      border-radius: 0.65rem;
      padding: 0.65rem 0.8rem;
    }

    .jev-card-header {
      font-size: 0.68rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: #94a3b8;
      margin-bottom: 0.4rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }

    .jev-prob-bar-container {
      display: flex;
      flex-direction: column;
      gap: 0.4rem;
      margin-top: 0.35rem;
    }

    .jev-prob-row {
      display: flex;
      flex-direction: column;
      gap: 0.15rem;
      background: rgba(255, 255, 255, 0.02);
      border: 1px solid rgba(255, 255, 255, 0.05);
      padding: 0.35rem 0.5rem;
      border-radius: 0.4rem;
      transition: all 0.15s ease;
    }

    .jev-prob-row.chosen {
      background: rgba(168, 85, 247, 0.15);
      border-color: rgba(168, 85, 247, 0.55);
    }

    .jev-prob-header {
      display: flex;
      justify-content: space-between;
      font-size: 0.75rem;
      font-weight: 700;
    }

    .jev-prob-bar-track {
      width: 100%;
      height: 6px;
      background: rgba(255, 255, 255, 0.08);
      border-radius: 3px;
      overflow: hidden;
    }

    .jev-prob-bar-fill {
      height: 100%;
      background: linear-gradient(90deg, #a855f7, #c084fc);
      border-radius: 3px;
      transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .jev-prob-row.chosen .jev-prob-bar-fill {
      background: linear-gradient(90deg, #38bdf8, #818cf8);
    }

    .jev-chip {
      display: inline-block;
      padding: 0.15rem 0.45rem;
      font-size: 0.68rem;
      font-weight: 600;
      border-radius: 4px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.15);
      color: #e2e8f0;
      margin: 0.1rem;
    }

    /* Floating Tab to expand drawer when collapsed */
    #btn-expand-jev-drawer {
      position: fixed;
      top: 5rem;
      left: 1rem;
      z-index: 229;
      background: rgba(12, 16, 28, 0.95);
      border: 1.5px solid rgba(168, 85, 247, 0.6);
      color: #e9d5ff;
      border-radius: 0.5rem;
      padding: 0.45rem 0.75rem;
      font-size: 0.78rem;
      font-weight: 700;
      display: none;
      align-items: center;
      gap: 0.45rem;
      box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6), 0 0 14px rgba(168, 85, 247, 0.3);
      cursor: pointer;
      pointer-events: auto;
    }
    #btn-expand-jev-drawer:hover {
      background: rgba(24, 32, 54, 0.98);
      border-color: #c084fc;
    }

    /* Replay Control Dock (Bottom Center) */
    #replay-control-dock {
      display: none;
      flex-direction: column;
      gap: 0.5rem;
      background: rgba(10, 14, 24, 0.96);
      border: 1.5px solid rgba(168, 85, 247, 0.45);
      backdrop-filter: blur(18px);
      border-radius: 0.9rem;
      padding: 0.6rem 1rem;
      box-shadow: 0 12px 40px rgba(0, 0, 0, 0.85), 0 0 25px rgba(168, 85, 247, 0.2);
      max-width: 860px;
      width: 94vw;
      margin: 0 auto;
      pointer-events: auto;
      z-index: 200;
    }

    .replay-scrubber-row {
      display: flex;
      align-items: center;
      gap: 0.8rem;
    }

    #replay-scrubber {
      flex: 1;
      height: 8px;
      accent-color: #a855f7;
      cursor: pointer;
    }

    .replay-btn-cluster {
      display: flex;
      align-items: center;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 0.5rem;
    }

    .replay-nav-group {
      display: flex;
      align-items: center;
      gap: 0.3rem;
    }

    .replay-nav-btn {
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.18);
      color: #f1f5f9;
      font-size: 0.82rem;
      font-weight: 700;
      padding: 0.3rem 0.6rem;
      border-radius: 6px;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: all 0.15s ease;
      font-family: inherit;
    }

    .replay-nav-btn:hover {
      background: rgba(168, 85, 247, 0.25);
      border-color: rgba(168, 85, 247, 0.55);
      color: #fff;
    }

    .replay-nav-btn.primary {
      background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(126, 34, 206, 0.4));
      border-color: #c084fc;
      color: #fff;
      padding: 0.3rem 0.8rem;
    }

    @media (max-width: 768px) {
      #jev-inspector-drawer {
        width: calc(100vw - 1rem) !important;
        left: 0.5rem !important;
        top: 5.6rem !important;
        max-height: calc(100dvh - 8rem) !important;
      }
      #replay-control-dock {
        width: 98vw !important;
        padding: 0.4rem 0.6rem !important;
      }
    }

  
    /* Nav placement cleanly unified in design-system.css */
    .patrons-nav-links { gap: 0.95rem; }
    @media (min-width: 768px) and (max-width: 899px) {
      .patrons-nav-links { display: none !important; }
      .patrons-mobile-nav { display: flex !important; }
    }
    @media (min-width: 900px) {
      .patrons-nav-links { display: flex !important; }
      .patrons-mobile-nav { display: none !important; }
    }
    @media (min-width: 1080px) { .patrons-nav-links { gap: 1.35rem; } }
    @media (min-width: 1240px) { .patrons-nav-links { gap: 1.65rem; } }
    @media (max-width: 599px) {
      .patrons-mobile-nav { position: relative !important; left: auto !important; transform: none !important; }
    }
    .patrons-nav-right { gap: 0.4rem !important; }
    @media (min-width: 640px) { .patrons-nav-right { gap: 0.55rem !important; } }
    .patrons-cta-secondary {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 0.3rem;
      padding: 0.34rem 0.68rem;
      border-radius: 9999px;
      background: rgba(255, 255, 255, 0.07);
      color: #F3F4F6 !important;
      font-family: 'Sequel Sans', -apple-system, BlinkMacSystemFont, sans-serif;
      font-weight: 600;
      font-size: 0.6875rem;
      line-height: 1;
      text-decoration: none;
      border: 1px solid rgba(255, 255, 255, 0.22);
      box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
      transition: all 0.2s ease;
      white-space: nowrap;
      cursor: pointer;
    }
    @media (min-width: 640px) {
      .patrons-cta-secondary { gap: 0.35rem; padding: 0.43rem 0.95rem; font-size: 0.75rem; }
    }
    .patrons-cta-secondary:hover {
      background: rgba(255, 255, 255, 0.14);
      border-color: rgba(245, 194, 66, 0.55);
      color: #FFFFFF !important;
      transform: scale(1.03);
    }
    .patrons-cta-secondary:active { transform: scale(0.96); }

/* ============================================================================
   BAEOND WEB ARENA v2 — DESIGN CANON OVERRIDES (ITERATION 5 SLEEK FINAL LOCK)
   Sovereign Posture (>= 85% canvas), 9-Sliced Figma Nameplates (Full-Size 1:1
   Emblems), Deeper 3D Recessed Card-Pocket Wells (0% bleed), On-Board Planeswalker
   Queller Tray, Breathable 2-Row Mobile Rail, Strict Zero Glass-on-Glass.
   ============================================================================ */

/* Hide old stacked marketing site bar on active Arena canvas; folded into Site Menu popover */
header.patrons-nav-wrapper.prototype-patrons-nav,
.prototype-patrons-nav {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* 1. Sovereign Single Desktop Top Rail (44px) */
#top-phase-timeline.horizontal-phase-timeline {
  position: fixed !important;
  top: max(8px, env(safe-area-inset-top)) !important;
  left: 16px !important;
  right: 16px !important;
  width: auto !important;
  height: 44px !important;
  min-height: 44px !important;
  transform: none !important;
  padding: 0 14px !important;
  border-radius: 9999px !important;
  background: rgba(9, 15, 28, 0.86) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.22) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
  z-index: 140 !important;
}

.sovereign-brand-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sovereign-brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #ffd76a;
  box-shadow: 0 0 10px rgba(255, 215, 106, 0.85);
}

.sovereign-brand-word {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #f8fafc;
}

.sovereign-rail-divider {
  width: 1px;
  height: 20px;
  background: rgba(255, 255, 255, 0.14);
  flex-shrink: 0;
}

.sovereign-telemetry-cluster {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.sovereign-cae-pill {
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(12, 74, 110, 0.48);
  border: 1px solid rgba(56, 189, 248, 0.52);
  color: #7dd3fc;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.sovereign-locus-pill {
  padding: 4px 11px;
  border-radius: 9999px;
  background: rgba(88, 28, 135, 0.44);
  border: 1px solid rgba(192, 132, 252, 0.55);
  color: #e9d5ff;
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.sovereign-locus-pill:hover {
  border-color: rgba(233, 213, 255, 0.85);
  transform: translateY(-1px);
}

.sovereign-right-cluster {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
}

.site-menu-popover {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 210px;
  padding: 10px;
  border-radius: 14px;
  background: rgba(11, 17, 31, 0.98);
  border: 1px solid rgba(255, 215, 106, 0.35);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.85);
  z-index: 260;
  flex-direction: column;
  gap: 4px;
}

.site-menu-popover.is-open {
  display: flex;
}

.site-menu-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: 8px;
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.76rem;
  font-weight: 600;
  transition: background 0.15s ease, color 0.15s ease;
}

.site-menu-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffd76a;
}

.site-menu-cta {
  margin-top: 4px;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #090d16 !important;
  font-weight: 800;
}

/* 2. Sleek Figma Chamfered Nameplates (356x80px Desktop • Full-Size 1:1 Strain Emblem) */
#p2-player-card.player-card.p2.figma-nameplate-hud,
.player-card.figma-nameplate-hud {
  display: grid !important;
  grid-template-columns: 54px minmax(112px, 1fr) auto !important;
  align-items: center !important;
  gap: 8px !important;
  width: 356px !important;
  min-width: 344px !important;
  max-width: calc(100vw - 24px) !important;
  height: 80px !important;
  min-height: 80px !important;
  padding: 10px 14px !important;
  border-radius: 0 !important;
  background-color: transparent !important;
  background: var(--np-frame-url) center / 100% 100% no-repeat !important;
  border: none !important;
  border-image: none !important;
  box-shadow: none !important;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.78));
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  box-sizing: border-box !important;
  pointer-events: auto !important;
  z-index: 120 !important;
}

#p2-player-card.player-card.p2.figma-nameplate-hud.is-active-turn,
.player-card.figma-nameplate-hud.is-active-turn {
  box-shadow: none !important;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 12px rgba(255, 215, 106, 0.36));
}

/* Fixed Desktop Anchors */
#p2-player-card.figma-nameplate-hud {
  position: fixed !important;
  top: 60px !important;
  right: 16px !important;
  left: auto !important;
  transform: none !important;
}

.player-card.p1.figma-nameplate-hud {
  position: fixed !important;
  left: 16px !important;
  bottom: max(16px, env(safe-area-inset-bottom)) !important;
  right: auto !important;
  transform: none !important;
}

/* Bay 1: Full-Size 1:1 Strain Emblem Medallion */
.np-emblem-bay {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(var(--np-accent-rgb, 74, 222, 128), 0.45);
  background: rgba(4, 8, 16, 0.92);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
}

.np-emblem-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  display: block;
}

/* Bay 2: Compact Identity, Economy (qAe/nAe/Talents), & Breach Pips */
.np-stats-bay {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  min-width: 0;
}

.np-identity-line {
  display: flex;
  align-items: baseline;
  gap: 5px;
  white-space: nowrap;
  overflow: hidden;
}

.figma-nameplate-hud .player-name {
  font-size: 0.86rem !important;
  font-weight: 800 !important;
  color: #f8fafc !important;
  letter-spacing: 0.01em !important;
}

.np-seat-tag {
  font-size: 0.64rem;
  font-weight: 700;
  color: #94a3b8;
}

.np-economy-line {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
}

.np-qae-val {
  color: #ffd76a;
  cursor: pointer;
}

.np-nae-val {
  color: #d8b4fe;
  cursor: pointer;
}

.np-talents-chip {
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
}

.np-breach-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.figma-nameplate-hud .meter-label {
  font-size: 0.64rem !important;
  color: #94a3b8 !important;
  font-weight: 700 !important;
  text-transform: none !important;
}

.figma-nameplate-hud .gem-pips-row {
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
}

.figma-nameplate-hud .gem-pip {
  width: 7px !important;
  height: 7px !important;
  border-radius: 50% !important;
  background: rgba(15, 23, 42, 0.95) !important;
  border: 1px solid rgba(148, 163, 184, 0.65) !important;
}

.figma-nameplate-hud .gem-pip.filled {
  background: var(--np-accent, #4ade80) !important;
  border-color: #ffffff !important;
  box-shadow: 0 0 6px var(--np-accent, #4ade80) !important;
}

/* Bay 3: 3 Deeper 3D Recessed Card-Pocket Wells (overflow: hidden • 0% bevel bleed!) */
.card-well-rail.np-wells-bay {
  position: static !important;
  inset: auto !important;
  transform: none !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 0 !important;
  margin: 0 !important;
  background: none !important;
  border: none !important;
  box-shadow: none !important;
}

.np-wells-bay .card-well {
  position: relative !important;
  width: 44px !important;
  height: 58px !important;
  min-width: 44px !important;
  min-height: 58px !important;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  background: #02040a !important;
  border: 1px solid rgba(148, 163, 184, 0.35) !important;
  box-shadow:
    inset 0 8px 10px -2px rgba(0, 0, 0, 0.98),
    inset 5px 0 8px -3px rgba(0, 0, 0, 0.94),
    inset -5px 0 8px -3px rgba(0, 0, 0, 0.94),
    0 1px 0 rgba(255, 255, 255, 0.08) !important;
  cursor: pointer !important;
  touch-action: none !important;
  transition: border-color 0.16s ease, box-shadow 0.16s ease !important;
}

.np-wells-bay .card-well::before {
  /* Inner recessed bevel cavity wall & diagonal corner depth hint */
  content: '';
  position: absolute;
  inset: 4px 4px 20px 4px;
  border-radius: 3px;
  border: 1px solid rgba(51, 65, 85, 0.5);
  background: radial-gradient(circle at 50% 35%, rgba(15, 23, 42, 0.45), rgba(2, 4, 9, 0.95));
  pointer-events: none;
  z-index: 1;
}

.np-wells-bay .card-well .deck-top-card {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  transform: none !important;
}

.np-wells-bay .card-well .deck-card-img {
  position: absolute !important;
  left: 5px !important;
  right: 5px !important;
  width: calc(100% - 10px) !important;
  height: 36px !important;
  top: var(--well-tuck, 18%) !important;
  object-fit: cover !important;
  border-radius: 3px !important;
  border: 1px solid rgba(var(--well-accent-rgb, 56, 189, 248), 0.65) !important;
  box-shadow: 0 -2px 0 rgba(203, 213, 225, 0.55), 0 -4px 0 rgba(148, 163, 184, 0.35), 0 4px 8px rgba(0, 0, 0, 0.92) !important;
  transition: top 0.2s cubic-bezier(0.2, 0.9, 0.3, 1) !important;
  z-index: 2 !important;
}

.np-wells-bay .card-well.well-empty .deck-card-img {
  opacity: 0 !important;
  pointer-events: none !important;
}

.np-wells-bay .card-well.well-empty::after {
  /* Empty milled slot groove */
  content: '';
  position: absolute;
  left: 9px;
  right: 9px;
  top: 38%;
  height: 1px;
  background: rgba(100, 116, 139, 0.38);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.9);
  z-index: 2;
}

/* Taller Machined Opaque Front Pocket Lip (~34% height = 19px of 58px) */
.np-wells-bay .card-well .deck-badge {
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100% !important;
  transform: none !important;
  box-sizing: border-box !important;
  height: 19px !important;
  padding: 0 3px !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  background: linear-gradient(180deg, #0b1222 0%, #060a14 100%) !important;
  border: none !important;
  border-top: 1px solid rgba(var(--well-accent-rgb, 148, 163, 184), 0.72) !important;
  box-shadow: 0 -6px 8px rgba(0, 0, 0, 0.85) !important;
  font-size: 0.45rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.01em !important;
  color: #cbd5e1 !important;
  z-index: 3 !important;
  border-radius: 0 !important;
}

.np-wells-bay .card-well .deck-badge b {
  color: rgb(var(--well-accent-rgb, 56, 189, 248)) !important;
  font-size: 0.54rem !important;
}

.np-wells-bay .card-well.well-empty .deck-badge {
  border-top-color: rgba(148, 163, 184, 0.45) !important;
  color: #cbd5e1 !important;
}

.np-wells-bay .card-well.well-empty .deck-badge b {
  color: #e2e8f0 !important;
}

.np-wells-bay .card-well:hover,
.np-wells-bay .card-well.is-drop-target {
  border-color: #fbbf24 !important;
  box-shadow:
    inset 0 8px 10px -2px rgba(0, 0, 0, 0.98),
    0 0 14px rgba(251, 191, 36, 0.58) !important;
}

/* 3. Bottom-Right Commit & Undo Action Cluster + Clean Hand Fan */
.bottom-bar {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  max-width: none !important;
  transform: none !important;
  padding: 0 !important;
  pointer-events: none !important;
  background: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.bottom-controls-row {
  position: relative !important;
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
}

.p1-actions-dock {
  position: fixed !important;
  right: 16px !important;
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 12px)) !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-end !important;
  gap: 8px !important;
  z-index: 135 !important;
  pointer-events: auto !important;
}

#btn-commit-contest {
  padding: 0.5rem 1.05rem !important;
  border-radius: 9999px !important;
  font-size: 0.78rem !important;
  font-weight: 800 !important;
  background: rgba(16, 54, 38, 0.92) !important;
  border: 1.5px solid rgba(74, 222, 128, 0.78) !important;
  color: #bbf7d0 !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.65), 0 0 18px rgba(74, 222, 128, 0.22) !important;
}

#btn-undo-action {
  padding: 0.34rem 0.85rem !important;
  border-radius: 9999px !important;
  font-size: 0.72rem !important;
  background: rgba(15, 23, 42, 0.88) !important;
  border: 1px solid rgba(255, 255, 255, 0.24) !important;
}

/* 4. 8dp On-Board Planeswalker Queller Activation Tray */
.queller-planeswalker-tray {
  position: fixed;
  z-index: 230;
  display: flex;
  gap: 10px;
  max-width: min(472px, calc(100vw - 24px));
  padding: 12px;
  border-radius: 16px;
  background: rgba(10, 16, 30, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 215, 106, 0.65);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.85), 0 0 28px rgba(255, 215, 106, 0.2);
}

.pw-tray-card {
  width: 204px;
  flex-shrink: 0;
  padding: 10px;
  border-radius: 11px;
  background: #0b1518;
  border: 1px solid rgba(255, 215, 106, 0.45);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pw-tray-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.pw-tray-name {
  flex: 1;
  min-width: 0;
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.15;
  color: #fef08a;
  white-space: normal;
  word-break: break-word;
}

.pw-tray-badge {
  flex-shrink: 0;
  font-size: 0.54rem;
  font-weight: 800;
  padding: 2px 5px;
  border-radius: 9999px;
  background: rgba(20, 83, 45, 0.85);
  color: #86efac;
  border: 1px solid rgba(74, 222, 128, 0.45);
}

.pw-tray-close {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #cbd5e1;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.65rem;
  cursor: pointer;
}

.pw-tray-passive {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: #cbd5e1;
}

.pw-tray-passive strong {
  color: #bbf7d0;
  font-size: 0.7rem;
}

.pw-tray-actions {
  flex: 1;
  min-width: 185px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pw-tray-header-line {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pw-tray-act-title {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #fef08a;
}

.pw-tray-cache {
  font-size: 0.68rem;
  color: #94a3b8;
}

.pw-tray-buttons-slot {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Notice: #btn-queller-flourish / #btn-queller-ability inside tray use crisp OPAQUE matte fills (Zero Glass-on-Glass) */
.pw-tray-buttons-slot .queller-hud-pill {
  width: 100% !important;
  text-align: left !important;
  justify-content: flex-start !important;
  padding: 9px 11px !important;
  border-radius: 10px !important;
  background: #171207 !important;
  border: 1px solid rgba(255, 215, 106, 0.72) !important;
  color: #fef08a !important;
  font-size: 0.74rem !important;
  font-weight: 700 !important;
  cursor: pointer !important;
}

.pw-tray-buttons-slot .queller-hud-pill.ability {
  background: #0c192c !important;
  border-color: rgba(56, 189, 248, 0.65) !important;
  color: #bae6fd !important;
}

.pw-tray-buttons-slot .queller-hud-pill:disabled {
  opacity: 0.44 !important;
  cursor: not-allowed !important;
}

/* 5. Projected Rift Corridor Signifier Overlays & Float Credit */
.rift-corridor-overlays {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 5;
}

#battlefield-card-zoom-overlay {
  z-index: 1500 !important;
}

.rift-slot-badge-anchor {
  position: fixed;
  left: 0;
  top: 0;
  pointer-events: none;
}

.rift-ov-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 9999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.6rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.75);
}

.rift-ov-pill.is-zero {
  pointer-events: auto;
  cursor: pointer;
  background: rgba(8, 47, 73, 0.94);
  border: 1px solid #38bdf8;
  color: #e0f2fe;
}

.rift-ov-pill.is-locked {
  background: rgba(136, 19, 55, 0.94);
  border: 1px solid #fb7185;
  color: #ffe4e6;
}

.rift-ov-pill.is-absolved {
  background: rgba(69, 26, 3, 0.94);
  border: 1px solid #fbbf24;
  color: #fef08a;
}

.rift-ov-pill.is-dim {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid rgba(100, 116, 139, 0.72);
  color: #cbd5e1;
}

.rift-ov-pill.is-inertia {
  background: rgba(30, 27, 75, 0.94);
  border: 1px solid #c084fc;
  color: #e9d5ff;
}

.rift-ov-pill.is-thr {
  background: rgba(9, 15, 28, 0.88);
  border: 1px solid rgba(148, 163, 184, 0.4);
  color: #cbd5e1;
}

.rift-float-credit-hud {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(10, 28, 48, 0.9);
  border: 1px solid rgba(56, 189, 248, 0.72);
  color: #bae6fd;
  font-size: 0.72rem;
  font-weight: 800;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.6), 0 0 18px rgba(56, 189, 248, 0.28);
  pointer-events: auto;
}

.rift-float-credit-hud .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #38bdf8;
}

/* 6. 8dp Non-Blocking Trigger Callouts */
.hud-trigger-callout {
  position: fixed;
  top: 60px;
  left: 16px;
  z-index: 150;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  max-width: 268px;
  padding: 8px 11px;
  border-radius: 12px;
  background: rgba(14, 20, 38, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(251, 191, 36, 0.6);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.68);
  pointer-events: none;
}

.trigger-badge {
  padding: 2px 6px;
  border-radius: 9999px;
  background: rgba(180, 105, 8, 0.55);
  border: 1px solid rgba(251, 191, 36, 0.7);
  color: #fef08a;
  font-size: 0.62rem;
  font-weight: 800;
}

.trigger-title {
  color: #f8fafc;
  font-size: 0.74rem;
  font-weight: 800;
}

.trigger-sub {
  width: 100%;
  color: #bae6fd;
  font-size: 0.68rem;
}

/* 7. 24dp Transient Match Setup & Zero Glass-on-Glass Opaque Modals */
.arena-opaque-modal,
.decision-modal-container,
#playtest-tools-drawer,
#zone-inspector-drawer {
  background: #0c1322 !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.arena-setup-modal {
  width: min(510px, calc(100vw - 24px));
  padding: 20px 22px;
  border-radius: 18px;
  border: 1px solid rgba(255, 215, 106, 0.55);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.9);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.arena-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 10px;
}

.arena-modal-title {
  margin: 0;
  color: #fef08a;
  font-size: 1.05rem;
  font-weight: 800;
}

.arena-modal-subtitle {
  margin: 2px 0 0;
  color: #94a3b8;
  font-size: 0.72rem;
}

.setup-mode-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.setup-mode-pill {
  padding: 8px 10px;
  border-radius: 9999px;
  background: #141d31;
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #cbd5e1;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
}

.setup-mode-pill.is-active {
  background: #0c4a6e;
  border-color: #38bdf8;
  color: #e0f2fe;
}

.setup-queller-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.setup-queller-card {
  padding: 10px 12px;
  border-radius: 12px;
  background: #111827;
  border: 1px solid rgba(255, 215, 106, 0.45);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setup-queller-card.is-p2 {
  border-color: rgba(244, 63, 94, 0.45);
}

.setup-queller-tag,
.setup-locus-tag {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #94a3b8;
}

.setup-queller-tag.is-p2 {
  color: #fda4af;
}

.setup-select {
  width: 100%;
  background: #090e1a !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
  padding: 6px 8px !important;
  border-radius: 8px !important;
  font-size: 0.76rem !important;
}

.setup-queller-meta {
  font-size: 0.7rem;
  color: #cbd5e1;
}

.setup-queller-sub {
  font-size: 0.66rem;
  color: #94a3b8;
}

.setup-locus-card {
  padding: 11px 13px;
  border-radius: 12px;
  background: #171228;
  border: 1px solid rgba(192, 132, 252, 0.52);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setup-locus-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.setup-locus-tag {
  color: #d8b4fe;
}

.setup-locus-stats {
  font-size: 0.68rem;
  font-weight: 700;
  color: #7dd3fc;
}

.setup-locus-desc {
  margin: 0;
  font-size: 0.7rem;
  color: #cbd5e1;
  line-height: 1.35;
}

.setup-footer-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.setup-launch-btn {
  padding: 8px 18px;
  border-radius: 9999px;
  border: none;
  background: linear-gradient(135deg, #fbbf24, #d97706);
  color: #090d16;
  font-size: 0.8rem;
  font-weight: 800;
  cursor: pointer;
}

/* Interactive touch helpers */
.hand-card-el {
  touch-action: none !important;
}

.hand-card-el.is-grabbed-instant {
  transform: translateY(-10px) scale(1.04) !important;
}

/* 8. Responsive Tablet (<= 1120px) & Breathable Mobile (<= 640px) Ergonomics */
@media (max-width: 1120px) {
  #top-phase-timeline.horizontal-phase-timeline {
    padding: 0 10px !important;
    gap: 6px !important;
  }

  .sovereign-brand-word,
  .sovereign-rail-divider,
  #hud-rules-version,
  .phase-node-label {
    display: none !important;
  }

  .sovereign-locus-pill {
    max-width: 132px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .sovereign-right-cluster .action-btn {
    padding: 0.2rem 0.48rem !important;
    font-size: 0.64rem !important;
  }
}

@media (max-width: 1024px) {
  #p2-player-card.player-card.p2.figma-nameplate-hud,
  .player-card.figma-nameplate-hud {
    width: 310px !important;
    min-width: 296px !important;
    height: 76px !important;
    min-height: 76px !important;
    grid-template-columns: 46px minmax(90px, 1fr) auto !important;
    gap: 6px !important;
    padding: 8px 10px !important;
  }

  #p2-player-card.player-card.p2.figma-nameplate-hud,
  #p2-player-card.figma-nameplate-hud {
    top: 58px !important;
    right: 10px !important;
  }

  .player-card.p1.figma-nameplate-hud {
    left: 10px !important;
    bottom: max(10px, env(safe-area-inset-bottom)) !important;
  }

  .p1-actions-dock {
    right: 10px !important;
    bottom: max(10px, calc(env(safe-area-inset-bottom) + 6px)) !important;
  }

  .np-emblem-bay {
    width: 46px;
    height: 46px;
  }

  .np-wells-bay .card-well {
    width: 40px !important;
    height: 54px !important;
    min-width: 40px !important;
    min-height: 54px !important;
  }
}

@media (max-width: 640px) {
  #top-phase-timeline.horizontal-phase-timeline {
    height: auto !important;
    min-height: 62px !important;
    border-radius: 14px !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    padding: 5px 8px !important;
    gap: 4px 6px !important;
    left: 8px !important;
    right: 8px !important;
    top: max(6px, env(safe-area-inset-top)) !important;
  }

  #top-phase-timeline .sovereign-brand-cluster,
  #top-phase-timeline .sovereign-telemetry-cluster {
    gap: 4px !important;
  }

  #hud-call-right-badge {
    font-size: 0.6rem !important;
    padding: 2px 6px !important;
  }

  .sovereign-cae-pill {
    font-size: 0.6rem !important;
    padding: 2px 6px !important;
  }

  .sovereign-locus-pill {
    max-width: 108px !important;
    font-size: 0.6rem !important;
    padding: 2px 6px !important;
  }

  .sovereign-right-cluster {
    width: 100% !important;
    justify-content: space-between !important;
    gap: 4px !important;
  }

  .sovereign-right-cluster .action-btn {
    padding: 2px 7px !important;
    font-size: 0.62rem !important;
  }

  .sovereign-brand-word,
  .phase-timeline-track {
    display: none !important;
  }

  #p2-player-card.player-card.p2.figma-nameplate-hud,
  .player-card.figma-nameplate-hud {
    min-width: 0 !important;
    width: calc(100vw - 16px) !important;
    max-width: calc(100vw - 16px) !important;
    left: 8px !important;
    right: 8px !important;
    height: 74px !important;
    min-height: 74px !important;
    grid-template-columns: 46px minmax(88px, 1fr) auto !important;
    padding: 8px 10px !important;
  }

  #p2-player-card.player-card.p2.figma-nameplate-hud,
  #p2-player-card.figma-nameplate-hud {
    top: calc(max(6px, env(safe-area-inset-top)) + 76px) !important;
  }

  .player-card.p1.figma-nameplate-hud {
    bottom: calc(env(safe-area-inset-bottom) + 134px) !important;
  }

  .np-emblem-bay {
    width: 46px;
    height: 46px;
  }

  .np-wells-bay .card-well {
    width: 40px !important;
    height: 54px !important;
    min-width: 40px !important;
    min-height: 54px !important;
  }

  .p1-actions-dock {
    left: 8px !important;
    right: 8px !important;
    bottom: calc(env(safe-area-inset-bottom) + 92px) !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .rift-ov-pill {
    font-size: 8px !important;
    padding: 1px 4px !important;
  }

  #btn-undo-action {
    flex: 0 0 auto !important;
  }

  #btn-commit-contest {
    flex: 1 !important;
    text-align: center !important;
    justify-content: center !important;
  }

  .setup-queller-grid {
    grid-template-columns: 1fr;
  }
}
