    :root {
      --obsidian-bg: #0F1115;
      --card-bg: rgba(22, 25, 34, 0.88);
      --elevated-bg: rgba(30, 34, 45, 0.9);
      --runic-border: rgba(46, 52, 64, 0.8);
      --blood-crimson: #991B1B;
      --bright-crimson: #DC2626;
      --tarnished-gold: #D97706;
      --amber-gold: #F59E0B;
      --parchment-text: #E2E8F0;
      --muted-silver: #94A3B8;
      --health-green: #10B981;
      --vtt-scale: 1.0;
    }

    * {
      box-sizing: border-box;
      margin: 0;
      padding: 0;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
    }

    html, body {
      width: 100%;
      height: 100%;
      height: 100dvh;
      background-color: #060709;
      color: var(--parchment-text);
      font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
      overflow: hidden;
      display: flex;
      justify-content: center;
      align-items: center;
    }

    /* Mobile Frame for Desktop View */
    .mobile-frame {
      width: 100%;
      max-width: 440px;
      height: 100dvh;
      max-height: 880px;
      background-color: var(--obsidian-bg);
      display: flex;
      flex-direction: column;
      position: relative;
      overflow: hidden;
      border-radius: 36px;
      box-shadow: 0 25px 60px rgba(0, 0, 0, 0.9), 0 0 0 2px #262933;
    }

    /* Fullscreen on Mobile Devices (Samsung Galaxy S25+, iPhones, etc.) */
    @media (max-width: 600px) {
      body {
        align-items: stretch;
        background-color: var(--obsidian-bg);
      }
      .mobile-frame {
        max-width: 100%;
        max-height: 100dvh;
        height: 100dvh;
        border-radius: 0;
        box-shadow: none;
        border: none;
      }
    }

    /* Fullscreen Immersion & Standalone Desktop Window Expansion */
    :fullscreen body,
    :-webkit-full-screen body,
    body.fullscreen-active,
    body.standalone-app {
      align-items: stretch !important;
      background-color: var(--obsidian-bg) !important;
    }

    :fullscreen .mobile-frame,
    :-webkit-full-screen .mobile-frame,
    body.fullscreen-active .mobile-frame,
    body.standalone-app .mobile-frame {
      max-width: 100% !important;
      max-height: 100dvh !important;
      height: 100dvh !important;
      width: 100vw !important;
      border-radius: 0 !important;
      box-shadow: none !important;
      border: none !important;
    }

    /* On expanded desktop screens, center screen cards comfortably */
    body.fullscreen-active .screen-content,
    body.standalone-app .screen-content,
    :fullscreen .screen-content,
    :-webkit-full-screen .screen-content {
      max-width: 640px;
      margin: 0 auto;
      width: 100%;
    }

    /* Animated Dynamic Background Layer */
    .ambient-bg {
      position: absolute;
      top: -5%;
      left: -5%;
      width: 110%;
      height: 110%;
      background-size: cover;
      background-position: center;
      background-image: none;
      background: radial-gradient(ellipse at 50% 25%, #450a0a 0%, #220505 50%, #0a0202 100%);
      z-index: 1;
      opacity: 0.52;
      transition: background 0.8s ease-in-out, opacity 0.5s ease;
      animation: ambientSlowDrift 28s ease-in-out infinite alternate;
      pointer-events: none;
    }

    @keyframes ambientSlowDrift {
      0% { transform: scale(1.0) translate(0, 0); }
      50% { transform: scale(1.06) translate(-1%, -1.5%); }
      100% { transform: scale(1.02) translate(1%, 0.5%); }
    }

    /* Ambient Warm Forge Fire Glow at Screen Base */
    .forge-fire-backdrop {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 55%;
      background: radial-gradient(ellipse at 50% 115%, rgba(245, 158, 11, 0.32) 0%, rgba(220, 38, 38, 0.22) 40%, transparent 80%);
      z-index: 2;
      pointer-events: none;
      animation: forgePulseFlame 4s ease-in-out infinite alternate;
    }
    @keyframes forgePulseFlame {
      0% { opacity: 0.65; transform: scaleY(0.95); }
      50% { opacity: 1.0; transform: scaleY(1.08); }
      100% { opacity: 0.75; transform: scaleY(0.98); }
    }

    /* HartForge Fiery Brand Styling */
    .forge-brand-wrapper {
      text-align: center;
      margin: 12px 0 16px;
      position: relative;
      z-index: 5;
    }
    .forge-sigil-outer {
      position: relative;
      width: 86px;
      height: 86px;
      margin: 0 auto 12px;
      display: flex;
      justify-content: center;
      align-items: center;
    }
    .forge-sigil-glow {
      position: absolute;
      top: -10px;
      left: -10px;
      right: -10px;
      bottom: -10px;
      border-radius: 28px;
      background: radial-gradient(circle, rgba(245, 158, 11, 0.5) 0%, rgba(220, 38, 38, 0.3) 50%, transparent 75%);
      filter: blur(12px);
      animation: forgePulseGlow 3s ease-in-out infinite alternate;
      pointer-events: none;
    }
    .forge-sigil-badge {
      position: relative;
      width: 100%;
      height: 100%;
      border-radius: 24px;
      border: 2px solid var(--amber-gold);
      background: radial-gradient(circle at 50% 30%, #3B1B10 0%, #170E0D 60%, #0B0707 100%);
      display: flex;
      justify-content: center;
      align-items: center;
      box-shadow: 0 0 25px rgba(245, 158, 11, 0.5), inset 0 0 18px rgba(220, 38, 38, 0.45);
      animation: forgeBorderPulse 3s ease-in-out infinite alternate;
      padding: 6px;
      box-sizing: border-box;
      overflow: hidden;
    }
    .forge-sigil-img {
      width: 68px;
      height: 68px;
      display: block;
      filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.8));
      transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    }
    .forge-sigil-badge:hover .forge-sigil-img {
      transform: scale(1.08) rotate(2deg);
    }

    @keyframes forgePulseGlow {
      0% { opacity: 0.6; transform: scale(0.95); }
      50% { opacity: 1.0; transform: scale(1.15); }
      100% { opacity: 0.6; transform: scale(0.95); }
    }
    @keyframes forgeBorderPulse {
      0% { border-color: var(--tarnished-gold); box-shadow: 0 0 20px rgba(245, 158, 11, 0.4); }
      50% { border-color: #FDE68A; box-shadow: 0 0 35px rgba(245, 158, 11, 0.8), 0 0 50px rgba(220, 38, 38, 0.5); }
      100% { border-color: var(--tarnished-gold); box-shadow: 0 0 20px rgba(245, 158, 11, 0.4); }
    }

    .forge-main-title {
      font-family: 'Cinzel', serif;
      font-size: 28px;
      font-weight: 900;
      letter-spacing: 3px;
      margin-bottom: 2px;
      background: linear-gradient(180deg, #FFFFFF 0%, #FDE68A 30%, #F59E0B 70%, #DC2626 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      filter: drop-shadow(0 2px 10px rgba(245, 158, 11, 0.45));
    }
    .forge-realm-title {
      font-family: 'Cinzel', serif;
      font-size: 11px;
      color: var(--amber-gold);
      letter-spacing: 2px;
      font-weight: 600;
      text-transform: uppercase;
      margin-bottom: 6px;
    }
    .forge-pill-tag {
      display: inline-block;
      font-size: 9px;
      letter-spacing: 1px;
      color: #FCD34D;
      background: rgba(245, 158, 11, 0.14);
      border: 1px solid rgba(245, 158, 11, 0.35);
      padding: 3px 10px;
      border-radius: 12px;
      text-transform: uppercase;
      font-weight: 700;
    }

    /* Canvas for Dynamic Particle Simulation (Embers, Wisps, Void Dust) */
    #fx-canvas {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      z-index: 2;
      pointer-events: none;
    }

    /* Dark Vignette Overlay for Crisp Readability */
    .vignette-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: radial-gradient(circle at center, rgba(15, 17, 21, 0.3) 0%, rgba(15, 17, 21, 0.85) 75%, #0F1115 100%);
      z-index: 3;
      pointer-events: none;
    }

    /* Mobile Status Bar (Responsive 3-column layout) */
    .status-bar {
      height: 44px;
      padding: 0 12px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 4px;
      font-size: 11px;
      font-weight: 600;
      color: var(--muted-silver);
      background: rgba(15, 17, 21, 0.85);
      backdrop-filter: blur(10px);
      -webkit-backdrop-filter: blur(10px);
      z-index: 20;
      padding-top: env(safe-area-inset-top, 0px);
      flex-shrink: 0;
      border-bottom: 1px solid rgba(255,255,255,0.06);
    }

    .status-bar-left {
      display: flex;
      align-items: center;
      gap: 5px;
      flex: 1 1 0;
      min-width: 0;
    }

    .server-ping-badge {
      font-size: 8px;
      color: #38BDF8;
      background: rgba(56, 189, 248, 0.15);
      border: 1px solid rgba(56, 189, 248, 0.4);
      padding: 1px 5px;
      border-radius: 4px;
      font-weight: 800;
      letter-spacing: 0.5px;
      white-space: nowrap;
    }

    .status-bar-center {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      flex: 0 1 auto;
      text-align: center;
      pointer-events: none;
    }

    .status-bar-right {
      display: flex;
      align-items: center;
      justify-content: flex-end;
      gap: 6px;
      flex: 1 1 0;
      min-width: 0;
    }

    .btn-fullscreen-toggle {
      background: rgba(245, 158, 11, 0.12);
      border: 1px solid rgba(245, 158, 11, 0.35);
      color: var(--amber-gold);
      border-radius: 4px;
      width: 22px;
      height: 22px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      font-size: 12px;
      cursor: pointer;
      padding: 0;
      transition: background 0.15s ease, border-color 0.15s ease;
    }
    .btn-fullscreen-toggle:hover {
      background: rgba(245, 158, 11, 0.25);
      border-color: var(--amber-gold);
    }
    #theme-label {
      white-space: nowrap !important;
      max-width: none !important;
      overflow: visible !important;
      text-overflow: clip !important;
    }

    @media (max-width: 600px) {
      .status-bar {
        padding: 0 6px !important;
        height: 42px !important;
        gap: 4px !important;
      }
      .status-bar-subtitle {
        display: none !important;
      }
      .status-bar-center {
        flex: 0 0 auto !important;
        flex-shrink: 0 !important;
        min-width: max-content !important;
        z-index: 2;
      }
      .status-bar-center span:first-child {
        font-size: 11px !important;
        letter-spacing: 0.8px !important;
      }
      .status-bar-left {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        overflow: hidden !important;
      }
      .status-bar-right {
        flex: 0 1 auto !important;
        min-width: 0 !important;
        gap: 4px !important;
      }
      #header-supporter-btn {
        padding: 2px 6px !important;
        font-size: 9px !important;
        white-space: nowrap !important;
      }
      #header-supporter-text {
        font-size: 8.5px !important;
      }
      #theme-label {
        display: none !important;
      }
      #current-location-badge {
        max-width: calc(100vw - 110px) !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
      }
    }
    @media (max-width: 480px) {
      #view-mode-label {
        display: none !important;
      }
      #header-supporter-text {
        display: none !important;
      }
      #header-supporter-btn {
        padding: 2px 5px !important;
      }
      .status-bar-center span:first-child {
        font-size: 10px !important;
        letter-spacing: 0.8px !important;
      }
      .server-ping-badge {
        font-size: 7.5px;
        padding: 1px 3px;
        letter-spacing: 0.2px;
      }
      #vtt-status-strip {
        padding: 3px 6px !important;
        gap: 3px !important;
      }
      #vtt-status-strip .action-chip {
        font-size: 8px !important;
        padding: 1px 4px !important;
        white-space: nowrap !important;
      }
      #vtt-round-text {
        font-size: 8.5px !important;
        padding: 1px 4px !important;
      }
      #vtt-active-turn-tag {
        font-size: 8.5px !important;
      }
    }

    /* Screen Container - Added extra bottom clearance for S25+ gesture bar */
    .screen-content {
      flex: 1;
      overflow-y: auto;
      overflow-x: hidden;
      padding: 16px;
      padding-bottom: 140px; /* Ample scroll clearance above Samsung S25+ navigation */
      scroll-padding-bottom: 96px;
      display: none;
      flex-direction: column;
      gap: 12px;
      z-index: 10;
      position: relative;
      -webkit-overflow-scrolling: touch;
    }
    .screen-content:not(.active) { display: none !important; }
    .screen-content.active { display: flex !important; }

    /* Responsive Combat Screen with Smooth Vertical Scrolling */
    #screen-combat {
      padding: 8px 10px calc(88px + env(safe-area-inset-bottom, 0px)) 10px;
      gap: 6px;
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;
    }

    /* Typography */
    h1, h2, h3, h4, .title-font {
      font-family: 'Cinzel', serif;
      letter-spacing: 1px;
    }

    /* Cards */
    .card {
      background: var(--card-bg);
      border: 1px solid var(--runic-border);
      border-radius: 12px;
      padding: 14px;
      display: flex;
      flex-direction: column;
      gap: 8px;
      backdrop-filter: blur(12px);
      -webkit-backdrop-filter: blur(12px);
      flex-shrink: 0;
    }

    /* Buttons */
    .btn {
      background: linear-gradient(180deg, var(--bright-crimson) 0%, var(--blood-crimson) 100%);
      color: #FFF;
      border: none;
      border-radius: 8px;
      padding: 12px;
      font-family: 'Cinzel', serif;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 1px;
      cursor: pointer;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px;
      transition: opacity 0.15s, transform 0.1s;
      width: 100%;
      touch-action: manipulation;
    }
    .party-sub-tabs .btn {
      min-width: 0;
      white-space: normal;
      flex-wrap: wrap;
      line-height: 1.2;
      text-align: center;
    }
    @media (max-width: 360px) {
      .party-sub-tabs .btn {
        font-size: 9px !important;
        padding: 6px 2px !important;
        gap: 2px !important;
      }
    }
    @media (max-width: 420px) {
      #screen-settlement .btn,
      #screen-settlement button {
        max-width: 100%;
        white-space: normal !important;
        flex-wrap: wrap;
        text-align: center;
      }
    }
    .btn:active {
      transform: scale(0.97);
      opacity: 0.9;
    }
    .btn-secondary {
      background: var(--elevated-bg);
      border: 1px solid var(--runic-border);
      color: var(--parchment-text);
    }
    .btn-gold {
      background: linear-gradient(180deg, var(--amber-gold) 0%, var(--tarnished-gold) 100%);
      color: #0F1115;
    }
    .btn-apple {
      background: #000000;
      color: #FFFFFF;
      border: 1px solid #444444;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      font-size: 13px;
      font-weight: 600;
      letter-spacing: 0.3px;
    }
    .btn-apple:active {
      background: #1C1C1E;
    }
    .btn-google {
      background: #1E232E;
      color: #FFFFFF;
      border: 1px solid #334155;
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
      font-size: 13px;
      font-weight: 600;
      letter-spacing: 0.3px;
    }
    .btn-google:active {
      background: #283040;
    }
    .btn-small {
      padding: 8px 12px;
      font-size: 11px;
      width: auto;
    }

    /* Inputs */
    .input-field {
      background: var(--elevated-bg);
      border: 1px solid var(--runic-border);
      border-radius: 8px;
      color: var(--parchment-text);
      padding: 12px;
      font-size: 14px;
      width: 100%;
      outline: none;
    }
    .input-field:focus {
      border-color: var(--amber-gold);
    }

    /* Progress Track */
    .progress-track {
      height: 8px;
      background: #000;
      border-radius: 4px;
      overflow: hidden;
      position: relative;
    }
    .progress-fill {
      height: 100%;
      background: var(--health-green);
      transition: width 0.3s ease;
    }

    /* Samsung S25+ Optimized Elevated Bottom Navigation Bar */
    .bottom-nav {
      min-height: 76px;
      height: auto;
      padding-top: 0;
      padding-bottom: 0;
      background: rgba(11, 13, 17, 0.98);
      border-top: 1px solid rgba(217, 119, 6, 0.35);
      box-shadow: 0 -12px 36px rgba(0, 0, 0, 0.9);
      display: flex;
      justify-content: space-around;
      align-items: stretch;
      z-index: 25000 !important;
      position: relative;
      flex-shrink: 0;
      touch-action: manipulation;
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
    }
    body:has(#screen-auth.active) .bottom-nav,
    body:has(#screen-create-character.active) .bottom-nav {
      display: none !important;
    }
    .nav-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      font-size: 10px;
      color: var(--muted-silver);
      cursor: pointer;
      gap: 3px;
      flex: 1;
      height: 100%;
      min-height: 64px;
      margin: 0;
      padding: 0;
      background: transparent;
      border: none;
      outline: none;
      font-family: inherit;
      -webkit-appearance: none;
      appearance: none;
      padding-top: 8px;
      padding-bottom: max(24px, env(safe-area-inset-bottom, 24px));
      touch-action: manipulation;
      transition: color 0.15s, transform 0.1s;
      -webkit-tap-highlight-color: transparent;
      user-select: none;
    }
    .nav-item * {
      pointer-events: none;
    }
    .nav-item:active {
      transform: scale(0.92);
      color: var(--amber-gold);
    }
    .nav-item.active {
      color: var(--amber-gold);
      font-weight: 700;
    }
    .nav-item .nav-icon,
    .nav-item span:first-child {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 22px;
      height: 22px;
      font-size: 20px;
    }
    .nav-item .nav-icon svg,
    .nav-item span:first-child svg {
      width: 20px;
      height: 20px;
      display: block;
      transition: filter 0.15s ease, transform 0.15s ease;
    }
    .nav-item.active .nav-icon svg,
    .nav-item.active span:first-child svg {
      filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.65));
    }

    /* Attache Grid */
    .attache-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr);
      gap: 6px;
      background: rgba(10, 11, 14, 0.9);
      padding: 10px;
      border-radius: 10px;
      border: 1px solid var(--runic-border);
    }
    .grid-cell {
      aspect-ratio: 1;
      background: #161922;
      border: 1px solid #232733;
      border-radius: 6px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 11px;
      color: var(--muted-silver);
    }
    .grid-cell.occupied {
      background: #3B1215;
      border-color: var(--blood-crimson);
      color: #FECACA;
      font-weight: 700;
    }

    /* 5e Equipment & Attunement Slots (Item 5) */
    /* 5e Equipment & Attunement Slots (Item 3: Diablo/Baldur's Gate Wireframe Paperdoll) */
    .equip-slot-card {
      position: relative;
      background: linear-gradient(145deg, rgba(20, 25, 38, 0.92) 0%, rgba(12, 15, 24, 0.96) 100%);
      border: 1px solid rgba(180, 130, 60, 0.35);
      border-radius: 8px;
      padding: 8px 10px;
      cursor: pointer;
      transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6), 0 2px 6px rgba(0, 0, 0, 0.35);
    }
    .equip-slot-card:hover {
      border-color: var(--amber-gold);
      background: linear-gradient(145deg, rgba(32, 40, 58, 0.95) 0%, rgba(18, 22, 34, 0.98) 100%);
      box-shadow: inset 0 0 14px rgba(245, 158, 11, 0.18), 0 4px 14px rgba(245, 158, 11, 0.22);
      transform: translateY(-1px);
    }
    .equip-slot-card.is-empty {
      border: 1px dashed rgba(160, 120, 60, 0.38);
      background: linear-gradient(145deg, rgba(16, 20, 30, 0.8) 0%, rgba(10, 12, 18, 0.88) 100%);
    }
    .equip-slot-card.is-empty:hover {
      border-color: var(--amber-gold);
      border-style: solid;
      box-shadow: inset 0 0 14px rgba(245, 158, 11, 0.15), 0 3px 12px rgba(245, 158, 11, 0.2);
    }
    .equip-slot-card.is-empty .equip-slot-val {
      color: #94A3B8;
      font-style: italic;
      font-weight: 500;
      opacity: 0.85;
    }
    .equip-slot-header {
      display: flex;
      align-items: center;
      gap: 6px;
      margin-bottom: 2px;
    }
    .equip-slot-wireframe {
      width: 16px;
      height: 16px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      color: var(--amber-gold);
      flex-shrink: 0;
      transition: all 0.2s ease;
    }
    .equip-slot-card.is-empty .equip-slot-wireframe {
      color: #D97706;
      opacity: 0.7;
    }
    .equip-slot-card:hover .equip-slot-wireframe {
      color: #FDE68A;
      filter: drop-shadow(0 0 5px rgba(245, 158, 11, 0.7));
      transform: scale(1.1);
    }
    .slot-wireframe-svg {
      width: 100%;
      height: 100%;
      display: block;
    }
    .equip-slot-label {
      font-size: 9px;
      font-weight: 800;
      color: var(--amber-gold);
      letter-spacing: 0.5px;
    }
    .equip-slot-val {
      font-size: 11.5px;
      font-weight: 700;
      color: #FFF;
      margin-top: 1px;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .equip-slot-sub {
      font-size: 8.5px;
      color: var(--muted-silver);
      margin-top: 1px;
    }

    .attune-slot-card {
      position: relative;
      background: linear-gradient(145deg, rgba(26, 18, 42, 0.9) 0%, rgba(16, 10, 28, 0.96) 100%);
      border: 1px solid rgba(168, 85, 247, 0.38);
      border-radius: 8px;
      padding: 6px 8px;
      text-align: center;
      cursor: pointer;
      transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
      box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.6);
    }
    .attune-slot-card:hover {
      border-color: #D8B4FE;
      background: linear-gradient(145deg, rgba(38, 26, 60, 0.96) 0%, rgba(24, 16, 40, 0.98) 100%);
      box-shadow: inset 0 0 14px rgba(168, 85, 247, 0.2), 0 4px 14px rgba(168, 85, 247, 0.28);
      transform: translateY(-1px);
    }
    .attune-slot-card.is-empty {
      border: 1px dashed rgba(168, 85, 247, 0.35);
      background: linear-gradient(145deg, rgba(20, 14, 32, 0.8) 0%, rgba(12, 8, 20, 0.88) 100%);
    }
    .attune-slot-card.is-empty:hover {
      border-color: #C084FC;
      border-style: solid;
      box-shadow: inset 0 0 12px rgba(168, 85, 247, 0.2), 0 3px 10px rgba(168, 85, 247, 0.25);
    }
    .attune-slot-wireframe {
      width: 24px;
      height: 24px;
      margin: 2px auto 4px auto;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #C084FC;
      opacity: 0.75;
      transition: all 0.2s ease;
    }
    .attune-slot-card:hover .attune-slot-wireframe {
      opacity: 1;
      color: #F3E8FF;
      filter: drop-shadow(0 0 7px rgba(192, 132, 252, 0.75));
      transform: scale(1.1);
    }
    .attune-slot-num {
      font-size: 8px;
      font-weight: 800;
      color: #C084FC;
      letter-spacing: 0.5px;
    }
    .attune-slot-icon {
      font-size: 18px;
      margin: 2px 0;
    }
    .attune-slot-name {
      font-size: 10px;
      font-weight: 700;
      color: #F3E8FF;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }
    .attune-status-badge {
      display: inline-block;
      font-size: 8px;
      font-weight: 700;
      color: var(--muted-silver);
      background: rgba(255, 255, 255, 0.08);
      border-radius: 4px;
      padding: 1px 4px;
      margin-top: 3px;
    }
    .attune-status-badge.active {
      color: var(--health-green);
      background: rgba(16, 185, 129, 0.15);
      border: 1px solid rgba(168, 85, 247, 0.3);
    }
    .attune-status-badge.cooldown {
      color: #F87171;
      background: rgba(239, 68, 68, 0.15);
      border: 1px solid rgba(239, 68, 68, 0.3);
    }

    /* Badge */
    .badge {
      display: inline-block;
      padding: 2px 8px;
      border-radius: 999px;
      font-size: 10px;
      font-weight: 700;
      background: var(--elevated-bg);
      border: 1px solid var(--runic-border);
      color: var(--amber-gold);
    }

    /* Theme Switcher Chips */
    .theme-chip-bar {
      display: flex;
      gap: 6px;
      margin-top: 6px;
    }
    .theme-chip {
      flex: 1;
      padding: 6px 4px;
      border-radius: 6px;
      border: 1px solid var(--runic-border);
      background: var(--elevated-bg);
      color: var(--muted-silver);
      font-size: 10px;
      font-weight: 600;
      text-align: center;
      cursor: pointer;
      transition: all 0.2s;
    }
    .theme-chip.active {
      border-color: var(--amber-gold);
      color: var(--amber-gold);
      background: rgba(245, 158, 11, 0.12);
      font-weight: 700;
    }

    .report-btn {
      font-size: 10px;
      color: #64748B;
      cursor: pointer;
      align-self: flex-end;
      margin-top: 4px;
    }
    .report-btn:hover {
      color: var(--bright-crimson);
    }

    /* Modal Overlay & Dialog */
    .modal-overlay {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(6, 7, 9, 0.88);
      backdrop-filter: blur(6px);
      z-index: 30000;
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 20px;
    }
    .modal-card {
      background: var(--card-bg);
      border: 1px solid var(--tarnished-gold);
      border-radius: 12px;
      padding: 16px;
      max-width: 390px;
      width: 100%;
      box-shadow: 0 12px 32px rgba(0,0,0,0.9);
      max-height: 80vh;
      overflow-y: auto;
    }

    /* Modern Tactical War-Table Battlemap Styles */
    .vtt-board-wrapper {
      position: relative;
      width: 100%;
      max-width: var(--vtt-dynamic-size, calc(min(330px, 36vh) * var(--vtt-scale, 1.0)));
      aspect-ratio: 1 / 1;
      max-height: var(--vtt-dynamic-size, calc(36vh * var(--vtt-scale, 1.0)));
      flex-shrink: 0;
      margin: 0 auto;
      border-radius: 14px;
      overflow: hidden;
      border: 3px solid #1E293B;
      outline: 1.5px solid rgba(245, 158, 11, 0.45);
      outline-offset: -3px;
      box-shadow: 0 12px 35px rgba(0, 0, 0, 0.95), inset 0 0 35px rgba(0, 0, 0, 0.9);
      background-size: cover;
      background-position: center;
      background-repeat: no-repeat;
      user-select: none;
      touch-action: none;
      transition: max-width 0.2s ease, max-height 0.2s ease;
    }
    .vtt-grid {
      display: grid;
      width: 100%;
      height: 100%;
      aspect-ratio: 1 / 1;
      position: relative;
      background: rgba(8, 10, 15, 0.45);
      backdrop-filter: blur(1px);
    }
    .vtt-cell {
      position: relative;
      border: none !important;
      box-sizing: border-box;
      display: flex;
      justify-content: center;
      align-items: center;
      aspect-ratio: 1 / 1;
      transition: background-color 0.18s ease, box-shadow 0.18s ease;
      touch-action: manipulation;
    }
    /* Modern Corner-Cross Tick Marks at tile intersections */
    .vtt-cell::after {
      content: '';
      position: absolute;
      right: -2px;
      bottom: -2px;
      width: 4px;
      height: 4px;
      pointer-events: none;
      background: rgba(245, 158, 11, 0.35);
      border-radius: 50%;
      box-shadow: 0 0 3px rgba(245, 158, 11, 0.4);
      z-index: 4;
      opacity: 0.65;
    }

    /* Ambient Volumetric Torchlight Shader Layer */
    .vtt-torchlight-layer {
      position: absolute;
      inset: 0;
      pointer-events: none;
      z-index: 6;
      mix-blend-mode: screen;
      transition: background 0.35s ease-out;
      animation: vttTorchFlicker 3.5s ease-in-out infinite;
    }
    @keyframes vttTorchFlicker {
      0%, 100% { opacity: 0.88; transform: scale(1); }
      25% { opacity: 0.98; transform: scale(1.015); }
      50% { opacity: 0.82; transform: scale(0.99); }
      75% { opacity: 0.94; transform: scale(1.01); }
    }

    
    /* Procedural CSS Canvas Themes (Zero-AI Tactical Battlemap Shaders) */
    .vtt-board-wrapper.vtt-theme-forest {
      background: radial-gradient(circle at 50% 50%, #1A2E1E 0%, #0F1D13 60%, #070D09 100%),
                  repeating-linear-gradient(45deg, rgba(34, 197, 94, 0.03) 0, rgba(34, 197, 94, 0.03) 12px, transparent 12px, transparent 24px);
      border-color: #22C55E;
      box-shadow: 0 0 25px rgba(22, 101, 52, 0.35), inset 0 0 40px rgba(0, 0, 0, 0.8);
    }
    .vtt-board-wrapper.vtt-theme-swamp {
      background: radial-gradient(circle at 50% 50%, #202E1B 0%, #121A0F 60%, #060B05 100%),
                  repeating-radial-gradient(circle at 20% 30%, rgba(132, 204, 22, 0.05) 0, transparent 30px);
      border-color: #84CC16;
      box-shadow: 0 0 25px rgba(101, 163, 13, 0.35), inset 0 0 40px rgba(0, 0, 0, 0.85);
    }
    .vtt-board-wrapper.vtt-theme-volcano {
      background: radial-gradient(circle at 50% 50%, #3B1612 0%, #200B09 60%, #0D0403 100%),
                  repeating-linear-gradient(135deg, rgba(239, 68, 68, 0.04) 0, rgba(239, 68, 68, 0.04) 15px, transparent 15px, transparent 30px);
      border-color: #EF4444;
      box-shadow: 0 0 25px rgba(220, 38, 38, 0.4), inset 0 0 40px rgba(0, 0, 0, 0.85);
    }
    .vtt-board-wrapper.vtt-theme-crypt {
      background: radial-gradient(circle at 50% 50%, #1A1829 0%, #0F0E18 60%, #07060C 100%),
                  repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.03) 0, rgba(148, 163, 184, 0.03) 20px, transparent 20px, transparent 40px);
      border-color: #818CF8;
      box-shadow: 0 0 25px rgba(99, 102, 241, 0.35), inset 0 0 40px rgba(0, 0, 0, 0.85);
    }
    .vtt-board-wrapper.vtt-theme-arena,
    .vtt-board-wrapper.vtt-theme-pit {
      background: radial-gradient(circle at 50% 50%, #3D2614 0%, #22140A 60%, #0E0704 100%),
                  repeating-radial-gradient(circle at 50% 50%, rgba(245, 158, 11, 0.04) 0, transparent 25px);
      border-color: #F59E0B;
      box-shadow: 0 0 25px rgba(217, 119, 6, 0.4), inset 0 0 40px rgba(0, 0, 0, 0.85);
    }
    .vtt-board-wrapper.vtt-theme-citadel {
      background: radial-gradient(circle at 50% 50%, #172554 0%, #0F172A 60%, #030712 100%),
                  repeating-linear-gradient(60deg, rgba(56, 189, 248, 0.04) 0, rgba(56, 189, 248, 0.04) 18px, transparent 18px, transparent 36px);
      border-color: #38BDF8;
      box-shadow: 0 0 25px rgba(14, 165, 233, 0.35), inset 0 0 40px rgba(0, 0, 0, 0.85);
    }

    .vtt-theme-arena .vtt-grid {
      background: rgba(32, 20, 10, 0.45);
    }
    .vtt-theme-arena .vtt-cell {
      border-color: rgba(245, 158, 11, 0.20);
    }
    .vtt-theme-arena .vtt-cell:hover {
      background: rgba(217, 119, 6, 0.25);
    }

    /* Biome-Matched Tactical Battlemap Grid Styles (Prompt Item O) */
    .vtt-theme-forest .vtt-grid {
      background: rgba(14, 28, 16, 0.40);
    }
    .vtt-theme-forest .vtt-cell {
      border-color: rgba(74, 222, 128, 0.16);
    }
    .vtt-theme-forest .vtt-cell:hover {
      background: rgba(34, 197, 94, 0.22);
    }

    .vtt-theme-pit .vtt-grid {
      background: rgba(32, 20, 10, 0.45);
    }
    .vtt-theme-pit .vtt-cell {
      border-color: rgba(245, 158, 11, 0.20);
    }
    .vtt-theme-pit .vtt-cell:hover {
      background: rgba(217, 119, 6, 0.25);
    }

    .vtt-theme-swamp .vtt-grid {
      background: rgba(18, 26, 12, 0.50);
    }
    .vtt-theme-swamp .vtt-cell {
      border-color: rgba(163, 230, 53, 0.18);
    }
    .vtt-theme-swamp .vtt-cell:hover {
      background: rgba(132, 204, 22, 0.22);
    }

    .vtt-theme-volcano .vtt-grid {
      background: rgba(30, 12, 10, 0.50);
    }
    .vtt-theme-volcano .vtt-cell {
      border-color: rgba(239, 68, 68, 0.22);
    }
    .vtt-theme-volcano .vtt-cell:hover {
      background: rgba(220, 38, 38, 0.25);
    }

    .vtt-theme-crypt .vtt-grid {
      background: rgba(15, 17, 24, 0.50);
    }
    .vtt-theme-crypt .vtt-cell {
      border-color: rgba(148, 163, 184, 0.18);
    }
    .vtt-theme-crypt .vtt-cell:hover {
      background: rgba(99, 102, 241, 0.20);
    }
    .vtt-cell:hover {
      background: rgba(217, 119, 6, 0.18);
    }
    .vtt-cell.valid-move {
      background: rgba(16, 185, 129, 0.22);
      border-color: rgba(16, 185, 129, 0.6);
      cursor: pointer;
    }
    .vtt-cell.valid-move::after {
      content: '';
      width: 8px;
      height: 8px;
      background: rgba(16, 185, 129, 0.85);
      border-radius: 50%;
      box-shadow: 0 0 6px rgba(16, 185, 129, 0.9);
    }
    .vtt-cell.valid-attack {
      background: rgba(220, 38, 38, 0.28);
      border-color: var(--bright-crimson);
      cursor: pointer;
    }

    /* Fog of War Shroud (Item 13) */
    .vtt-cell.fog-shrouded {
      background: radial-gradient(circle, rgba(6, 8, 14, 0.93) 0%, rgba(2, 3, 6, 0.98) 100%) !important;
      border: none !important;
      box-shadow: inset 0 0 16px rgba(0, 0, 0, 0.95);
    }
    .vtt-cell.fog-shrouded::before,
    .vtt-cell.fog-shrouded::after {
      display: none !important;
    }
    .vtt-cell.fog-shrouded .vtt-token.monster-token,
    .vtt-cell.fog-shrouded .vtt-obstacle,
    .vtt-cell.fog-shrouded .vtt-obstacle-prop,
    .vtt-cell.fog-shrouded .vtt-hazard {
      display: none !important;
    }

    /* Planned Move & Ghost Token (Item 13) */
    .vtt-cell.planned-move {
      background: rgba(245, 158, 11, 0.35) !important;
      border: 2px dashed #F59E0B !important;
    }
    .vtt-token.ghost-token {
      opacity: 0.70;
      border: 2px dashed #F59E0B !important;
      filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8));
      pointer-events: none;
    }

    /* Floating Move Confirmation Pill on Target Cell */
    .vtt-cell-confirm-pill {
      position: absolute;
      bottom: calc(100% + 4px);
      left: 50%;
      transform: translateX(-50%);
      display: flex;
      align-items: center;
      gap: 5px;
      background: rgba(15, 23, 42, 0.96);
      border: 1.5px solid var(--amber-gold, #F59E0B);
      border-radius: 20px;
      padding: 3px 6px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.85), 0 0 8px rgba(245, 158, 11, 0.4);
      z-index: 60;
      white-space: nowrap;
      pointer-events: auto;
      user-select: none;
      animation: vttPillPop 0.18s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    }
    .vtt-cell-confirm-pill.pill-below {
      bottom: auto;
      top: calc(100% + 4px);
    }
    .vtt-cell-confirm-pill.pill-left-edge {
      left: 0;
      transform: none;
    }
    .vtt-cell-confirm-pill.pill-right-edge {
      left: auto;
      right: 0;
      transform: none;
    }
    @keyframes vttPillPop {
      0% { transform: scale(0.65); opacity: 0; }
      100% { transform: scale(1.0); opacity: 1; }
    }
    .btn-confirm-check {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: linear-gradient(135deg, #10B981 0%, #059669 100%);
      color: #FFFFFF;
      border: 1.5px solid #34D399;
      font-weight: 900;
      font-size: 14px;
      cursor: pointer;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
      transition: transform 0.15s ease, background 0.15s ease;
      line-height: 1;
      padding: 0;
    }
    .btn-confirm-check:hover {
      transform: scale(1.15);
      background: linear-gradient(135deg, #34D399 0%, #10B981 100%);
    }
    .btn-confirm-check:active {
      transform: scale(0.95);
    }
    .btn-confirm-cancel {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 26px;
      height: 26px;
      border-radius: 50%;
      background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
      color: #FFFFFF;
      border: 1.5px solid #F87171;
      font-weight: 900;
      font-size: 13px;
      cursor: pointer;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
      transition: transform 0.15s ease, background 0.15s ease;
      line-height: 1;
      padding: 0;
    }
    .btn-confirm-cancel:hover {
      transform: scale(1.15);
      background: linear-gradient(135deg, #F87171 0%, #EF4444 100%);
    }
    .btn-confirm-cancel:active {
      transform: scale(0.95);
    }
    .vtt-cell-confirm-pill .pill-dist {
      font-size: 11px;
      font-weight: 700;
      color: var(--amber-gold, #F59E0B);
      font-family: monospace;
      padding: 0 2px;
    }
    .vtt-token.target-reticle {
      animation: targetPulse 0.9s infinite alternate;
      border: 2px solid #EF4444 !important;
      box-shadow: 0 0 15px #EF4444 !important;
      cursor: pointer;
    }
    @keyframes targetPulse {
      0% { transform: scale(1.0); }
      100% { transform: scale(1.18); }
    }

    /* Threat Halos around Melee Enemies */
    .vtt-cell.vtt-threat-halo {
      box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.65);
      border-color: rgba(239, 68, 68, 0.85) !important;
      animation: threatHaloPulse 1.4s infinite alternate ease-in-out;
    }
    @keyframes threatHaloPulse {
      0% {
        box-shadow: inset 0 0 5px rgba(239, 68, 68, 0.4);
        border-color: rgba(239, 68, 68, 0.6);
      }
      100% {
        box-shadow: inset 0 0 14px rgba(239, 68, 68, 0.9);
        border-color: rgba(248, 113, 113, 1);
      }
    }
    .vtt-cell.vtt-threat-halo-safe {
      box-shadow: inset 0 0 8px rgba(16, 185, 129, 0.45) !important;
      border-color: rgba(52, 211, 153, 0.8) !important;
      animation: none !important;
    }

    /* GM Coordinate Labels */
    .vtt-coord-label {
      display: none;
      position: absolute;
      top: 1px;
      left: 2px;
      font-family: monospace;
      font-size: 8px;
      line-height: 1;
      color: rgba(199, 210, 254, 0.75);
      pointer-events: none;
      z-index: 5;
      user-select: none;
    }
    .vtt-debug-active .vtt-coord-label {
      display: block;
    }

    /* Board Shake on Crits & OA Hits */
    .vtt-board-shake {
      animation: vttShake 0.3s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
    }
    @keyframes vttShake {
      10%, 90% { transform: translate3d(-2px, -1px, 0); }
      20%, 80% { transform: translate3d(3px, 2px, 0); }
      30%, 50%, 70% { transform: translate3d(-4px, -2px, 0); }
      40%, 60% { transform: translate3d(4px, 1px, 0); }
    }

    /* Animated SVG Path for Hover/Move Preview */
    .vtt-svg-animated-path {
      animation: vttDash 0.8s linear infinite;
    }
    @keyframes vttDash {
      to {
        stroke-dashoffset: -10;
      }
    }

    /* Tactical Combat Action Modal Buttons */
    .radial-bubble-btn {
      background: linear-gradient(145deg, #1C2230, #11151F);
      border: 1.5px solid rgba(245, 158, 11, 0.4);
      border-radius: 8px;
      width: 100%;
      height: 52px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      color: #FFF;
      cursor: pointer;
      box-shadow: 0 4px 10px rgba(0,0,0,0.6);
      transition: all 0.15s ease;
      gap: 3px;
    }
    .radial-bubble-btn:hover {
      background: linear-gradient(145deg, #2B3347, #191F2C);
      border-color: var(--amber-gold);
      transform: translateY(-1px);
      box-shadow: 0 4px 14px rgba(245, 158, 11, 0.25);
    }
    .radial-bubble-btn:active {
      transform: scale(0.96);
      border-color: #FFF;
    }
    .radial-bubble-btn span {
      font-size: 9.5px;
      font-weight: 700;
      color: var(--amber-gold);
      letter-spacing: 0.3px;
      text-transform: uppercase;
      line-height: 1.1;
    }

    /* 5e Character Creation Chips & Point Buy (Item 2) */
    .race-chip, .class-chip, .bg-chip {
      background: var(--elevated-bg);
      border: 1px solid var(--runic-border);
      border-radius: 8px;
      padding: 8px 4px;
      color: var(--parchment-text);
      font-family: inherit;
      font-size: 11px;
      font-weight: 600;
      text-align: center;
      cursor: pointer;
      transition: all 0.15s;
    }
    .race-chip.active, .class-chip.active, .bg-chip.active {
      background: rgba(245, 158, 11, 0.22);
      border-color: var(--amber-gold);
      color: #FFF;
      box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
    }

    /* Solasta-Style Overworld Compass HUD */
    .compass-btn {
      padding: 0 !important;
      font-size: 10px !important;
      font-weight: 800 !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      height: 40px !important;
      border-radius: 6px !important;
      letter-spacing: 0.2px !important;
      transition: all 0.15s ease !important;
    }
    .compass-btn.available {
      border-color: var(--amber-gold) !important;
      color: #FFF !important;
      background: rgba(245, 158, 11, 0.15) !important;
      box-shadow: 0 0 8px rgba(245, 158, 11, 0.25) !important;
      cursor: pointer !important;
    }
    .compass-btn.selected {
      background: linear-gradient(135deg, #F59E0B, #D97706) !important;
      color: #0F1115 !important;
      border-color: #FDE68A !important;
      box-shadow: 0 0 14px rgba(245, 158, 11, 0.6) !important;
    }
    .compass-btn:disabled {
      opacity: 0.25 !important;
      cursor: not-allowed !important;
      border-color: rgba(148, 163, 184, 0.2) !important;
    }
    .stat-stepper-box {
      background: rgba(15, 20, 28, 0.7);
      border: 1px solid var(--runic-border);
      border-radius: 8px;
      padding: 6px 8px;
      display: flex;
      justify-content: space-between;
      align-items: center;
    }
    .step-btn {
      width: 22px;
      height: 22px;
      border-radius: 4px;
      border: 1px solid var(--runic-border);
      background: #1E232E;
      color: var(--parchment-text);
      font-weight: bold;
      font-size: 13px;
      display: flex;
      justify-content: center;
      align-items: center;
      cursor: pointer;
    }
    .step-btn:active {
      background: var(--amber-gold);
      color: #000;
    }

    .vtt-obstacle {
      font-size: 18px;
      filter: drop-shadow(0 2px 4px rgba(0,0,0,0.9));
      pointer-events: none;
    }

    /* Stylized Dark Fantasy Obstacle Blocks (Item 4) */
    .vtt-cell.vtt-cell-impassable {
      cursor: not-allowed !important;
      position: relative;
      overflow: hidden;
      box-sizing: border-box;
    }
    .vtt-cell.vtt-cell-impassable:hover {
      box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.4) !important;
    }

    .vtt-obstacle-block {
      position: absolute;
      inset: 1px;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      border-radius: 4px;
      box-sizing: border-box;
      pointer-events: none;
      z-index: 2;
      user-select: none;
    }

    .vtt-obstacle-hash {
      position: absolute;
      inset: 0;
      background: repeating-linear-gradient(
        -45deg,
        rgba(0, 0, 0, 0.45),
        rgba(0, 0, 0, 0.45) 4px,
        transparent 4px,
        transparent 8px
      );
      opacity: 0.65;
      pointer-events: none;
    }

    .vtt-obstacle-icon {
      font-size: 18px;
      filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.95));
      z-index: 1;
      line-height: 1;
    }

    .vtt-obstacle-label {
      font-size: 7px;
      font-weight: 800;
      letter-spacing: 0.6px;
      color: #94A3B8;
      text-shadow: 0 1px 2px #000;
      margin-top: 2px;
      z-index: 1;
      width: 100%;
      text-align: center;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      box-sizing: border-box;
      padding: 0 2px;
    }

    /* Real Stone Wall: Chiseled Dark Granite Block with top-down bevel and shadow */
    .vtt-cell.obs-wall {
      background: linear-gradient(180deg, #334155 0%, #1E293B 40%, #0F172A 100%) !important;
      border: 1.5px solid #475569 !important;
      border-top: 2px solid #94A3B8 !important;
      border-bottom: 2.5px solid #020617 !important;
      box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.25), inset 0 -3px 6px rgba(0, 0, 0, 0.9), 0 4px 8px rgba(0, 0, 0, 0.8) !important;
    }
    .vtt-cell.obs-wall .vtt-obstacle-block {
      background: radial-gradient(circle at 50% 30%, rgba(51, 65, 85, 0.6) 0%, rgba(15, 23, 42, 0.95) 100%);
      border: 1px solid rgba(148, 163, 184, 0.25);
    }
    .vtt-cell.obs-wall .vtt-obstacle-label {
      color: #CBD5E1;
    }

    /* Ancient Boulder */
    .vtt-cell.obs-boulder {
      background: radial-gradient(circle at 40% 35%, #475569 0%, #1E293B 65%, #0B0F17 100%) !important;
      border: 1.5px solid #334155 !important;
      border-radius: 6px !important;
      box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.2), inset -2px -3px 6px rgba(0, 0, 0, 0.95), 0 3px 6px rgba(0, 0, 0, 0.75) !important;
    }

    /* Ironwood Barricade / Timber */
    .vtt-cell.obs-barricade, .vtt-cell.obs-stump {
      background: linear-gradient(135deg, #3D2314 0%, #27170E 50%, #150C07 100%) !important;
      border: 1.5px solid #78350F !important;
      border-top: 2px solid #B45309 !important;
      box-shadow: inset 0 2px 3px rgba(245, 158, 11, 0.2), inset 0 -3px 5px rgba(0, 0, 0, 0.9), 0 3px 6px rgba(0, 0, 0, 0.7) !important;
    }

    /* Carved Monolithic Pillar */
    .vtt-cell.obs-pillar {
      background: radial-gradient(circle, #475569 0%, #1E293B 70%, #020617 100%) !important;
      border: 2px solid #64748B !important;
      border-radius: 50% !important;
      box-shadow: inset 0 3px 6px rgba(255, 255, 255, 0.3), inset 0 -4px 6px rgba(0, 0, 0, 0.95), 0 4px 8px rgba(0, 0, 0, 0.8) !important;
    }

    /* Dense Ancient Pine / Tree */
    .vtt-cell.obs-tree {
      background: radial-gradient(circle at 50% 35%, #14532D 0%, #064E3B 60%, #022C22 100%) !important;
      border: 1.5px solid #166534 !important;
      border-top: 2px solid #22C55E !important;
      box-shadow: inset 0 2px 4px rgba(34, 197, 94, 0.25), inset 0 -3px 5px rgba(0, 0, 0, 0.9), 0 3px 6px rgba(0, 0, 0, 0.7) !important;
    }

    /* Ancient Runic Sarcophagus */
    .vtt-cell.obs-sarcophagus {
      background: linear-gradient(180deg, #2E1065 0%, #1E1B4B 50%, #0F0E17 100%) !important;
      border: 1.5px solid #6B21A8 !important;
      box-shadow: inset 0 2px 4px rgba(168, 85, 247, 0.3), inset 0 -3px 6px rgba(0, 0, 0, 0.95), 0 4px 7px rgba(0, 0, 0, 0.8) !important;
    }

    /* Rubble / Bone Pile / Stalagmite */
    .vtt-cell.obs-rubble, .vtt-cell.obs-bone_pile, .vtt-cell.obs-stalagmite, .vtt-cell.obs-statue {
      background: linear-gradient(145deg, #334155 0%, #1E293B 60%, #0F172A 100%) !important;
      border: 1.5px solid #475569 !important;
      box-shadow: inset 0 2px 3px rgba(255, 255, 255, 0.15), inset 0 -3px 5px rgba(0, 0, 0, 0.9), 0 3px 6px rgba(0, 0, 0, 0.7) !important;
    }

    .vtt-hazard {
      position: absolute;
      inset: 2px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 13px;
      background: rgba(220, 38, 38, 0.25);
      border: 1px dashed var(--bright-crimson);
      border-radius: 4px;
      animation: pulse-hazard 2s infinite;
      pointer-events: none;
    }
    @keyframes pulse-hazard {
      0%, 100% { opacity: 0.6; }
      50% { opacity: 1; }
    }
    .vtt-token {
      position: absolute;
      width: 86%;
      height: 86%;
      border-radius: 50%;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      cursor: grab;
      z-index: 10;
      overflow: hidden;
      touch-action: manipulation;
      transition: transform 0.15s ease-out, box-shadow 0.15s;
      user-select: none;
      box-shadow: 0 4px 12px rgba(0,0,0,0.9);
    }
    .vtt-token-img {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      border-radius: 50%;
      object-fit: cover;
      z-index: 1;
      pointer-events: none;
      box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.6);
    }
    .vtt-token:active, .vtt-token.dragging {
      cursor: grabbing;
      transform: scale(1.22);
      z-index: 50;
      box-shadow: 0 10px 25px rgba(0,0,0,1);
    }
    .vtt-token.player-token {
      background: radial-gradient(circle, #3D2808 0%, #17120A 100%);
      border: 2px solid var(--amber-gold);
      box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
    }
    .vtt-token.ally-token {
      background: radial-gradient(circle, #0F2942 0%, #0A1420 100%);
      border: 2px solid #3B82F6;
      box-shadow: 0 0 10px rgba(59, 130, 246, 0.7);
    }
    .vtt-token.ally-token .vtt-token-hp-fill {
      background: #3B82F6;
    }
    .vtt-ally-name-tag {
      position: absolute;
      bottom: -13px;
      left: 50%;
      transform: translateX(-50%);
      font-size: 8px;
      font-weight: 700;
      color: #93C5FD;
      background: rgba(10, 20, 32, 0.9);
      padding: 1px 3px;
      border-radius: 2px;
      border: 1px solid rgba(59, 130, 246, 0.5);
      white-space: nowrap;
      pointer-events: none;
      z-index: 10;
    }
    .vtt-ally-ready-tag {
      position: absolute;
      top: -5px;
      right: -5px;
      font-size: 9px;
      background: #10B981;
      color: #FFF;
      border-radius: 50%;
      width: 14px;
      height: 14px;
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 0 5px rgba(16, 185, 129, 0.8);
      font-weight: bold;
      pointer-events: none;
    }
    .vtt-token.monster-token {
      background: radial-gradient(circle, #381216 0%, #160B0D 100%);
      border: 2px solid var(--bright-crimson);
      box-shadow: 0 0 10px rgba(220, 38, 38, 0.7);
    }
    .vtt-token-icon {
      font-size: 18px;
      line-height: 1;
      pointer-events: none;
    }
    .vtt-token-hp {
      width: 72%;
      height: 3px;
      background: #222;
      border-radius: 2px;
      margin-top: 2px;
      overflow: hidden;
      pointer-events: none;
    }
    .vtt-token-hp-fill {
      height: 100%;
      background: var(--health-green);
      transition: width 0.3s;
    }
    .vtt-ruler {
      position: absolute;
      top: 6px;
      left: 6px;
      background: rgba(0, 0, 0, 0.85);
      border: 1px solid var(--amber-gold);
      color: var(--amber-gold);
      font-size: 10px;
      font-weight: bold;
      padding: 3px 8px;
      border-radius: 4px;
      pointer-events: none;
      z-index: 25;
      display: none;
    }

    /* Enhanced Landing / Auth Screen Styles */
    .landing-badge-bar {
      display: flex;
      justify-content: center;
      gap: 6px;
      flex-wrap: wrap;
      margin: 6px 0 10px;
    }
    .landing-pill {
      font-size: 9px;
      font-weight: 700;
      letter-spacing: 0.5px;
      padding: 3px 8px;
      border-radius: 999px;
      background: rgba(22, 25, 34, 0.75);
      border: 1px solid rgba(245, 158, 11, 0.35);
      color: #FCD34D;
      display: inline-flex;
      align-items: center;
      gap: 4px;
      backdrop-filter: blur(8px);
    }
    .auth-tab-row {
      display: flex;
      background: rgba(15, 17, 21, 0.7);
      border-radius: 8px;
      padding: 3px;
      gap: 4px;
      border: 1px solid var(--runic-border);
      margin-bottom: 8px;
    }
    .auth-tab-btn {
      flex: 1;
      padding: 8px 4px;
      font-size: 11px;
      font-weight: 700;
      font-family: 'Cinzel', serif;
      letter-spacing: 0.5px;
      border: 1px solid transparent;
      background: transparent;
      color: var(--muted-silver);
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s ease;
      touch-action: manipulation;
    }
    .auth-tab-btn.active {
      background: linear-gradient(180deg, rgba(245, 158, 11, 0.22) 0%, rgba(220, 38, 38, 0.25) 100%);
      color: #FFF;
      border: 1px solid var(--amber-gold);
      box-shadow: 0 0 12px rgba(245, 158, 11, 0.35);
    }
    .auth-divider {
      display: flex;
      align-items: center;
      text-align: center;
      color: var(--muted-silver);
      font-size: 9px;
      font-weight: 600;
      letter-spacing: 1px;
      margin: 8px 0;
    }
    .auth-divider::before, .auth-divider::after {
      content: '';
      flex: 1;
      border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    }
    .auth-divider:not(:empty)::before {
      margin-right: 8px;
    }
    .auth-divider:not(:empty)::after {
      margin-left: 8px;
    }
    .intro-pillar-card {
      background: rgba(22, 25, 34, 0.88);
      border: 1px solid rgba(245, 158, 11, 0.25);
      border-radius: 10px;
      padding: 10px 12px;
      display: flex;
      gap: 10px;
      align-items: flex-start;
      transition: transform 0.2s, border-color 0.2s;
    }
    .intro-pillar-card:hover {
      border-color: var(--amber-gold);
      transform: translateY(-1px);
    }
    .intro-pillar-icon {
      font-size: 22px;
      line-height: 1;
      padding: 8px;
      border-radius: 8px;
      background: rgba(245, 158, 11, 0.12);
      border: 1px solid rgba(245, 158, 11, 0.3);
      flex-shrink: 0;
    }
    .intro-pillar-title {
      font-family: 'Cinzel', serif;
      font-size: 12px;
      font-weight: 700;
      color: var(--amber-gold);
      margin-bottom: 2px;
      letter-spacing: 0.5px;
    }
    .intro-pillar-text {
      font-size: 11px;
      color: var(--parchment-text);
      line-height: 1.4;
      opacity: 0.9;
    }
    .game-guide-step {
      display: flex;
      gap: 10px;
      align-items: flex-start;
      padding: 8px 10px;
      border-radius: 8px;
      background: rgba(15, 17, 21, 0.6);
      border-left: 3px solid var(--amber-gold);
      border-top: 1px solid rgba(255, 255, 255, 0.05);
      border-right: 1px solid rgba(255, 255, 255, 0.05);
      border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    .guide-step-num {
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: linear-gradient(135deg, var(--amber-gold) 0%, var(--tarnished-gold) 100%);
      color: #0F1115;
      font-weight: 900;
      font-size: 11px;
      display: flex;
      align-items: center;
      justify-content: center;
      flex-shrink: 0;
      margin-top: 1px;
      box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
    }
    .guide-step-content {
      flex: 1;
    }
    .guide-step-title {
      font-family: 'Cinzel', serif;
      font-size: 11px;
      font-weight: 700;
      color: var(--amber-gold);
      margin-bottom: 1px;
    }
    .guide-step-desc {
      font-size: 10px;
      color: var(--muted-silver);
      line-height: 1.35;
    }

    body.no-nav .bottom-nav { display: none; }

    /* NPC Atmospheric Dialogue & Scene Narrative */
    #npc-chat-log p,
    .npc-scene-narrative,
    .npc-spoken-dialogue,
    .npc-spoken-dialogue .dialogue-quote,
    .dialogue-quote {
      font-family: 'Crimson Pro', Georgia, serif;
      font-size: 15px !important;
      line-height: 1.5;
    }

    /* Spoken Dialogue: Pure Bright White with crisp shadow */
    .npc-spoken-dialogue,
    .npc-spoken-dialogue .dialogue-quote,
    .dialogue-quote {
      font-style: normal;
      color: #FFFFFF !important;
      font-weight: 600;
      letter-spacing: 0.15px;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    }

    /* Narrative: Bright Yellow across the 5 Biome Themes */
    .npc-scene-narrative {
      font-style: italic;
      color: #FDE047 !important; /* Bright Gold-Yellow default (Oakhaven Vale / Forest) */
      font-weight: 500;
      margin-bottom: 6px;
      padding: 4px 10px;
      border-left: 3px solid #EAB308;
      background: rgba(245, 158, 11, 0.08);
      border-radius: 0 4px 4px 0;
      text-shadow: 0 1px 3px rgba(0, 0, 0, 0.95);
    }

    /* Theme 1: Oakhaven Vale (Forest / Sun-Gold Yellow) */
    [data-npc-theme="forest"] .npc-scene-narrative,
    .theme-forest .npc-scene-narrative,
    .theme-oakhaven .npc-scene-narrative {
      color: #FDE047 !important;
      border-left-color: #EAB308;
      background: rgba(234, 179, 8, 0.10);
    }

    /* Theme 2: Sunken Mire (Swamp / Phosphorescent Lime-Yellow) */
    [data-npc-theme="swamp"] .npc-scene-narrative,
    .theme-swamp .npc-scene-narrative,
    .theme-mire .npc-scene-narrative {
      color: #E2F952 !important;
      border-left-color: #84CC16;
      background: rgba(132, 204, 22, 0.10);
    }

    /* Theme 3: Ashen Crags (Volcano / Molten Flame-Yellow) */
    [data-npc-theme="volcano"] .npc-scene-narrative,
    .theme-volcano .npc-scene-narrative,
    .theme-crags .npc-scene-narrative {
      color: #FDE047 !important;
      border-left-color: #F97316;
      background: rgba(249, 115, 22, 0.12);
    }

    /* Theme 4: Dread Hollow (Crypt / Spectral Moon-Yellow) */
    [data-npc-theme="crypt"] .npc-scene-narrative,
    .theme-crypt .npc-scene-narrative,
    .theme-dread .npc-scene-narrative {
      color: #FEF08A !important;
      border-left-color: #A855F7;
      background: rgba(168, 85, 247, 0.12);
    }

    /* Theme 5: High Reach City (Citadel / Radiant Imperial Gold) */
    [data-npc-theme="citadel"] .npc-scene-narrative,
    .theme-citadel .npc-scene-narrative,
    .theme-reach .npc-scene-narrative {
      color: #FACC15 !important;
      border-left-color: #38BDF8;
      background: rgba(56, 189, 248, 0.10);
    }

    /* Collapsible Field Toggle Buttons (Red - and Green +) */
    .field-collapse-btn {
      width: 22px;
      height: 22px;
      min-width: 22px;
      border-radius: 50%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      margin: 0;
      cursor: pointer;
      outline: none;
      transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
      flex-shrink: 0;
      box-sizing: border-box;
      user-select: none;
      -webkit-user-select: none;
    }
    .field-collapse-btn:hover {
      transform: scale(1.15);
    }
    .field-collapse-btn:active {
      transform: scale(0.95);
    }

    /* Red Minus Button (Collapse) */
    .field-collapse-btn.btn-collapse-minus {
      background: rgba(220, 38, 38, 0.25);
      border: 1.5px solid #EF4444;
      color: #EF4444;
      box-shadow: 0 0 8px rgba(239, 68, 68, 0.45);
    }
    .field-collapse-btn.btn-collapse-minus span {
      font-size: 16px;
      font-weight: 900;
      line-height: 1;
      display: block;
      margin-top: -2px;
    }
    .field-collapse-btn.btn-collapse-minus:hover {
      background: rgba(220, 38, 38, 0.55);
      box-shadow: 0 0 12px rgba(239, 68, 68, 0.75);
      color: #FFF;
    }

    /* Green Plus Button (Expand) */
    .field-collapse-btn.btn-collapse-plus {
      background: rgba(34, 197, 94, 0.25);
      border: 1.5px solid #22C55E;
      color: #22C55E;
      box-shadow: 0 0 8px rgba(34, 197, 94, 0.45);
    }
    .field-collapse-btn.btn-collapse-plus span {
      font-size: 15px;
      font-weight: 900;
      line-height: 1;
      display: block;
      margin-top: -1px;
    }
    .field-collapse-btn.btn-collapse-plus:hover {
      background: rgba(34, 197, 94, 0.55);
      box-shadow: 0 0 12px rgba(34, 197, 94, 0.75);
      color: #FFF;
    }

    .npc-shop-quick-btn {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      background: rgba(245, 158, 11, 0.15);
      border: 1px solid var(--amber-gold);
      color: var(--amber-gold);
      font-family: 'Cinzel', serif;
      font-size: 10px;
      font-weight: 700;
      padding: 5px 10px;
      border-radius: 4px;
      cursor: pointer;
      margin-bottom: 6px;
      transition: all 0.2s ease;
    }
    .npc-shop-quick-btn:hover {
      background: var(--amber-gold);
      color: #0F1115;
    }

    /* Mobile Keyboard Avoidance */
    body.keyboard-open .bottom-nav {
      display: none !important;
    }

    .screen-npc-container {
      flex: 1 1 0;
      min-height: 0;
      height: auto;
      max-height: none;
      padding: 8px 12px 6px;
      overflow: hidden;
      display: none;
      flex-direction: column;
      box-sizing: border-box;
    }

    body.keyboard-open .screen-npc-container {
      height: var(--screen-npc-height, calc(100dvh - 20px)) !important;
      max-height: var(--screen-npc-height, calc(100dvh - 20px)) !important;
      padding-bottom: 4px !important;
    }

    /* Gambits Card Container with Responsive Wrapping */
    .npc-gambits-bar {
      display: flex;
      flex-direction: column;
      background: rgba(15, 23, 42, 0.95);
      border: 1px solid rgba(245, 158, 11, 0.3);
      border-radius: 8px;
      padding: 6px 10px;
      margin-bottom: 6px;
      box-sizing: border-box;
      flex-shrink: 0;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    }

    .npc-gambits-top-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      width: 100%;
      box-sizing: border-box;
    }

    .npc-gambits-buttons-wrap {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      margin-top: 6px;
      width: 100%;
      box-sizing: border-box;
    }

    .gambit-chip {
      font-size: 10.5px !important;
      padding: 5px 9px !important;
      flex: 1 1 auto;
      min-width: 84px;
      text-align: center;
      white-space: nowrap;
      border-radius: 5px;
      background: rgba(30, 41, 59, 0.85);
      box-sizing: border-box;
      font-weight: 600;
      transition: all 0.15s ease;
      cursor: pointer;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 4px;
    }
    .gambit-chip:hover {
      transform: translateY(-1px);
      filter: brightness(1.2);
    }
    .gambit-chip:active {
      transform: translateY(0);
    }

    .gambit-persuade { border: 1px solid rgba(56, 189, 248, 0.5); color: #BAE6FD; }
    .gambit-intimidate { border: 1px solid rgba(239, 68, 68, 0.5); color: #FCA5A5; }
    .gambit-deceive { border: 1px solid rgba(168, 85, 247, 0.5); color: #E9D5FF; }
    .gambit-insight { border: 1px solid rgba(34, 197, 94, 0.5); color: #86EFAC; }
    .gambit-directions { border: 1px solid rgba(245, 158, 11, 0.5); color: var(--amber-gold); }

    /* Expanded / Fullscreen Reading Mode for NPC Tavern Chat */
    .screen-npc-container.reading-mode #npc-chat-env-header,
    .screen-npc-container.reading-mode #npc-quick-services-bar,
    .screen-npc-container.reading-mode #npc-gambits-bar {
      display: none !important;
    }

    .screen-npc-container.reading-mode #npc-chat-log {
      padding: 12px 2px;
      gap: 14px;
    }

    .screen-npc-container.reading-mode #npc-chat-log .card {
      max-width: 100% !important;
      padding: 14px 16px;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7);
    }

    .screen-npc-container.reading-mode #npc-chat-log p,
    .screen-npc-container.reading-mode .dialogue-quote {
      font-size: 16px !important;
      line-height: 1.65 !important;
      letter-spacing: 0.2px;
    }

    .npc-input-bar {
      flex-shrink: 0;
      padding-top: 8px;
      border-top: 1px solid rgba(255, 255, 255, 0.08);
      background: var(--ebon-night);
      display: flex;
      gap: 8px;
      align-items: center;
      position: relative;
      z-index: 50;
    }

    /* Arena VTT Bottom Padding & Column Centering to preserve scroll space */
    #arena-vtt-view {
      display: flex;
      flex-direction: column !important;
      width: 100%;
      align-items: stretch;
      padding-bottom: 76px;
    }

    /* Docked End Turn Container (Never overlaps battlemap tiles or tokens) */
    #vtt-end-turn-container {
      position: relative;
      z-index: 10;
      background: rgba(15, 17, 21, 0.96);
      padding: 4px 0;
      margin-top: 6px;
      border-top: 1px solid rgba(245, 158, 11, 0.2);
    }

    /* Uniform Combat Class Action Buttons */
    .vtt-uniform-class-btn,
    #vtt-class-action-container .btn {
      height: 32px !important;
      min-height: 32px !important;
      max-height: 32px !important;
      font-size: 10px !important;
      font-weight: 800 !important;
      padding: 4px 6px !important;
      margin: 0 !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      text-align: center !important;
      white-space: nowrap !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      box-sizing: border-box !important;
      width: 100% !important;
      line-height: 1 !important;
      letter-spacing: 0.3px !important;
    }

    /* Primal Rage Visual Indicators (Prompt Item 6) */
    .raging-token {
      box-shadow: 0 0 14px rgba(239, 68, 68, 0.9), inset 0 0 8px rgba(245, 158, 11, 0.8) !important;
      border-color: #EF4444 !important;
      animation: rageTokenPulse 1.2s infinite alternate !important;
    }
    @keyframes rageTokenPulse {
      0% { transform: scale(1); filter: drop-shadow(0 0 4px #EF4444); }
      100% { transform: scale(1.06); filter: drop-shadow(0 0 10px #F59E0B); }
    }
    .badge-raging {
      background: linear-gradient(135deg, rgba(220, 38, 38, 0.3), rgba(245, 158, 11, 0.3));
      border: 1px solid #EF4444;
      color: #FECACA;
      font-size: 9px;
      font-weight: 800;
      padding: 1px 5px;
      border-radius: 4px;
      display: inline-flex;
      align-items: center;
      gap: 3px;
      letter-spacing: 0.5px;
      animation: pulse 1.5s infinite;
    }

    /* Depleted Spell Slots Styling (Prompt Item 2) */
    .btn-spell-depleted {
      opacity: 0.45 !important;
      cursor: not-allowed !important;
      filter: grayscale(80%) !important;
      border-color: rgba(148, 163, 184, 0.2) !important;
    }

    /* End Turn Discoverability & Urgency Styling */
    .btn-end-turn-ready {
      background: linear-gradient(180deg, #374151 0%, #1F2937 100%) !important;
      border: 1.5px solid #4B5563 !important;
      color: #F3F4F6 !important;
      font-weight: 700 !important;
      font-size: 11px !important;
      padding: 10px 12px !important;
      width: 100% !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 6px !important;
      letter-spacing: 0.5px !important;
      border-radius: 6px !important;
      cursor: pointer !important;
      transition: all 0.2s ease !important;
    }

    .btn-end-turn-urgent {
      background: linear-gradient(180deg, #F59E0B 0%, #D97706 50%, #B45309 100%) !important;
      border: 1.5px solid #FDE68A !important;
      color: #0F1115 !important;
      font-weight: 900 !important;
      font-size: 11px !important;
      padding: 10px 12px !important;
      width: 100% !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 6px !important;
      letter-spacing: 0.5px !important;
      border-radius: 6px !important;
      cursor: pointer !important;
      animation: pulseEndTurn 1.3s infinite alternate !important;
      box-shadow: 0 0 16px rgba(245, 158, 11, 0.75) !important;
    }

    @keyframes pulseEndTurn {
      0% {
        transform: scale(1);
        box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
      }
      100% {
        transform: scale(1.02);
        box-shadow: 0 0 18px rgba(245, 158, 11, 0.95);
      }
    }

    .combat-first-hint-banner {
      background: rgba(30, 41, 59, 0.95);
      border: 1px solid var(--amber-gold);
      border-radius: 6px;
      padding: 6px 10px;
      margin-bottom: 6px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 8px;
      font-size: 10.5px;
      color: #F8FAFC;
    }

    /* Combat Floating Hit / Miss Animations (Item 4) */
    @keyframes combatFloatResult {
      0% {
        transform: translate(-50%, 0) scale(0.6);
        opacity: 0;
      }
      20% {
        transform: translate(-50%, -12px) scale(1.18);
        opacity: 1;
      }
      70% {
        transform: translate(-50%, -24px) scale(1.0);
        opacity: 1;
      }
      100% {
        transform: translate(-50%, -42px) scale(0.9);
        opacity: 0;
      }
    }

    .combat-float-hit {
      position: absolute;
      z-index: 80;
      pointer-events: none;
      font-family: 'Cinzel', serif;
      font-size: 13px;
      font-weight: 900;
      letter-spacing: 0.5px;
      color: #FBBF24;
      text-shadow: 0 0 10px rgba(245, 158, 11, 0.9), 0 2px 4px #000;
      white-space: nowrap;
      animation: combatFloatResult 1.3s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }

    .combat-float-crit {
      position: absolute;
      z-index: 85;
      pointer-events: none;
      font-family: 'Cinzel', serif;
      font-size: 15px;
      font-weight: 900;
      letter-spacing: 1px;
      color: #34D399;
      text-shadow: 0 0 14px rgba(52, 211, 153, 0.95), 0 2px 6px #000;
      white-space: nowrap;
      animation: combatFloatResult 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    }

    .combat-float-miss {
      position: absolute;
      z-index: 80;
      pointer-events: none;
      font-family: 'Cinzel', serif;
      font-size: 12px;
      font-weight: 700;
      letter-spacing: 0.5px;
      color: #94A3B8;
      text-shadow: 0 0 8px rgba(148, 163, 184, 0.8), 0 2px 4px #000;
      white-space: nowrap;
      animation: combatFloatResult 1.2s ease-out forwards;
    }

    /* Narrative NPC Typography & Voices (Item 6) */
    .npc-narrative-prose {
      font-family: 'Crimson Pro', Georgia, serif;
      font-size: 15px;
      line-height: 1.55;
      color: #E2E8F0;
      letter-spacing: 0.15px;
      margin: 4px 0 2px;
    }

    .npc-speaker-name {
      font-family: 'Cinzel', serif;
      font-size: 10.5px;
      font-weight: 700;
      color: var(--amber-gold);
      letter-spacing: 0.5px;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    /* Combat Screen Device-Aware Auto-Scaling */
    @media (max-height: 740px) {
      #screen-combat {
        padding: 6px 8px calc(88px + env(safe-area-inset-bottom, 0px)) 8px !important;
        overflow-y: auto !important;
      }
      #screen-combat .card {
        padding: 6px 8px !important;
        margin-bottom: 4px !important;
      }
      #combat-prose-text {
        font-size: 10px !important;
        line-height: 1.3 !important;
        margin-top: 1px !important;
        max-height: 75px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
      }
      #combat-dice-msg {
        font-size: 10.5px !important;
      }
    }

    /* Mobile Responsive Scrollable Combat Viewport (Phones, Flagships & Narrow Screens) */
    @media (max-width: 600px) {
      #screen-combat.active {
        flex: 1 1 0 !important;
        min-height: 0 !important;
        height: auto !important;
        max-height: none !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        -webkit-overflow-scrolling: touch !important;
        overscroll-behavior-y: contain !important;
        padding: 4px 6px calc(92px + env(safe-area-inset-bottom, 0px)) 6px !important;
        scroll-padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)) !important;
        gap: 5px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        box-sizing: border-box !important;
      }
      #screen-combat:not(.active) {
        display: none !important;
      }
      #arena-vtt-view {
        height: auto !important;
        min-height: min-content !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        overflow: visible !important;
      }
      #arena-vtt-view:not([style*="display: none"]) {
        display: flex !important;
      }
      #arena-vtt-view[style*="display: none"] {
        display: none !important;
      }
      #arena-lobby-view[style*="display: none"] {
        display: none !important;
      }
      #arena-lobby-view:not([style*="display: none"]) {
        display: flex !important;
      }
      .desktop-combat-container {
        display: flex !important;
        flex-direction: column !important;
        flex: none !important;
        min-height: min-content !important;
        height: auto !important;
        overflow: visible !important;
        justify-content: flex-start !important;
        gap: 5px !important;
      }
      .desktop-combat-left,
      .desktop-combat-right {
        overflow: visible !important;
        height: auto !important;
        min-height: min-content !important;
      }
      .vtt-board-wrapper {
        max-height: min(var(--vtt-dynamic-size, 250px), 260px, 31vh) !important;
        max-width: min(var(--vtt-dynamic-size, 250px), 260px, 31vh) !important;
        margin: 0 auto 2px auto !important;
      }
      #vtt-path-banner {
        display: none !important; /* redundant on mobile, saves 28px */
      }
      #vtt-first-battle-hint {
        display: none !important; /* saves 40px */
      }
      #screen-combat .card {
        padding: 6px 10px !important;
        margin-bottom: 4px !important;
      }
      #combat-prose-text {
        max-height: 80px !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        text-overflow: clip !important;
        font-size: 9.5px !important;
        line-height: 1.3 !important;
      }
      #combat-dice-msg {
        font-size: 10.5px !important;
        line-height: 1.25 !important;
      }
      #vtt-quick-actions button {
        min-height: 34px !important;
      }
    }

    /* Arcane Quota Wellspring & Monetization Styles */
    #settings-quota-card {
      position: relative;
      overflow: hidden;
      flex-shrink: 0 !important;
      min-height: fit-content !important;
    }
    #settings-quota-card::before {
      content: "";
      position: absolute;
      inset: 0;
      background: radial-gradient(circle, rgba(168, 85, 247, 0.06) 0%, transparent 70%);
      pointer-events: none;
    }
    #quota-progress-bar {
      box-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
    }

    /* PWA Update Notification Toast */
    /* Universal Floating Realm Toast Container */
    #realm-toast-container {
      position: fixed !important;
      top: calc(56px + env(safe-area-inset-top, 0px)) !important;
      left: 50% !important;
      transform: translateX(-50%) !important;
      z-index: 9999 !important;
      display: flex !important;
      flex-direction: column !important;
      gap: 8px !important;
      pointer-events: none !important;
      width: max-content !important;
      max-width: 90vw !important;
    }

    .pwa-update-toast {
      position: fixed;
      top: calc(56px + env(safe-area-inset-top, 0px));
      left: 50%;
      transform: translateX(-50%);
      width: calc(100% - 24px);
      max-width: 440px;
      background: rgba(18, 15, 30, 0.98);
      border: 1.5px solid var(--amber-gold);
      border-radius: 8px;
      padding: 8px 12px;
      color: #FFF;
      font-size: 11px;
      z-index: 99999;
      box-shadow: 0 4px 20px rgba(0, 0, 0, 0.7), 0 0 15px rgba(245, 158, 11, 0.35);
      display: none;
      animation: slideDownToast 0.3s ease-out;
    }
    @keyframes slideDownToast {
      from { transform: translate(-50%, -20px); opacity: 0; }
      to { transform: translate(-50%, 0); opacity: 1; }
    }

    /* ========================================================
       DESKTOP SUPPORT & WIDESCREEN RPG LAYOUT
       ======================================================== */
    body.desktop-view,
    html.desktop-view body {
      align-items: center;
      justify-content: center;
      background-color: #080A0F;
      background-image: 
        radial-gradient(ellipse at 50% 0%, rgba(245, 158, 11, 0.08) 0%, transparent 70%),
        radial-gradient(circle at 100% 100%, rgba(239, 68, 68, 0.05) 0%, transparent 60%);
      background-attachment: fixed;
    }

    body.desktop-view .mobile-frame,
    html.desktop-view .mobile-frame {
      max-width: 1240px;
      width: 95vw;
      height: 94vh;
      max-height: 960px;
      border-radius: 16px;
      border: 1px solid var(--runic-border);
      box-shadow: 0 20px 70px rgba(0, 0, 0, 0.95), 0 0 0 1px rgba(245, 158, 11, 0.2);
    }

    /* Widescreen Status Bar */
    body.desktop-view .status-bar {
      padding: 10px 24px;
      border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    }
    body.desktop-view .status-bar-center img {
      width: 20px;
      height: 20px;
    }
    body.desktop-view .status-bar-center span:first-child {
      font-size: 13px !important;
      letter-spacing: 1.5px !important;
    }
    body.desktop-view .status-bar-subtitle {
      font-size: 8.5px !important;
      letter-spacing: 0.8px !important;
    }

    /* View Mode Switcher Pill */
    .view-mode-pill {
      background: rgba(245, 158, 11, 0.12) !important;
      border: 1px solid rgba(245, 158, 11, 0.35) !important;
      color: var(--amber-gold) !important;
      border-radius: 4px !important;
      padding: 2px 6px !important;
      font-size: 9px !important;
      font-weight: 600 !important;
      display: inline-flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 3px !important;
      cursor: pointer !important;
      font-family: var(--font-sans) !important;
      transition: all 0.2s ease !important;
      white-space: nowrap !important;
      user-select: none !important;
      outline: none !important;
      box-shadow: none !important;
      -webkit-appearance: none !important;
      appearance: none !important;
      -webkit-tap-highlight-color: transparent !important;
    }
    .view-mode-pill:hover,
    .view-mode-pill:active {
      background: rgba(245, 158, 11, 0.25) !important;
      border-color: var(--amber-gold) !important;
    }

    /* Desktop Screen Content */
    body.desktop-view .screen-content {
      padding: 16px 28px 84px;
      max-width: 100% !important;
    }

    /* Containers render as column flex on mobile to maintain valid box tree and prevent layout shifts */
    .desktop-auth-container,
    .desktop-town-container,
    .desktop-hero-container,
    .desktop-travel-container,
    .desktop-combat-container,
    .desktop-settings-container {
      display: flex;
      flex-direction: column;
      width: 100%;
      gap: 12px;
    }

    /* SCREEN 1: LANDING / AUTH DESKTOP GRID */
    body.desktop-view .desktop-auth-container {
      display: grid;
      grid-template-columns: 1fr 1.15fr;
      gap: 24px;
      align-items: start;
    }
    body.desktop-view .desktop-auth-left,
    body.desktop-view .desktop-auth-right {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    /* SCREEN 2: HEARTH / TOWN DESKTOP GRID */
    body.desktop-view .desktop-town-container {
      display: grid;
      grid-template-columns: 1.1fr 1fr;
      gap: 20px;
      align-items: start;
    }
    body.desktop-view .desktop-town-left,
    body.desktop-view .desktop-town-right {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    /* SCREEN 3: HERO & INVENTORY DESKTOP 3-COLUMN GRID */
    body.desktop-view .desktop-hero-container {
      display: grid;
      grid-template-columns: 1fr 1.15fr 1.1fr;
      gap: 18px;
      align-items: start;
    }
    body.desktop-view .desktop-hero-col1,
    body.desktop-view .desktop-hero-col2,
    body.desktop-view .desktop-hero-col3 {
      display: flex;
      flex-direction: column;
      gap: 10px;
    }

    /* SCREEN 4: TRAVEL DESKTOP GRID */
    body.desktop-view .desktop-travel-container {
      display: grid;
      grid-template-columns: 1.1fr 1fr;
      gap: 20px;
      align-items: start;
    }
    body.desktop-view .desktop-travel-left,
    body.desktop-view .desktop-travel-right {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    /* SCREEN 5: COMBAT BATTLEMAP 2-COLUMN COMMANDER HUD */
    body.desktop-view #screen-combat {
      overflow-y: auto !important;
      -webkit-overflow-scrolling: touch !important;
      padding-bottom: 96px !important;
      scroll-padding-bottom: 96px !important;
    }
    body.desktop-view #arena-vtt-view {
      display: flex !important;
      flex-direction: column !important;
      width: 100% !important;
      align-items: stretch !important;
    }
    body.desktop-view .desktop-combat-container {
      display: grid;
      grid-template-columns: 1.15fr 1fr;
      gap: 20px;
      align-items: start;
      height: auto !important;
      min-height: min-content !important;
    }
    body.desktop-view .desktop-combat-left {
      display: flex;
      flex-direction: column;
      gap: 8px;
    }
    body.desktop-view .desktop-combat-right {
      display: flex;
      flex-direction: column;
      gap: 8px;
      max-height: calc(100vh - 130px);
      overflow-y: auto;
      padding-right: 6px;
    }
    body.desktop-view #vtt-grid-container {
      max-width: 520px;
      max-height: 520px;
      margin: 0 auto;
    }

    /* SCREEN 6: SETTINGS DESKTOP GRID */
    body.desktop-view .desktop-settings-container {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      align-items: start;
    }
    body.desktop-view .desktop-settings-left,
    body.desktop-view .desktop-settings-right {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    /* Desktop Bottom Navigation Bar */
    body.desktop-view .bottom-nav {
      height: 64px;
      padding: 0 40px;
    }
    body.desktop-view .nav-item {
      font-size: 11px;
    }
    body.desktop-view .nav-item span:first-child {
      font-size: 20px;
    }

    /* ==========================================
       DELVE & CRAFTING CUSTOM STYLES
       ========================================== */
    #modal-dungeon-delve {
      padding: 12px 12px calc(80px + env(safe-area-inset-bottom, 0px)) 12px !important;
      box-sizing: border-box;
      align-items: center;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
    }
    .delve-card {
      box-shadow: 0 0 25px rgba(34, 197, 94, 0.25);
      animation: delveFadeIn 0.25s ease-out;
      max-height: calc(100dvh - 110px) !important;
      margin: auto auto 12px auto !important;
      box-sizing: border-box;
      padding-bottom: 24px !important;
    }
    @keyframes delveFadeIn {
      from { opacity: 0; transform: scale(0.96); }
      to { opacity: 1; transform: scale(1); }
    }
    .delve-breadcrumbs::-webkit-scrollbar {
      height: 4px;
    }
    .delve-breadcrumbs::-webkit-scrollbar-thumb {
      background: rgba(34, 197, 94, 0.4);
      border-radius: 4px;
    }

    /* ==========================================
       VISUAL WORLD MAP (PARCHMENT CARTOGRAPHY)
       ========================================== */
    .world-map-wrapper {
      position: relative;
      background: radial-gradient(circle at 50% 40%, rgba(28, 24, 20, 0.98), rgba(14, 12, 10, 0.99));
      border: 1.5px solid var(--runic-border);
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 6px 24px rgba(0, 0, 0, 0.8), inset 0 0 30px rgba(0, 0, 0, 0.6);
      margin-bottom: 12px;
    }
    .world-map-svg {
      width: 100%;
      height: auto;
      display: block;
      user-select: none;
    }
    .map-region-node {
      cursor: pointer;
      transition: transform 0.2s ease, filter 0.2s ease;
    }
    .map-region-node:hover {
      filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.8));
    }
    .map-region-node.active-location {
      filter: drop-shadow(0 0 12px rgba(34, 197, 94, 0.9));
    }
    .map-beacon-pulse {
      animation: mapBeaconRing 2s infinite ease-out;
      transform-origin: center;
    }
    @keyframes mapBeaconRing {
      0% { r: 12; opacity: 0.9; stroke-width: 2px; }
      50% { opacity: 0.4; }
      100% { r: 32; opacity: 0; stroke-width: 0.5px; }
    }
    .map-road-line {
      stroke-dasharray: 6 4;
      animation: mapRoadDash 30s linear infinite;
    }
    @keyframes mapRoadDash {
      to { stroke-dashoffset: -100; }
    }
    .map-territory-hover {
      cursor: pointer;
      transition: fill-opacity 0.25s ease, stroke-opacity 0.25s ease;
    }
    .map-territory-hover:hover {
      fill-opacity: 0.35 !important;
      stroke-opacity: 0.8 !important;
    }

    .roadmap-step-pill {
      background: rgba(0, 0, 0, 0.45);
      border: 1px solid rgba(245, 158, 11, 0.25);
      border-radius: 6px;
      padding: 7px 9px;
      cursor: pointer;
      transition: all 0.2s ease;
    }
    .roadmap-step-pill:hover {
      border-color: var(--amber-gold);
      background: rgba(245, 158, 11, 0.14);
      transform: translateY(-1px);
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    }

    /* Uniform Travel Screen Header & Action Toolbar */
    .travel-top-banner {
      background: linear-gradient(180deg, rgba(10, 14, 22, 0.98) 0%, rgba(15, 20, 30, 0.94) 100%);
      border-bottom: 1px solid rgba(245, 158, 11, 0.35);
      padding: 8px 12px;
      z-index: 10;
      box-shadow: 0 4px 18px rgba(0, 0, 0, 0.65);
    }
    .travel-banner-row-1 {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 6px;
    }
    .travel-action-toolbar {
      display: grid;
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 4px;
      align-items: center;
      width: 100%;
      max-width: 760px;
    }
    .travel-tool-btn {
      height: 32px !important;
      min-width: 0 !important;
      padding: 0 4px !important;
      font-size: 9.5px !important;
      font-weight: 700 !important;
      display: flex !important;
      align-items: center !important;
      justify-content: center !important;
      gap: 3px !important;
      white-space: nowrap !important;
      border-radius: 5px !important;
      background: rgba(22, 27, 38, 0.85) !important;
      border: 1px solid rgba(255, 255, 255, 0.12) !important;
      color: #E2E8F0 !important;
      transition: all 0.15s ease !important;
      box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35) !important;
      cursor: pointer !important;
    }
    .travel-tool-btn:hover {
      background: rgba(35, 43, 60, 0.95) !important;
      border-color: var(--amber-gold) !important;
      color: #FFF !important;
      transform: translateY(-1px) !important;
    }
    .travel-tool-btn.btn-camp {
      border-color: rgba(245, 158, 11, 0.4) !important;
      color: #FDE68A !important;
    }
    .travel-tool-btn.btn-camp:hover {
      background: rgba(245, 158, 11, 0.15) !important;
      border-color: #F59E0B !important;
    }
    .travel-tool-btn.btn-retreat {
      border-color: rgba(239, 68, 68, 0.4) !important;
      color: #FCA5A5 !important;
    }
    .travel-tool-btn.btn-retreat:hover {
      background: rgba(239, 68, 68, 0.15) !important;
      border-color: #EF4444 !important;
    }
    @media (max-width: 420px) {
      .travel-action-toolbar {
        gap: 3px;
      }
      .travel-tool-btn {
        font-size: 8.5px !important;
        padding: 0 2px !important;
        gap: 2px !important;
        overflow: hidden;
      }
    }


    /* VTT Drag-to-Resize Handle & Live Tooltip */
    .vtt-board-wrapper.is-resizing {
      transition: none !important;
      user-select: none;
    }
    .vtt-resize-handle {
      position: absolute;
      bottom: 2px;
      right: 2px;
      width: 26px;
      height: 26px;
      cursor: nwse-resize;
      display: flex;
      align-items: flex-end;
      justify-content: flex-end;
      padding: 3px;
      box-sizing: border-box;
      color: var(--amber-gold, #F59E0B);
      opacity: 0.60;
      transition: opacity 0.2s ease, transform 0.15s ease, color 0.2s ease;
      z-index: 55;
      touch-action: none;
      user-select: none;
      border-radius: 0 0 10px 0;
    }
    .vtt-resize-handle:hover,
    .vtt-resize-handle.active {
      opacity: 1.0;
      color: #FBBF24;
      transform: scale(1.18);
      filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.7));
    }
    .vtt-resize-handle svg {
      pointer-events: none;
      filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.9));
    }
    .vtt-resize-tooltip {
      position: absolute;
      bottom: 30px;
      right: 4px;
      background: rgba(15, 23, 42, 0.96);
      border: 1.5px solid var(--amber-gold, #F59E0B);
      border-radius: 6px;
      padding: 3px 8px;
      font-size: 11px;
      font-family: monospace;
      font-weight: 700;
      color: var(--amber-gold, #F59E0B);
      pointer-events: none;
      z-index: 60;
      white-space: nowrap;
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.85);
      display: none;
      animation: vttPillPop 0.15s ease-out;
    }


    /* -------------------------------------------------------------
       VTT 2.0: Kinetic Combat Juice & Line-of-Sight Targeting Animations
       ------------------------------------------------------------- */
    @keyframes violentShake {
      0%, 100% { transform: translate(0, 0) scale(1); }
      15% { transform: translate(-7px, 5px) scale(1.01); }
      30% { transform: translate(6px, -5px) scale(0.995); }
      45% { transform: translate(-5px, 4px); }
      60% { transform: translate(4px, -3px); }
      75% { transform: translate(-2px, 2px); }
    }
    .shake-impact {
      animation: violentShake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97) both !important;
    }

    @keyframes tokenLunge {
      0% { transform: translate(0, 0); }
      35% { transform: translate(var(--lunge-dx, 16px), var(--lunge-dy, -10px)) scale(1.12); }
      70% { transform: translate(var(--lunge-dx, 18px), var(--lunge-dy, -12px)) scale(1.08); }
      100% { transform: translate(0, 0) scale(1); }
    }
    .token-lunging {
      animation: tokenLunge 0.32s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards !important;
      z-index: 40 !important;
    }

    @keyframes hitRecoil {
      0% { filter: brightness(3.2) contrast(1.8); transform: translate(0, 0); }
      30% { transform: translate(var(--recoil-dx, 8px), var(--recoil-dy, -4px)) scale(0.92); filter: brightness(2.2); }
      65% { transform: translate(-3px, 2px); filter: brightness(1.3); }
      100% { transform: translate(0, 0) scale(1); filter: brightness(1); }
    }
    .token-hit {
      animation: hitRecoil 0.34s ease-out forwards !important;
    }

    @keyframes kineticDamageFloat {
      0% { opacity: 0; transform: translateY(8px) scale(0.5); filter: drop-shadow(0 0 10px rgba(239, 68, 68, 0.8)); }
      20% { opacity: 1; transform: translateY(-12px) scale(1.35); }
      40% { transform: translateY(-20px) scale(1.1); }
      75% { opacity: 1; transform: translateY(-34px) scale(1.0); }
      100% { opacity: 0; transform: translateY(-50px) scale(0.85); }
    }
    .damage-floater {
      position: absolute;
      font-family: var(--hf-font-title, 'Cinzel', serif);
      font-weight: 800;
      pointer-events: none;
      z-index: 100;
      animation: kineticDamageFloat 1.3s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
      text-shadow: 0 2px 6px rgba(0, 0, 0, 0.95);
    }

    /* Fighting-Game Ghost Health Decay */
    .hp-ghost-fill {
      position: absolute;
      left: 0;
      top: 0;
      height: 100%;
      background: #FBBF24 !important;
      opacity: 0.85;
      transition: width 0.75s cubic-bezier(0.25, 1, 0.5, 1);
      z-index: 1;
      border-radius: inherit;
    }
    .hp-real-fill {
      position: relative;
      height: 100%;
      transition: width 0.12s ease-out;
      z-index: 2;
      border-radius: inherit;
    }

    /* Tactical Attack Confirmation Bar */
    #vtt-attack-confirm-bar {
      transition: all 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
    }

    /* Quick Audio HUD Toggle (Item 4) */
    .audio-hud-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 22px;
      height: 22px;
      padding: 0;
      border-radius: 4px;
      background: rgba(245, 158, 11, 0.12);
      border: 1px solid rgba(245, 158, 11, 0.35);
      color: var(--amber-gold);
      cursor: pointer;
      transition: all 0.2s ease;
      user-select: none;
      -webkit-tap-highlight-color: transparent;
      flex-shrink: 0;
    }
    .audio-hud-btn:hover {
      background: rgba(245, 158, 11, 0.22);
      border-color: var(--amber-gold);
      box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
    }
    .audio-hud-btn.audio-muted {
      background: rgba(148, 163, 184, 0.1);
      border-color: rgba(148, 163, 184, 0.3);
      color: #94A3B8;
    }
    .audio-hud-btn.audio-muted:hover {
      background: rgba(148, 163, 184, 0.18);
      border-color: #CBD5E1;
      color: #E2E8F0;
    }
    .audio-hud-icon-wrap {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 100%;
      height: 100%;
    }
    .audio-hud-svg {
      width: 13px;
      height: 13px;
      display: block;
    }
    .audio-hud-popover {
      position: fixed;
      top: 36px;
      right: 12px;
      z-index: 9999;
      background: rgba(15, 23, 42, 0.95);
      border: 1px solid var(--amber-gold);
      color: var(--parchment-text);
      font-size: 11px;
      font-weight: 700;
      padding: 4px 10px;
      border-radius: 6px;
      box-shadow: 0 4px 14px rgba(0, 0, 0, 0.8), 0 0 10px rgba(245, 158, 11, 0.3);
      pointer-events: none;
      opacity: 0;
      transform: translateY(-4px);
      transition: opacity 0.2s ease, transform 0.2s ease;
    }
    .audio-hud-popover.visible {
      opacity: 1;
      transform: translateY(0);
    }

    /* VTT and Crest Token SVG Scaling */
    .vtt-token-icon svg,
    .heraldic-crest-svg {
      width: 100%;
      height: 100%;
      display: block;
      pointer-events: none;
    }

    /* Initiative Strip Turn Chips & Active Turn Glow */
    .init-turn-chip {
      padding: 2px 7px;
      border-radius: 4px;
      font-size: 8.5px;
      font-weight: 600;
      background: rgba(15, 23, 42, 0.7);
      border: 1px solid rgba(148, 163, 184, 0.25);
      color: #CBD5E1;
      transition: all 0.2s ease;
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }
    .init-turn-chip.init-active-glow {
      background: rgba(245, 158, 11, 0.22);
      border-color: var(--amber-gold);
      color: var(--amber-gold);
      font-weight: 800;
      box-shadow: 0 0 10px rgba(245, 158, 11, 0.65);
    }

    /* Active Turn Token Indicator Pulse */
    .vtt-token.active-turn-token {
      animation: activeTurnPulse 1.8s infinite ease-in-out;
      box-shadow: 0 0 14px rgba(245, 158, 11, 0.8), inset 0 0 6px rgba(245, 158, 11, 0.4) !important;
    }
    @keyframes activeTurnPulse {
      0%, 100% {
        filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.6));
        transform: scale(1);
      }
      50% {
        filter: drop-shadow(0 0 10px rgba(245, 158, 11, 0.95));
        transform: scale(1.05);
      }
    }


/* HartForge Supporter Pass Conversion Surfaces & Golden Frame Badge */
.header-supporter-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.1;
  color: #FDE68A;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.4), rgba(219, 39, 119, 0.4));
  border: 1px solid #C084FC;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 0 10px rgba(168, 85, 247, 0.4);
  transition: all 0.2s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.header-supporter-pill:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(168, 85, 247, 0.75);
  border-color: #E9D5FF;
}
.header-supporter-pill.is-active {
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid #F59E0B;
  color: #FDE68A;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.35);
}

.supporter-golden-frame {
  border: 1.5px solid #F59E0B !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.25) !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(20, 16, 28, 0.95) 100%) !important;
}

.level-cap-gate-card {
  animation: levelCapGlow 3s infinite ease-in-out;
}
@keyframes levelCapGlow {
  0%, 100% {
    box-shadow: 0 0 14px rgba(168, 85, 247, 0.35);
    border-color: #C084FC;
  }
  50% {
    box-shadow: 0 0 22px rgba(168, 85, 247, 0.65);
    border-color: #E9D5FF;
  }
}


    /* Living Overworld Volumetric Fog & Atmospheric Mist Drift */
    .hex-mist-drift, #hex-mist-drift {
  display: none !important;
  animation: none !important;
  mix-blend-mode: normal !important;
}
    @keyframes hexMistDrift {
      0% {
        transform: translate3d(0, 0, 0) scale(1);
        opacity: 0.75;
      }
      50% {
        transform: translate3d(-35px, 20px, 0) scale(1.025);
        opacity: 0.95;
      }
      100% {
        transform: translate3d(25px, -25px, 0) scale(1.01);
        opacity: 0.75;
      }
    }

/* Hex Overworld Action Card & Mobile Hardware-Acceleration Guards */
#hex-traversal-action-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: linear-gradient(180deg, rgba(16, 22, 36, 0.98) 0%, rgba(9, 13, 22, 0.99) 100%) !important;
  isolation: isolate;
  transform: translateZ(0);
}

#hex-action-amenities .amenity-chip {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #E2E8F0;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}


    /* Strict Mobile Viewport Fit for Combat VTT Toolbar, Status Strip & Quick Actions */
    #screen-combat,
    #screen-combat .desktop-combat-layout,
    #screen-combat .desktop-combat-left,
    #screen-combat .desktop-combat-right {
      max-width: 100% !important;
      min-width: 0 !important;
      box-sizing: border-box !important;
      overflow-x: hidden !important;
    }
    #vtt-status-strip {
      display: flex !important;
      justify-content: space-between !important;
      align-items: center !important;
      gap: 4px !important;
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
      overflow: hidden !important;
      padding: 3px 6px !important;
    }
    #vtt-status-strip > div {
      min-width: 0 !important;
      display: flex !important;
      align-items: center !important;
      gap: 3px !important;
      flex-shrink: 1 !important;
    }
    #vtt-status-strip > div:last-child {
      flex-shrink: 0 !important;
    }
    #vtt-status-strip .action-chip {
      display: inline-flex !important;
      align-items: center !important;
      gap: 3px !important;
      white-space: nowrap !important;
      font-size: 8.5px !important;
      padding: 1px 4px !important;
    }
    #vtt-quick-actions {
      display: grid !important;
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
      gap: 5px !important;
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }
    #btn-quick-primary,
    #btn-quick-secondary {
      min-width: 0 !important;
      width: 100% !important;
      max-width: 100% !important;
      overflow: hidden !important;
      padding: 5px 6px !important;
      gap: 4px !important;
      box-sizing: border-box !important;
    }
    #quick-primary-label,
    #quick-secondary-label {
      min-width: 0 !important;
      flex: 1 1 0% !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
      display: flex !important;
      align-items: center !important;
      gap: 4px !important;
    }
    #quick-primary-badge,
    #quick-secondary-badge {
      flex-shrink: 0 !important;
      white-space: nowrap !important;
      font-size: 8px !important;
      padding: 1px 4px !important;
    }
    #vtt-normal-actions {
      display: grid !important;
      grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
      gap: 4px !important;
      width: 100% !important;
      max-width: 100% !important;
      box-sizing: border-box !important;
    }
    #vtt-normal-actions > button,
    #vtt-class-action-container button {
      min-width: 0 !important;
      max-width: 100% !important;
      overflow: hidden !important;
      text-overflow: ellipsis !important;
      white-space: nowrap !important;
      box-sizing: border-box !important;
    }

    /* Compact Short-Viewport Combat Fit (e.g. 360x640 Play Store capture & compact phones) */
    @media (max-width: 768px) and (max-height: 680px) {
      #screen-combat.active {
        gap: 3px !important;
        padding: 3px 6px calc(76px + env(safe-area-inset-bottom, 0px)) 6px !important;
      }
      .vtt-board-wrapper {
        max-height: min(var(--vtt-dynamic-size, 200px), 200px, 25vh) !important;
        max-width: min(var(--vtt-dynamic-size, 200px), 200px, 25vh) !important;
      }
      #screen-combat .card {
        padding: 4px 8px !important;
        margin-bottom: 2px !important;
      }
      #screen-combat .desktop-combat-container,
      #screen-combat .desktop-combat-left,
      #screen-combat .desktop-combat-right {
        gap: 3px !important;
      }
      #combat-prose-text {
        max-height: 44px !important;
        font-size: 9px !important;
        line-height: 1.2 !important;
      }
      #vtt-quick-actions button,
      #vtt-class-action-container button,
      #vtt-normal-actions button {
        min-height: 28px !important;
        padding-top: 4px !important;
        padding-bottom: 4px !important;
      }
    }
