/* game.css — Titan's Legacy Dark Theme */
/* Titan's Legacy — Idle Adventure Game */

/* ─── CSS VARIABLES ──────────────────────────────────────────────────────── */
:root {
  --bg-main:      #0c0812;
  --bg-panel:     #12101a;
  --bg-panel-2:   #1a1728;
  --bg-panel-3:   #221f30;
  --border:       #2d2840;
  --border-gold:  #8b6914;
  --text-main:    #c9b99a;
  --text-gold:    #fbbf24;
  --text-bright:  #f5f0e8;
  --text-muted:   #6b6380;
  --text-green:   #4ade80;
  --text-red:     #f87171;
  --text-blue:    #60a5fa;
  --text-purple:  #c084fc;
  --text-cyan:    #22d3ee;
  --accent:       #7c3aed;
  --accent-hover: #6d28d9;
  --danger:       #dc2626;
  --danger-hover: #b91c1c;
  --gold-grad: linear-gradient(135deg, #78550a 0%, #c99a2e 50%, #78550a 100%);
  --panel-shadow: 0 4px 24px rgba(0,0,0,0.6);
  --inset-shadow: inset 0 2px 8px rgba(0,0,0,0.5);
  --font-main: 'Segoe UI', system-ui, sans-serif;
  --radius: 6px;
  --radius-sm: 3px;
}

/* ─── RESET & BASE ───────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%; height: 100%;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-main);
  font-size: 13px;
  line-height: 1.4;
  overflow: hidden;
}

/* Global interaction polish: prevent accidental text highlighting in normal game UI */
:where(#main-game-ui, #game-screen, .screen, .modal, #resume-loading-overlay, #char-create-modal, #bug-report-modal, #global-search-modal) :is(*):not(input):not(textarea):not(select):not([contenteditable='true']):not([contenteditable='']) {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

input, textarea, select,
[contenteditable='true'],
[contenteditable=''],
[contenteditable] {
  user-select: text;
  -webkit-user-select: text;
  -moz-user-select: text;
  -ms-user-select: text;
}

a { color: var(--text-gold); }
b, strong { color: var(--text-bright); }
hr { border: none; border-top: 1px solid var(--border); margin: 6px 0; }
.muted { color: var(--text-muted); font-size: 11px; }

input[type=number], input[type=text] {
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 3px 6px;
  font-size: 12px;
}
input[type=checkbox] { accent-color: var(--accent); }

/* ─── SCROLLBARS ─────────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-gold); }

/* ─── SCREENS ────────────────────────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--bg-main);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.26s ease;
  z-index: 1000;
}
.screen.is-visible { opacity: 1; visibility: visible; }
.full-screen-flex {
  align-items: center;
  justify-content: center;
}
.bg-cinematic {
  background:
    linear-gradient(rgba(8, 9, 14, 0.28), rgba(7, 8, 13, 0.84)),
    radial-gradient(circle at 50% 18%, rgba(82, 122, 204, 0.16), transparent 28%),
    radial-gradient(circle at 50% 100%, rgba(191, 113, 51, 0.14), transparent 36%),
    var(--titans-legacy-bg);
  background-size: cover;
  background-position: var(--titans-legacy-bg-position);
  background-repeat: no-repeat;
}

/* ─── TITLE SCREEN ───────────────────────────────────────────────────────── */
#title-screen,
#splash-screen {
  background:
    radial-gradient(ellipse 60% 54% at 50% 26%, rgba(93, 133, 222, 0.2) 0%, transparent 70%),
    radial-gradient(ellipse 90% 90% at 50% 100%, rgba(9, 7, 15, 0.16) 0%, rgba(5, 5, 10, 0.82) 68%),
    linear-gradient(rgba(10, 12, 19, 0.18), rgba(5, 6, 10, 0.72)),
    var(--titans-legacy-bg);
  background-size: cover;
  background-position: var(--titans-legacy-bg-position);
  overflow: hidden;
}
#title-screen::before,
#splash-screen::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.015'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
.title-wrapper,
.splash-shell {
  display: flex; flex-direction: column; align-items: center;
  gap: 14px; z-index: 1;
  padding: 40px 20px;
  width: min(100%, 720px);
  text-align: center;
}
.title-emblem {
  width: 132px; height: 132px;
  padding: 14px;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 34% 28%, rgba(255, 223, 147, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(51, 34, 22, 0.92), rgba(19, 13, 9, 0.96));
  border: 1px solid rgba(231, 194, 118, 0.34);
  border-radius: 34px;
  display: flex; align-items: center; justify-content: center;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 217, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.38);
  margin-bottom: 4px;
}
.title-emblem::after {
  content: '';
  position: absolute;
  inset: 1px;
  border-radius: 33px;
  border: 1px solid rgba(255, 232, 186, 0.06);
  pointer-events: none;
}
.title-emblem-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 14px 26px rgba(0, 0, 0, 0.34))
    drop-shadow(0 0 16px rgba(237, 176, 95, 0.18));
}
.title-logo {
  font-size: 52px; font-weight: 900;
  color: #f6e8c9;
  letter-spacing: 0.24em; text-align: center;
  text-transform: uppercase;
  text-shadow:
    0 2px 18px rgba(0, 0, 0, 0.44),
    0 0 18px rgba(231, 182, 102, 0.18);
}
.title-subtitle {
  color: rgba(224, 213, 188, 0.82); font-size: 13px;
  letter-spacing: 0.24em; text-transform: uppercase;
  text-align: center;
}
.title-buttons { display: flex; gap: 12px; margin-top: 8px; }
.title-play-btn,
.splash-play-btn {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 50%, #5b21b6 100%);
  border: 2px solid #9f67fa;
  color: white; font-size: 16px; font-weight: 700;
  padding: 14px 48px; border-radius: 6px; cursor: pointer;
  letter-spacing: 1px; text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(124,58,237,0.5);
  transition: all 0.2s;
}
.title-play-btn:hover,
.splash-play-btn:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 50%, #6d28d9 100%);
  box-shadow: 0 6px 30px rgba(124,58,237,0.7);
  transform: translateY(-2px);
}
.title-play-btn:active,
.splash-play-btn:active { transform: translateY(0); }
.title-disclaimer { font-size: 10px; color: #3d3458; text-align: center; max-width: 380px; margin-top: 4px; }

/* ─── CHARACTER SELECT SCREEN ────────────────────────────────────────────── */
#save-screen,
#char-select-hub {
  flex-direction: column;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(26, 16, 48, 0.78) 0%, transparent 60%),
    linear-gradient(rgba(10, 12, 19, 0.18), rgba(5, 6, 10, 0.76)),
    var(--titans-legacy-bg);
  background-size: cover;
  background-position: var(--titans-legacy-bg-position);
  background-repeat: no-repeat;
  overflow-y: auto;
  justify-content: flex-start;
  align-items: stretch;
}
.charsel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px;
  background: linear-gradient(90deg, #1a1230 0%, #12101a 100%);
  border-bottom: 2px solid var(--border-gold);
  flex-shrink: 0;
}
.charsel-back-btn {
  background: none; border: 1px solid var(--border);
  color: var(--text-muted); width: 36px; height: 36px;
  border-radius: var(--radius-sm); cursor: pointer; font-size: 14px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.charsel-back-btn:hover { border-color: var(--border-gold); color: var(--text-gold); }
.charsel-logo {
  font-size: 20px; font-weight: 900; letter-spacing: 2px;
  text-transform: uppercase;
  background: var(--gold-grad);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.charsel-body {
  flex: 1; padding: 24px 20px;
  display: flex; flex-direction: column; align-items: center; gap: 20px;
}
.charsel-title {
  font-size: 18px; font-weight: 700; color: var(--text-gold);
  display: flex; align-items: center; gap: 8px;
  text-transform: uppercase; letter-spacing: 1px;
}
.charsel-slots {
  display: flex; flex-direction: column; gap: 12px;
  width: 100%; max-width: 680px;
}
.hub-panel {
  width: min(1320px, calc(100% - 48px));
  margin: 40px auto;
  background: rgba(10, 8, 16, 0.94);
  border: 1px solid rgba(201, 154, 46, 0.4);
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.65), 0 0 0 1px rgba(201,154,46,0.08);
  padding: 36px;
  backdrop-filter: blur(12px);
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.hub-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 0;
}
.hub-kicker {
  font-size: 11px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hub-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-bright);
  letter-spacing: 0.5px;
}
.hub-copy,
.hub-community-copy,
.hub-cloud-user-email {
  color: var(--text-main);
  font-size: 13px;
}
.hub-status {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(26, 23, 40, 0.85);
  color: var(--text-main);
}
.hub-status[data-tone="success"] { color: var(--text-green); border-color: rgba(74, 222, 128, 0.35); }
.hub-status[data-tone="warn"] { color: var(--text-gold); border-color: rgba(251, 191, 36, 0.35); }
.hub-status[data-tone="error"] { color: var(--text-red); border-color: rgba(248, 113, 113, 0.35); }
.hub-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
  flex: 1 1 auto;
}
.hub-column {
  min-width: 0;
  background: rgba(18, 15, 28, 0.9);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  min-height: 100%;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.03), 0 4px 24px rgba(0,0,0,0.3);
}
.hub-column-header {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.hub-column-eyebrow {
  font-size: 10px;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hub-column-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-gold);
}
.hub-save-slots {
  max-width: none;
  width: 100%;
}
.hub-cloud-panel,
.hub-cloud-auth-row,
.hub-cloud-actions,
.hub-community-actions,
.hub-footer {
  display: flex;
  gap: 12px;
}
.hub-cloud-panel,
.hub-community-actions,
.hub-footer {
  flex-direction: column;
}
.hub-cloud-auth-row,
.hub-cloud-actions {
  flex-direction: row;
  flex-wrap: wrap;
}
.hub-cloud-actions {
  flex-direction: column;
  align-items: stretch;
}
.hub-cloud-auth-row > *,
.hub-cloud-actions > *,
.hub-community-actions > * {
  flex: 1 1 180px;
}
.hub-cloud-actions > * {
  flex: 1 1 auto;
}
.cloud-input,
.cloud-auth-btn,
.cloud-google-btn,
.hub-community-btn {
  width: 100%;
}
.hub-footer {
  margin-top: auto;
  align-items: flex-end;
}

@media (max-width: 1100px) {
  .hub-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 700px) {
  .hub-grid { grid-template-columns: 1fr; }
  .hub-panel { width: calc(100% - 24px); padding: 20px; margin: 20px auto; }
  .hub-column { padding: 18px; }
}

/* Slot cards */
.cs-slot-card {
  background: linear-gradient(135deg, #161224 0%, #1a1728 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.cs-slot-card:hover { border-color: var(--border-gold); box-shadow: 0 4px 20px rgba(0,0,0,0.6); }
.cs-slot-card.mode-ironman { border-color: #334155; }
.cs-slot-card.mode-ironman:hover { border-color: #7dd3fc; }
.cs-slot-card.mode-hardcore { border-color: #3f1515; }
.cs-slot-card.mode-hardcore:hover { border-color: #f87171; }
.cs-slot-card.cs-dead { border-color: #4b1111; opacity: 0.75; }

.cs-slot-filled {
  display: flex; align-items: stretch; gap: 0;
}
.cs-slot-mode-bar {
  width: 6px; align-self: stretch;
  background: var(--border-gold);
  flex-shrink: 0;
}
.cs-slot-mode-bar.bar-regular  { background: linear-gradient(180deg, #c99a2e, #78550a); }
.cs-slot-mode-bar.bar-ironman  { background: linear-gradient(180deg, #7dd3fc, #1e40af); }
.cs-slot-mode-bar.bar-hardcore { background: linear-gradient(180deg, #f87171, #991b1b); }

.cs-slot-inner {
  flex: 1; padding: 10px 14px;
  display: flex; align-items: flex-start; gap: 10px;
  min-width: 0;
}
.cs-slot-avatar {
  width: 36px; height: 36px; flex-shrink: 0;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: 50%;
  padding: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-gold);
}
.cs-slot-avatar-icon {
  width: 100%;
  height: 100%;
  flex-shrink: 0;
  display: block;
  object-fit: contain;
  line-height: 1;
  image-rendering: auto;
}
.cs-avatar-generic   { color: rgba(244, 213, 152, 0.9); }
.cs-avatar-ironman   { color: #7dd3fc; }
.cs-avatar-hardcore  { color: #f87171; }
.cs-avatar-dead      { color: #6b7280; }

.mode-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  object-fit: contain;
  image-rendering: auto;
  font-size: 12px;
  line-height: 1;
  color: var(--text-gold);
}
.cs-slot-avatar-icon.mode-icon {
  width: 100%;
  height: 100%;
  font-size: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cs-slot-details { flex: 1; min-width: 0; }
.cs-char-name {
  font-size: 15px; font-weight: 800; color: var(--text-bright);
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 2px;
  min-width: 0;
}
.cs-inline-mode-icon {
  width: 15px;
  height: 15px;
  opacity: 0.96;
}
.cs-char-name-text {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.15;
}
.cs-mode-badge {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px;
  flex-shrink: 0;
}
.cs-mode-badge.badge-regular  { background: #78420a; color: #fbbf24; }
.cs-mode-badge.badge-ironman  { background: #1e3a5f; color: #7dd3fc; }
.cs-mode-badge.badge-hardcore { background: #5a1515; color: #fca5a5; }
.cs-mode-badge.badge-dead     { background: #2d2d2d; color: #6b7280; }

.cs-char-stats {
  display: flex; gap: 14px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-muted); margin-bottom: 4px;
}
.cs-stat-item { display: flex; align-items: center; gap: 4px; }
.cs-stat-item i { font-size: 10px; }
.cs-stat-cb  { color: var(--text-gold); }
.cs-stat-tl  { color: #94a3b8; }
.cs-stat-qp  { color: #c084fc; }

.cs-char-meta { font-size: 10px; color: #44415a; }
.cs-char-meta .cs-status-dot {
  display: inline-block; width: 6px; height: 6px;
  border-radius: 50%; margin-right: 4px; vertical-align: middle;
}
.cs-status-dot.dot-active  { background: #4ade80; box-shadow: 0 0 4px #4ade80; }
.cs-status-dot.dot-idle    { background: #fbbf24; }
.cs-status-dot.dot-dead    { background: #6b7280; }

.cs-current-action {
  display: grid;
  gap: 2px;
  margin-top: 6px;
  min-width: 0;
}
.cs-current-action-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6f6b84;
}
.cs-current-action-value {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.cs-slot-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 5px;
}
.cs-slot-flag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}
.cs-slot-flag.is-cloud {
  border-color: rgba(96, 165, 250, 0.32);
  color: #bfdbfe;
}
.cs-slot-flag.is-local {
  border-color: rgba(148, 163, 184, 0.25);
  color: #cbd5e1;
}
.cs-slot-flag.is-entitlement {
  border-color: rgba(251, 191, 36, 0.28);
  color: #fde68a;
}
.cs-slot-flag.is-beta {
  border-color: rgba(125, 211, 252, 0.24);
  color: #c4f1ff;
}
.cs-slot-flag.is-beta.is-active {
  border-color: rgba(74, 222, 128, 0.32);
  color: #bbf7d0;
}
.cs-slot-flag.is-beta.is-expired {
  border-color: rgba(248, 113, 113, 0.28);
  color: #fecaca;
}
.cs-slot-owner {
  margin-top: 6px;
  font-size: 10px;
  color: #6f6b84;
  white-space: normal;
  overflow-wrap: anywhere;
}

.cs-slot-actions {
  display: flex; flex-direction: column; gap: 5px;
  padding: 10px 12px; flex-shrink: 0;
  min-width: 108px;
  justify-content: center;
}
.cs-play-btn {
  background: linear-gradient(135deg, #166534 0%, #15803d 100%);
  border: 1px solid #4ade80;
  color: white; font-size: 13px; font-weight: 700;
  padding: 8px 20px; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.15s; white-space: nowrap;
  width: 100%;
}
.cs-play-btn:hover {
  background: linear-gradient(135deg, #15803d 0%, #16a34a 100%);
  box-shadow: 0 2px 8px rgba(74,222,128,0.35);
}
.cs-delete-btn {
  background: #1a0808; border: 1px solid #5a1515;
  color: #f87171; font-size: 11px;
  padding: 5px 12px; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.15s; text-align: center;
  width: 100%;
}
.cs-delete-btn:hover { background: #2d1010; border-color: #f87171; }

.cs-slot-card.cs-slot-protected {
  border-color: rgba(148, 163, 184, 0.24);
}

.cs-slot-locked {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-height: 106px;
  background: linear-gradient(135deg, rgba(18, 16, 26, 0.96), rgba(14, 13, 20, 0.96));
}

.cs-slot-locked-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.26);
  background: rgba(148, 163, 184, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #cbd5e1;
  font-size: 18px;
}

.cs-slot-locked-copy {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.cs-slot-locked-title {
  color: var(--text-bright);
  font-size: 15px;
  font-weight: 700;
}

.cs-slot-locked-text {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.4;
}

.cs-slot-locked-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.cs-slot-locked-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(241, 197, 115, 0.22);
  background: rgba(241, 197, 115, 0.08);
  color: var(--text-gold);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.cs-slot-locked-btn:hover {
  border-color: rgba(241, 197, 115, 0.36);
  background: rgba(241, 197, 115, 0.14);
}

.cs-slot-locked-btn.is-secondary {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(148, 163, 184, 0.08);
  color: #dbe4f0;
}

.cs-slot-locked-note {
  font-size: 11px;
  line-height: 1.45;
  color: rgba(203, 213, 225, 0.78);
}

.cs-slot-locked-badge {
  align-self: flex-start;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.08);
  color: #cbd5e1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

/* Empty slot card */
.cs-slot-empty {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  transition: background 0.15s;
}
.cs-slot-empty:hover { background: rgba(255,255,255,0.02); }
.cs-slot-empty-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border: 2px dashed var(--border);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--border);
  transition: all 0.15s;
}
.cs-slot-card:hover .cs-slot-empty-icon {
  border-color: var(--border-gold); color: var(--text-gold);
}
.cs-slot-empty-label { color: var(--text-muted); font-size: 13px; }
.cs-slot-empty-sub { color: #302d40; font-size: 11px; margin-top: 2px; }
.cs-slot-number {
  font-size: 11px; color: #302d40;
  margin-left: auto; padding-right: 4px;
}
.cs-create-btn {
  background: var(--accent);
  border: 1px solid #9f67fa; color: white;
  font-size: 12px; font-weight: 700;
  padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.15s; margin-left: auto; flex-shrink: 0;
}
.cs-create-btn:hover { background: var(--accent-hover); }

/* ─── CHARACTER CREATION MODAL ───────────────────────────────────────────── */
.char-create-box { max-width: 580px; }
.char-create-body { padding: 18px; display: flex; flex-direction: column; gap: 20px; }
.cc-section { display: flex; flex-direction: column; gap: 10px; }
.cc-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); }
.cc-name-input {
  width: 100%;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-bright);
  font-size: 18px; font-weight: 600;
  padding: 10px 14px;
  transition: border-color 0.15s;
}
.cc-name-input:focus { border-color: var(--border-gold); outline: none; }
.cc-name-input::placeholder { color: var(--text-muted); font-weight: 400; font-size: 14px; }

.cc-modes { display: flex; flex-direction: column; gap: 8px; }
.cc-mode-card {
  background: var(--bg-panel-2);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex; gap: 12px; align-items: flex-start;
  cursor: pointer;
  transition: all 0.15s;
}
.cc-mode-card:hover { border-color: var(--border-gold); background: var(--bg-panel-3); }
.cc-mode-card.selected {
  border-color: var(--text-gold);
  background: #1c1810;
  box-shadow: inset 0 0 20px rgba(251,191,36,0.06), 0 2px 12px rgba(0,0,0,0.4);
}
.cc-mode-card[data-mode="ironman"].selected  { border-color: #7dd3fc; background: #0d1a28; box-shadow: inset 0 0 20px rgba(125,211,252,0.04); }
.cc-mode-card[data-mode="hardcore"].selected { border-color: #f87171; background: #1c0a0a; box-shadow: inset 0 0 20px rgba(248,113,113,0.04); }
.cc-mode-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 50%;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.cc-mode-icon i { color: var(--text-gold); }
.ironman-icon i, .hardcore-icon i { color: #7dd3fc; }
.cc-mode-icon-img { width: 36px; height: 36px; object-fit: contain; display: block; image-rendering: auto; }
.cc-mode-badge { width: 28px; height: 28px; object-fit: contain; }
.cc-mode-info { flex: 1; }
.cc-mode-name { font-size: 15px; font-weight: 700; color: var(--text-bright); margin-bottom: 4px; }
.cc-mode-desc { font-size: 11px; color: var(--text-muted); line-height: 1.5; margin-bottom: 8px; text-wrap: pretty; }
.cc-mode-perks { display: flex; flex-wrap: wrap; gap: 4px; }
.cc-perk { font-size: 10px; padding: 2px 7px; border-radius: 10px; }
.perk-green { background: #0d2010; color: #4ade80; border: 1px solid #1a3d1a; }
.perk-red   { background: #1c0808; color: #f87171; border: 1px solid #3d1414; }

.cc-create-btn {
  background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
  border: 1px solid #9f67fa;
  color: white; font-size: 15px; font-weight: 700;
  padding: 13px 0; border-radius: var(--radius);
  cursor: pointer; width: 100%;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 16px rgba(124,58,237,0.4);
  transition: all 0.2s;
}
.cc-create-btn:hover {
  background: linear-gradient(135deg, #6d28d9 0%, #8b5cf6 100%);
  box-shadow: 0 6px 24px rgba(124,58,237,0.6);
  transform: translateY(-1px);
}
.cc-create-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ─── GAME SCREEN ────────────────────────────────────────────────────────── */
/* ─── GAME HEADER BAR ────────────────────────────────────────────────────── */
#game-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 38px;
  min-height: 38px;
  background: linear-gradient(90deg, #0a0e1a 0%, #0f1629 60%, #0a0e1a 100%);
  border-bottom: 2px solid var(--border-gold);
  padding: 0 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
  flex-shrink: 0;
  z-index: 10;
}
.game-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.game-header-icon {
  font-size: 18px;
  color: var(--text-gold);
  filter: drop-shadow(0 0 6px rgba(251,191,36,0.5));
}
.game-header-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-gold);
  letter-spacing: 0.5px;
  text-shadow: 0 0 12px rgba(251,191,36,0.3);
  font-family: 'Georgia', serif;
}
.game-header-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}
.game-header-sub {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 600;
}
.game-header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Save mode indicators */
.save-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 3px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
  opacity: 0.45;
  transition: all 0.2s;
}
.save-indicator.active {
  opacity: 1;
  color: #4ade80;
  border-color: rgba(74,222,128,0.3);
  background: rgba(74,222,128,0.08);
}
.save-indicator.active i { color: #4ade80; }
.save-indicator i { font-size: 11px; }

/* Cloud indicator — green when signed in */
#save-ind-cloud.connected {
  opacity: 1;
  color: #4ade80;
  border-color: rgba(74,222,128,0.35);
  background: rgba(74,222,128,0.1);
}
#save-ind-cloud.connected i { color: #4ade80; }

/* Cloud indicator — red when signed out / disconnected */
#save-ind-cloud.disconnected {
  opacity: 1;
  color: #f87171;
  border-color: rgba(248,113,113,0.35);
  background: rgba(248,113,113,0.1);
}
#save-ind-cloud.disconnected i { color: #f87171; }

/* Cloud indicator — amber when local is ahead of cloud (sync pending) */
#save-ind-cloud.sync-pending {
  opacity: 1;
  color: #f5d48a;
  border-color: rgba(245, 194, 76, 0.36);
  background: rgba(245, 194, 76, 0.12);
}
#save-ind-cloud.sync-pending i { color: #f5d48a; }

/* Header settings button */
.header-settings-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text-muted);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
  margin-left: 4px;
}
.header-settings-btn:hover {
  border-color: var(--border-gold);
  color: var(--text-gold);
}

/* Panels row below header */
#panels-row {
  display: flex;
  flex-direction: row;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

#game-screen {
  display: none;
  flex-direction: column;
  width: 100vw; height: 100vh;
  gap: 0;
  padding: 0;
  overflow: hidden;
}

/* ─── THREE-PANEL LAYOUT ─────────────────────────────────────────────────── */
.panel {
  display: flex; flex-direction: column;
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  overflow: hidden;
}
.panel-header {
  background: var(--bg-panel-2);
  border-bottom: 2px solid var(--border-gold);
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  display: flex; align-items: center; gap: 6px; flex-shrink: 0;
}
.panel-header i { color: var(--text-gold); }
.panel-body { flex: 1; overflow-y: auto; padding: 8px; }

/* Left panel */
#left-panel {
  width: clamp(236px, 18.5vw, 274px);
  min-width: 236px;
  flex: 0 0 clamp(236px, 18.5vw, 274px);
}

/* Middle panel */
#middle-panel { flex: 1; min-width: 0; border-right: 1px solid var(--border); }

/* Right panel */
#right-panel { width: 240px; min-width: 220px; border-right: none; }

/* ─── CHARACTER INFO ─────────────────────────────────────────────────────── */
#char-info {
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--border);
  padding: 10px 12px;
  display: flex; flex-direction: column; gap: 6px;
  flex-shrink: 0; position: relative;
}
#char-info-hitsplats {
  inset: 4px 10px 4px 10px;
  overflow: hidden;
  contain: layout paint;
}
.char-name-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px;
}
.char-name { font-size: 15px; font-weight: 700; color: var(--text-bright); }
.char-cb { font-size: 11px; color: var(--text-gold); }

/* Vitals bars */
.vitals { display: flex; flex-direction: column; gap: 4px; }
.vital-row { display: flex; align-items: center; gap: 6px; font-size: 11px; }
.vital-label { width: 14px; text-align: center; }
.vital-bar-bg {
  flex: 1; height: 10px;
  background: #1a0808;
  border: 1px solid #3d1a1a;
  border-radius: 2px;
  overflow: hidden;
}
.vital-bar-hp .vital-bar-bg { background: #0d1a0d; border-color: #1a3d1a; }
.vital-bar-fill { height: 100%; transition: width 0.3s; border-radius: 2px; }
.vital-text { font-size: 10px; color: var(--text-muted); width: 52px; text-align: right; }

/* ─── SKILL TILES ────────────────────────────────────────────────────────── */
#skills-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 8px;
  align-content: start;
}
.skill-tile {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 7px 8px;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 0 8px;
  align-items: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  min-height: 46px;
}
.skill-tile:hover { border-color: var(--border-gold); background: var(--bg-panel-3); }

/* Skill sprite / icon placement */
.skill-sprite,
.skill-icon-fa,
.skill-icon {
  grid-row: 1;
  grid-column: 1;
}
.skill-art-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}
.skill-art-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.skill-art-fallback {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  color: var(--text-gold);
}
.skill-art-icon.show-fallback .skill-art-fallback {
  display: flex;
}
.skill-art-icon.show-fallback {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: 6px;
}
.skill-tile .item-icon,
.skill-sprite,
.skill-icon {
  width: 22px;
  height: 22px;
  min-width: 22px;
}
.skill-tile .item-icon {
  border-radius: 6px;
  font-size: 12px;
  box-shadow: none;
  --item-icon-padding: 2px;
}
.skill-icon-fa {
  font-size: 11px;
  color: var(--text-gold);
  text-align: center;
}
.skill-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.skill-name {
  display: block;
  font-size: 11px;
  line-height: 1.15;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.skill-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.skill-level {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
  min-width: 18px;
  text-align: right;
}
.skill-bar-bg {
  flex: 1;
  min-width: 0;
  height: 5px;
  background: var(--bg-panel-3);
  border-radius: 999px;
  overflow: hidden;
}
.skill-bar-fill { height: 100%; border-radius: 2px; transition: width 0.4s; }

/* ─── NAV BAR (bottom of middle panel) ──────────────────────────────────── */
#nav-bar {
  background: var(--bg-panel-2);
  border-top: 2px solid var(--border-gold);
  display: flex;
  padding: 4px 6px;
  gap: 4px;
  flex-shrink: 0;
}
.nav-btn {
  flex: 1;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
  font-size: 11px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.nav-btn i { font-size: 14px; }
.nav-btn:hover { border-color: var(--border-gold); color: var(--text-gold); background: var(--bg-panel); }

/* ─── MIDDLE PANEL TABS ──────────────────────────────────────────────────── */
.tab-bar {
  display: flex;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.tab-btn {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 7px 4px;
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.tab-btn:hover { color: var(--text-main); }
.tab-btn.active { color: var(--text-gold); border-bottom-color: var(--text-gold); }
.tab-content { display: none; height: 100%; overflow: auto; }
.tab-content.active { display: block; }

/* ─── COMBAT PANEL ───────────────────────────────────────────────────────── */
.combat-idle {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 100%; color: var(--text-muted); gap: 8px;
}
.combat-idle i { font-size: 32px; opacity: 0.3; }
.combat-target {
  display: flex; gap: 10px; padding: 10px;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--border);
}
.combat-portrait-wrapper { position: relative; width: 60px; height: 60px; flex-shrink: 0; }
.hitsplats-container {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none; z-index: 50; overflow: visible;
}
.hit-splat {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 14px; font-weight: 800; font-family: 'Arial Black', sans-serif;
  text-shadow: 1px 1px 0 #000, -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000;
  animation: floatsplat 1.2s ease-out forwards;
  pointer-events: none; z-index: 100; white-space: nowrap;
}
.hit-splat.damage { color: #ff3333; }
.hit-splat.critical { font-size: 22px; color: #ff9900; }
.hit-splat.heal { color: #33ff33; font-size: 12px; }
.hit-splat.block i { color: #3399ff; font-size: 16px; text-shadow: 0 0 3px rgba(0,0,0,0.8); }

@keyframes floatsplat {
  0% { opacity: 0; transform: translate(-50%, 0) scale(0.5); }
  15% { opacity: 1; transform: translate(-50%, -20px) scale(1.2); }
  30% { transform: translate(-50%, -25px) scale(1); }
  80% { opacity: 1; transform: translate(-50%, -40px) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -45px) scale(0.8); }
}

.combat-monster-img { width: 100%; height: 100%; object-fit: contain; image-rendering: pixelated; }
.combat-target-info { flex: 1; }
.combat-monster-name { font-size: 14px; font-weight: 700; color: var(--text-bright); }
.combat-monster-sub { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.hp-bar-wrap {
  position: relative; height: 14px;
  background: #1a0808; border: 1px solid #3d1a1a; border-radius: 2px; overflow: hidden;
}
.hp-bar-inner { height: 100%; transition: width 0.3s; }
.hp-bar-label {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; color: white; font-weight: 600;
  text-shadow: 1px 1px 2px black;
}

.combat-stats-row {
  display: flex; gap: 0; padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.combat-stat { flex: 1; text-align: center; }
.stat-label { display: block; font-size: 10px; color: var(--text-muted); }
.stat-val { font-size: 14px; font-weight: 700; color: var(--text-gold); }

.combat-style-selector {
  display: flex; gap: 4px; padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.style-btn {
  flex: 1;
  background: var(--bg-panel-3); border: 1px solid var(--border);
  color: var(--text-muted); border-radius: var(--radius-sm);
  padding: 4px; font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.style-btn:hover { border-color: var(--border-gold); color: var(--text-main); }
.style-btn.active { background: var(--accent); border-color: var(--accent); color: white; font-weight: 700; }

.combat-automation-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 12px 10px 14px;
  border-bottom: 1px solid var(--border);
}
.combat-automation-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 124px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.08), transparent 45%),
    linear-gradient(180deg, rgba(18, 24, 39, 0.96), rgba(10, 14, 24, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}
.combat-automation-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.combat-automation-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #fff1d6;
}
.combat-automation-copy {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(219, 225, 238, 0.72);
}
.combat-automation-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 11px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.combat-automation-toggle input {
  accent-color: #f3c76f;
}
.combat-automation-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}
.combat-automation-note {
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.14);
  background: rgba(96, 165, 250, 0.08);
  font-size: 12px;
  line-height: 1.45;
  color: #bfdbfe;
}
.ae-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.ae-input {
  width: 58px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(6, 10, 18, 0.62);
  color: #f8fafc;
  text-align: center;
}

@media (max-width: 720px) {
  .combat-automation-row {
    grid-template-columns: 1fr;
  }
}

.fallen-loot-panel {
  margin: 12px 10px 0;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(229, 190, 103, 0.2);
  background:
    radial-gradient(circle at top left, rgba(246, 202, 108, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(24, 21, 31, 0.98), rgba(12, 11, 18, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 222, 0.08),
    0 16px 28px rgba(0, 0, 0, 0.22);
}

.fallen-loot-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.fallen-loot-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8ebcf;
}

.fallen-loot-sub {
  margin-top: 3px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(214, 203, 181, 0.76);
}

.fallen-loot-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(241, 197, 115, 0.18);
  background: rgba(241, 197, 115, 0.09);
  color: rgba(248, 199, 90, 0.9);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.fallen-loot-grid {
  display: grid;
  gap: 8px;
}

.fallen-loot-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.035);
}

.fallen-loot-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(11, 10, 16, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.05);
  flex-shrink: 0;
}

.fallen-loot-item-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.fallen-loot-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.fallen-loot-name {
  font-size: 13px;
  font-weight: 700;
  color: #f6efe0;
}

.fallen-loot-meta {
  font-size: 10px;
  color: rgba(208, 199, 182, 0.72);
}

.fallen-loot-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.fallen-loot-actions .btn-primary,
.fallen-loot-actions .btn-outline {
  flex: 1;
  margin-top: 0;
}

.combat-idle-secondary {
  height: auto;
  padding: 18px 0 8px;
}

/* ─── MONSTER LIST ───────────────────────────────────────────────────────── */
.search-row { padding: 6px 8px; display: flex; gap: 6px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.search-input {
  flex: 1;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  font-size: 12px;
}
.search-input:focus { border-color: var(--border-gold); outline: none; }
#monster-list { padding: 6px; display: flex; flex-direction: column; gap: 4px; }

.monster-card {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  display: flex; align-items: center; gap: 8px;
  transition: border-color 0.15s;
}
.monster-card:hover { border-color: var(--border-gold); }
.monster-card.active { border-color: var(--accent); background: #1e1a2e; }
.monster-card.slayer-task { border-color: var(--text-purple); }
/* Monster image wrapper + image + placeholder */
.monster-img-wrap {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  position: relative;
}
.monster-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}
/* Placeholder shown when wiki image 404s */
.monster-img-ph {
  width: 44px;
  height: 44px;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0;
  text-transform: uppercase;
  user-select: none;
}
/* Bestiary uses the same wrapper */
.bestiary-img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  image-rendering: pixelated;
  display: block;
}
.monster-info { flex: 1; min-width: 0; }
.monster-name { font-size: 12px; font-weight: 600; color: var(--text-bright); display: flex; align-items: center; gap: 4px; }
.monster-stats { font-size: 10px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 6px; }
.cb-tag { color: var(--text-gold); }
.slayer-badge {
  font-size: 9px; background: var(--accent); color: white;
  padding: 0 4px; border-radius: 2px; font-weight: 700;
}
.slayer-req-tag { font-size: 10px; color: var(--text-purple); margin-top: 2px; }

.fight-btn {
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  color: var(--text-green);
  border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 11px; cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
}
.fight-btn:hover { border-color: var(--text-green); background: #0d2010; }
.fight-btn.fighting { color: var(--text-red); }
.fight-btn.fighting:hover { border-color: var(--text-red); background: #200d0d; }

/* ─── EQUIPMENT GRID ─────────────────────────────────────────────────────── */
/*
 * Fixed-pixel paperdoll — NEVER depends on container height.
 * 3 columns × 5 rows of 60 px slots, 4 px gap, 8 px padding.
 * Total rendered size: 3×60 + 2×4 + 2×8 = 204 px wide
 *                      5×60 + 4×4 + 2×8 = 332 px tall
 */
/* ─── EQUIPMENT TAB LAYOUT ───────────────────────────────────────────────── */
/* flex display/direction/overflow/height are set via JS tab switcher (initTabs) */

#equipment-grid {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  grid-template-rows: repeat(5, 52px);
  gap: 4px;
  padding: 8px 8px 4px;
  flex-shrink: 0;
  margin: 0 auto;
  box-sizing: content-box;
}
.equip-slot {
  width: 52px;
  height: 52px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s;
  position: relative;
  overflow: hidden;
}
.equip-slot:hover { border-color: var(--border-gold); }
.equip-slot.filled { background: var(--bg-panel-3); }
.equip-slot > img { width: 80%; height: 80%; object-fit: contain; image-rendering: pixelated; }
.slot-label { font-size: 8px; color: var(--text-muted); text-align: center; line-height: 1.3; }

/* ─── EQUIP STATS ────────────────────────────────────────────────────────── */
#equip-stats {
  flex: 1;
  border-top: 2px solid var(--border-gold);
  padding: 0 0 6px;
  overflow: visible;
}

/* Two-column bonuses grid (Attack | Defence) */
.stat-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--border);
}
.stat-col {
  padding: 5px 7px;
}
.stat-col:first-child {
  border-right: 1px solid var(--border);
}

/* Full-width other bonuses row */
.stat-other {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px 7px;
  border-bottom: 1px solid var(--border);
  gap: 0;
}

/* Speed bar */
.stat-speed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 9px;
}

.stat-section-title {
  font-size: 8.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--text-gold);
  opacity: 0.8;
  padding: 2px 0 3px;
  white-space: nowrap;
}
.stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10.5px;
  padding: 1px 0;
  color: var(--text-main);
}
.stat-label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 10px;
  white-space: nowrap;
}
.stat-label i {
  width: 11px;
  text-align: center;
  font-size: 9px;
  color: var(--border-gold);
  opacity: 0.8;
}
.stat-pos  { color: #4ade80; font-weight: 600; font-size: 10px; }
.stat-neg  { color: #f87171; font-weight: 600; font-size: 10px; }
.stat-zero { color: var(--text-muted); font-size: 10px; }
.stat-sep  { margin: 4px 0; border-color: var(--border); }
.stat-speed-badge {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-gold);
  background: rgba(251,191,36,0.1);
  border: 1px solid rgba(251,191,36,0.25);
  border-radius: 4px;
  padding: 1px 6px;
}

/* ─── INVENTORY GRID ─────────────────────────────────────────────────────── */
#inventory-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 3px;
  padding: 6px;
}
.inv-slot {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s;
  overflow: hidden;
}
.inv-slot:hover { border-color: var(--border-gold); }
.inv-slot.filled { background: var(--bg-panel-3); }
.inv-img { width: 80%; height: 80%; object-fit: contain; image-rendering: pixelated; }
.inv-qty {
  position: absolute; bottom: 1px; right: 2px;
  font-size: 9px; font-weight: 700; color: var(--text-gold);
  text-shadow: 1px 1px 1px black;
  padding: 1px 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(7, 12, 22, 0.92), rgba(7, 12, 22, 0.7));
  border: 1px solid rgba(255, 215, 128, 0.18);
  line-height: 1;
}

#gp-display {
  text-align: center; padding: 4px;
  font-size: 12px; color: var(--text-gold); font-weight: 600;
  border-top: 1px solid var(--border);
}

.ui-inline-abbr {
  display: inline-flex;
  align-items: center;
  gap: 0;
  cursor: help;
  text-decoration: underline dotted rgba(226, 188, 111, 0.5);
  text-underline-offset: 0.12em;
}

/* ─── PRAYER TAB LAYOUT ──────────────────────────────────────────────────── */
/* flex display/direction/overflow/height are set via JS tab switcher (initTabs) */

/* ── Prayer action bar — slim toolbar at top ─────────────────────────── */
.prayer-actions-bar {
  display: flex;
  gap: 5px;
  padding: 5px 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg-panel-2);
}
.prayer-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.prayer-action-btn:hover:not(:disabled) {
  border-color: #a78bfa;
  background: rgba(124,58,237,0.15);
  color: #c4b5fd;
}
.prayer-action-btn:disabled,
.prayer-action-btn.on-cooldown {
  opacity: 0.45;
  cursor: not-allowed;
}
.prayer-action-btn i { color: #a78bfa; font-size: 11px; }
.prayer-cd {
  font-size: 9px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  margin-left: 2px;
}

#prayer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  padding: 6px;
  flex: 1;
  overflow-y: auto;
  align-content: start;
}
#devotion-grid,
#bounty-content,
#stats-content {
  height: 100%;
  overflow-y: auto;
}
#devotion-grid,
#bounty-content,
#stats-content {
  padding: 8px;
}
.devotion-panel-shell {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.devotion-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.devotion-summary-card {
  background: linear-gradient(180deg, rgba(12,22,40,0.92), rgba(9,14,26,0.92));
  border: 1px solid rgba(96,165,250,0.2);
  border-radius: var(--radius-sm);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.devotion-summary-card.wide { grid-column: 1 / -1; }
.devotion-summary-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.devotion-summary-value {
  font-size: 13px;
  font-weight: 700;
  color: #dbeafe;
}
.devotion-summary-value.small { font-size: 11px; line-height: 1.4; }
.devotion-grid-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.prayer-tile {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 2px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 52px;
}
.prayer-tile:hover:not(.locked) { border-color: #a78bfa; background: rgba(124,58,237,0.08); }
.prayer-tile.active { background: #2d1f50; border-color: #7c3aed; box-shadow: 0 0 6px #7c3aed44; }
.prayer-tile.locked { opacity: 0.35; cursor: not-allowed; }
.prayer-icon { width: 30px; height: 30px; object-fit: contain; image-rendering: pixelated; }
.prayer-name { font-size: 7.5px; color: var(--text-muted); text-align: center; line-height: 1.2; padding: 0 1px; }
.devotion-tile {
  appearance: none;
  align-items: stretch;
  min-height: 122px;
  padding: 8px;
  gap: 6px;
  text-align: left;
  background: linear-gradient(180deg, rgba(13,20,35,0.96), rgba(9,14,26,0.96));
}
.devotion-tile:hover:not(.locked) {
  border-color: rgba(96,165,250,0.55);
  background: linear-gradient(180deg, rgba(15,26,46,0.98), rgba(10,17,31,0.98));
}
.devotion-tile.active {
  border-color: rgba(96,165,250,0.9);
  box-shadow: 0 0 0 1px rgba(96,165,250,0.15), 0 0 14px rgba(59,130,246,0.18);
  background: linear-gradient(180deg, rgba(20,34,58,1), rgba(12,20,34,1));
}
.devotion-tile-top {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  font-size: 9px;
}
.devotion-level-badge,
.devotion-drain-badge {
  border-radius: 999px;
  padding: 2px 6px;
  background: rgba(15,23,42,0.82);
  border: 1px solid rgba(148,163,184,0.22);
  color: var(--text-muted);
}
.devotion-icon-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 34px;
}
.devotion-icon { width: 34px; height: 34px; }
.devotion-name {
  font-size: 10px;
  color: var(--text-bright);
  font-weight: 700;
  text-align: left;
  padding: 0;
}
.devotion-copy {
  font-size: 9px;
  line-height: 1.35;
  color: var(--text-muted);
}

/* ─── STANDALONE SHOPS ───────────────────────────────────────────────────── */
#shops-panel {
  padding: 8px 7px 0;
  overflow-y: auto;
  flex-shrink: 0;          /* doesn't shrink when tools-panel is visible below */
}
/* When the Outfit Forge is rendered, shops-panel contains .outfit-list and
   must fill the flex column and scroll — not clip. flex: 1 overrides
   flex-shrink: 0; min-height: 0 allows it to shrink below content height
   so overflow-y: auto actually triggers. tools-panel is hidden in this state
   so the flex: 1 takeover does not affect the Workshop layout. */
#shops-panel:has(.outfit-list) {
  flex: 1;
  min-height: 0;
}

.shops-header {
  padding: 6px 2px 8px;
  border-bottom: 1px solid var(--border-color, rgba(255,255,255,0.08));
  margin-bottom: 8px;
}
.shops-header-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.shops-header-sub {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
}

/* Shop card list */
.shop-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.shop-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 7px;
  padding: 8px 10px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.shop-card:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.15);
}
.shop-card--locked {
  opacity: 0.72;
}
.shop-card--locked .shop-card-icon {
  color: #94a3b8;
  background: rgba(148,163,184,0.1);
}
.shop-card--locked .shop-visit-btn {
  color: #94a3b8;
  background: rgba(148,163,184,0.1);
  border-color: rgba(148,163,184,0.22);
}
.shop-card-icon {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,200,50,0.1);
  border-radius: 6px;
  font-size: 14px;
  color: #fbbf24;
  flex-shrink: 0;
}
.shop-card-body {
  flex: 1;
  min-width: 0;
}
.shop-card-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-card-tagline {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-visit-btn {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 5px;
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.3);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.shop-visit-btn:hover {
  background: rgba(251,191,36,0.28);
}

/* Workshop divider */
.shops-workshop-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 8px;
  color: var(--text-muted, #94a3b8);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.shops-workshop-divider::before,
.shops-workshop-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.07);
}

/* Shop detail view */
.shop-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 2px 8px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.shop-back-btn {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  background: rgba(255,255,255,0.06);
  color: var(--text-muted, #94a3b8);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.shop-back-btn:hover {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary, #e2e8f0);
}
.shop-detail-title {
  flex: 1;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-gp-row {
  font-size: 10px;
  font-weight: 700;
  color: #fbbf24;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.shop-detail-desc {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  line-height: 1.5;
  margin-bottom: 10px;
  font-style: italic;
}

/* Shop item rows */
.shop-items {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.shop-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 6px;
  padding: 7px 9px;
}
.shop-item--disabled {
  opacity: 0.45;
}
.shop-item-body {
  flex: 1;
  min-width: 0;
}
.shop-item-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-item-sub {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  margin-top: 1px;
}
.shop-item-btns {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.shop-btn {
  font-size: 10px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.shop-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.shop-btn--buy {
  background: rgba(74,222,128,0.15);
  color: #4ade80;
  border-color: rgba(74,222,128,0.3);
}
.shop-btn--buy:hover:not(:disabled) {
  background: rgba(74,222,128,0.28);
}
.shop-btn--convert {
  background: rgba(96,165,250,0.15);
  color: #60a5fa;
  border-color: rgba(96,165,250,0.3);
}
.shop-btn--convert:hover:not(:disabled) {
  background: rgba(96,165,250,0.28);
}
.shop-btn--all {
  background: rgba(251,191,36,0.15);
  color: #fbbf24;
  border-color: rgba(251,191,36,0.3);
}
.shop-btn--all:hover:not(:disabled) {
  background: rgba(251,191,36,0.28);
}
.shop-btn--outfit {
  background: rgba(167,139,250,0.15);
  color: #a78bfa;
  border-color: rgba(167,139,250,0.3);
}
.shop-btn--outfit:hover:not(:disabled) {
  background: rgba(167,139,250,0.28);
}

/* Token hint row in outfit detail */
.shop-detail-token-hint {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  padding: 5px 2px 8px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.shop-detail-token-hint i { color: #60a5fa; }

/* ─── OUTFIT FORGE ────────────────────────────────────────────────────────── */
.outfit-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.outfit-entry {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 8px;
  overflow: hidden;
}
.outfit-entry-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.outfit-entry-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}
.outfit-entry-info {
  flex: 1;
  min-width: 0;
}
.outfit-entry-name {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.outfit-entry-bonus {
  font-size: 9px;
  color: var(--text-muted, #94a3b8);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.outfit-token-count {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.outfit-token-label {
  font-size: 9px;
  font-weight: 400;
  color: var(--text-muted, #94a3b8);
}
.outfit-pieces {
  display: flex;
  flex-direction: column;
}
.outfit-piece-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.outfit-piece-row:last-child { border-bottom: none; }
.outfit-piece--owned { background: rgba(74,222,128,0.04); }
.outfit-piece--locked { opacity: 0.5; }
.outfit-piece-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.outfit-piece-slot {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted, #94a3b8);
  background: rgba(255,255,255,0.06);
  padding: 2px 5px;
  border-radius: 4px;
  flex-shrink: 0;
}
.outfit-piece-name {
  font-size: 10px;
  color: var(--text-primary, #e2e8f0);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.outfit-piece-action { flex-shrink: 0; }
.outfit-owned-badge {
  font-size: 10px;
  font-weight: 700;
  color: #4ade80;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ─── TOOLS UPGRADE PANEL ────────────────────────────────────────────────── */
#tools-panel {
  padding: 8px 7px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  flex: 1;                  /* fills remaining height inside the Workshop shop detail */
  min-height: 80px;
}
.tool-card {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 9px 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.tool-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tool-icon-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.tool-card-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tool-card-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-gold);
  display: flex;
  align-items: center;
  gap: 5px;
}
.tool-card-title i { font-size: 10px; }
.tool-card-current {
  font-size: 11.5px;
  color: var(--text-main);
  font-weight: 600;
}
.tool-card-skill {
  font-size: 10px;
  color: var(--text-muted);
}
.tool-card-pace {
  font-size: 10px;
  color: rgba(223, 214, 196, 0.82);
}
.tool-speed {
  color: #4ade80;
  font-weight: 600;
}
.tool-progress-wrap {
  position: relative;
  background: var(--bg-panel-3);
  border-radius: 3px;
  height: 12px;
  overflow: hidden;
}
.tool-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #7c3aed, #a855f7);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.tool-progress-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 0 3px rgba(0,0,0,0.8);
  pointer-events: none;
}
.tool-upgrade-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  background: rgba(124,58,237,0.15);
  border: 1px solid #7c3aed;
  border-radius: 4px;
  color: #c4b5fd;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.tool-upgrade-btn:hover:not(.disabled) {
  background: rgba(124,58,237,0.3);
  border-color: #a78bfa;
  color: #ede9fe;
}
.tool-upgrade-btn.disabled,
.tool-upgrade-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.tool-upgrade-btn i { font-size: 10px; }
.tool-cost {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-gold);
  font-weight: 700;
}
.tool-maxed {
  font-size: 10.5px;
  color: #4ade80;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
}
.tool-maxed i { font-size: 11px; }

/* ─── RIGHT PANEL TABS ───────────────────────────────────────────────────── */
.right-tabs {
  display: flex; flex-wrap: wrap;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.right-tab {
  background: none; border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  padding: 6px 8px;
  font-size: 10px; cursor: pointer;
  transition: all 0.15s; flex: 1 0 33.333%; text-align: center;
}
.right-tab:hover { color: var(--text-main); }
.right-tab.active { color: var(--text-gold); border-bottom-color: var(--text-gold); }

/* ─── SLAYER PANEL ───────────────────────────────────────────────────────── */
.slayer-stats {
  display: flex; gap: 0;
  background: var(--bg-panel-2);
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}
.sl-stat { flex: 1; text-align: center; }
.sl-stat span { display: block; font-size: 16px; font-weight: 700; color: var(--text-gold); }
.sl-stat small { font-size: 9px; color: var(--text-muted); }

.slayer-task-box {
  margin: 8px;
  background: var(--bg-panel-3);
  border: 1px solid var(--text-purple);
  border-radius: var(--radius);
  padding: 8px;
}
.sl-task-title { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.sl-task-monster { font-size: 15px; font-weight: 700; color: var(--text-bright); margin: 2px 0; }
.sl-task-progress { font-size: 11px; color: var(--text-purple); }
.sl-progress-bg { height: 4px; background: var(--bg-panel-2); border-radius: 2px; margin-top: 6px; overflow: hidden; }
.sl-progress-fill { height: 100%; background: var(--text-purple); border-radius: 2px; transition: width 0.4s; }
.sl-no-task { text-align: center; color: var(--text-muted); padding: 12px 8px; font-size: 12px; }

.slayer-masters-grid { padding: 6px; display: flex; flex-direction: column; gap: 4px; }
.slayer-master-card {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  display: flex; align-items: center; gap: 8px;
}
.slayer-master-card.locked { opacity: 0.5; }
.master-portrait { width: 36px; height: 36px; object-fit: contain; border-radius: 50%; background: var(--bg-panel-3); }
.master-details { flex: 1; }
.master-name { font-size: 12px; font-weight: 600; color: var(--text-bright); }
.master-loc { font-size: 10px; color: var(--text-muted); }
.master-reqs { font-size: 10px; color: var(--text-gold); }
.get-task-btn {
  background: var(--accent);
  border: none; color: white;
  border-radius: var(--radius-sm);
  padding: 4px 8px; font-size: 11px; cursor: pointer;
  transition: background 0.15s;
}
.get-task-btn:hover { background: var(--accent-hover); }
.get-task-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  background: rgba(71,85,105,0.55);
}
.bounty-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0;
  border-bottom: none;
  background: none;
}
.bounty-stat-card {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 6px;
}
.bounty-task-card,
.bounty-master-section,
.stats-progress-panel,
.stats-boss-panel {
  background: linear-gradient(180deg, rgba(13,20,35,0.96), rgba(8,12,24,0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
}
.bounty-task-header,
.stats-progress-meta,
.stats-boss-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.bounty-task-header h4,
.bounty-master-section h4,
.stats-progress-panel h4,
.stats-boss-panel h4 {
  margin: 0 0 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-gold);
}
.bounty-task-master,
.bounty-task-streak,
.bounty-task-footer,
.bounty-task-action-kicker,
.bounty-task-action-note,
.bounty-task-status,
.bounty-empty-copy,
.bounty-master-location,
.bounty-master-reqs,
.bounty-master-note,
.stats-empty {
  font-size: 10px;
  color: var(--text-muted);
}
.task-info { display: flex; justify-content: space-between; gap: 8px; }
.task-monster { font-size: 15px; font-weight: 700; color: var(--text-bright); }
.task-amount { font-size: 12px; font-weight: 700; color: #93c5fd; }
.task-progress,
.stats-progress-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.task-bar,
.stats-progress-bar {
  height: 8px;
  background: rgba(15,23,42,0.9);
  border-radius: 999px;
  overflow: hidden;
}
.task-fill,
.stats-progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #38bdf8, #818cf8);
}
.bounty-empty-state {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  border: 1px dashed rgba(244, 199, 118, 0.16);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(244, 199, 118, 0.1), transparent 42%),
    linear-gradient(180deg, rgba(18, 22, 34, 0.95), rgba(10, 12, 21, 0.92));
}
.bounty-empty-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(244, 199, 118, 0.18);
  background: rgba(244, 199, 118, 0.08);
  color: #f9d48e;
  flex: 0 0 auto;
}
.bounty-empty-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bounty-section-head,
.stats-panel-head {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
}
.bounty-section-kicker,
.stats-panel-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 209, 148, 0.7);
}
.bounty-empty-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-bright);
}
.bounty-task-footer-row,
.bounty-task-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bounty-task-footer-row {
  margin-top: 6px;
}
.bounty-task-status {
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(15,23,42,0.72);
  color: #cbd5e1;
  white-space: nowrap;
}
.bounty-task-status.ready {
  border-color: rgba(250,204,21,0.4);
  background: rgba(120,53,15,0.28);
  color: #fcd34d;
}
.bounty-task-actions {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(148,163,184,0.12);
  flex-wrap: wrap;
}
.bounty-task-action-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bounty-task-action-kicker {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(191,219,254,0.86);
}
.bounty-task-action-note {
  color: var(--text-muted);
}
.bounty-skip-btn {
  min-width: 148px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(96,165,250,0.35);
  background: linear-gradient(135deg, rgba(30,41,59,0.96), rgba(15,23,42,0.96));
  color: #dbeafe;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 10px 22px rgba(2,6,23,0.32);
}
.bounty-skip-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(147,197,253,0.7);
}
.bounty-skip-btn.ready {
  border-color: rgba(250,204,21,0.5);
  background: linear-gradient(135deg, rgba(120,53,15,0.96), rgba(146,64,14,0.94));
  color: #fef3c7;
  box-shadow: 0 12px 28px rgba(120,53,15,0.34);
}
.bounty-skip-btn.ready:hover {
  border-color: rgba(253,224,71,0.8);
}
.bounty-skip-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
  box-shadow: none;
}
.bounty-master-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bounty-master-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: rgba(15,23,42,0.82);
  border: 1px solid rgba(148,163,184,0.15);
}
.bounty-master-card.locked { opacity: 0.65; }
.bounty-master-crest {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 30% 30%, rgba(96,165,250,0.25), rgba(30,41,59,0.95));
  border: 1px solid rgba(96,165,250,0.35);
  color: #dbeafe;
  font-size: 11px;
  font-weight: 800;
  flex-shrink: 0;
}
.bounty-master-copy { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.bounty-master-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-bright);
}
.bounty-master-note {
  color: #93c5fd;
}
.stats-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.stats-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
}
.stats-card {
  background: linear-gradient(180deg, rgba(13,20,35,0.96), rgba(8,12,24,0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.stats-card-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.stats-card-value {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-bright);
}
.stats-progress-panel,
.stats-hall-panel {
  padding: 14px 16px;
}
.stats-kill-section + .stats-kill-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.stats-kill-subtitle {
  margin-bottom: 10px;
  font-size: 11px;
  line-height: 1.5;
  color: rgba(214, 221, 233, 0.72);
}
.mastery-live-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.08), transparent 42%),
    linear-gradient(180deg, rgba(23, 29, 42, 0.94), rgba(10, 13, 22, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 22px rgba(0, 0, 0, 0.16);
}

.mastery-live-panel--compact {
  padding: 10px 12px;
  gap: 8px;
}

.mastery-live-panel--combat {
  margin: 10px 10px 0;
  border-color: rgba(96, 165, 250, 0.22);
}

.mastery-live-panel--equipment {
  margin: 8px 7px 0;
}

.mastery-live-panel--bounty {
  margin-top: 12px;
  border-color: rgba(248, 113, 113, 0.2);
}

.mastery-live-panel--dungeon {
  margin-top: 14px;
  border-color: rgba(226, 188, 111, 0.2);
}

.mastery-live-panel--detail {
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 22%, rgba(255,255,255,0.08));
  background:
    radial-gradient(circle at top left, color-mix(in srgb, var(--branch-accent, #94a3b8) 18%, transparent), transparent 40%),
    linear-gradient(180deg, rgba(23, 29, 42, 0.94), rgba(10, 13, 22, 0.9));
}

.mastery-live-panel--stats {
  min-height: 100%;
}

.mastery-live-head {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mastery-live-kicker {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(214, 223, 238, 0.58);
}

.mastery-live-head strong {
  font-size: 13px;
  line-height: 1.35;
  color: #f8fafc;
}

.mastery-live-copy {
  font-size: 11px;
  line-height: 1.55;
  color: #9fb1ca;
}

.mastery-live-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mastery-live-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(255, 255, 255, 0.04);
  color: #dbe5f2;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mastery-live-chip strong {
  color: #f8d68b;
  font-weight: 800;
}

.mastery-live-chip.is-contextual {
  border-color: rgba(96, 165, 250, 0.26);
  background: rgba(96, 165, 250, 0.1);
}

.stats-mastery-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.stats-boss-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.stats-boss-rank {
  width: 26px;
  font-size: 10px;
  color: #93c5fd;
  font-weight: 700;
}
.stats-boss-name {
  flex: 1;
  font-size: 11px;
  color: var(--text-main);
}
.stats-boss-kills {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-gold);
}

@media (max-width: 720px) {
  .stats-mastery-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── BANK ───────────────────────────────────────────────────────────────── */
#bank-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 2px;
  padding: 6px;
}
.bank-slot {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative; overflow: hidden;
  transition: border-color 0.15s;
}
.bank-slot:hover { border-color: var(--border-gold); }
.bank-img { width: 80%; height: 80%; object-fit: contain; image-rendering: pixelated; }
.bank-qty {
  position: absolute; bottom: 1px; right: 1px;
  font-size: 8px; font-weight: 700; color: var(--text-gold);
  text-shadow: 1px 1px 1px black;
  padding: 1px 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(7, 12, 22, 0.92), rgba(7, 12, 22, 0.7));
  border: 1px solid rgba(255, 215, 128, 0.18);
  line-height: 1;
}
.bank-empty { grid-column: 1/-1; text-align: center; color: var(--text-muted); padding: 20px; }

/* ─── GAME LOG ───────────────────────────────────────────────────────────── */
#game-log-resizer {
  flex: 0 0 8px;
  cursor: ns-resize;
  background: transparent;
  border-top: 2px solid transparent;
  transition: border-color 0.2s;
  margin: 0;
}
#game-log-resizer:hover,
#game-log-resizer.gl-dragging {
  border-top-color: var(--border-gold);
}

#game-log {
  flex: 0 0 auto;
  height: 160px;
  min-height: 60px;
  max-height: 50vh;
  background: #080610;
  border-top: 2px solid var(--border-gold);
  overflow-y: auto;
  padding: 4px 8px;
  font-size: 11px;
  font-family: monospace;
  color: var(--text-muted);
}
#game-log div { padding: 1px 0; border-bottom: 1px solid #110f1a; }
.pm-entry {
  margin: 2px 0;
  padding: 3px 6px !important;
  border-left: 2px solid rgba(96,165,250,0.45);
  background: rgba(10,18,34,0.7);
}
.pm-entry.incoming { border-left-color: rgba(125,211,252,0.6); }
.pm-entry.outgoing { border-left-color: rgba(167,139,250,0.6); }
.pm-text {
  color: #bfdbfe;
  font-weight: 600;
}
.pm-text.incoming { color: #bfdbfe; }
.pm-text.outgoing { color: #c4b5fd; }

/* Links inside the activity log */
#game-log a {
  color: #60a5fa;
  text-decoration: underline;
  text-underline-offset: 2px;
  pointer-events: all;
  cursor: pointer;
}
#game-log a:hover { color: #93c5fd; }

/* ─── CHAT BAR ───────────────────────────────────────────────────────────── */
#chat-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #080610;
  border-top: 1px solid var(--border);
  padding: 4px 8px;
  flex: 0 0 auto;
}
#chat-prompt {
  color: var(--text-gold);
  font-family: monospace;
  font-size: 12px;
  font-weight: bold;
  user-select: none;
}
#chat-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-family: monospace;
  font-size: 11px;
  padding: 2px 4px;
  caret-color: var(--text-gold);
}
#chat-input::placeholder {
  color: var(--text-muted);
  opacity: 0.5;
}
#chat-send-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 5px;
  font-size: 11px;
  transition: color 0.15s;
}
#chat-send-btn:hover { color: var(--text-gold); }

#hazard-footer {
  position: fixed;
  right: 14px;
  bottom: 10px;
  z-index: 30;
  font-size: 11px;
  color: #bfdbfe;
  text-shadow: 0 0 6px rgba(96,165,250,0.18);
  pointer-events: none;
  animation: hazardFooterPulse 4.8s ease-in-out infinite;
}

@keyframes hazardFooterPulse {
  0%, 100% {
    opacity: 0.82;
    text-shadow: 0 0 4px rgba(96,165,250,0.12);
  }
  50% {
    opacity: 1;
    text-shadow: 0 0 9px rgba(96,165,250,0.26);
  }
}

/* ─── MODALS ─────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75);
  padding: 20px;
}
.modal.open { display: flex; }
.modal-box {
  background: var(--bg-panel);
  border: 2px solid var(--border-gold);
  border-radius: var(--radius);
  box-shadow: 0 8px 48px rgba(0,0,0,0.8);
  width: 100%; max-width: 640px;
  max-height: 80vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-box.wide { max-width: 900px; }
.modal-header {
  background: var(--bg-panel-2);
  border-bottom: 2px solid var(--border-gold);
  padding: 10px 14px;
  display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0;
}
.modal-title { font-size: 14px; font-weight: 700; color: var(--text-gold); }
.modal-footer {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
  background: rgba(18, 16, 26, 0.92);
}
.modal-close {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}
.modal-close:hover {
  color: var(--text-red);
  border-color: rgba(248, 113, 113, 0.30);
  background: rgba(248, 113, 113, 0.08);
  transform: translateY(-1px);
}
.modal-body { overflow-y: auto; padding: 12px; flex: 1; }

/* ─── PATCH NOTES ────────────────────────────────────────────────────────── */
#patch-notes-modal .modal-box {
  max-width: 800px;
  width: clamp(520px, 74vw, 860px);
  max-height: 86vh;
}
#patch-notes-modal .modal-title {
  font-size: 17px;
  letter-spacing: 0.04em;
}
#patch-notes-modal .modal-body {
  padding: 24px 28px 26px;
}
.patch-notes-version-stamp {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border-gold);
}
.patch-notes-version-label {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: 0.02em;
}
.patch-notes-date {
  font-size: 12px;
  color: var(--text-muted);
}
.pn-launch-banner {
  background: linear-gradient(135deg, rgba(212,175,55,0.10) 0%, rgba(212,175,55,0.03) 100%);
  border: 1px solid rgba(212,175,55,0.32);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 24px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}
.pn-launch-banner strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-gold);
  margin-bottom: 5px;
}
.patch-note-section {
  margin-bottom: 22px;
}
.patch-note-section:last-child {
  margin-bottom: 0;
}
.patch-note-heading {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-gold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 1px solid rgba(212,175,55,0.2);
  padding-bottom: 7px;
  margin-bottom: 13px;
}
.patch-notes-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.patch-notes-list li {
  position: relative;
  padding-left: 15px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}
.patch-notes-list li::before {
  content: '▸';
  position: absolute;
  left: 0;
  top: 2px;
  color: var(--text-gold);
  font-size: 9px;
}
.pn-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 1px 5px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
  position: relative;
  top: -1px;
}
.pn-badge.new {
  background: rgba(74,222,128,0.13);
  color: #4ade80;
  border: 1px solid rgba(74,222,128,0.28);
}
.pn-badge.fix {
  background: rgba(251,191,36,0.10);
  color: var(--text-gold);
  border: 1px solid rgba(251,191,36,0.22);
}

.onboarding-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: none;
  pointer-events: auto;
  background:
    radial-gradient(circle at 78% 8%, rgba(251, 191, 36, 0.08), transparent 24%),
    radial-gradient(circle at 18% 82%, rgba(96, 165, 250, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(7, 8, 12, 0.06), rgba(7, 8, 12, 0.16));
}
.onboarding-overlay.is-active { display: block; }
.onboarding-panel {
  position: absolute;
  top: 24px;
  right: 24px;
  width: min(430px, calc(100vw - 36px));
  padding: 22px 22px 18px;
  border-radius: 24px;
  border: 1px solid rgba(247, 210, 139, 0.28);
  background:
    linear-gradient(180deg, rgba(27, 23, 36, 0.96), rgba(14, 12, 22, 0.98)),
    radial-gradient(circle at top right, rgba(251, 191, 36, 0.12), transparent 38%);
  box-shadow:
    0 26px 80px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 248, 220, 0.05);
  backdrop-filter: blur(12px);
}
.onboarding-overlay[data-side="left"] .onboarding-panel {
  right: auto;
  left: 24px;
}
.onboarding-overlay[data-side="center"] .onboarding-panel {
  left: 50%;
  right: auto;
  transform: translateX(-50%);
}
.onboarding-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.onboarding-kicker {
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(224, 213, 188, 0.74);
  margin-bottom: 6px;
}
.onboarding-progress,
.onboarding-focus-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.onboarding-progress {
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: rgba(28, 48, 78, 0.48);
  color: #bfdbfe;
}
.onboarding-focus-chip {
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(88, 56, 10, 0.38);
  color: #fde68a;
  max-width: 180px;
  text-align: right;
  justify-content: center;
}
.onboarding-title {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.08;
  color: var(--text-bright);
}
.onboarding-body {
  color: rgba(233, 225, 211, 0.92);
  font-size: 14px;
  line-height: 1.68;
}
.onboarding-body p {
  margin: 0;
}
.tutorial-points {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding: 0;
}
.tutorial-points li {
  position: relative;
  padding-left: 18px;
  color: rgba(214, 205, 190, 0.84);
}
.tutorial-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 9px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fbbf24, #d97706);
  box-shadow: 0 0 12px rgba(251, 191, 36, 0.34);
}
.onboarding-detail {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(107, 99, 128, 0.32);
  color: rgba(160, 221, 255, 0.84);
  font-size: 12px;
  line-height: 1.6;
}
.onboarding-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 18px;
}
.onboarding-actions .onboarding-action-primary {
  margin-left: auto;
}
.onboarding-actions .btn-outline,
.onboarding-actions .btn-primary {
  min-height: 40px;
}

@keyframes tutorialPulse {
  0%, 100% {
    box-shadow:
      0 0 0 1px rgba(255, 236, 197, 0.78),
      0 0 0 6px rgba(251, 191, 36, 0.12),
      0 22px 50px rgba(3, 7, 18, 0.26);
  }
  50% {
    box-shadow:
      0 0 0 1px rgba(255, 248, 227, 0.92),
      0 0 0 10px rgba(251, 191, 36, 0.18),
      0 28px 64px rgba(3, 7, 18, 0.34);
  }
}

body.tutorial-running .tutorial-focus-target {
  position: relative;
  border-radius: 18px;
  animation: tutorialPulse 2.2s ease-in-out infinite;
}

body.tutorial-running .tutorial-focus-target.quest-row {
  border-radius: 12px;
}

@media (max-width: 900px) {
  .onboarding-panel {
    left: 16px !important;
    right: 16px !important;
    top: auto;
    bottom: 16px;
    width: auto;
    transform: none !important;
    padding: 18px 18px 16px;
    border-radius: 20px;
  }

  .onboarding-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .onboarding-focus-chip {
    max-width: 100%;
    text-align: left;
  }

  .onboarding-title {
    font-size: 24px;
  }

  .onboarding-actions {
    flex-wrap: wrap;
  }

  .onboarding-actions .onboarding-action-primary {
    margin-left: 0;
    flex: 1 1 100%;
  }
}

/* ─── TRAINING SUBTAB CHIPS (e.g. Smelt / Smith, Shaping / Stringing) ────── */
.training-subtab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 10px;
  padding: 4px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.training-subtab-chip {
  flex: 1 1 0;
  min-width: 90px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 12px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted, #9aa0a6);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s, border-color 0.12s;
}
.training-subtab-chip:hover {
  color: var(--text-gold, #f0c674);
  background: rgba(255, 215, 120, 0.06);
}
.training-subtab-chip.is-active {
  color: var(--text-gold, #f0c674);
  background: rgba(255, 215, 120, 0.10);
  border-color: var(--border-gold, #8a6d2b);
}
.training-subtab-chip .chip-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  color: var(--text-dim, #c7ccd1);
  background: rgba(255, 255, 255, 0.05);
  border-radius: 9999px;
}
.training-subtab-chip.is-active .chip-count {
  color: #1a1a1a;
  background: var(--text-gold, #f0c674);
}

/* ─── TRAINING ACTIONS ───────────────────────────────────────────────────── */
.training-action {
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
  margin-bottom: 4px;
  display: flex; flex-direction: column; gap: 4px;
  transition: border-color 0.15s;
}
.training-action:hover:not(.locked) { border-color: var(--border-gold); }
.training-action.active { border-color: var(--text-green); background: #0d1a12; }
.training-action.locked { opacity: 0.5; }
.action-header { display: flex; justify-content: space-between; align-items: center; }
.action-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.action-name { font-size: 13px; font-weight: 600; color: var(--text-bright); }
.action-xp { font-size: 12px; color: var(--text-gold); font-variant-numeric: tabular-nums; display: inline-flex; align-items: center; gap: 6px; }
.action-xp--boosted {
  color: #bef5c6;
  text-shadow: 0 0 8px rgba(52, 211, 153, 0.25);
  transition: color 0.18s ease, text-shadow 0.18s ease;
}
.action-xp-boost {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #062e1b;
  background: linear-gradient(180deg, #7ef0a8, #34d399);
  border: 1px solid rgba(16, 90, 60, 0.45);
  box-shadow: 0 1px 0 rgba(255,255,255,0.15) inset, 0 1px 3px rgba(16, 90, 60, 0.35);
  font-variant-numeric: tabular-nums;
  cursor: help;
}
.action-details {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.action-route-chip {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid rgba(156, 176, 219, 0.22);
  background: rgba(156, 176, 219, 0.08);
  color: #d9e2ff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}
.action-route-chip--xp { color: #f5d38b; border-color: rgba(245, 211, 139, 0.32); background: rgba(245, 211, 139, 0.10); }
.action-route-chip--profit { color: #8ee6b5; border-color: rgba(142, 230, 181, 0.32); background: rgba(142, 230, 181, 0.10); }
.action-route-chip--prep { color: #9fd6ff; border-color: rgba(159, 214, 255, 0.32); background: rgba(159, 214, 255, 0.10); }
.action-route-chip--finish { color: #f0a6c8; border-color: rgba(240, 166, 200, 0.32); background: rgba(240, 166, 200, 0.10); }
.action-route-chip--supply { color: #c9e889; border-color: rgba(201, 232, 137, 0.32); background: rgba(201, 232, 137, 0.10); }
.action-icon { flex-shrink: 0; }
.action-icon.item-art {
  --item-icon-padding: 2px;
}
.train-btn {
  background: var(--bg-panel-3); border: 1px solid var(--border);
  color: var(--text-green); border-radius: var(--radius-sm);
  padding: 4px 12px; font-size: 12px; cursor: pointer; align-self: flex-start;
  transition: all 0.15s;
}
.train-btn:hover { border-color: var(--text-green); }
.train-btn.active { background: #0d2010; border-color: var(--text-green); }
.locked-req { font-size: 11px; color: var(--text-red); }

/* Action consumption row */
.action-consumes {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 2px 0;
}
.consume-label {
  color: var(--text-muted);
  font-weight: 500;
  opacity: 0.7;
}
.consume-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-main);
  background: rgba(255,255,255,0.04);
  padding: 1px 5px;
  border-radius: 3px;
  border: 1px solid var(--border);
}
button.consume-item {
  appearance: none;
  font: inherit;
  line-height: inherit;
}
.consume-item.consume-missing {
  color: var(--text-red);
  border-color: rgba(239,68,68,0.3);
  background: rgba(239,68,68,0.08);
}
.consume-item--market {
  cursor: pointer;
  border-color: rgba(212, 175, 55, 0.35);
  background: rgba(212, 175, 55, 0.08);
  transition: color 0.15s, border-color 0.15s, background 0.15s, transform 0.15s;
}
.consume-item--market:hover,
.consume-item--market:focus-visible {
  color: var(--text-gold);
  border-color: rgba(212, 175, 55, 0.9);
  background: rgba(212, 175, 55, 0.14);
  transform: translateY(-1px);
  outline: none;
}
.consume-item-market-icon {
  color: var(--text-gold);
  font-size: 10px;
  opacity: 0.9;
}
.action-details {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.action-gives {
  color: var(--text-green);
  font-weight: 500;
}
.action-time {
  color: var(--text-muted);
  opacity: 0.8;
}

/* ─── QUEST MODAL ────────────────────────────────────────────────────────── */
#quests-modal {
  padding: 18px;
  background:
    radial-gradient(circle at top, rgba(212, 175, 55, 0.14), transparent 28%),
    rgba(2, 4, 10, 0.84);
  backdrop-filter: blur(6px);
}
#quests-modal .modal-box,
.quest-modal-box {
  width: clamp(1100px, 88vw, 1450px);
  max-width: calc(100vw - 24px);
  height: clamp(700px, 84vh, 920px);
  max-height: calc(100vh - 24px);
  border-radius: 24px;
  border: 1px solid rgba(212, 175, 55, 0.5);
  background:
    linear-gradient(180deg, rgba(33, 26, 43, 0.96), rgba(11, 14, 22, 0.98));
  box-shadow:
    0 32px 90px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.quest-modal-header {
  padding: 22px 28px 20px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.2);
  background:
    linear-gradient(180deg, rgba(38, 31, 50, 0.98), rgba(18, 21, 31, 0.92));
}
.quest-modal-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.quest-modal-header .modal-title {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.quest-modal-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.quest-modal-header .modal-close {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.28);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-main);
  font-size: 24px;
  line-height: 1;
}
.quest-modal-header .modal-close:hover {
  color: var(--text-bright);
  border-color: rgba(212, 175, 55, 0.55);
  background: rgba(212, 175, 55, 0.12);
}
.quest-modal-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(7, 10, 17, 0.3), rgba(7, 10, 17, 0.92));
}
.quest-filter-row {
  padding: 20px 24px 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.16);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex-shrink: 0;
  background:
    linear-gradient(180deg, rgba(22, 25, 37, 0.86), rgba(16, 19, 28, 0.62));
}
#quest-search-input {
  flex: 1 1 340px;
  min-width: 280px;
  padding: 12px 14px;
  font-size: 14px;
  border-radius: 14px;
  border-color: rgba(212, 175, 55, 0.16);
  background: rgba(18, 22, 33, 0.95);
}
#quest-search-input::placeholder {
  color: rgba(201, 185, 154, 0.55);
}
#quest-search-input:focus {
  border-color: rgba(212, 175, 55, 0.55);
  box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.18);
}
.quest-filter-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.quest-filter-row select {
  min-width: 170px;
  height: 44px;
  padding: 0 16px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 14px;
  background: rgba(18, 22, 33, 0.95);
  border: 1px solid rgba(212, 175, 55, 0.16);
  color: var(--text-main);
}
.quest-modal-marks {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.24);
  background: rgba(212, 175, 55, 0.1);
  color: var(--text-gold);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.quest-modal-marks b {
  font-size: 15px;
  color: var(--text-bright);
}
.lore-activities-panel {
  padding: 0 24px 18px;
  flex-shrink: 0;
}
.lore-activities-panel:empty {
  display: none;
}
.lore-activity-shell {
  border: 1px solid rgba(96, 165, 250, 0.14);
  border-radius: 20px;
  padding: 18px 20px;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.88), rgba(11, 16, 24, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 34px rgba(0, 0, 0, 0.24);
}
.lore-activity-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 14px;
}
.lore-activity-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-bright);
}
.lore-activity-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.lore-activity-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: rgba(96, 165, 250, 0.08);
  color: #bfdbfe;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
}
.lore-activity-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.lore-card {
  min-height: 190px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(96, 165, 250, 0.12);
  background: rgba(14, 18, 27, 0.9);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.lore-card.active {
  border-color: rgba(96, 165, 250, 0.45);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.16);
}
.lore-card.disabled {
  opacity: 0.62;
}
.lore-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.lore-card-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-bright);
  line-height: 1.3;
}
.lore-card-meta,
.lore-card-progress,
.lore-card-preview,
.lore-last-reward {
  font-size: 12px;
  color: var(--text-muted);
}
.lore-card-count {
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.18);
  background: rgba(212, 175, 55, 0.08);
  color: var(--text-gold);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.lore-card-copy {
  flex: 1;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-main);
}
.lore-card-preview {
  line-height: 1.5;
}
.lore-card-progress {
  font-variant-numeric: tabular-nums;
}
.lore-card-btn {
  width: 100%;
  margin-top: auto;
}
.lore-last-reward {
  margin-top: 14px;
  line-height: 1.5;
}
.quests-layout {
  display: grid;
  grid-template-columns: minmax(360px, 38%) minmax(0, 1fr);
  gap: 22px;
  padding: 0 24px 24px;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
#quests-list,
.quest-detail-pane {
  min-height: 0;
  border: 1px solid rgba(212, 175, 55, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(18, 22, 32, 0.94), rgba(9, 13, 21, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 38px rgba(0, 0, 0, 0.26);
  overflow: hidden;
}
#quests-list {
  display: flex;
  flex-direction: column;
}
.quest-list-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.quest-list-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 10px;
}
.quest-list-kicker {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-gold);
}
.quest-list-title {
  margin-top: 6px;
  font-size: 21px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.15;
}
.quest-list-count {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.2);
  background: rgba(212, 175, 55, 0.08);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 800;
  color: var(--text-gold);
  font-variant-numeric: tabular-nums;
}
.quest-list-summary-meta {
  padding: 0 20px 16px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
  font-size: 12px;
  color: var(--text-muted);
}
.quest-list-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quest-list-empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  padding: 18px;
}
.quest-row {
  display: block;
  min-height: 124px;
  padding: 16px 18px;
  border-radius: 20px;
  border: 1px solid rgba(212, 175, 55, 0.1);
  background:
    linear-gradient(135deg, rgba(30, 26, 40, 0.95), rgba(16, 20, 31, 0.96));
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}
.quest-row:hover {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.34);
  background:
    linear-gradient(135deg, rgba(38, 31, 50, 0.98), rgba(18, 22, 34, 0.98));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}
.quest-row.is-selected {
  border-color: rgba(212, 175, 55, 0.58);
  background:
    linear-gradient(135deg, rgba(52, 39, 20, 0.32), rgba(22, 27, 40, 0.98));
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.28),
    inset 0 0 0 1px rgba(212, 175, 55, 0.14);
}
.quest-row-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-width: 0;
}
.quest-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  border: 1px solid rgba(212, 175, 55, 0.16);
  background: rgba(212, 175, 55, 0.08);
  color: var(--text-gold);
}
.quest-row.status-not_started .quest-icon {
  border-color: rgba(107, 99, 128, 0.45);
  background: rgba(107, 99, 128, 0.14);
  color: #d4d0dd;
}
.quest-row.status-ready .quest-icon {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.14);
  color: var(--text-gold);
}
.quest-row.status-in_progress .quest-icon {
  border-color: rgba(96, 165, 250, 0.42);
  background: rgba(96, 165, 250, 0.14);
  color: #bfdbfe;
}
.quest-row.status-paused .quest-icon {
  border-color: rgba(129, 140, 248, 0.38);
  background: rgba(99, 102, 241, 0.14);
  color: #c7d2fe;
}
.quest-row.status-blocked .quest-icon {
  border-color: rgba(248, 113, 113, 0.4);
  background: rgba(248, 113, 113, 0.14);
  color: #fecaca;
}
.quest-row.status-completed .quest-icon {
  border-color: rgba(74, 222, 128, 0.38);
  background: rgba(74, 222, 128, 0.14);
  color: #bbf7d0;
}
.quest-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
}
.quest-card-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}
.quest-name {
  display: block;
  font-size: 19px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.32;
  letter-spacing: 0.01em;
  text-wrap: pretty;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
  max-width: 100%;
}
.quest-card-subline {
  display: block;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}
.quest-meta,
.quest-detail-subtitle,
.quest-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}
.quest-meta-pill,
.quest-detail-meta-chip,
.quest-preview-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.quest-detail-meta-chip {
  padding: 7px 12px;
  font-size: 12px;
}
.quest-meta-pill.is-members,
.quest-detail-meta-chip.is-members {
  border-color: rgba(212, 175, 55, 0.26);
  background: rgba(212, 175, 55, 0.12);
  color: var(--text-gold);
}
.quest-meta-pill.is-f2p,
.quest-detail-meta-chip.is-f2p {
  border-color: rgba(74, 222, 128, 0.22);
  background: rgba(74, 222, 128, 0.1);
  color: #bbf7d0;
}
.quest-meta-pill.is-titan,
.quest-detail-meta-chip.is-titan {
  border-color: rgba(251, 191, 36, 0.3);
  background: rgba(251, 191, 36, 0.12);
  color: #fde68a;
}
.quest-preview-chip.is-gold,
.quest-detail-meta-chip.is-gold {
  border-color: rgba(212, 175, 55, 0.28);
  background: rgba(212, 175, 55, 0.12);
  color: var(--text-gold);
}
.quest-preview-chip.is-neutral {
  color: #d4d0dd;
}
.quest-status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.quest-card-state {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: fit-content;
  padding-left: 8px;
}
.quest-card-state .quest-status-badge {
  max-width: 100%;
}
.quest-status-badge.status-not_started {
  color: #d4d0dd;
  border-color: rgba(107, 99, 128, 0.38);
}
.quest-status-badge.status-ready {
  color: var(--text-gold);
  border-color: rgba(212, 175, 55, 0.34);
  background: rgba(212, 175, 55, 0.12);
}
.quest-status-badge.status-in_progress {
  color: #bfdbfe;
  border-color: rgba(96, 165, 250, 0.34);
  background: rgba(96, 165, 250, 0.12);
}
.quest-status-badge.status-paused {
  color: #c7d2fe;
  border-color: rgba(129, 140, 248, 0.32);
  background: rgba(99, 102, 241, 0.12);
}
.quest-status-badge.status-blocked {
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.34);
  background: rgba(248, 113, 113, 0.1);
}
.quest-status-badge.status-completed {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.34);
  background: rgba(74, 222, 128, 0.1);
}
.quest-stage-meter {
  position: relative;
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(9, 13, 21, 0.92);
  border: 1px solid rgba(212, 175, 55, 0.14);
}
.quest-stage-meter.compact {
  min-width: 0;
  height: 8px;
}
.quest-stage-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.18s ease, background 0.18s ease;
}
.quest-stage-fill.status-not_started {
  background: linear-gradient(90deg, rgba(107, 99, 128, 0.7), rgba(156, 163, 175, 0.7));
}
.quest-stage-fill.status-in_progress {
  background: linear-gradient(90deg, #b07a14, #fbbf24);
}
.quest-stage-fill.status-completed {
  background: linear-gradient(90deg, #166534, #4ade80);
}
.quest-stage-fill.status-active {
  background: linear-gradient(90deg, #2563eb, #60a5fa);
  animation: quest-pulse 1.5s ease-in-out infinite;
}
@keyframes quest-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}
.quest-detail-pane {
  padding: 0;
  display: flex;
  flex-direction: column;
}
.quest-detail-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}
.quest-detail-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 24px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.quest-detail-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.7;
  padding: 36px;
}
.quest-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}
.quest-detail-title-block {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.quest-detail-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-bright);
  line-height: 1.08;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.quest-stage-summary {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.14);
  background:
    linear-gradient(135deg, rgba(44, 31, 17, 0.18), rgba(18, 23, 35, 0.92));
}
.quest-stage-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.quest-stage-header-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.quest-stage-header-copy strong {
  font-size: 18px;
  color: var(--text-bright);
  line-height: 1.2;
}
.quest-stage-kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-gold);
}
.quest-stage-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.quest-stage-meta span {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
}
.quest-stage-meta strong {
  font-size: 18px;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}
.quest-section-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding-bottom: 24px;
}
.quest-detail-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 18px 20px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(20, 24, 35, 0.94), rgba(11, 15, 24, 0.96));
}
.quest-detail-section.section-span-2 {
  grid-column: 1 / -1;
}
.quest-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.quest-detail-section h4 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-gold);
}
.quest-section-caption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.quest-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.quest-overview-card {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
}
.quest-overview-label {
  display: block;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.quest-summary,
.quest-lore {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-main);
}
.quest-requirement-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}
.quest-requirement-summary.is-clear {
  border-color: rgba(74, 222, 128, 0.18);
  background: rgba(74, 222, 128, 0.08);
}
.quest-requirement-summary.is-missing {
  border-color: rgba(248, 113, 113, 0.22);
  background:
    linear-gradient(135deg, rgba(127, 29, 29, 0.38), rgba(68, 12, 12, 0.22));
}
.quest-requirement-summary-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
}
.quest-requirement-summary-copy {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.quest-requirement-summary-count {
  min-width: 44px;
  text-align: right;
  font-size: 30px;
  font-weight: 800;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
}
.quest-requirement-groups {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quest-requirement-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quest-requirement-group + .quest-requirement-group {
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.quest-requirement-group-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.quest-requirement-list,
.quest-reward-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.quest-requirement-row,
.quest-reward-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 13px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.quest-requirement-row:hover,
.quest-reward-row:hover {
  border-color: rgba(212, 175, 55, 0.24);
  background: rgba(255, 255, 255, 0.05);
  transform: translateY(-1px);
}
.quest-requirement-row.missing {
  border-color: rgba(248, 113, 113, 0.28);
  background:
    linear-gradient(135deg, rgba(127, 29, 29, 0.28), rgba(59, 17, 17, 0.2));
}
.quest-requirement-row.met {
  border-color: rgba(74, 222, 128, 0.18);
}
.quest-requirement-label,
.quest-reward-label {
  color: var(--text-main);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.quest-requirement-row.missing .quest-requirement-label {
  color: #fecaca;
}
.quest-requirement-value,
.quest-reward-value {
  color: var(--text-bright);
  white-space: nowrap;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.quest-requirement-row.met .quest-requirement-value {
  color: #bbf7d0;
}
.quest-requirement-row.missing .quest-requirement-value {
  color: #fecaca;
}
.ge-route-link {
  cursor: pointer;
  border-bottom: 1px dashed rgba(212, 175, 55, 0.5);
  transition: color 0.15s, border-color 0.15s;
}
.ge-route-link:hover {
  color: var(--text-gold);
  border-bottom-color: var(--text-gold);
}
.quest-action-btn {
  min-width: 184px;
  padding: 12px 18px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.15s, background 0.15s, color 0.15s;
}
.quest-action-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  border-color: rgba(212, 175, 55, 0.3);
  color: var(--text-bright);
}
.quest-action-btn.row-action {
  margin-top: 0;
}
.quest-action-btn[data-quest-action="start"] {
  border-color: rgba(212, 175, 55, 0.42);
  background: var(--gold-grad);
  color: #120d06;
}
.quest-action-btn[data-quest-action="resume"] {
  border-color: rgba(96, 165, 250, 0.34);
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.24), rgba(21, 61, 124, 0.32));
  color: #dbeafe;
}
.quest-action-btn[data-quest-action="start"]:hover:not(:disabled) {
  border-color: rgba(251, 191, 36, 0.65);
  color: #120d06;
}
.quest-action-btn[data-quest-action="resume"]:hover:not(:disabled) {
  border-color: rgba(147, 197, 253, 0.58);
  color: #eff6ff;
}
.quest-action-btn[data-quest-action="pause"] {
  border-color: rgba(96, 165, 250, 0.32);
  background: rgba(96, 165, 250, 0.12);
  color: #bfdbfe;
}
.quest-action-btn[data-quest-action="pause"]:hover:not(:disabled) {
  background: rgba(96, 165, 250, 0.2);
}
.quest-action-btn[data-quest-action="blocked"] {
  border-color: rgba(248, 113, 113, 0.22);
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
}
.quest-action-btn:disabled,
.quest-action-btn[disabled] {
  opacity: 0.52;
  cursor: not-allowed;
  transform: none;
  filter: grayscale(0.15);
}
.complete-quest-btn {
  background: var(--gold-grad);
  border: 1px solid rgba(212, 175, 55, 0.34);
  color: #120d06;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.quest-unlock-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.quest-unlock-chip {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-gold);
  border: 1px solid rgba(212, 175, 55, 0.24);
  background: rgba(212, 175, 55, 0.08);
  transition: all 0.15s ease;
}
.quest-unlock-chip:hover {
  background: rgba(212, 175, 55, 0.16);
  border-color: rgba(212, 175, 55, 0.4);
  box-shadow: 0 0 12px rgba(212, 175, 55, 0.18);
}
.quest-stage-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.quest-stage-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: flex-start;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.03);
  font-size: 13px;
  color: var(--text-main);
}
.quest-stage-check.completed {
  border-color: rgba(74, 222, 128, 0.22);
}
.quest-stage-check.current {
  border-color: rgba(212, 175, 55, 0.28);
  background: rgba(212, 175, 55, 0.08);
}
.quest-stage-check.upcoming {
  opacity: 0.92;
}
.quest-stage-glyph {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
}
.quest-stage-check.completed .quest-stage-glyph {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.18);
  background: rgba(74, 222, 128, 0.08);
}
.quest-stage-check.current .quest-stage-glyph {
  color: var(--text-gold);
  border-color: rgba(212, 175, 55, 0.24);
  background: rgba(212, 175, 55, 0.1);
}
.quest-stage-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.quest-stage-copy-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.quest-stage-step {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-gold);
}
.quest-stage-state {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.quest-stage-check.completed .quest-stage-state {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.18);
}
.quest-stage-check.current .quest-stage-state {
  color: var(--text-gold);
  border-color: rgba(212, 175, 55, 0.22);
}
.quest-stage-text {
  color: var(--text-main);
  line-height: 1.6;
  overflow-wrap: anywhere;
}
.quest-focus-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(143, 211, 255, 0.16);
  background:
    linear-gradient(180deg, rgba(28, 36, 54, 0.72), rgba(11, 15, 24, 0.68));
  color: rgba(218, 229, 245, 0.78);
  font-size: 12px;
  line-height: 1.55;
}
.quest-focus-note i {
  margin-top: 2px;
  color: rgba(143, 211, 255, 0.9);
}
.quest-focus-note.is-active {
  border-color: rgba(116, 229, 154, 0.2);
  background:
    radial-gradient(circle at 0% 0%, rgba(116, 229, 154, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(25, 45, 38, 0.72), rgba(11, 18, 19, 0.68));
}
.quest-focus-note.is-active i {
  color: rgba(116, 229, 154, 0.92);
}
.quest-detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px 24px;
  border-top: 1px solid rgba(212, 175, 55, 0.1);
  background:
    linear-gradient(180deg, rgba(10, 14, 22, 0.42), rgba(7, 10, 17, 0.98));
  flex-shrink: 0;
}
.quest-action-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.quest-action-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
}
.quest-action-subtitle {
  max-width: 54ch;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.quest-detail-footer .quest-action-btn {
  margin-top: 0;
  min-width: 220px;
}
.quest-empty-note {
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* ─── QUEST TOOLTIPS ─────────────────────────────────────────────────────── */
#global-q-tooltip {
  position: fixed;
  z-index: 10000;
  background: rgba(12, 18, 28, 0.98);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  color: #fff;
  font-size: 11px;
  line-height: 1.4;
  box-shadow: 0 8px 24px rgba(0,0,0,0.9);
  pointer-events: none;
  min-width: 160px;
  max-width: 250px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s;
}
#global-q-tooltip.visible {
  opacity: 1;
  visibility: visible;
}
.q-tt-title { font-weight: 700; color: var(--text-gold); margin-bottom: 4px; display: block; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.q-tt-desc { color: var(--text-main); display: block; margin-bottom: 6px; }
.q-tt-stat { color: var(--text-muted); display: block; margin-bottom: 2px; }
.q-tt-stat strong { color: var(--text-bright); }
.q-tt-hint { color: #60a5fa; font-style: italic; font-size: 10px; display: block; margin-top: 6px; }

@media (max-width: 1200px) {
  #quests-modal .modal-box,
  .quest-modal-box {
    width: calc(100vw - 24px);
    height: min(90vh, 920px);
  }

  .quests-layout {
    grid-template-columns: 1fr;
  }

  #quests-list {
    max-height: 42vh;
  }

  .quest-detail-pane {
    min-height: 0;
  }
}

@media (max-width: 900px) {
  #quests-modal {
    padding: 10px;
  }

  #quests-modal .modal-box,
  .quest-modal-box {
    width: calc(100vw - 20px);
    height: calc(100vh - 20px);
    max-height: calc(100vh - 20px);
    border-radius: 18px;
  }

  .quest-modal-header {
    padding: 18px 18px 16px;
  }

  .quest-modal-header .modal-title {
    font-size: 19px;
  }

  .quest-filter-row,
  .lore-activities-panel,
  .quests-layout {
    padding-left: 16px;
    padding-right: 16px;
  }

  .quest-filter-row {
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .quest-modal-marks {
    margin-left: 0;
  }

  .quests-layout {
    gap: 16px;
    padding-bottom: 16px;
  }

  #quests-list {
    max-height: 36vh;
  }

  .quest-row {
    padding: 14px 16px;
  }

  .quest-row-main {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: flex-start;
  }

  .quest-card-state {
    grid-column: 2;
    justify-content: flex-start;
    padding-left: 0;
  }

  .quest-detail-title {
    font-size: 26px;
  }

  .quest-stage-meta,
  .quest-section-grid {
    grid-template-columns: 1fr;
  }

  .quest-detail-section.section-span-2 {
    grid-column: auto;
  }

  .quest-detail-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .quest-detail-footer .quest-action-btn {
    width: 100%;
    min-width: 0;
  }
}

@media (max-width: 640px) {
  .quest-list-summary,
  .quest-list-summary-meta,
  .quest-list-scroll,
  .quest-detail-scroll,
  .quest-detail-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .quest-row,
  .quest-detail-section,
  .quest-stage-summary {
    padding: 14px;
  }

  .quest-row-main {
    gap: 12px;
  }

  .quest-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    font-size: 16px;
  }

  .quest-name {
    font-size: 17px;
  }

  .quest-card-subline {
    font-size: 11px;
  }

  .quest-detail-header {
    flex-direction: column;
  }
}

/* ─── GE PANEL ───────────────────────────────────────────────────────────── */
.ge-title { font-size: 13px; font-weight: 700; color: var(--text-gold); padding: 6px 0; }
.ge-loading, .ge-error { color: var(--text-muted); text-align: center; padding: 20px; }
.ge-price-list { display: flex; flex-direction: column; gap: 4px; }
.ge-price-row {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
}
.ge-item-img { width: 24px; height: 24px; object-fit: contain; image-rendering: pixelated; }
.ge-item-name { flex: 1; font-size: 12px; color: var(--text-main); }
.ge-item-price { font-size: 12px; font-weight: 700; color: var(--text-gold); }

/* ─── BESTIARY ───────────────────────────────────────────────────────────── */
#bestiary-list { padding: 4px; }
.bestiary-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 6px; border-bottom: 1px solid var(--border);
}
.bestiary-img { width: 48px; height: 48px; object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.bestiary-info { flex: 1; }
.bestiary-name { font-size: 13px; font-weight: 700; color: var(--text-bright); display: flex; align-items: center; gap: 6px; }
.sl-req-badge { font-size: 9px; background: var(--accent); color: white; padding: 0 4px; border-radius: 2px; }
.bestiary-stats { font-size: 11px; color: var(--text-muted); margin: 2px 0; }
.bestiary-drops { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.drop-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 5px 1px 3px;
  font-size: 10px; color: var(--text-muted);
  cursor: default;
  transition: border-color 0.1s;
}
.drop-chip:hover { border-color: var(--text-gold); color: var(--text-main); }
.drop-chip-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  border-radius: 4px;
  font-size: 10px;
  --item-icon-padding: 1px;
}

/* ─── CONTEXT MENUS ──────────────────────────────────────────────────────── */
.item-context-menu {
  position: fixed; z-index: 2000;
  background: var(--bg-panel);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.8);
  min-width: 160px;
  max-width: min(260px, calc(100vw - 16px));
  overflow: hidden;
  top: 0;
  left: 0;
}
.item-menu-header {
  background: var(--bg-panel-2);
  padding: 6px 10px;
  font-size: 12px; font-weight: 700; color: var(--text-gold);
  border-bottom: 1px solid var(--border);
}
.item-menu-btn {
  display: block; width: 100%;
  background: none; border: none;
  color: var(--text-main);
  padding: 7px 10px; font-size: 12px; text-align: left; cursor: pointer;
  transition: background 0.1s;
}
.item-menu-btn:hover { background: var(--bg-panel-3); color: var(--text-bright); }
.item-menu-btn.cancel { color: var(--text-muted); }

/* ─── OFFLINE REPORT ─────────────────────────────────────────────────────── */
#offline-modal .modal-box {
  border-color: rgba(132, 187, 255, 0.22);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(245, 189, 100, 0.12), transparent 28%),
    var(--panel-shell-elevated, var(--bg-panel));
}

#offline-report {
  display: grid;
  gap: 12px;
  max-width: min(720px, calc(100vw - 32px));
}

.offline-report-summary {
  display: grid;
  gap: 8px;
}

.report-time {
  margin: 0;
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  background: rgba(59, 130, 246, 0.08);
  color: rgba(229, 238, 255, 0.92);
  font-size: 14px;
}

.report-time-processed {
  border-color: rgba(245, 189, 100, 0.22);
  background: rgba(245, 189, 100, 0.08);
}

.report-section {
  margin-top: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

.report-section-notes {
  display: grid;
  gap: 6px;
}

.report-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 7px;
}

.report-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 12px;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.report-row:last-child {
  border-bottom: 0;
}

.report-row span {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

.report-row span:last-child {
  color: rgba(250, 224, 171, 0.94);
  font-weight: 700;
  text-align: right;
  white-space: nowrap;
}

.report-row em {
  color: rgba(125, 211, 252, 0.9);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.report-row-more span {
  color: rgba(190, 203, 224, 0.72);
}

.report-note {
  margin: 0;
  line-height: 1.55;
}

/* ─── BUTTONS ────────────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--accent);
  border: none; color: white;
  border-radius: var(--radius-sm);
  padding: 7px 14px; font-size: 12px; cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-danger {
  background: var(--danger);
  border: none; color: white;
  border-radius: var(--radius-sm);
  padding: 7px 14px; font-size: 12px; cursor: pointer;
  width: 100%; margin-top: 8px;
  transition: background 0.15s;
}
.btn-danger.sm { width: auto; margin-top: 0; padding: 5px 10px; }
.btn-danger:hover { background: var(--danger-hover); }
.btn-outline {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 6px 12px; font-size: 12px; cursor: pointer;
  transition: all 0.15s;
}
.btn-outline:hover { border-color: var(--border-gold); color: var(--text-main); }
.btn-outline.active {
  border-color: rgba(96,165,250,0.65);
  color: #dbeafe;
  background: rgba(15,23,42,0.82);
}

/* ─── CLOUD SAVE SECTION ─────────────────────────────────────────────────── */
.cloud-save-status {
  font-size: 12px;
  padding: 8px 10px;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 34px;
  display: flex;
  align-items: center;
  line-height: 1.4;
  color: var(--text-muted);
}
.cloud-save-status span { display: block; }

.cloud-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cloud-btn-row .btn-outline {
  flex: 1;
  min-width: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 10px;
}
.cloud-btn-row .btn-outline:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}
.cloud-note {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.75;
  line-height: 1.5;
  margin-top: 2px;
}
.cloud-note code {
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 0 3px;
  font-size: 10px;
  color: var(--text-gold);
}
.community-btn-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.community-btn-row .btn-outline {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.community-note {
  margin-top: 6px;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-muted);
}
.leaderboard-controls,
.admin-toolbar {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.leaderboard-status,
.admin-meta,
.admin-status {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.leaderboard-list,
.admin-key-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.leaderboard-row,
.admin-key-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
}
.leaderboard-rank,
.admin-key-state {
  font-size: 10px;
  font-weight: 700;
  color: #93c5fd;
}
.leaderboard-name,
.admin-key-code {
  font-size: 12px;
  color: var(--text-main);
  word-break: break-word;
}
.leaderboard-value,
.admin-key-time {
  font-size: 10px;
  color: var(--text-gold);
}
.leaderboard-empty,
.admin-empty {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
}
/* ── Hall of Heroes / Hiscores ── */
.hof-modal-box {
  max-width: 900px;
  width: 96vw;
}
.hof-modal-body {
  display: grid;
  grid-template-columns: minmax(188px, 210px) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  min-height: 0;
  max-height: 70vh;
  overflow: hidden;
  min-width: 0;
  padding: 0;
}
/* Category sidebar */
.hof-sidebar {
  border-right: 1px solid var(--border);
  padding: 8px 0 12px;
  overflow-y: auto;
  overflow-x: hidden;
  flex-shrink: 0;
  min-height: 0;
  height: 100%;
  scrollbar-gutter: stable;
  overscroll-behavior: contain;
}
.hof-sidebar-section {
  margin-bottom: 2px;
}
.hof-sidebar-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 10px 3px;
}
.hof-cat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 10px;
  background: none;
  border: none;
  border-radius: 0;
  color: var(--text-main);
  font-size: 11px;
  cursor: pointer;
  text-align: left;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hof-cat-btn i { font-size: 10px; flex-shrink: 0; color: var(--text-muted); width: 13px; }
.hof-cat-btn:hover { background: var(--bg-panel-3); color: var(--text-bright); }
.hof-cat-btn.active {
  background: rgba(201, 154, 46, 0.12);
  color: var(--text-gold);
  font-weight: 600;
  border-left: 2px solid var(--text-gold);
  padding-left: 8px;
}
.hof-cat-btn.active i { color: var(--text-gold); }
.hof-cat-btn:disabled { opacity: 0.45; cursor: default; }
.hof-soon-tag {
  margin-left: auto;
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(100,100,120,0.3);
  color: var(--text-muted);
  letter-spacing: 0.05em;
}
/* HoF content panel */
.hof-content {
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 10px 12px;
  min-width: 0;
  min-height: 0;
}
.hof-category-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 6px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}
.hof-category-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
}
/* Hiscores table */
.hof-table {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.hof-table-head {
  display: grid;
  grid-template-columns: 36px auto 1fr 132px;
  gap: 6px;
  padding: 4px 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hof-table-row {
  display: grid;
  grid-template-columns: 36px auto 1fr 132px;
  gap: 6px;
  align-items: center;
  padding: 7px 8px;
  border-radius: 6px;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  transition: border-color 0.1s;
}
.hof-table-row:hover { border-color: var(--border-gold); }

/* ── Rank row enhancements ─────────────────────────────────────────────────── */
.hof-table-row.rank-1 {
  border-color: rgba(255, 215, 0, 0.55);
  background: linear-gradient(90deg, rgba(255, 200, 0, 0.07) 0%, rgba(255, 180, 0, 0.04) 100%);
  box-shadow: inset 0 0 24px rgba(255, 200, 0, 0.04);
}
.hof-table-row.rank-2 {
  border-color: rgba(180, 190, 255, 0.38);
  background: rgba(160, 170, 240, 0.04);
}
.hof-table-row.rank-3 {
  border-color: rgba(220, 140, 50, 0.42);
  background: rgba(200, 120, 40, 0.04);
}

.hof-rank {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
}
.hof-rank-1 { color: #ffd700; text-shadow: 0 0 8px rgba(255,215,0,0.7); }
.hof-rank-2 { color: #c4ccf0; text-shadow: 0 0 6px rgba(180,190,255,0.5); }
.hof-rank-3 { color: #dc8c32; text-shadow: 0 0 6px rgba(220,140,50,0.45); }

.hof-mode-cell { display: flex; align-items: center; }
.hof-mode-cell img { width: 18px; height: 18px; object-fit: contain; }
.hof-player { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hof-player-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Rank #1 — Sovereign Gold (mythic / regal / radiant) ─────────────────── */
@keyframes hof-rank-1-pulse {
  0%, 100% {
    text-shadow:
      0 0  8px rgba(255, 215, 0, 0.85),
      0 0 20px rgba(255, 190, 0, 0.45),
      0 0 40px rgba(255, 165, 0, 0.18);
  }
  50% {
    text-shadow:
      0 0 12px rgba(255, 225, 0, 1.00),
      0 0 28px rgba(255, 200, 0, 0.62),
      0 0 54px rgba(255, 180, 0, 0.26);
  }
}
.hof-name-rank-1 {
  color: #ffe566 !important;
  font-weight: 700 !important;
  animation: hof-rank-1-pulse 2.8s ease-in-out infinite;
}

/* ── Rank #2 — Arcane Silver (cold / astral / precise) ──────────────────── */
.hof-name-rank-2 {
  color: #c8d4ff !important;
  font-weight: 700 !important;
  text-shadow:
    0 0  8px rgba(180, 200, 255, 0.70),
    0 0 20px rgba(140, 160, 240, 0.30);
}

/* ── Rank #3 — Ember Bronze (warm / forged / fierce) ─────────────────────── */
.hof-name-rank-3 {
  color: #e8a040 !important;
  font-weight: 700 !important;
  text-shadow:
    0 0  8px rgba(240, 160, 60, 0.70),
    0 0 18px rgba(210, 120, 30, 0.32);
}

/* ── Player title badge in HOF rows ─────────────────────────────────────── */
.title-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(241, 197, 115, 0.24);
  background:
    linear-gradient(180deg, rgba(59, 46, 29, 0.68), rgba(23, 19, 16, 0.92));
  color: rgba(247, 230, 193, 0.94);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 18px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.title-pill::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 999px;
  flex-shrink: 0;
  background:
    radial-gradient(circle at 35% 35%, rgba(255, 250, 237, 0.96), rgba(241, 197, 115, 0.88) 52%, rgba(179, 118, 41, 0.08) 100%);
  box-shadow: 0 0 10px rgba(241, 197, 115, 0.34);
}

.title-pill-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hof-player-title {
  margin-top: 2px;
  padding: 2px 8px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(244, 226, 189, 0.92);
  background:
    linear-gradient(180deg, rgba(58, 41, 24, 0.62), rgba(21, 17, 13, 0.88));
}

.hof-player-meta {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hof-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-gold);
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  white-space: nowrap;
  line-height: 1.16;
}
.hof-value.large-num { font-size: 11px; }
.hof-value.has-lines { gap: 1px; }
.hof-value-line {
  display: block;
  white-space: nowrap;
}
.hof-value-muted {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

/* Mode badge tone variants */
.tone-hardcore { color: #f87171; }
.tone-standalone { color: #93c5fd; }
.tone-default { color: var(--text-muted); }

/* ══════════════════════════════════════════════════════════════════════════════
   TITLE SYSTEM — char-info panel (desktop) + mobile hero panel
══════════════════════════════════════════════════════════════════════════════ */

/* Equipped title badge shown inline with the char name */
.char-title-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 4px 11px;
  flex-shrink: 1;
  background:
    linear-gradient(180deg, rgba(67, 49, 27, 0.7), rgba(23, 18, 13, 0.94));
}

/* Title selector row — sits below the char name on desktop */
.char-title-row {
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.title-selector-row-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(214, 203, 180, 0.56);
}

.title-selector {
  position: relative;
  display: inline-flex;
  max-width: 100%;
  z-index: 1;
  isolation: isolate;
}

.title-selector.is-open {
  z-index: 120;
}

#panels-row.title-selector-overlay-open,
body.platform-mobile #panels-row.title-selector-overlay-open {
  overflow: visible;
  isolation: isolate;
}

.panel.title-selector-host-open,
body.platform-mobile .panel.title-selector-host-open {
  overflow: visible;
  z-index: 140;
}

#char-info.title-selector-surface-open,
.mobile-hero-card.title-selector-surface-open,
.mobile-hero-title-selector.title-selector-surface-open {
  overflow: visible;
  z-index: 220;
}

.title-selector-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 100%;
  min-height: 40px;
  padding: 7px 13px 7px 14px;
  border-radius: 16px;
  border: 1px solid rgba(241, 197, 115, 0.16);
  background:
    linear-gradient(180deg, rgba(31, 28, 38, 0.98), rgba(14, 12, 21, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 18px rgba(0, 0, 0, 0.16);
  color: #f5efe3;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, transform 0.14s ease, background 0.14s ease;
}

.title-selector-trigger:hover,
.title-selector.is-open .title-selector-trigger {
  border-color: rgba(241, 197, 115, 0.34);
  background:
    linear-gradient(180deg, rgba(43, 37, 44, 0.98), rgba(18, 15, 25, 0.96));
}

.title-selector-trigger:focus-visible,
.title-selector-option:focus-visible,
.archive-view-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(241, 197, 115, 0.16);
}

.title-selector-trigger:active {
  transform: translateY(1px);
}

.title-selector-trigger-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.title-selector-trigger-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(214, 202, 180, 0.56);
}

.title-selector-current {
  max-width: 100%;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-selector-trigger i {
  font-size: 11px;
  color: rgba(241, 197, 115, 0.88);
  flex-shrink: 0;
}

.title-selector-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: min(320px, calc(100vw - 48px));
  width: max-content;
  max-width: min(360px, calc(100vw - 48px));
  max-height: 320px;
  padding: 8px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 18px;
  border: 1px solid rgba(241, 197, 115, 0.16);
  background:
    linear-gradient(180deg, rgba(28, 24, 34, 0.99), rgba(12, 10, 18, 0.98));
  backdrop-filter: blur(16px);
  box-shadow:
    0 28px 56px rgba(0, 0, 0, 0.48),
    0 0 0 1px rgba(255, 245, 221, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  z-index: 1600;
  will-change: top, left;
}

.title-selector-menu.is-floating {
  position: fixed;
  margin: 0;
}

.title-selector.is-open .title-selector-menu {
  transform-origin: top left;
  animation: titleSelectorMenuIn 0.14s ease-out;
}

.title-selector.is-open .title-selector-menu.is-drop-up {
  transform-origin: bottom left;
}

.title-selector-option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: #f3ecde;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}

.title-selector-option:hover {
  border-color: rgba(241, 197, 115, 0.16);
  background: rgba(255, 255, 255, 0.04);
}

.title-selector-option.is-selected {
  border-color: rgba(241, 197, 115, 0.24);
  background:
    linear-gradient(180deg, rgba(67, 49, 28, 0.42), rgba(31, 24, 18, 0.46));
}

.title-selector-option-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.title-selector-option-label {
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.title-selector-option-meta {
  font-size: 10px;
  color: rgba(212, 202, 186, 0.62);
}

.title-selector-option-check {
  opacity: 0;
  color: rgba(241, 197, 115, 0.94);
  flex-shrink: 0;
}

.title-selector-option.is-selected .title-selector-option-check {
  opacity: 1;
}

@keyframes titleSelectorMenuIn {
  from {
    opacity: 0;
    transform: translateY(-4px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* ── Mobile hero panel: title badge + selector ────────────────────────────── */
.mobile-hero-title-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  flex-shrink: 1;
}

.mobile-hero-title-selector {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.mobile-hero-title-selector .title-selector-trigger {
  min-height: 42px;
}

/* ── Milestone Archive / Titles Collection ───────────────────────────────── */
.milestone-archive-body {
  padding: 0;
  display: flex;
  flex-direction: column;
  min-height: 400px;
}

.milestone-archive-view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 12px 0;
}

.archive-view-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(241, 197, 115, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(227, 218, 199, 0.72);
  font-size: 11px;
  font-weight: 800;
  font-family: inherit;
  letter-spacing: 0.04em;
  transition: border-color 0.14s ease, background 0.14s ease, color 0.14s ease;
}

.archive-view-btn:hover {
  border-color: rgba(241, 197, 115, 0.24);
  color: #f7efdf;
}

.archive-view-btn.active {
  border-color: rgba(241, 197, 115, 0.34);
  background:
    linear-gradient(180deg, rgba(67, 49, 28, 0.42), rgba(31, 24, 18, 0.46));
  color: var(--text-gold);
}

.milestone-filter-row {
  gap: 8px;
}

.milestone-filter-row.is-hidden {
  display: none;
}

.milestone-archive-list {
  overflow-y: auto;
  flex: 1;
  max-height: 65vh;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.milestone-archive-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.milestone-archive-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-gold);
}

.milestone-archive-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(241, 197, 115, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(216, 205, 186, 0.72);
  font-size: 12px;
}

.milestone-achievement-grid,
.archive-title-grid--realm {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.archive-title-grid--skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
  gap: 12px;
}

.milestone-achievement-card,
.archive-realm-title-card,
.archive-skill-title-card,
.title-archive-summary-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(241, 197, 115, 0.12);
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(26, 23, 34, 0.98), rgba(12, 11, 19, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 24px rgba(0, 0, 0, 0.14);
}

.milestone-achievement-card.is-ready,
.archive-realm-title-card.is-unlocked,
.archive-title-row.is-unlocked {
  border-color: rgba(241, 197, 115, 0.2);
}

.milestone-achievement-card.is-claimed {
  opacity: 0.72;
}

.archive-realm-title-card.is-equipped,
.archive-title-row.is-equipped {
  border-color: rgba(241, 197, 115, 0.34);
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(42, 31, 24, 0.96), rgba(18, 14, 12, 0.95));
}

.milestone-achievement-head,
.archive-title-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.milestone-achievement-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
}

.milestone-achievement-tier,
.archive-title-tier {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(241, 197, 115, 0.18);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(241, 197, 115, 0.88);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.milestone-achievement-copy,
.archive-title-copy,
.title-archive-summary-copy,
.archive-title-card-desc,
.archive-skill-title-meta {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(214, 205, 189, 0.7);
}

.stats-achievement-title {
  font-size: 13px;
  font-weight: 800;
  color: #f7efdf;
}

.milestone-achievement-state,
.archive-title-status {
  font-size: 10px;
  font-weight: 800;
  color: rgba(241, 197, 115, 0.9);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.milestone-achievement-footer,
.archive-title-card-footer {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.milestone-achievement-reward-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.stats-achievement-reward small {
  display: block;
  margin-top: 2px;
  color: rgba(214, 205, 189, 0.62);
}

.stats-achievement-reward {
  min-width: 0;
  font-size: 11px;
  color: #f5ede1;
}

.title-archive-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.title-archive-summary-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(214, 203, 180, 0.58);
}

.title-archive-summary-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
  color: #f7efdf;
}

.archive-title-progress {
  margin-top: 10px;
}

.archive-title-badge {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.archive-title-card-desc {
  max-width: 70%;
}

.archive-title-locked-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(216, 205, 186, 0.64);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.archive-skill-title-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.archive-skill-title-skill {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.archive-skill-title-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(241, 197, 115, 0.1);
  object-fit: contain;
  flex-shrink: 0;
}

.archive-skill-title-name {
  font-size: 14px;
  font-weight: 800;
  color: #f7efdf;
}

.archive-title-rows {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.archive-title-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(8, 10, 15, 0.34);
}

.archive-title-row-main {
  min-width: 0;
}

.archive-title-row-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.archive-title-row-actions {
  display: flex;
  align-items: center;
}

.archive-title-equip-btn {
  min-height: 34px;
  padding: 0 12px;
}

@media (max-width: 720px) {
  .archive-title-row {
    grid-template-columns: 1fr;
  }

  .archive-title-row-actions {
    justify-content: flex-start;
  }

  .archive-title-card-desc {
    max-width: 100%;
  }
}
}

/* HoF Search */
.hof-search-row {
  margin-bottom: 8px;
}
.hof-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.hof-search-icon {
  position: absolute;
  left: 9px;
  font-size: 10px;
  color: var(--text-muted);
  pointer-events: none;
}
.hof-search-input {
  width: 100%;
  padding: 6px 28px 6px 28px;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 11px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
.hof-search-input::placeholder { color: var(--text-muted); }
.hof-search-input:focus { border-color: var(--border-gold); }
.hof-search-clear {
  position: absolute;
  right: 7px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 3px;
  line-height: 1;
  transition: color 0.1s, opacity 0.15s;
}
.hof-search-clear:hover { color: var(--text-bright); }

/* HoF Pagination */
.hof-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 0 2px;
}
.hof-page-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 10px;
  cursor: pointer;
  transition: border-color 0.1s, color 0.1s;
}
.hof-page-btn:hover:not(:disabled) { border-color: var(--border-gold); color: var(--text-gold); }
.hof-page-btn:disabled { opacity: 0.35; cursor: default; }
.hof-page-info {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.hof-page-info strong { color: var(--text-bright); font-weight: 600; }

.admin-modal-box,
.bug-report-modal-box {
  max-width: 960px;
}
.admin-summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.admin-summary-card {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(201, 154, 46, 0.16);
  background: rgba(17, 15, 24, 0.78);
}
.admin-summary-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-summary-value {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}
.admin-section {
  margin-top: 12px;
}
.admin-section-title {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-key-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.admin-key-groups {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.admin-key-section {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(17, 15, 24, 0.62);
  border: 1px solid rgba(201, 154, 46, 0.12);
}
.admin-key-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.admin-key-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}
.admin-key-section-note {
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}
.admin-key-section-count {
  min-width: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: var(--text-gold);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
}
.admin-key-card {
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(17, 15, 24, 0.78);
  border: 1px solid rgba(201, 154, 46, 0.16);
}
.admin-key-card-top,
.admin-key-card-actions,
.admin-report-card-top,
.admin-detail-header,
.admin-detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.admin-key-card-meta,
.admin-key-card-redeemed,
.admin-report-card-meta,
.admin-report-card-summary,
.admin-detail-grid,
.admin-detail-copy,
.closed-beta-status,
.bug-report-auth-note,
.bug-report-status {
  font-size: 11px;
  line-height: 1.45;
}
.admin-key-card-meta,
.admin-report-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
  color: var(--text-muted);
}
.admin-key-card-redeemed {
  margin-top: 6px;
  color: #cbd5e1;
}
.admin-key-state {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.admin-key-state.tone-unused {
  color: #cbd5e1;
}
.admin-key-state.tone-redeemed {
  color: #93c5fd;
}
.admin-key-state.tone-revoked {
  color: #fca5a5;
}
.admin-report-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 10px;
}
.admin-report-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 540px;
  overflow: auto;
}
.admin-report-card {
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(201, 154, 46, 0.16);
  background: rgba(17, 15, 24, 0.78);
  color: inherit;
}
.admin-report-card.is-selected {
  border-color: rgba(96, 165, 250, 0.38);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.2);
}
.admin-report-card-title,
.admin-detail-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.admin-report-card-summary {
  margin-top: 6px;
  color: var(--text-muted);
}
.admin-report-detail {
  min-height: 540px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid rgba(201, 154, 46, 0.16);
  background: rgba(17, 15, 24, 0.78);
}
.admin-detail-kicker,
.bug-report-context-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-detail-pills,
.admin-report-card-top {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-report-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  font-size: 10px;
  color: var(--text-muted);
}
.admin-report-pill.tone-critical,
.admin-report-pill.tone-major,
.admin-report-pill.tone-expired,
.closed-beta-status[data-tone="warn"] {
  color: #fecaca;
}
.admin-report-pill.tone-minor,
.admin-report-pill.tone-moderate,
.admin-report-pill.tone-status,
.admin-report-pill.tone-category {
  color: #cbd5e1;
}
.admin-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
}
.admin-detail-grid > div,
.bug-report-context > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.admin-detail-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.admin-detail-section {
  margin-top: 12px;
}
.admin-detail-section-title {
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-gold);
}
.admin-detail-copy {
  white-space: pre-wrap;
  color: var(--text-main);
}
.admin-detail-two-col,
.bug-report-two-col,
.bug-report-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.admin-detail-editor {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.admin-detail-editor-field,
.bug-report-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.admin-detail-editor-field > span,
.bug-report-field > span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-main);
}
.admin-filter-row {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.bug-report-context,
.closed-beta-summary {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(201, 154, 46, 0.16);
  background: rgba(17, 15, 24, 0.78);
}
.bug-report-context {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.bug-report-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bug-report-copy {
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.bug-report-auth-note[data-tone="warn"] {
  color: #fecaca;
}
.bug-report-auth-note[data-tone="muted"] {
  color: var(--text-muted);
}
.bug-report-textarea {
  min-height: 116px;
  resize: vertical;
}
.bug-report-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.closed-beta-panel {
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.closed-beta-summary-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}
.closed-beta-summary-copy {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}
.closed-beta-summary.tone-active {
  border-color: rgba(74, 222, 128, 0.3);
}
.closed-beta-summary.tone-expired,
.closed-beta-summary.tone-revoked {
  border-color: rgba(248, 113, 113, 0.25);
}
.closed-beta-summary.tone-admin {
  border-color: rgba(96, 165, 250, 0.3);
}
.closed-beta-redeem-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
.closed-beta-status[data-tone="success"] {
  color: #bbf7d0;
}
.closed-beta-status[data-tone="muted"] {
  color: var(--text-muted);
}
.btn-outline.sm {
  padding: 5px 9px;
  font-size: 11px;
}
@media (max-width: 960px) {
  .admin-report-shell,
  .admin-filter-row,
  .admin-detail-grid,
  .admin-detail-two-col,
  .bug-report-two-col,
  .bug-report-grid,
  .bug-report-context,
  .closed-beta-redeem-row {
    grid-template-columns: 1fr;
  }
}

/* ─── CLOUD AUTH FORM ────────────────────────────────────────────────────── */
#cloud-auth-panel {
  margin-top: 8px;
}
.cloud-auth-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cloud-input {
  width: 100%;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 7px 10px;
  font-size: 12px;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.cloud-input:focus {
  border-color: var(--border-gold);
}
.cloud-input::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}
.cloud-auth-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 12px;
  padding: 7px 10px;
}
.cloud-auth-error {
  font-size: 11px;
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--radius-sm);
  padding: 5px 8px;
  line-height: 1.4;
}
.cloud-or-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  font-size: 11px;
  color: var(--text-muted);
}
.cloud-or-divider::before,
.cloud-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.cloud-google-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 12px;
  font-size: 12px;
}
.cloud-google-btn i { color: #ea4335; }
.hub-cloud-account-meta,
.cloud-account-meta {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.45;
}
.cloud-slot-preview {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cloud-slot-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(201, 154, 46, 0.16);
  background: rgba(17, 15, 24, 0.78);
}
.cloud-slot-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}
.cloud-slot-meta {
  margin-top: 4px;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.45;
}
.cloud-slot-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid rgba(74, 222, 128, 0.26);
  background: rgba(15, 23, 20, 0.88);
  color: #bbf7d0;
  font-size: 10px;
  font-weight: 700;
}
.cloud-slot-preview-empty {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px dashed rgba(255,255,255,0.12);
  color: var(--text-muted);
  font-size: 11px;
}
.cloud-sync-guard {
  margin-top: 8px;
  padding: 9px 11px;
  border-radius: 10px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(40, 28, 10, 0.56);
  color: #fde68a;
  font-size: 11px;
  line-height: 1.45;
}

.save-conflict-box {
  max-width: 960px;
}
.save-conflict-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
}
.save-conflict-copy {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.6;
}
.save-conflict-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.save-conflict-card {
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(20,18,28,0.96), rgba(14,12,20,0.92));
  padding: 14px;
  min-width: 0;
}
.save-conflict-card.is-local {
  border-color: rgba(96, 165, 250, 0.2);
}
.save-conflict-card.is-cloud {
  border-color: rgba(74, 222, 128, 0.2);
}
.save-conflict-card-kicker {
  font-size: 11px;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.save-conflict-card-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.save-conflict-title {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.save-conflict-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-bright);
}
.save-conflict-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.save-conflict-pill.is-newer {
  background: rgba(74, 222, 128, 0.14);
  border: 1px solid rgba(74, 222, 128, 0.28);
  color: #bbf7d0;
}
.save-conflict-pill.is-recommended {
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.32);
  color: #fde68a;
}
.save-conflict-summary,
.save-conflict-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.save-conflict-line {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.05);
}
.save-conflict-label {
  font-size: 10px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.save-conflict-value {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-main);
}
.save-conflict-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.save-conflict-footer {
  justify-content: space-between;
}

@media (max-width: 820px) {
  .save-conflict-grid {
    grid-template-columns: 1fr;
  }
  .save-conflict-summary,
  .save-conflict-stats {
    grid-template-columns: 1fr;
  }
}

.remote-session-box {
  max-width: 520px;
  border: 1px solid rgba(201, 154, 46, 0.38);
  background:
    radial-gradient(circle at top, rgba(250, 204, 21, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(18, 14, 24, 0.98), rgba(12, 10, 18, 0.98));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
}

.remote-session-frame {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px 24px 22px;
}

.remote-session-crest {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(201, 154, 46, 0.2), rgba(120, 53, 15, 0.22));
  border: 1px solid rgba(251, 191, 36, 0.32);
  color: #fde68a;
  font-size: 26px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.remote-session-kicker {
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(251, 191, 36, 0.78);
}

.remote-session-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  color: #f8fafc;
}

.remote-session-copy {
  font-size: 14px;
  line-height: 1.72;
  color: rgba(226, 232, 240, 0.92);
}

.remote-session-detail {
  padding: 13px 15px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 12px;
  line-height: 1.6;
  color: rgba(191, 219, 254, 0.9);
}

.remote-session-footer {
  display: flex;
  justify-content: flex-end;
}

.remote-session-btn {
  min-width: 240px;
}

body.session-superseded #main-game-ui {
  filter: saturate(0.9);
}

@media (max-width: 820px) {
  .remote-session-frame {
    padding: 20px 18px 18px;
  }

  .remote-session-title {
    font-size: 22px;
  }

  .remote-session-btn {
    width: 100%;
    min-width: 0;
  }
}

/* ─── SETTINGS PANEL ─────────────────────────────────────────────────────── */
.settings-section { margin-bottom: 16px; }
.settings-label { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 6px; }
.export-area, .import-area {
  width: 100%;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 6px; font-size: 11px; font-family: monospace;
  resize: vertical; height: 60px; margin-bottom: 4px;
}

/* ─── GRAND EXCHANGE ─────────────────────────────────────────────────────── */

/* Modal overrides for GE — make it wider */
#ge-modal {
  z-index: 1105;
}
#ge-modal .modal-box {
  width: min(680px, 96vw);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
}
#ge-modal .modal-body {
  flex: 1;
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.ge-layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 68vh;
}

/* Top bar: tabs + search */
.ge-top-bar {
  padding: 12px 14px 0;
  background: var(--bg-panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.ge-mode-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
}
.ge-mode-tab {
  flex: 1;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 8px 0;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  cursor: pointer;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.ge-mode-tab:hover  { color: var(--text-main); border-color: var(--border-gold); }
.ge-mode-tab.active {
  background: var(--bg-panel-2);
  border-color: var(--border-gold);
  border-bottom-color: var(--bg-panel-2);
  color: var(--text-gold);
  position: relative;
  z-index: 1;
}

.ge-search-row {
  display: flex;
  align-items: center;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 10px;
  margin-bottom: 10px;
  transition: border-color 0.15s;
}
.ge-search-row:focus-within { border-color: var(--border-gold); }
.ge-search-icon { color: var(--text-muted); font-size: 13px; flex-shrink: 0; }
.ge-search-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 13px;
  padding: 9px 8px;
}
.ge-search-input::placeholder { color: var(--text-muted); }
.ge-search-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  display: none;
  transition: color 0.12s;
}
.ge-search-clear:hover { color: var(--text-red); }

/* Results area */
.ge-results-area {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.ge-results-area::-webkit-scrollbar { width: 5px; }
.ge-results-area::-webkit-scrollbar-track { background: transparent; }
.ge-results-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

.ge-hint {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 28px 16px 12px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ge-hint i { font-size: 22px; color: var(--border-gold); margin-bottom: 4px; }
.ge-hint-sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 8px 0;
}
.ge-loading {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 28px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.ge-loading i { font-size: 18px; }

/* Results list */
.ge-results-list { display: flex; flex-direction: column; gap: 4px; }
.ge-result-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.12s, background 0.12s;
}
.ge-result-row:hover { border-color: var(--border-gold); background: var(--bg-panel-3); }
.ge-item-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: pixelated;
}
.ge-result-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ge-result-name {
  color: var(--text-main);
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ge-result-stock {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 11px;
}
.ge-stock-inv  { color: var(--text-green); }
.ge-stock-bank { color: var(--text-blue);  }
.ge-limit-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-gold);
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 999px;
  padding: 1px 6px;
  line-height: 1.3;
}
.ge-limit-chip.is-blocked {
  color: var(--text-red);
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
}
.ge-result-price {
  color: var(--text-gold);
  font-size: 13px;
  white-space: nowrap;
  font-weight: 600;
  min-width: 70px;
  text-align: right;
}
.ge-result-price.market-up,
.ge-txn-price-each.market-up,
.ge-txn-market-note.market-up { color: var(--text-green); }
.ge-result-price.market-down,
.ge-txn-price-each.market-down,
.ge-txn-market-note.market-down { color: var(--text-red); }
.ge-result-price.market-flat,
.ge-txn-price-each.market-flat,
.ge-txn-market-note.market-flat { color: var(--text-gold); }
.ge-market-delta {
  display: block;
  font-size: 10px;
  font-weight: 500;
  opacity: 0.85;
}
.ge-no-price { color: var(--text-muted); font-weight: 400; }
.ge-limit-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 0;
  padding: 7px 9px;
  background: rgba(212, 175, 55, 0.08);
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-gold);
  font-size: 12px;
}
.ge-limit-note.is-blocked {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.22);
  color: var(--text-red);
}
.ge-limit-refresh {
  color: var(--text-muted);
  margin-left: auto;
}
.ge-action-btn {
  background: var(--accent);
  border: none;
  color: white;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.ge-action-btn:hover:not([disabled]) { background: var(--accent-hover); }
.ge-btn-dim, .ge-action-btn[disabled] {
  background: var(--bg-panel-3);
  color: var(--text-muted);
  border: 1px solid var(--border);
  cursor: not-allowed;
}

/* Quick-sell section */
.ge-quick-section { margin-top: 14px; }
.ge-section-heading {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ge-quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 6px;
}
.ge-quick-item {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  background: var(--bg-panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  overflow: hidden;
}
.ge-quick-item:hover { border-color: var(--border-gold); background: var(--bg-panel-3); }
.ge-quick-item.ge-quick-bank { border-style: dashed; }
.ge-quick-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  flex-shrink: 0;
  image-rendering: pixelated;
}
.ge-quick-label {
  flex: 1;
  font-size: 11px;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ge-quick-qty {
  font-size: 10px;
  color: var(--text-gold);
  flex-shrink: 0;
}
.ge-bank-tag { color: var(--text-blue); }

/* Transaction box */
.ge-txn-box {
  border-top: 1px solid var(--border);
  background: var(--bg-panel);
  flex-shrink: 0;
}
.ge-txn-panel {
  padding: 12px 14px;
}
.ge-txn-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.ge-txn-img {
  width: 40px;
  height: 40px;
  object-fit: contain;
  image-rendering: pixelated;
  flex-shrink: 0;
}
.ge-txn-title-wrap { flex: 1; }
.ge-txn-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-bright);
}
.ge-txn-price-each {
  font-size: 12px;
  color: var(--text-gold);
  margin-top: 1px;
}
.ge-txn-market-note {
  font-size: 10px;
  font-weight: 600;
  margin-top: 3px;
}
.ge-txn-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  transition: color 0.12s;
}
.ge-txn-close:hover { color: var(--text-red); }

.ge-txn-info {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.ge-txn-info b { color: var(--text-gold); }

.ge-txn-qty-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.ge-qty-label {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.ge-qty-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ge-qty-step {
  background: none;
  border: none;
  color: var(--text-gold);
  padding: 4px 10px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.1s;
}
.ge-qty-step:hover { background: var(--bg-panel-2); }
.ge-qty-input {
  width: 70px;
  background: none;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  color: var(--text-main);
  font-size: 13px;
  text-align: center;
  padding: 5px 4px;
  outline: none;
}
.ge-qty-input::-webkit-outer-spin-button,
.ge-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.ge-total-line {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}
.ge-total-line b { color: var(--text-gold); }

.ge-tax-breakdown {
  margin-top: 2px;
  margin-left: auto;
  width: 100%;
  display: grid;
  gap: 3px;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
}

.ge-tax-line {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.ge-tax-line b {
  color: var(--text-main);
}

.ge-tax-line-net b,
.ge-tax-line-net {
  color: var(--text-gold);
  font-weight: 600;
}

.ge-qty-presets {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ge-preset-btn {
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.ge-preset-btn:hover {
  border-color: var(--border-gold);
  color: var(--text-gold);
}

.ge-txn-btns {
  display: flex;
  gap: 8px;
}
.ge-confirm-btn {
  flex: 1;
  background: var(--accent);
  border: none;
  color: white;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 0;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.ge-confirm-btn:hover:not([disabled]) { background: var(--accent-hover); }
.ge-confirm-btn[disabled], .ge-confirm-btn.ge-btn-dim {
  background: var(--bg-panel-3);
  color: var(--text-muted);
  cursor: not-allowed;
}
.ge-cancel-btn {
  background: var(--bg-panel-3);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}
.ge-cancel-btn:hover { border-color: var(--border-gold); color: var(--text-main); }

/* GE sell button in bank context menu */
.ge-sell-btn { color: var(--text-gold) !important; }

/* ─── TRAINING TAB ───────────────────────────────────────────────────────── */

/* Empty state */
.training-tab-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 100%;
  min-height: 188px;
  padding: 28px 20px;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed rgba(241, 197, 115, 0.18);
  border-radius: 20px;
  background:
    radial-gradient(circle at top, rgba(241, 197, 115, 0.12), transparent 46%),
    linear-gradient(180deg, rgba(22, 26, 38, 0.94), rgba(10, 12, 19, 0.9));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 28px rgba(0, 0, 0, 0.12);
}

.training-tab-empty-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  border: 1px solid rgba(241, 197, 115, 0.18);
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 246, 220, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(69, 53, 31, 0.96), rgba(23, 20, 17, 0.94));
  color: var(--text-gold);
  font-size: 24px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 10px 20px rgba(0, 0, 0, 0.18);
}

.training-tab-empty-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(240, 209, 148, 0.72);
}

.training-tab-empty-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff3da;
}

.training-tab-empty-copy {
  max-width: 42ch;
  font-size: 12.5px;
  line-height: 1.6;
  color: rgba(218, 214, 206, 0.78);
}

/* Header row: icon + skill name + level + stop button */
.tt-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-panel);
}
.tt-skill-icon {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tt-skill-sprite {
  width: 22px;
  height: 22px;
  image-rendering: pixelated;
}
.tt-skill-fa {
  font-size: 16px;
  color: var(--text-gold);
}
.tt-skill-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
  text-transform: capitalize;
}
.tt-skill-level {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-gold);
  min-width: 26px;
  text-align: right;
  line-height: 1;
}
.tt-stop-btn {
  background: rgba(239,68,68,0.15);
  color: #f87171;
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: 4px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.12s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.tt-stop-btn:hover {
  background: rgba(239,68,68,0.3);
  border-color: #f87171;
}

/* XP bar section */
.tt-xp-section {
  padding: 8px 10px 6px;
  border-bottom: 1px solid var(--border);
}
.tt-xp-bar-bg {
  position: relative;
  width: 100%;
  height: 16px;
  background: var(--bg-input);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 5px;
  border: 1px solid var(--border);
}
.tt-xp-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
  min-width: 2px;
}
.tt-xp-bar-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0,0,0,0.8);
  pointer-events: none;
  letter-spacing: 0.3px;
}
.tt-xp-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tt-xp-meta b { color: var(--text-main); }
.tt-active-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px 6px;
  background: rgba(74,222,128,0.07);
  border: 1px solid rgba(74,222,128,0.15);
  border-radius: 4px;
}
.tt-active-label b { color: var(--text-green); }

.tt-live-summary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.tt-live-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tt-live-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 74px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.03);
}

.tt-live-card-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(223, 214, 196, 0.62);
}

.tt-live-card strong {
  font-size: 14px;
  line-height: 1.35;
  color: #f8f1e4;
}
.tt-live-consumes {
  padding: 0;
  gap: 6px;
}
.tt-live-consumes .consume-item {
  font-size: 11px;
}

.tt-live-empty {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed rgba(241, 197, 115, 0.16);
  background: rgba(241, 197, 115, 0.06);
  color: rgba(223, 214, 196, 0.84);
  font-size: 12px;
  line-height: 1.5;
}

.tt-stop-btn--summary {
  align-self: flex-start;
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
}

/* Section heading */
.tt-actions-heading {
  padding: 7px 10px 5px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Action list container */
.tt-action-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Reuse existing training-action cards for both modal and tab */
#tt-action-list .training-action {
  border-radius: 0;
  border-left: none;
  border-right: none;
  border-top: none;
}
#training-actions-popup-list .training-action {
  margin-top: 10px;
}
#tt-action-list .training-action:last-child {
  border-bottom: 1px solid var(--border);
}

/* Detail pills inside action cards */
.action-req {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-green);
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.2);
  border-radius: 3px;
  padding: 1px 5px;
}
.action-req.req-locked {
  color: #f87171;
  background: rgba(239,68,68,0.08);
  border-color: rgba(239,68,68,0.2);
}
.action-gives {
  font-size: 11px;
  color: var(--text-muted);
}
.action-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ─── RESPONSIVE — minimal adjustments ──────────────────────────────────── */
@media (max-width: 900px) {
  #left-panel { width: 190px; min-width: 190px; flex-basis: 190px; }
  #right-panel { width: 200px; min-width: 180px; }
}
@media (max-width: 700px) {
  #panels-row { flex-direction: column; overflow-y: auto; }
  #left-panel, #right-panel { width: 100%; max-width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
  #middle-panel { min-height: 400px; }
  .game-header-center { display: none; }
}

/* ─── ITEM ICON SYSTEM ───────────────────────────────────────────────────── */
.item-icon {
  --item-icon-padding: 2px;
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #2a2a35;
  border: 1px solid #4b5563;
  border-radius: 8px;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
  transition: all 0.15s ease;
  cursor: pointer;
  box-sizing: border-box;
}

.item-icon.item-art {
  position: relative;
  overflow: hidden;
  --item-icon-padding: 0px;
  padding: 0;
  box-sizing: border-box;
  background: #241307;
  border-color: rgba(120, 77, 34, 0.8);
}

.item-icon.item-art .item-icon-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center;
  image-rendering: auto;
  padding: 0;
  border-radius: 6px;
  box-sizing: border-box;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.item-icon.item-art .item-icon-image[hidden] {
  display: none;
}

.item-icon.item-art .item-icon-fallback {
  position: absolute;
  inset: var(--item-icon-padding);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: inherit;
}

.item-icon.action-icon {
  cursor: default;
  box-shadow: 0 1px 4px rgba(0,0,0,0.28);
}

.item-icon.show-fallback .item-icon-fallback {
  display: flex;
}

.item-icon:hover {
  transform: scale(1.05);
  border-color: #7c3aed;
  box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}

/* Item icon variations for different contexts */
.item-icon.small {
  width: 32px;
  height: 32px;
  font-size: 16px;
  --item-icon-padding: 2px;
}

.item-icon.large {
  width: 48px;
  height: 48px;
  font-size: 24px;
  --item-icon-padding: 3px;
}

.item-icon.tiny {
  width: 24px;
  height: 24px;
  font-size: 12px;
  border-radius: 4px;
  --item-icon-padding: 1px;
}

/* Item icon in inventory slots */
.item-icon.inv-slot-icon,
.item-icon.bank-slot-icon,
.item-icon.equip-slot-icon {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border: none;
  border-radius: inherit;
  box-shadow: none;
  cursor: inherit;
  --item-icon-padding: 2px;
}

.item-icon.ge-item-img,
.item-icon.ge-quick-img,
.item-icon.ge-txn-img {
  --item-icon-padding: 2px;
}

.item-icon.ge-item-img {
  --item-icon-padding: 1px;
}

.item-icon.ge-quick-img,
.item-icon.drop-chip-icon,
.item-icon.prayer-icon {
  --item-icon-padding: 1px;
}

.item-icon.inv-slot-icon:hover,
.item-icon.bank-slot-icon:hover,
.item-icon.equip-slot-icon:hover,
.item-icon.ge-item-img:hover,
.item-icon.ge-quick-img:hover,
.item-icon.ge-txn-img:hover,
.item-icon.skill-icon:hover,
.item-icon.tt-skill-icon:hover,
.item-icon.tool-icon-img:hover,
.item-icon.action-icon:hover,
.item-icon.drop-chip-icon:hover,
.item-icon.prayer-icon:hover {
  transform: none;
  border-color: #4b5563;
  box-shadow: none;
}

/* Item icon in GE results */
.ge-item-img {
  width: 32px;
  height: 32px;
  font-size: 16px;
}

.ge-quick-img {
  width: 24px;
  height: 24px;
  font-size: 12px;
}

.ge-txn-img {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

/* Item icon in monster drops */
.monster-drop-icon {
  width: 24px;
  height: 24px;
  font-size: 12px;
  border-radius: 4px;
}

/* Prayer/Devotion icons */
.prayer-icon {
  width: 24px;
  height: 24px;
  font-size: 14px;
  border-radius: 4px;
}

/* Monster icons */
.monster-img,
.bestiary-img,
.combat-monster-img {
  width: 48px;
  height: 48px;
  font-size: 24px;
  border-radius: 8px;
}

/* Skill icons */
.skill-icon,
.tt-skill-icon,
.tool-icon-img {
  width: 32px;
  height: 32px;
  font-size: 16px;
  border-radius: 4px;
}
#skills-panel .skill-icon {
  width: 28px;
  height: 28px;
}
.tt-header .tt-skill-icon {
  width: 24px;
  height: 24px;
}


/* Spark-safe hub sizing / overflow fix */
.screen {
  padding: 16px;
  overflow-y: auto;
}

#char-select-hub {
  align-items: flex-start;
}

.hub-panel {
  width: min(1180px, calc(100vw - 32px));
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  margin: auto;
}

.hub-grid {
  align-items: start;
}

.hub-column {
  min-height: 0;
}

@media (max-width: 1180px) {
  .hub-grid {
    grid-template-columns: 1fr;
  }
}

/* ─── CODEX UI MODERNIZATION PASS ───────────────────────────────────────── */
:root {
  --titans-legacy-bg: url("img/ui/branding/titans_legacy_background_ruins_20260409.png");
  --titans-legacy-bg-position: 50% 50%;
  --shell-gap: 14px;
  --shell-radius: 24px;
  --surface-radius: 16px;
  --surface-radius-sm: 12px;
  --panel-line: rgba(197, 165, 96, 0.16);
  --panel-line-strong: rgba(222, 188, 116, 0.28);
  --panel-shell:
    linear-gradient(180deg, rgba(25, 22, 34, 0.98), rgba(11, 10, 16, 0.96));
  --panel-shell-elevated:
    linear-gradient(180deg, rgba(28, 25, 39, 0.99), rgba(14, 13, 21, 0.97));
  --panel-strip:
    linear-gradient(180deg, rgba(36, 32, 48, 0.94), rgba(20, 18, 28, 0.9));
  --panel-shadow-xl:
    0 22px 44px rgba(0, 0, 0, 0.46),
    0 3px 12px rgba(0, 0, 0, 0.28);
}

html,
body {
  background:
    radial-gradient(circle at top, rgba(92, 51, 16, 0.14), transparent 28%),
    radial-gradient(circle at 20% 0%, rgba(84, 45, 112, 0.16), transparent 28%),
    #07060b;
  color: #dbd3c4;
}

body {
  letter-spacing: 0.01em;
}

#main-game-ui {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(7, 9, 14, 0.18), rgba(5, 5, 9, 0.56)),
    radial-gradient(circle at 22% 18%, rgba(56, 146, 159, 0.1), transparent 20%),
    radial-gradient(circle at 82% 18%, rgba(92, 143, 229, 0.1), transparent 22%),
    var(--titans-legacy-bg) var(--titans-legacy-bg-position)/cover no-repeat;
}

#main-game-ui::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 16%, rgba(92, 140, 214, 0.08), transparent 26%),
    radial-gradient(circle at 50% 108%, rgba(19, 22, 30, 0.13), transparent 34%),
    linear-gradient(180deg, rgba(5, 7, 12, 0.09), rgba(4, 4, 8, 0.44));
  pointer-events: none;
}

#main-game-ui::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at center, transparent 34%, rgba(4, 6, 10, 0.1) 78%, rgba(4, 6, 10, 0.24) 100%),
    linear-gradient(90deg, rgba(4, 6, 10, 0.18), transparent 18%, transparent 82%, rgba(4, 6, 10, 0.18)),
    linear-gradient(180deg, rgba(4, 6, 10, 0.1), transparent 18%, rgba(4, 6, 10, 0.2));
  pointer-events: none;
}

#game-screen {
  position: relative;
  z-index: 1;
  padding: var(--shell-gap);
  gap: var(--shell-gap);
  background: transparent;
}

#game-header {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  position: relative;
  min-height: 54px;
  height: 54px;
  padding: 0 64px 0 20px;
  border: 1px solid var(--panel-line-strong);
  border-radius: var(--shell-radius);
  background:
    linear-gradient(135deg, rgba(31, 26, 40, 0.96), rgba(15, 14, 22, 0.94)),
    radial-gradient(circle at top, rgba(237, 192, 102, 0.12), transparent 34%);
  box-shadow: var(--panel-shadow-xl);
  overflow: hidden;
  isolation: isolate;
}

#game-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 14% 40%, rgba(243, 196, 101, 0.14), transparent 18%),
    linear-gradient(90deg, transparent 0%, rgba(255, 236, 196, 0.06) 48%, transparent 100%);
  opacity: 0.85;
  pointer-events: none;
}

#game-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 10%, rgba(118, 71, 197, 0.12), transparent 28%),
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.05) 32%, transparent 62%);
  opacity: 0.45;
  pointer-events: none;
  animation: headerAmbientShift 14s ease-in-out infinite;
}

@keyframes headerAmbientShift {
  0%, 100% { transform: translate3d(0, 0, 0); opacity: 0.34; }
  50% { transform: translate3d(-1.5%, 0, 0); opacity: 0.52; }
}

.game-header-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.game-header-left::after {
  content: '';
  display: none;
}

.game-header-logo-frame {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 5px;
  border-radius: 12px;
  border: 1px solid rgba(235, 194, 113, 0.32);
  background:
    radial-gradient(circle at 30% 28%, rgba(255, 233, 177, 0.16), transparent 26%),
    linear-gradient(180deg, rgba(74, 48, 20, 0.95), rgba(39, 22, 10, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 222, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.28);
}

.game-header-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter:
    drop-shadow(0 12px 18px rgba(0, 0, 0, 0.28))
    drop-shadow(0 0 12px rgba(241, 191, 96, 0.16));
}

.game-header-title {
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f5e8c8;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.4);
  white-space: nowrap;
}

/* Brand column: title + status icons row + eyebrow */
.game-header-brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.game-header-brand-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.game-header-eyebrow {
  font-size: 9px;
  letter-spacing: 0.20em;
  text-transform: uppercase;
  color: rgba(233, 215, 184, 0.55);
  font-weight: 600;
  line-height: 1;
}

.game-header-center {
  display: none;
}

.game-header-center::after {
  content: '';
}

.game-header-sub {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: rgba(226, 210, 176, 0.85);
}

.game-header-right {
  display: none;
}

.game-header-status-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.save-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  min-height: unset;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  background: rgba(255, 255, 255, 0.04);
  color: rgba(233, 225, 208, 0.52);
  font-size: 12px;
  opacity: 0.7;
  transition: all 0.2s;
}

.header-social-link {
  position: absolute;
  top: 50%;
  right: 18px;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.10), transparent 34%),
    linear-gradient(180deg, rgba(42, 31, 28, 0.96), rgba(22, 17, 15, 0.94));
  color: rgba(255, 136, 76, 0.92);
  text-decoration: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 8px 16px rgba(0, 0, 0, 0.24);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    box-shadow 0.16s ease;
}

.header-social-link i {
  font-size: 16px;
}

.header-social-link:hover {
  transform: translateY(calc(-50% - 1px));
  border-color: rgba(255, 141, 87, 0.38);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(67, 42, 30, 0.98), rgba(30, 20, 17, 0.96));
  color: #ff9f67;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 18px rgba(0, 0, 0, 0.28);
}

.header-social-link:focus-visible {
  outline: none;
  border-color: rgba(255, 163, 106, 0.55);
  box-shadow:
    0 0 0 2px rgba(255, 160, 102, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 18px rgba(0, 0, 0, 0.28);
}

.save-indicator.active {
  color: #a3e6b0;
  border-color: rgba(111, 214, 133, 0.32);
  background: rgba(74, 222, 128, 0.1);
  opacity: 1;
}

#save-ind-offline.disabled {
  opacity: 1;
  color: #f5d48a;
  border-color: rgba(245, 194, 76, 0.34);
  background: rgba(245, 194, 76, 0.12);
}

#save-ind-cloud.connected {
  background: rgba(74, 222, 128, 0.1);
}

#save-ind-cloud.disconnected {
  background: rgba(248, 113, 113, 0.1);
}

#save-ind-playfab.playfab-active {
  opacity: 1;
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.1);
}

#save-ind-playfab.playfab-active i {
  color: #4ade80;
}

#save-ind-playfab.playfab-pending {
  opacity: 1;
  color: #f5d48a;
  border-color: rgba(245, 194, 76, 0.36);
  background: rgba(245, 194, 76, 0.12);
}

#save-ind-playfab.playfab-pending i {
  color: #f5d48a;
}

#save-ind-playfab.playfab-non-active {
  opacity: 1;
  color: #d6dde8;
  border-color: rgba(148, 163, 184, 0.34);
  background: rgba(71, 85, 105, 0.18);
}

#save-ind-playfab.playfab-non-active i {
  color: #d6dde8;
}

/* Pulse when cloud auto-save succeeds */
@keyframes cloudSyncedFlash {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.55); }
  60%  { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
#save-ind-cloud.cloud-synced-flash {
  animation: cloudSyncedFlash 0.9s ease-out forwards;
}

.header-settings-btn {
  display: none;
}

#panels-row {
  gap: var(--shell-gap);
  min-height: 0;
  align-items: stretch;
}

.panel {
  min-height: 0;
  border: 1px solid var(--panel-line);
  border-right: 1px solid var(--panel-line);
  border-radius: var(--shell-radius);
  background: var(--panel-shell);
  box-shadow: var(--panel-shadow-xl);
  overflow: hidden;
  backdrop-filter: blur(8px);
  position: relative;
}

.panel::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 242, 212, 0.22), transparent);
  opacity: 0.9;
  pointer-events: none;
}

.panel > * {
  position: relative;
  z-index: 1;
}

.panel-header {
  min-height: 46px;
  padding: 0 16px;
  border-bottom: 1px solid var(--panel-line);
  background: var(--panel-strip);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  color: rgba(235, 209, 149, 0.88);
}

.panel-body {
  padding: 12px;
}

#left-panel {
  width: clamp(286px, 20.5vw, 322px);
  min-width: 286px;
  flex: 0 0 clamp(286px, 20.5vw, 322px);
}

#middle-panel {
  min-width: 0;
}

#right-panel {
  width: clamp(312px, 22.5vw, 356px);
  min-width: 312px;
  background: var(--panel-shell-elevated);
}

#char-info {
  padding: 16px 16px 14px;
  gap: 10px;
  border-bottom: 1px solid var(--panel-line);
  background:
    linear-gradient(180deg, rgba(31, 27, 41, 0.98), rgba(17, 16, 24, 0.94));
}

#char-info-hitsplats {
  inset: 6px 14px 6px 14px;
}

.char-name-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
}

.char-name {
  font-size: 18px;
  font-weight: 800;
  color: #f5efe4;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.char-name-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.char-mode-icon {
  width: 16px;
  height: 16px;
}

.char-cb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(241, 197, 115, 0.18);
  background: rgba(241, 197, 115, 0.08);
  color: rgba(251, 191, 36, 0.94);
  font-size: 11px;
  font-weight: 700;
  margin-left: auto;
  flex-shrink: 0;
}

.vitals {
  gap: 7px;
}

.vital-row {
  gap: 8px;
}

.vital-label {
  width: 18px;
}

.vital-bar-bg {
  height: 12px;
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(4, 6, 10, 0.66);
}

.vital-bar-fill {
  border-radius: 999px;
}

.vital-text {
  width: 62px;
  font-size: 10px;
  color: rgba(214, 208, 195, 0.76);
}

#char-info > div:last-child {
  padding-top: 2px;
  font-size: 11px !important;
  color: rgba(199, 188, 168, 0.72);
}

/* ── Skills panel — compact professional layout ──────────────────────── */
#skills-panel {
  padding: 6px 7px;
  gap: 4px;
}

.skill-tile {
  min-height: 0;
  padding: 5px 7px;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 0 7px;
  border-radius: 8px;
  background: rgba(28, 24, 38, 0.92);
  border: 1px solid rgba(224, 191, 124, 0.09);
  box-shadow: none;
  position: static;
  overflow: visible;
  align-items: center;
}

.skill-tile::before {
  display: none; /* remove decorative gradient overlay */
}

.skill-tile:hover {
  border-color: rgba(235, 194, 113, 0.28);
  background: rgba(36, 30, 50, 0.96);
  transform: none;
}

.skill-tile > * {
  position: static;
  z-index: auto;
}

.skill-art-icon {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(60, 42, 18, 0.85);
  border: 1px solid rgba(235, 194, 113, 0.14);
  box-shadow: none;
}

.skill-art-image {
  width: 90%;
  height: 90%;
  object-fit: contain;
  display: block;
  filter: none;
}

.skill-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  justify-content: center;
}

.skill-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 6px;
  min-width: 0;
}

.skill-art-fallback {
  color: var(--text-gold);
}

.skill-tile .item-icon,
.skill-sprite,
.skill-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
}

.skill-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  font-weight: 600;
  color: rgba(240, 232, 215, 0.92);
  line-height: 1.2;
  letter-spacing: 0;
  min-height: 0;
  max-width: 100%;
}

.skill-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.skill-submeta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 10px;
  color: rgba(203, 213, 225, 0.7);
  line-height: 1.25;
}

.skill-progress-card {
  border-radius: 18px;
  border: 1px solid rgba(241, 197, 115, 0.1);
  background:
    linear-gradient(180deg, rgba(21, 18, 31, 0.98), rgba(14, 13, 22, 0.98));
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.skill-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.skill-progress-title-wrap {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

.skill-progress-icon .skill-art-icon,
.skill-progress-icon .skill-icon {
  width: 42px;
  height: 42px;
}

.skill-progress-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.skill-progress-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(241, 197, 115, 0.76);
}

.skill-progress-title {
  font-size: 20px;
  font-weight: 800;
  color: #f8f1e4;
  line-height: 1.1;
}

.skill-progress-live {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(223, 214, 196, 0.78);
}

.skill-progress-level {
  flex-shrink: 0;
  min-width: 58px;
  text-align: center;
  padding: 9px 10px;
  border-radius: 14px;
  border: 1px solid rgba(241, 197, 115, 0.18);
  background: rgba(241, 197, 115, 0.08);
  color: var(--text-gold);
  font-size: 14px;
  font-weight: 800;
}

.skill-progress-track {
  height: 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.skill-progress-fill {
  height: 100%;
  border-radius: 999px;
  min-width: 2px;
}

.skill-progress-labels,
.skill-progress-footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  color: rgba(223, 214, 196, 0.76);
}

.skill-progress-labels b,
.skill-progress-footer b {
  color: #f8f1e4;
}

.skill-progress-meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.skill-progress-meta-pill--mastered {
  border-color: rgba(74, 222, 128, 0.25);
  background: rgba(74, 222, 128, 0.1);
  color: #86efac;
}

.skill-level {
  min-width: 0;
  padding: 0;
  border-radius: 0;
  background: none;
  border: none;
  box-shadow: none;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  text-align: right;
  color: #fff4dc;
  flex-shrink: 0;
}

.skill-bar-bg {
  height: 4px;
  width: 100%;
  flex: 1 1 auto;
  background: rgba(5, 8, 12, 0.65);
  border-radius: 999px;
  box-shadow: none;
}

.skill-bar-fill {
  border-radius: 999px;
  box-shadow: none;
}

.devotion-actions-bar {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.devotion-action-btn {
  flex: 1 1 0;
  min-height: 42px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  border: 1px solid rgba(224, 191, 124, 0.2);
  background:
    linear-gradient(180deg, rgba(49, 40, 27, 0.96), rgba(22, 19, 15, 0.98));
  color: #efe3ca;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.06),
    0 10px 18px rgba(0, 0, 0, 0.18);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.devotion-action-btn i {
  color: var(--text-gold);
}

.devotion-action-btn:hover:not(:disabled) {
  border-color: rgba(235, 194, 113, 0.34);
  background:
    linear-gradient(180deg, rgba(63, 50, 33, 0.98), rgba(29, 23, 16, 0.99));
  color: #fff6e7;
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.08),
    0 14px 26px rgba(0, 0, 0, 0.24);
}

.devotion-action-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.tab-bar {
  gap: 8px;
  padding: 12px 12px 0;
  background: var(--panel-strip);
  border-bottom: none;
}

.tab-btn {
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px 14px 0 0;
  background:
    linear-gradient(180deg, rgba(27, 25, 38, 0.98), rgba(17, 16, 25, 0.96));
  color: rgba(207, 199, 181, 0.66);
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.tab-btn:hover {
  color: rgba(246, 238, 224, 0.92);
  border-color: rgba(241, 197, 115, 0.22);
}

.tab-btn.active {
  color: #fbf4e7;
  border-bottom-color: rgba(241, 197, 115, 0.55);
  border-color: rgba(241, 197, 115, 0.26);
  background:
    linear-gradient(180deg, rgba(61, 48, 31, 0.54), rgba(30, 24, 19, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 245, 216, 0.05);
}

.tab-content {
  min-height: 0;
}

.search-row {
  margin: 12px 12px 0;
  padding: 0 12px;
  min-height: 48px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(17, 20, 28, 0.94), rgba(10, 12, 18, 0.9));
}

.search-input {
  background: transparent;
  border: none;
  padding: 0;
  font-size: 13px;
}

.search-input:focus {
  border: none;
  outline: none;
  box-shadow: none;
}

#monster-list {
  padding: 12px;
  gap: 8px;
}

.monster-card {
  padding: 10px 12px;
  gap: 10px;
  border-radius: 16px;
  border-color: rgba(221, 187, 116, 0.12);
  background:
    linear-gradient(180deg, rgba(29, 27, 39, 0.98), rgba(17, 16, 25, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.monster-card:hover {
  border-color: rgba(235, 194, 113, 0.28);
}

.monster-card.active {
  border-color: rgba(192, 132, 252, 0.38);
  background:
    linear-gradient(180deg, rgba(50, 32, 65, 0.96), rgba(24, 18, 34, 0.95));
}

.monster-img-wrap {
  width: 68px;
  height: 68px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.monster-img,
.bestiary-img {
  width: 68px;
  height: 68px;
}

.combat-portrait-wrapper {
  width: 160px;
  height: 160px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.monster-img-wrap::before,
.combat-portrait-wrapper::before {
  content: '';
  position: absolute;
  inset: auto 6% 8% 6%;
  height: 70%;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, rgba(143, 183, 255, 0.16), rgba(117, 82, 40, 0.08) 45%, transparent 72%);
  filter: blur(10px);
  pointer-events: none;
}

.combat-monster-img {
  width: 160px;
  height: 160px;
}

.item-icon.monster-img,
.item-icon.bestiary-img,
.item-icon.combat-monster-img {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  overflow: visible;
  cursor: default;
}

.item-icon.monster-img:hover,
.item-icon.bestiary-img:hover,
.item-icon.combat-monster-img:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.item-icon.monster-img .item-icon-image,
.item-icon.bestiary-img .item-icon-image,
.item-icon.combat-monster-img .item-icon-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  image-rendering: auto;
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.28));
  border-radius: 14px;
}

.item-icon.combat-monster-img .item-icon-image {
  filter: drop-shadow(0 14px 18px rgba(0, 0, 0, 0.34));
}

.monster-name {
  font-size: 13px;
  font-weight: 700;
}

.monster-stats {
  gap: 8px;
}

#combat-panel,
#training-actions {
  padding: 12px !important;
}

.fight-btn,
.train-btn,
.ge-action-btn,
.btn-primary,
.btn-outline {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 700;
}

.btn-primary,
.ge-action-btn,
.train-btn.active {
  box-shadow: 0 10px 18px rgba(124, 58, 237, 0.18);
}

.btn-outline {
  background:
    linear-gradient(180deg, rgba(28, 25, 37, 0.98), rgba(18, 16, 24, 0.96));
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(234, 225, 209, 0.76);
}

.btn-outline:hover {
  color: var(--text-bright);
  border-color: rgba(241, 197, 115, 0.24);
  background:
    linear-gradient(180deg, rgba(38, 33, 47, 0.98), rgba(23, 20, 29, 0.96));
}

.training-action {
  margin-bottom: 8px;
  padding: 10px 12px;
  border-radius: 16px;
  border-color: rgba(221, 187, 116, 0.12);
  background:
    linear-gradient(180deg, rgba(29, 27, 39, 0.98), rgba(17, 16, 25, 0.95));
}

.action-name {
  font-size: 13px;
  font-weight: 700;
}

#game-log-resizer {
  margin: 0 12px;
}

#game-log {
  flex: 0 0 auto;
  height: 136px;
  min-height: 60px;
  max-height: 50vh;
  margin: 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(10, 13, 18, 0.96), rgba(6, 8, 12, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

#game-log div {
  padding: 3px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

#chat-bar {
  margin: 10px 12px 0;
  padding: 0 12px;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 15px;
  background:
    linear-gradient(180deg, rgba(14, 17, 24, 0.96), rgba(8, 10, 15, 0.94));
  gap: 8px;
}

#chat-input {
  padding: 0;
  font-size: 12px;
}

#chat-send-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

#chat-send-btn:hover {
  color: var(--text-bright);
  border-color: rgba(241, 197, 115, 0.24);
  background: rgba(241, 197, 115, 0.09);
}

#nav-bar {
  margin: 12px;
  padding: 0;
  gap: 8px;
  border-top: none;
  background: transparent;
}

.nav-btn {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(28, 26, 39, 0.98), rgba(17, 16, 24, 0.96));
  font-size: 11px;
  font-weight: 700;
  flex-direction: row;
  justify-content: center;
  gap: 7px;
}

.nav-btn i {
  font-size: 13px;
}

.nav-btn:hover {
  color: var(--text-bright);
  border-color: rgba(241, 197, 115, 0.22);
  background:
    linear-gradient(180deg, rgba(41, 34, 45, 0.98), rgba(24, 21, 30, 0.96));
}

.right-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 12px 0;
  border-bottom: none;
  background: var(--panel-strip);
}

.right-tab {
  min-height: 56px;
  padding: 8px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px 14px 0 0;
  background:
    linear-gradient(180deg, rgba(28, 25, 38, 0.98), rgba(17, 16, 25, 0.96));
  color: rgba(207, 199, 181, 0.66);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.right-tab.active {
  color: #fbf4e7;
  border-bottom-color: rgba(241, 197, 115, 0.55);
  border-color: rgba(241, 197, 115, 0.26);
  background:
    linear-gradient(180deg, rgba(61, 48, 31, 0.54), rgba(30, 24, 19, 0.9));
}

[data-tab-group="right"][data-tab-content] {
  padding: 12px;
}

#right-panel {
  min-height: 0;
  overflow: hidden;
}

#right-panel > .right-tabs {
  flex: 0 0 auto;
}

#right-panel > [data-tab-group="right"][data-tab-content] {
  flex: 1 1 auto;
  min-height: 0;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
}

#right-panel > [data-tab-group="right"][data-tab-content="equipment"] {
  scroll-padding-bottom: 32px;
  padding-bottom: 32px;
}

#equipment-grid {
  grid-template-columns: repeat(3, 62px);
  grid-template-rows: repeat(5, 62px);
  gap: 8px;
  padding: 0 0 16px;
}

.equip-slot {
  width: 62px;
  height: 62px;
  border-radius: 18px;
  border-color: rgba(224, 191, 124, 0.12);
  background:
    linear-gradient(180deg, rgba(31, 28, 42, 0.98), rgba(18, 17, 25, 0.94));
}

.equip-slot.filled {
  background:
    linear-gradient(180deg, rgba(38, 33, 48, 0.98), rgba(20, 18, 27, 0.96));
}

.slot-label {
  font-size: 9px;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(207, 199, 181, 0.55);
}

#equip-stats {
  margin-top: 4px;
  padding: 14px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-cols {
  gap: 10px;
  padding: 0 12px;
  border-bottom: none;
}

.stat-col {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(23, 25, 33, 0.94), rgba(13, 14, 20, 0.92));
}

.stat-col:first-child {
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-other {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 0 12px;
  margin-top: 10px;
  border-bottom: none;
}

.stat-other .stat-row {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(23, 25, 33, 0.94), rgba(13, 14, 20, 0.92));
}

.stat-speed-bar {
  margin: 12px 12px 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(17, 19, 26, 0.95), rgba(11, 12, 18, 0.93));
}

.stat-section-title {
  font-size: 10px;
  letter-spacing: 0.14em;
}

#inventory-grid {
  gap: 8px;
  padding: 0;
}

#bank-grid {
  gap: 8px;
  padding: 12px;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
}

.inv-slot,
.bank-slot {
  border-radius: 18px;
  border-color: rgba(224, 191, 124, 0.12);
  background:
    linear-gradient(180deg, rgba(31, 28, 42, 0.98), rgba(18, 17, 25, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.inv-slot {
  min-height: 68px;
}

.bank-slot {
  min-height: 64px;
}

.inv-slot.filled,
.bank-slot.filled {
  background:
    linear-gradient(180deg, rgba(38, 33, 48, 0.98), rgba(20, 18, 27, 0.96));
}

.inv-qty,
.bank-qty {
  right: 4px;
  bottom: 4px;
  font-size: 10px;
  padding: 3px 5px;
}

.item-icon.inv-slot-icon,
.item-icon.bank-slot-icon,
.item-icon.equip-slot-icon {
  --item-icon-padding: 0px;
}

.item-icon.item-art {
  background: #241307;
  border-color: rgba(132, 86, 39, 0.8);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 225, 0.05),
    0 2px 8px rgba(0, 0, 0, 0.28);
}

.item-icon.item-art .item-icon-image {
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.22));
}

.item-context-menu {
  min-width: 220px;
  border-radius: 18px;
  border: 1px solid rgba(226, 188, 111, 0.26);
  background:
    linear-gradient(180deg, rgba(22, 21, 31, 0.99), rgba(12, 12, 18, 0.98));
  box-shadow:
    0 18px 36px rgba(0, 0, 0, 0.48),
    0 2px 0 rgba(255, 255, 255, 0.02);
  padding: 8px;
}

.item-menu-header {
  padding: 10px 10px 12px;
  background: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.item-menu-btn {
  margin-top: 4px;
  padding: 10px 12px;
  border-radius: 12px;
}

.item-menu-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.modal {
  background: rgba(3, 4, 9, 0.78);
  backdrop-filter: blur(8px);
}

.modal-box {
  border-radius: 24px;
  border: 1px solid rgba(226, 188, 111, 0.28);
  background:
    linear-gradient(180deg, rgba(24, 22, 34, 0.99), rgba(10, 10, 16, 0.98));
  box-shadow:
    0 30px 70px rgba(0, 0, 0, 0.62),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.modal-header {
  padding: 14px 18px;
  background: var(--panel-strip);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.modal-title {
  font-size: 16px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#global-q-tooltip,
#global-ui-tooltip {
  position: fixed;
  z-index: 10000;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.14s ease, transform 0.14s ease;
  transform: translateY(8px);
}

#global-q-tooltip.visible,
#global-ui-tooltip.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#global-q-tooltip {
  background:
    linear-gradient(180deg, rgba(17, 21, 31, 0.99), rgba(10, 12, 18, 0.98));
  border: 1px solid rgba(226, 188, 111, 0.28);
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.48);
  max-width: 300px;
}

#global-ui-tooltip {
  max-width: min(320px, calc(100vw - 24px));
}

.ui-tooltip-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 240px;
  padding: 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(226, 188, 111, 0.28);
  background:
    linear-gradient(180deg, rgba(20, 22, 31, 0.99), rgba(11, 12, 18, 0.98));
  box-shadow:
    0 20px 36px rgba(0, 0, 0, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.ui-tooltip-card--compact {
  min-width: 180px;
  gap: 8px;
}

.ui-tt-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(219, 199, 161, 0.68);
}

.ui-tt-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: #f5efe2;
}

.ui-tt-rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ui-tt-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  line-height: 1.35;
}

.ui-tt-row-label {
  flex-shrink: 0;
  color: rgba(185, 178, 165, 0.74);
}

.ui-tt-row-value {
  text-align: right;
  color: #e8e1d2;
}

.ui-tt-section {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 2px;
}

.ui-tt-section-title {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(219, 199, 161, 0.66);
}

.ui-tt-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.ui-tt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: #ece5d6;
}

.ui-tt-chip.quest {
  border-color: rgba(96, 165, 250, 0.22);
  background: rgba(96, 165, 250, 0.1);
}

.ui-tt-chip-label {
  color: rgba(192, 184, 170, 0.72);
}

.ui-tt-footer {
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 11px;
  line-height: 1.55;
  color: rgba(205, 197, 182, 0.72);
}

.ui-tt-footer--plain {
  padding-top: 0;
  border-top: none;
}

#hazard-footer {
  right: 18px;
  bottom: 16px;
}

.monster-context,
.bestiary-context,
.combat-monster-context {
  color: rgba(205, 194, 170, 0.74);
}

.monster-context,
.bestiary-context {
  font-size: 11px;
  line-height: 1.35;
}

.monster-context {
  margin-top: 4px;
}

.bestiary-context {
  margin-top: 5px;
}

.combat-target {
  align-items: flex-end;
  gap: 16px;
  padding: 14px 14px 16px;
  background:
    linear-gradient(180deg, rgba(22, 21, 32, 0.98), rgba(12, 11, 18, 0.96));
}

.combat-target-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.combat-monster-name {
  font-size: 18px;
  letter-spacing: 0.01em;
}

.combat-monster-sub {
  margin-bottom: 0;
  font-size: 12px;
  color: rgba(219, 208, 187, 0.74);
}

.combat-monster-context {
  font-size: 11px;
  line-height: 1.45;
}

.monster-img-wrap {
  width: 82px;
  height: 82px;
}

.monster-img,
.bestiary-img {
  width: 82px;
  height: 82px;
}

.combat-portrait-wrapper {
  width: 212px;
  height: 212px;
}

.combat-monster-img {
  width: 212px;
  height: 212px;
}

.dungeon-tab-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dungeon-tab-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid rgba(226, 188, 111, 0.16);
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.12), transparent 34%),
    linear-gradient(180deg, rgba(28, 27, 39, 0.98), rgba(14, 14, 21, 0.95));
}

.dungeon-tab-kicker,
.dungeon-card-kicker,
.unlock-notice-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(219, 199, 161, 0.66);
}

.dungeon-tab-title {
  margin-top: 6px;
  font-size: 20px;
  font-weight: 800;
  color: #f7f0e2;
}

.dungeon-tab-copy {
  margin-top: 8px;
  max-width: 620px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(212, 204, 190, 0.76);
}

.dungeon-tab-hero-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dungeon-hero-chip,
.dungeon-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(226, 188, 111, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #f0e6d3;
  font-size: 11px;
}

.dungeon-hero-chip.is-unlocked {
  border-color: rgba(74, 222, 128, 0.24);
  background: rgba(74, 222, 128, 0.1);
  color: #d5f7dd;
}

.dungeon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 12px;
}

.dungeon-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(226, 188, 111, 0.12);
  background:
    linear-gradient(180deg, rgba(24, 23, 34, 0.98), rgba(12, 11, 18, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 16px 28px rgba(0, 0, 0, 0.18);
}

.dungeon-card.unlocked {
  border-color: rgba(241, 197, 115, 0.18);
}

.dungeon-card.locked {
  opacity: 0.92;
  border-color: rgba(148, 163, 184, 0.14);
}

.dungeon-card-top,
.dungeon-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.dungeon-card-name {
  margin-top: 5px;
  font-size: 16px;
  font-weight: 800;
  color: #f7f0e2;
}

.dungeon-card-state {
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(226, 188, 111, 0.16);
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(241, 227, 198, 0.82);
}

.dungeon-card.locked .dungeon-card-state {
  border-color: rgba(248, 113, 113, 0.16);
  background: rgba(248, 113, 113, 0.08);
  color: #fecaca;
}

.dungeon-card-location {
  font-size: 11px;
  font-weight: 700;
  color: rgba(244, 206, 135, 0.82);
}

.dungeon-card-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(212, 204, 190, 0.76);
}

.dungeon-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
  color: rgba(193, 184, 168, 0.72);
}

.dungeon-card-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(226, 188, 111, 0.1);
}

.dungeon-card-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dungeon-card-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(219, 199, 161, 0.62);
}

.dungeon-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dungeon-chip.is-threat {
  border-color: rgba(192, 132, 252, 0.16);
  background: rgba(168, 85, 247, 0.1);
}

.dungeon-chip.is-threat.is-boss-threat {
  border-color: rgba(251, 191, 36, 0.2);
  background: rgba(251, 191, 36, 0.12);
  color: #fde7ba;
}

.dungeon-chip.is-threat.is-hidden-boss {
  border-color: rgba(148, 163, 184, 0.22);
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.24), rgba(15, 23, 42, 0.28));
  color: rgba(226, 232, 240, 0.84);
  letter-spacing: 0.04em;
}

.dungeon-card-footer {
  margin-top: auto;
  align-items: center;
  color: rgba(210, 201, 185, 0.72);
  font-size: 11px;
  line-height: 1.45;
}

.dungeon-card-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.dungeon-card-chest {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(250, 204, 21, 0.14);
  background:
    radial-gradient(circle at top left, rgba(250, 204, 21, 0.08), transparent 42%),
    rgba(255, 255, 255, 0.025);
}

.dungeon-card-chest-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  line-height: 1.45;
  color: rgba(241, 227, 198, 0.82);
}

.dungeon-card-btn,
.unlock-notice-btn {
  white-space: nowrap;
}

.dungeon-detail-modal-box {
  width: min(860px, calc(100vw - 32px));
}

.dungeon-detail-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dungeon-detail-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(219, 199, 161, 0.66);
}

.dungeon-detail-summary {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(224, 216, 202, 0.82);
}

.dungeon-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.dungeon-detail-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(226, 188, 111, 0.14);
  background: linear-gradient(180deg, rgba(26, 24, 34, 0.96), rgba(13, 12, 19, 0.96));
}

.dungeon-detail-label,
.dungeon-detail-subtitle {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(219, 199, 161, 0.62);
}

.dungeon-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dungeon-detail-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(226, 188, 111, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #f0e6d3;
  font-size: 11px;
}

.dungeon-threat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dungeon-route-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dungeon-route-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(226, 188, 111, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.dungeon-route-row.is-finale {
  border-color: rgba(250, 204, 21, 0.24);
  background:
    radial-gradient(circle at left, rgba(250, 204, 21, 0.1), transparent 52%),
    rgba(250, 204, 21, 0.045);
}

.dungeon-route-index {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(226, 188, 111, 0.18);
  background: rgba(15, 12, 18, 0.82);
  color: #f5d27e;
  font-size: 12px;
  font-weight: 800;
}

.dungeon-route-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dungeon-route-main strong {
  color: #f7f0e2;
  font-size: 12px;
}

.dungeon-route-main small {
  color: rgba(214, 206, 192, 0.72);
  font-size: 11px;
  line-height: 1.35;
}

.dungeon-threat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(168, 85, 247, 0.12);
  background: rgba(168, 85, 247, 0.08);
}

.dungeon-threat-row.is-boss {
  border-color: rgba(251, 191, 36, 0.18);
  background: rgba(251, 191, 36, 0.1);
}

.dungeon-threat-row.is-hidden {
  border-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.22), rgba(15, 23, 42, 0.26));
}

.dungeon-threat-name {
  font-size: 12px;
  font-weight: 700;
  color: #f7f0e2;
}

.dungeon-threat-role {
  font-size: 11px;
  color: rgba(214, 206, 192, 0.78);
  text-align: right;
}

.dungeon-loot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.dungeon-loot-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(226, 188, 111, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.dungeon-loot-card.is-hidden {
  border-color: rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(51, 65, 85, 0.18), rgba(15, 23, 42, 0.24));
}

.dungeon-loot-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: rgba(16, 12, 10, 0.74);
  border: 1px solid rgba(226, 188, 111, 0.14);
  flex-shrink: 0;
}

.dungeon-loot-icon.is-hidden {
  color: rgba(226, 232, 240, 0.86);
  font-size: 18px;
  font-weight: 800;
}

.dungeon-loot-item-icon {
  width: 30px;
  height: 30px;
}

.dungeon-loot-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.dungeon-loot-name {
  font-size: 12px;
  font-weight: 700;
  color: #f7f0e2;
}

.dungeon-loot-meta,
.dungeon-empty-note {
  font-size: 11px;
  line-height: 1.45;
  color: rgba(214, 206, 192, 0.72);
}

.dungeon-detail-callout {
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(74, 222, 128, 0.16);
  background: rgba(74, 222, 128, 0.08);
  color: #def7e5;
  font-size: 12px;
  line-height: 1.5;
}

.dungeon-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* Boss chest callout inside dungeon detail modal */
.dungeon-detail-boss-chest {
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(226, 188, 111, 0.28);
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.1), transparent 50%),
    rgba(255, 255, 255, 0.03);
}
.dungeon-detail-boss-chest-copy {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(212, 204, 190, 0.82);
}

.dungeon-chest-preview-grid {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.dungeon-chest-preview-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid rgba(226, 188, 111, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.dungeon-chest-preview-card.is-rare {
  border-color: rgba(250, 204, 21, 0.26);
  background:
    radial-gradient(circle at top left, rgba(250, 204, 21, 0.12), transparent 48%),
    rgba(255, 255, 255, 0.045);
}

.dungeon-chest-preview-card span {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dungeon-chest-preview-card strong {
  color: #f7f0e2;
  font-size: 12px;
}

.dungeon-chest-preview-card small {
  color: rgba(214, 206, 192, 0.7);
  font-size: 11px;
  white-space: nowrap;
}

/* Dungeon card enhancements */
.dungeon-card-state-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 5px;
}
.dungeon-card-clears {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fde68a;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.24);
}

/* Dungeon Progress Banner (shown in combat panel during an active dungeon run) */
.dungeon-progress-banner {
  margin: 10px 0 6px;
  padding: 10px 14px 10px;
  border-radius: 10px;
  border: 1px solid rgba(148, 107, 56, 0.3);
  background:
    radial-gradient(circle at top left, rgba(217, 155, 60, 0.08), transparent 60%),
    rgba(255, 255, 255, 0.025);
}
.dungeon-progress-banner.boss-stage {
  border-color: rgba(226, 188, 111, 0.4);
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.13), transparent 60%),
    rgba(255, 255, 255, 0.03);
}
.dungeon-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 7px;
}
.dungeon-progress-name {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(212, 180, 120, 0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dungeon-progress-stage {
  font-size: 11px;
  font-weight: 700;
  color: #f0e6d3;
  white-space: nowrap;
}
.boss-stage .dungeon-progress-stage {
  color: #fde68a;
}
.dungeon-progress-bar-wrap {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 6px;
}
.dungeon-progress-bar-inner {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #d4a94a, #f5d27e);
  transition: width 0.35s ease;
}
.boss-stage .dungeon-progress-bar-inner {
  background: linear-gradient(90deg, #b8860b, #fde68a);
}
.dungeon-progress-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.dungeon-progress-kills {
  font-size: 11px;
  font-weight: 600;
  color: rgba(212, 204, 190, 0.85);
}
.dungeon-progress-next {
  font-size: 10px;
  color: rgba(180, 165, 140, 0.7);
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.boss-stage .dungeon-progress-kills {
  color: #fde68a;
}

/* Dungeon Clear Modal */
.dungeon-clear-modal-box {
  max-width: 560px;
  width: min(560px, calc(100vw - 28px));
}
.dungeon-clear-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dungeon-clear-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  padding: 16px 0 12px;
}
.dungeon-clear-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(253, 230, 138, 0.8);
}
.dungeon-clear-title {
  font-size: 22px;
  font-weight: 800;
  color: #f7f0e2;
  line-height: 1.2;
}
.dungeon-clear-boss-line {
  font-size: 13px;
  color: rgba(212, 204, 190, 0.76);
}
.dungeon-clear-boss-line strong {
  color: #f0e6d3;
}
.dungeon-clear-badge-row {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.dungeon-clear-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(226, 188, 111, 0.2);
  color: #f0e6d3;
}
.dungeon-clear-badge.first-clear {
  background: rgba(250, 204, 21, 0.14);
  border-color: rgba(250, 204, 21, 0.4);
  color: #fde68a;
}
.dungeon-clear-firstclear-note {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(74, 222, 128, 0.08);
  border: 1px solid rgba(74, 222, 128, 0.2);
  color: #d5f7dd;
  font-size: 12px;
  font-weight: 600;
}
.dungeon-clear-rewards-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: min(320px, 42vh);
  overflow: auto;
  padding-right: 2px;
}
.dungeon-clear-rewards-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 188, 111, 0.8);
}
.dungeon-clear-rewards-label strong {
  letter-spacing: 0;
  text-transform: none;
  color: #fde68a;
  font-size: 11px;
}
.dungeon-clear-rewards-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dungeon-clear-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}
.dungeon-clear-actions .btn-danger {
  grid-column: 1 / -1;
}
.dungeon-clear-reward-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.dungeon-clear-reward-row.is-coin {
  border-color: rgba(250, 204, 21, 0.2);
  background: rgba(250, 204, 21, 0.06);
}
.dungeon-clear-reward-row.is-mark {
  border-color: rgba(74, 222, 128, 0.2);
  background: rgba(74, 222, 128, 0.06);
}
.dungeon-clear-reward-row.is-rare {
  border-color: rgba(250, 204, 21, 0.34);
  background:
    radial-gradient(circle at left, rgba(250, 204, 21, 0.13), transparent 52%),
    rgba(250, 204, 21, 0.07);
}
.dungeon-clear-reward-icon {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dungeon-clear-reward-coin {
  font-size: 16px;
  color: #fde68a;
}
.dungeon-clear-item-icon {
  width: 28px;
  height: 28px;
  object-fit: contain;
}
.dungeon-clear-reward-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  font-weight: 600;
  color: #f0e6d3;
}
.dungeon-clear-reward-label small {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(214, 206, 192, 0.58);
}
.dungeon-clear-no-unique {
  font-size: 12px;
  color: rgba(212, 204, 190, 0.6);
  font-style: italic;
}
.dungeon-clear-footer-note {
  text-align: center;
  font-size: 11px;
  color: rgba(212, 204, 190, 0.5);
  padding-bottom: 4px;
}

.dungeon-pending-chest-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 12px 0 16px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(250, 204, 21, 0.32);
  background:
    radial-gradient(circle at left, rgba(250, 204, 21, 0.14), transparent 48%),
    rgba(22, 18, 25, 0.88);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}
.dungeon-pending-chest-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(250, 204, 21, 0.12);
  border: 1px solid rgba(250, 204, 21, 0.28);
  color: #fde68a;
  font-size: 20px;
}
.dungeon-pending-chest-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.dungeon-pending-chest-copy strong {
  color: #f7f0e2;
  font-size: 14px;
}
.dungeon-pending-chest-copy span {
  color: rgba(212, 204, 190, 0.72);
  font-size: 12px;
  line-height: 1.4;
}

.dungeon-clear-chest-stage {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dungeon-clear-chest-button {
  position: relative;
  isolation: isolate;
  min-height: 132px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(250, 204, 21, 0.34);
  background:
    radial-gradient(circle at 24% 20%, rgba(250, 204, 21, 0.22), transparent 34%),
    linear-gradient(145deg, rgba(62, 43, 18, 0.94), rgba(20, 16, 22, 0.98));
  color: #f7f0e2;
  text-align: left;
  cursor: pointer;
  box-shadow:
    0 22px 44px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  overflow: hidden;
  touch-action: manipulation;
}

.dungeon-clear-chest-button:hover,
.dungeon-clear-chest-button:focus-visible {
  border-color: rgba(253, 230, 138, 0.58);
  transform: translateY(-1px);
}

.dungeon-clear-chest-button:disabled {
  cursor: default;
  transform: none;
  opacity: 0.86;
}

.dungeon-clear-chest-aura {
  position: absolute;
  inset: -40%;
  z-index: -1;
  background:
    conic-gradient(from 90deg, transparent, rgba(250, 204, 21, 0.18), transparent, rgba(147, 51, 234, 0.16), transparent);
  animation: dungeonChestAura 5s linear infinite;
}

.dungeon-clear-chest-icon {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  border: 1px solid rgba(253, 230, 138, 0.3);
  background: rgba(15, 12, 18, 0.72);
  color: #fde68a;
  font-size: 34px;
  box-shadow: inset 0 0 22px rgba(250, 204, 21, 0.14);
}

.dungeon-clear-chest-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dungeon-clear-chest-copy strong {
  font-size: 19px;
  line-height: 1.2;
}

.dungeon-clear-chest-copy small {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(244, 232, 204, 0.74);
}

.dungeon-clear-rewards-section[aria-hidden="true"] {
  display: none;
}

.dungeon-clear-chest-stage.is-opened .dungeon-clear-rewards-section {
  animation: dungeonRewardReveal 0.26s ease both;
}

@keyframes dungeonChestAura {
  to { transform: rotate(360deg); }
}

@keyframes dungeonRewardReveal {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .dungeon-clear-chest-aura,
  .dungeon-clear-chest-stage.is-opened .dungeon-clear-rewards-section {
    animation: none;
  }
}

@media (max-width: 640px) {
  .dungeon-clear-modal-box {
    width: min(560px, calc(100vw - 18px));
  }

  .dungeon-clear-chest-button {
    min-height: 112px;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .dungeon-clear-chest-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    font-size: 28px;
  }

  .dungeon-clear-rewards-section {
    max-height: min(360px, 46vh);
  }

  .dungeon-clear-rewards-label {
    align-items: flex-start;
    flex-direction: column;
  }

  .dungeon-clear-actions {
    grid-template-columns: 1fr;
  }

  .dungeon-pending-chest-card {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .dungeon-pending-chest-icon {
    margin: 0 auto;
  }
}

#unlock-notice-host {
  position: fixed;
  top: 92px;
  right: 20px;
  z-index: 10050;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

#unlock-notice-host.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.unlock-notice-card {
  width: min(360px, calc(100vw - 24px));
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(226, 188, 111, 0.22);
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(24, 22, 34, 0.99), rgba(11, 11, 17, 0.98));
  box-shadow:
    0 24px 46px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  pointer-events: auto;
}

.unlock-notice-title {
  margin-top: 6px;
  font-size: 18px;
  font-weight: 800;
  color: #f7f0e2;
}

.unlock-notice-body {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.55;
  color: rgba(212, 204, 190, 0.78);
}

.unlock-notice-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

@media (max-width: 1480px) {
  #left-panel {
    width: clamp(264px, 19vw, 300px);
    min-width: 264px;
    flex-basis: clamp(264px, 19vw, 300px);
  }

  #right-panel {
    width: clamp(288px, 21vw, 330px);
    min-width: 288px;
  }

  /* game-header-title stays at its default 20px — no override needed here */
}

@media (max-width: 1240px) {
  #game-screen {
    padding: 12px;
    gap: 12px;
  }

  #game-header {
    min-height: auto;
    height: auto;
    padding: 10px 16px;
  }

  #left-panel {
    width: 248px;
    min-width: 248px;
    flex-basis: 248px;
  }

  #right-panel {
    width: 276px;
    min-width: 276px;
  }

  .dungeon-tab-hero {
    flex-direction: column;
  }

  .dungeon-tab-hero-meta {
    justify-content: flex-start;
  }

  #equipment-grid {
    grid-template-columns: repeat(3, 58px);
    grid-template-rows: repeat(5, 58px);
  }

  .equip-slot {
    width: 58px;
    height: 58px;
  }

  .nav-btn {
    padding: 0 10px;
    font-size: 10px;
  }
}

@media (max-width: 1020px) {
  #panels-row {
    flex-direction: column;
    overflow-y: auto;
  }

  #left-panel,
  #right-panel {
    width: 100%;
    min-width: 0;
    flex-basis: auto;
  }

  #middle-panel {
    min-height: 460px;
  }

  #unlock-notice-host {
    left: 12px;
    right: 12px;
    top: 86px;
  }

  .unlock-notice-card {
    width: auto;
  }
}

/* ─── PLATFORM ADAPTATION PASS ───────────────────────────────────────────── */
.platform-launch-panel {
  width: min(100%, 760px);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(231, 194, 118, 0.24);
  background:
    radial-gradient(circle at top left, rgba(236, 190, 100, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(25, 22, 37, 0.94), rgba(11, 10, 18, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 220, 0.04),
    0 16px 34px rgba(0, 0, 0, 0.26);
}

.platform-launch-kicker,
.mobile-summary-kicker,
.mobile-journey-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(219, 199, 161, 0.66);
}

.platform-launch-copy,
.platform-launch-note {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(233, 225, 209, 0.82);
}

.platform-choice-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.platform-choice-row--settings {
  margin-top: 10px;
}

.platform-choice-btn {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 96px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(27, 25, 38, 0.98), rgba(15, 14, 23, 0.96));
  color: #ede3d1;
  text-align: left;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.platform-recommended-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  display: none;
  align-items: center;
  justify-content: center;
  height: 20px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(241, 197, 115, 0.28);
  background: rgba(241, 197, 115, 0.12);
  color: #f7d792;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.platform-choice-btn.recommended .platform-recommended-badge {
  display: inline-flex;
}

.platform-check-icon {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(76, 222, 128, 0.42);
  background: rgba(34, 197, 94, 0.16);
  color: #86efac;
  opacity: 0;
  transform: scale(0.82);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.platform-choice-btn.active .platform-check-icon {
  opacity: 1;
  transform: scale(1);
}

.platform-choice-btn:hover {
  border-color: rgba(241, 197, 115, 0.3);
  background:
    linear-gradient(180deg, rgba(37, 33, 48, 0.98), rgba(20, 18, 28, 0.96));
  transform: translateY(-1px);
}

.platform-choice-btn.active {
  border-color: rgba(241, 197, 115, 0.42);
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(45, 36, 27, 0.98), rgba(20, 18, 25, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.06),
    0 14px 26px rgba(0, 0, 0, 0.22);
}

.platform-choice-btn--compact {
  min-height: 82px;
}

.platform-choice-icon {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid rgba(241, 197, 115, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-gold);
  font-size: 18px;
}

.platform-choice-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.platform-choice-title {
  font-size: 15px;
  font-weight: 800;
  color: #f8f1e4;
}

.platform-choice-desc {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(220, 212, 196, 0.74);
}

.daily-buff-indicator {
  margin-top: 8px;
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid rgba(96, 165, 250, 0.24);
  background: rgba(59, 130, 246, 0.12);
  color: #bfdbfe;
  font-size: 11px;
  font-weight: 800;
}

.daily-modal-box {
  max-width: 820px;
}

.daily-modal-body {
  padding: 0;
}

.daily-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: start;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at 10% 0%, rgba(244, 199, 118, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(24, 28, 42, 0.92), rgba(12, 14, 23, 0.86));
}

.daily-copy {
  margin-top: 0;
  max-width: 520px;
  color: rgba(233, 225, 209, 0.78);
  font-size: 13px;
  line-height: 1.5;
}

.daily-date-card {
  min-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(244, 199, 118, 0.2);
  background: rgba(244, 199, 118, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  cursor: default;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.daily-date-card:hover,
.daily-date-card:active,
.daily-date-card:focus-visible {
  transform: none;
}

.daily-date-label {
  color: #fff3d7;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.daily-reset-line {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(237, 224, 202, 0.78);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.daily-reset-line i {
  color: #f7c76f;
}

.daily-buff-card {
  min-width: 190px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(233, 225, 209, 0.76);
  background: rgba(255, 255, 255, 0.04);
  font-weight: 800;
  cursor: default;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.daily-buff-card:hover,
.daily-buff-card:active,
.daily-buff-card:focus-visible {
  transform: none;
}

.daily-buff-card.is-active {
  border-color: rgba(96, 165, 250, 0.28);
  color: #bfdbfe;
  background: rgba(59, 130, 246, 0.12);
}

.daily-task-list {
  display: grid;
  gap: 12px;
  padding: 18px;
}

.daily-task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  cursor: default;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.daily-task-card:hover,
.daily-task-card:active,
.daily-task-card:focus-visible {
  transform: none;
}

.daily-task-card.is-ready {
  border-color: rgba(74, 222, 128, 0.3);
  background: rgba(34, 197, 94, 0.08);
}

.daily-task-card.is-claimed {
  opacity: 0.74;
}

.daily-task-topline {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.daily-task-title {
  min-width: 0;
  color: #f8f1e4;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.daily-task-state {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(233, 225, 209, 0.74);
  background: rgba(255, 255, 255, 0.055);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.daily-task-state.is-ready {
  border-color: rgba(74, 222, 128, 0.28);
  color: #bff7d0;
  background: rgba(34, 197, 94, 0.12);
}

.daily-task-state.is-claimed {
  color: rgba(233, 225, 209, 0.58);
}

.daily-task-desc,
.daily-task-progress,
.daily-reward-line {
  color: rgba(233, 225, 209, 0.74);
  font-size: 12px;
  line-height: 1.45;
  transition: color 0.16s ease;
}

.daily-task-desc:hover,
.daily-task-desc:active,
.daily-task-desc:focus-visible,
.daily-task-progress:hover,
.daily-task-progress:active,
.daily-task-progress:focus-visible,
.daily-reward-line:hover,
.daily-reward-line:active,
.daily-reward-line:focus-visible {
  transform: none;
}

.daily-progress-bar {
  height: 8px;
  margin: 10px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.daily-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f7c76f, #60a5fa);
}

.daily-task-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.daily-task-progress b {
  color: #f7d99e;
  font-weight: 900;
}

.daily-task-reward {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: stretch;
  cursor: default;
}

.daily-task-state {
  transition: border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.daily-task-state:hover,
.daily-task-state:active,
.daily-task-state:focus-visible {
  transform: none;
}

.daily-reward-label {
  color: rgba(219, 199, 161, 0.68);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.daily-claim-btn {
  min-height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(241, 197, 115, 0.3);
  background: rgba(241, 197, 115, 0.14);
  color: #f8e2ad;
  font-weight: 900;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.daily-claim-btn:hover:not(:disabled) {
  border-color: rgba(241, 197, 115, 0.55);
  background: rgba(241, 197, 115, 0.22);
  transform: translateY(-1px);
}

.daily-claim-btn:active:not(:disabled) {
  transform: translateY(0);
}

.daily-claim-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 680px) {
  .daily-summary {
    grid-template-columns: 1fr;
  }

  .daily-task-card {
    grid-template-columns: 1fr;
  }

  .daily-date-card,
  .daily-buff-card {
    width: 100%;
  }

  .daily-reset-line {
    white-space: normal;
  }
}

#mobile-hero-panel,
#mobile-journey-panel,
#mobile-quests-panel,
.mobile-surface-top,
.mobile-only-tab,
.mobile-only-tab-content {
  display: none;
}

.mobile-surface-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.mobile-surface-top {
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(24, 22, 33, 0.98), rgba(14, 13, 20, 0.95));
}

.mobile-surface-top--embedded {
  padding: 12px 14px 10px;
}

.platform-label-mobile {
  display: none;
}

body.platform-mobile .platform-label-desktop {
  display: none;
}

body.platform-mobile .platform-label-mobile {
  display: inline;
}

.mobile-surface-top--systems {
  display: none;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.mobile-surface-top-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.mobile-surface-back-btn {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid rgba(241, 197, 115, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #f7efdf;
  flex-shrink: 0;
}

.mobile-surface-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(224, 213, 188, 0.66);
}

.mobile-surface-title {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.15;
  color: #f7f0e2;
}

.mobile-surface-copy {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(220, 212, 196, 0.76);
}

.mobile-surface-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 14px 16px calc(22px + env(safe-area-inset-bottom));
}

.mobile-hero-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-hero-card,
.mobile-hero-section-card,
.mobile-activity-shell,
.mobile-skills-copy,
.mobile-skill-group,
.mobile-summary-pill {
  border: 1px solid rgba(226, 188, 111, 0.12);
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(27, 24, 36, 0.98), rgba(13, 12, 20, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 24px rgba(0, 0, 0, 0.14);
}

.mobile-hero-card,
.mobile-hero-section-card {
  border-radius: 22px;
  padding: 14px;
}

.mobile-hero-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.mobile-hero-title-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-hero-name-row {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: #f8f1e4;
  min-width: 0;
}

.mobile-hero-name-text {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-hero-mode-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.mobile-hero-meta {
  font-size: 13px;
  color: rgba(218, 207, 189, 0.76);
}

.mobile-hero-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-hero-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(241, 197, 115, 0.14);
  background: rgba(255, 255, 255, 0.05);
  color: #f4e3be;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mobile-hero-focus-card {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

.mobile-hero-focus-label,
.mobile-hero-stat-label,
.mobile-hero-section-copy,
.mobile-skill-group-copy {
  font-size: 11px;
  color: rgba(212, 202, 184, 0.68);
}

.mobile-hero-focus-card strong {
  font-size: 17px;
  color: #f8f1e4;
}

.mobile-hero-focus-card span:last-child {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(223, 214, 196, 0.8);
}

.mobile-hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 10px;
}

.mobile-hero-stat-card,
.mobile-hero-journey-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(20, 20, 29, 0.98), rgba(13, 13, 20, 0.96));
}

.mobile-hero-stat-card strong,
.mobile-hero-journey-card strong {
  font-size: 18px;
  color: #f8f1e4;
}

.mobile-hero-stat-sub {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(207, 198, 181, 0.7);
}

.mobile-hero-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.mobile-hero-action-btn,
.mobile-hero-inline-link,
.mobile-skill-row,
.mobile-nav-btn {
  appearance: none;
  border: none;
}

.mobile-hero-action-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
  min-height: 78px;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(241, 197, 115, 0.14);
  background:
    linear-gradient(180deg, rgba(25, 24, 33, 0.98), rgba(12, 12, 19, 0.96));
  color: #f7efdf;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 20px rgba(0, 0, 0, 0.14);
}

.mobile-hero-action-btn i {
  font-size: 16px;
  color: var(--text-gold);
}

.mobile-hero-action-btn span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mobile-hero-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.mobile-hero-section-title,
.mobile-skill-group-title {
  font-size: 16px;
  font-weight: 800;
  color: #f8f1e4;
  margin-bottom: 4px;
}

.mobile-hero-inline-link {
  background: none;
  color: var(--text-gold);
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  white-space: nowrap;
}

.mobile-hero-skill-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-hero-skill-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.03);
}

.mobile-hero-skill-chip span {
  font-size: 12px;
  color: rgba(223, 214, 196, 0.8);
}

.mobile-hero-skill-chip strong {
  font-size: 15px;
  color: #f8f1e4;
}

.mobile-hero-journey-grid {
  display: grid;
  gap: 10px;
}

.mobile-skills-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-skills-copy,
.mobile-activity-shell {
  border-radius: 18px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(223, 214, 196, 0.8);
}

.mobile-skills-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-skills-surface-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.mobile-skill-group {
  border-radius: 22px;
  padding: 14px;
}

.mobile-skill-group-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}

.mobile-skill-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-height: 86px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(18, 20, 29, 0.98), rgba(11, 12, 18, 0.96));
  color: #f8f1e4;
  text-align: left;
}

.mobile-skill-row-icon .skill-art-icon,
.mobile-skill-row-icon .skill-icon {
  width: 40px;
  height: 40px;
}

.mobile-skill-row-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-skill-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.mobile-skill-row-name {
  font-size: 15px;
  font-weight: 800;
  color: #f8f1e4;
}

.mobile-skill-row-level {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-gold);
}

.mobile-skill-row-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mobile-skill-row-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.mobile-skill-row-fill {
  height: 100%;
  border-radius: 999px;
}

.mobile-skill-row-xp {
  font-size: 11px;
  color: rgba(223, 214, 196, 0.7);
  line-height: 1.45;
}

.mobile-skill-row-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(241, 197, 115, 0.14);
  background: rgba(241, 197, 115, 0.08);
  color: var(--text-gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-activity-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.mobile-activity-copy {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(223, 214, 196, 0.78);
}

.mobile-activity-log {
  min-height: 220px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(6, 8, 14, 0.84);
  padding: 10px 12px;
  overflow-y: auto;
  font-family: monospace;
  font-size: 12px;
  color: var(--text-muted);
}

.mobile-activity-log div {
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mobile-activity-empty {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(223, 214, 196, 0.72);
}

#mobile-summary-bar {
  display: none;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(226, 188, 111, 0.18);
  border-radius: 18px;
  background:
    radial-gradient(circle at top left, rgba(95, 138, 220, 0.16), transparent 30%),
    linear-gradient(180deg, rgba(23, 22, 32, 0.98), rgba(10, 11, 18, 0.96));
  box-shadow: var(--panel-shadow-xl);
}

#mobile-summary-bar[data-summary-mode="combat"] {
  border-color: rgba(103, 176, 239, 0.24);
  background:
    radial-gradient(circle at top left, rgba(84, 158, 245, 0.2), transparent 28%),
    radial-gradient(circle at bottom right, rgba(214, 89, 89, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(18, 22, 35, 0.98), rgba(8, 11, 20, 0.98));
}

.mobile-summary-inline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.mobile-summary-inline-main,
.mobile-combat-summary-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.mobile-summary-inline-name {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-size: 17px;
  font-weight: 800;
  color: #f6efe2;
}

.mobile-summary-inline-name span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-summary-mode-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.mobile-summary-inline-meta,
.mobile-combat-summary-meta {
  font-size: 12px;
  color: rgba(215, 205, 187, 0.74);
}

.mobile-summary-inline-focus,
.mobile-combat-summary-focus,
.mobile-combat-pill {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
}

.mobile-summary-inline-focus {
  min-width: 138px;
  max-width: 180px;
}

.mobile-summary-inline-label,
.mobile-combat-summary-focus span,
.mobile-combat-pill span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(205, 194, 170, 0.64);
}

.mobile-summary-inline-focus strong,
.mobile-combat-summary-focus strong,
.mobile-combat-pill strong {
  font-size: 14px;
  line-height: 1.25;
  color: #f6efe2;
}

.mobile-summary-inline-focus strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-combat-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mobile-combat-summary-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.mobile-combat-summary-title {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.15;
  color: #f8f1e4;
}

.mobile-combat-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-journey-body {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.mobile-journey-hero {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 2px 10px;
}

.mobile-journey-title {
  font-size: 18px;
  font-weight: 800;
  color: #f7f0e2;
}

.mobile-journey-copy,
.mobile-journey-mode-note {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(220, 212, 196, 0.76);
}

.mobile-journey-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mobile-journey-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 96px;
  padding: 13px;
  border-radius: 18px;
  border: 1px solid rgba(226, 188, 111, 0.12);
  background:
    linear-gradient(180deg, rgba(26, 24, 35, 0.98), rgba(12, 11, 18, 0.96));
  color: #efe5d4;
  text-align: left;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 28px rgba(0, 0, 0, 0.18);
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.mobile-journey-card:hover {
  border-color: rgba(241, 197, 115, 0.24);
  background:
    linear-gradient(180deg, rgba(35, 31, 47, 0.98), rgba(16, 15, 23, 0.97));
  transform: translateY(-1px);
}

.mobile-journey-card-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 14px;
  border: 1px solid rgba(241, 197, 115, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-gold);
  font-size: 17px;
}

.mobile-journey-card-copy {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.mobile-journey-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #f8f1e4;
}

.mobile-journey-card-desc {
  font-size: 11px;
  line-height: 1.5;
  color: rgba(220, 212, 196, 0.72);
}

.mobile-quests-shell {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-quests-toolbar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(226, 188, 111, 0.12);
  background:
    linear-gradient(180deg, rgba(26, 24, 35, 0.98), rgba(12, 11, 18, 0.96));
}

.mobile-quests-toolbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.mobile-quest-marks {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(241, 197, 115, 0.16);
  background: rgba(255, 255, 255, 0.04);
  color: #f4e3be;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-quests-layout {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.mobile-quest-detail-screen {
  display: none;
}

.mobile-quest-detail-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mobile-quest-detail-screen-copy,
.mobile-combat-subview-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mobile-quest-detail-screen-kicker,
.mobile-combat-subview-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(234, 198, 122, 0.82);
}

.mobile-quest-detail-screen-title,
.mobile-combat-subview-title {
  font-size: 16px;
  font-weight: 800;
  color: #f7f0e2;
}

.mobile-quest-detail-close,
.mobile-combat-subview-close {
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-combat-subview {
  display: none;
}

.mobile-combat-subview-shell {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.mobile-combat-subview-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background:
    radial-gradient(circle at top left, rgba(93, 145, 229, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(21, 24, 36, 0.98), rgba(10, 12, 20, 0.98));
}

.mobile-combat-subview-desc {
  font-size: 12px;
  line-height: 1.55;
  color: rgba(219, 210, 193, 0.72);
}

.mobile-combat-subview-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#mobile-nav-bar {
  display: none;
  gap: 8px;
}

.mobile-nav-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 58px;
  padding: 8px 6px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(26, 24, 35, 0.98), rgba(13, 12, 20, 0.97));
  color: rgba(224, 216, 198, 0.68);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-nav-btn i {
  font-size: 16px;
}

.mobile-nav-btn.active {
  color: #fbf4e7;
  border-color: rgba(241, 197, 115, 0.38);
  background:
    radial-gradient(circle at 50% 0%, rgba(241, 197, 115, 0.2), transparent 70%),
    linear-gradient(180deg, rgba(55, 44, 28, 0.99), rgba(22, 19, 28, 0.98));
}

.mobile-nav-btn.active i {
  color: #f1c573;
}

.mobile-nav-btn:active:not(.active) {
  background: linear-gradient(180deg, rgba(35, 32, 48, 0.98), rgba(16, 14, 22, 0.97));
  border-color: rgba(255, 255, 255, 0.12);
}

.item-context-menu.mobile-context-menu {
  width: auto;
  min-width: 0;
  border-radius: 22px;
  padding: 10px;
}

.item-context-menu.mobile-context-menu .item-menu-btn {
  min-height: 46px;
}

@media (max-width: 760px) {
  .platform-choice-row {
    grid-template-columns: 1fr;
  }
}

/* ─── EMERGENCY MOBILE SPLASH SCROLL REACHABILITY ──────────────────────────── */
@media (max-width: 760px), (max-height: 720px) {
  #splash-screen {
    align-items: stretch;
    justify-content: flex-start;
    min-height: 100vh;
    min-height: 100dvh;
    height: 100vh;
    height: 100dvh;
    padding: max(12px, env(safe-area-inset-top)) 12px calc(24px + env(safe-area-inset-bottom));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  #splash-screen .splash-shell {
    width: min(100%, 620px);
    min-height: auto;
    margin: 0 auto;
    padding: 22px 14px calc(32px + env(safe-area-inset-bottom));
    justify-content: flex-start;
    gap: 14px;
  }

  #splash-screen .platform-launch-panel,
  #splash-screen .splash-play-btn {
    flex-shrink: 0;
  }

  #splash-screen .splash-play-btn {
    width: min(100%, 360px);
    margin-bottom: max(10px, env(safe-area-inset-bottom));
  }
}

body.platform-mobile #splash-screen {
  align-items: stretch;
  justify-content: flex-start;
  min-height: 100dvh;
  height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
}

body.platform-mobile .splash-shell {
  width: min(100%, 620px);
  min-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  margin: 0 auto;
  padding: 22px 14px;
  justify-content: center;
  gap: 14px;
  border-radius: 26px;
}

body.platform-mobile .splash-status-line {
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.08em;
}

body.platform-mobile .splash-status-line span {
  min-height: 22px;
  padding: 0 8px;
}

body.platform-mobile .title-logo {
  font-size: clamp(34px, 11vw, 48px);
  letter-spacing: 0.16em;
}

body.platform-mobile .title-subtitle {
  font-size: 12px;
  letter-spacing: 0.06em;
}

body.platform-mobile .splash-play-btn {
  max-width: 360px;
}

@media (max-height: 720px) {
  body.platform-mobile .splash-shell {
    justify-content: flex-start;
  }

  body.platform-mobile .title-emblem {
    width: 84px;
    height: 84px;
    border-radius: 24px;
  }

  body.platform-mobile .platform-choice-btn {
    min-height: 82px;
  }
}

body.platform-mobile .splash-play-btn {
  width: 100%;
  min-height: 56px;
  border-radius: 16px;
}

body.platform-mobile #char-select-hub {
  padding: 0 0 env(safe-area-inset-bottom);
}

body.platform-mobile .hub-panel {
  width: min(100%, calc(100% - 16px));
  margin: 10px auto 14px;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
  max-height: calc(100dvh - 120px);
}

/* ─── MOBILE INPUT / CREATION OVERRIDES ─────────────────────────────────────
   1. cloud-input font-size must be ≥16px on iOS or Safari will auto-zoom
      the viewport on focus, which causes jarring layout shift.
   2. char-create-box is capped at 580px for desktop; on narrow phones it
      should fill the available width instead.
*/
body.platform-mobile .cloud-input {
  font-size: 16px;
}

body.platform-mobile .char-create-box {
  max-width: 100%;
}

body.platform-mobile .hub-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

body.platform-mobile .hub-footer {
  align-items: stretch;
}

body.platform-mobile .cs-slot-filled {
  flex-direction: column;
  align-items: stretch;
}

body.platform-mobile .cs-slot-mode-bar {
  width: auto;
  height: 4px;
}

body.platform-mobile .cs-slot-inner {
  width: 100%;
  padding: 14px 14px 10px;
  align-items: flex-start;
}

body.platform-mobile .cs-slot-actions {
  width: 100%;
  padding: 0 14px 14px;
  flex-direction: row;
}

body.platform-mobile .cs-play-btn,
body.platform-mobile .cs-delete-btn,
body.platform-mobile .cs-create-btn {
  min-height: 42px;
  flex: 1 1 0;
}

body.platform-mobile #main-game-ui {
  overflow: hidden;
}

body.platform-mobile {
  --titans-legacy-bg-position: 52% 50%;
}

body.platform-mobile #game-screen {
  min-height: 100dvh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  padding: max(6px, env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
}

body.platform-mobile #game-header {
  grid-row: 1;
  grid-template-columns: 1fr;
  align-items: center;
  min-height: auto;
  height: auto;
  padding: 8px 48px 8px 12px;
  border-radius: 18px;
}

body.platform-mobile .game-header-center {
  display: none;
}

body.platform-mobile .game-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

body.platform-mobile .game-header-left::after {
  display: none;
}

body.platform-mobile .game-header-logo-frame {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

body.platform-mobile .game-header-title {
  font-size: 14px;
  letter-spacing: 0.06em;
}

body.platform-mobile .game-header-eyebrow {
  font-size: 8px;
  letter-spacing: 0.14em;
}

body.platform-mobile .game-header-right {
  display: none;
}

body.platform-mobile .game-header-status-row {
  gap: 4px;
}

body.platform-mobile .save-indicator {
  width: 22px;
  height: 22px;
  font-size: 10px;
  border-radius: 6px;
}

body.platform-mobile .header-settings-btn {
  display: none;
}

body.platform-mobile .header-social-link {
  right: 12px;
  width: 24px;
  height: 24px;
  border-radius: 8px;
}

body.platform-mobile .header-social-link i {
  font-size: 13px;
}

body.platform-mobile #mobile-summary-bar {
  grid-row: 2;
  display: grid;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 18px;
}

body.platform-mobile #panels-row {
  grid-row: 3;
  position: relative;
  display: block;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  isolation: isolate;
}

body.platform-mobile #mobile-hero-panel,
body.platform-mobile #middle-panel,
body.platform-mobile #right-panel,
body.platform-mobile #mobile-journey-panel,
body.platform-mobile #mobile-quests-panel {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  flex-direction: column;
  overflow: hidden;
}

body.platform-mobile #middle-panel,
body.platform-mobile #mobile-quests-panel .mobile-surface-shell {
  position: relative;
}

body.platform-mobile #left-panel {
  display: none !important;
}

body.platform-mobile[data-mobile-surface="hero"]    #mobile-hero-panel,
body.platform-mobile[data-mobile-surface="combat"]  #middle-panel,
body.platform-mobile[data-mobile-surface="skills"]  #middle-panel,
body.platform-mobile[data-mobile-surface="bounty"]  #middle-panel,
body.platform-mobile[data-mobile-surface="quests"]  #mobile-quests-panel,
body.platform-mobile[data-mobile-surface="more"]    #mobile-journey-panel,
body.platform-mobile[data-mobile-surface="gear"]    #right-panel {
  display: flex;
}

body.platform-mobile .panel {
  border-radius: 24px;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(79, 132, 227, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(24, 22, 33, 0.98), rgba(10, 10, 17, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 34px rgba(0, 0, 0, 0.22);
}

body.platform-mobile .mobile-surface-top,
body.platform-mobile .mobile-only-tab {
  display: flex;
}

body.platform-mobile .mobile-surface-top--systems {
  display: grid;
  padding: 10px 14px 10px;
  gap: 10px;
  border-bottom-color: rgba(241, 197, 115, 0.08);
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(28, 23, 31, 0.98), rgba(14, 13, 20, 0.95));
}

body.platform-mobile .mobile-surface-top {
  padding: 10px 14px 8px;
  gap: 2px;
}

body.platform-mobile #mobile-hero-panel .mobile-surface-scroll,
body.platform-mobile #mobile-journey-grid.mobile-surface-scroll,
body.platform-mobile #mobile-quests-panel .mobile-surface-scroll {
  padding: 12px 14px calc(22px + env(safe-area-inset-bottom));
}

body.platform-mobile .mobile-quest-detail-screen,
body.platform-mobile .mobile-combat-subview {
  position: absolute;
  inset: 0;
  z-index: 7;
  padding: max(10px, env(safe-area-inset-top)) 10px calc(10px + env(safe-area-inset-bottom));
  background:
    linear-gradient(180deg, rgba(8, 10, 16, 0.78), rgba(6, 7, 12, 0.92));
  backdrop-filter: blur(14px);
}

body.platform-mobile #mobile-quests-panel[data-detail-open="true"] .mobile-quest-detail-screen,
body.platform-mobile #middle-panel[data-mobile-subview-open="true"] .mobile-combat-subview {
  display: flex;
  flex-direction: column;
}

body.platform-mobile .mobile-quest-detail-screen {
  gap: 10px;
}

body.platform-mobile .mobile-quest-detail-pane,
body.platform-mobile .mobile-combat-subview-body {
  border-radius: 24px;
  border: 1px solid rgba(225, 190, 118, 0.14);
  background:
    radial-gradient(circle at top left, rgba(79, 132, 227, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(24, 22, 33, 0.98), rgba(10, 10, 17, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 18px 34px rgba(0, 0, 0, 0.22);
}

body.platform-mobile .mobile-quest-detail-pane {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

body.platform-mobile .mobile-quest-detail-pane .quest-detail-scroll {
  padding-top: 18px;
}

body.platform-mobile .mobile-combat-subview-body > .tab-content {
  display: flex !important;
  flex: 1 1 auto;
  min-height: 0;
}

body.platform-mobile .mobile-combat-subview-body #monster-list,
body.platform-mobile .mobile-combat-subview-body #dungeons-panel,
body.platform-mobile .mobile-combat-subview-body #mobile-bounty-content,
body.platform-mobile .mobile-combat-subview-body #mobile-activity-log {
  flex: 1 1 auto;
}

body.platform-mobile .tab-bar {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 8px;
  padding: 0 14px 10px;
}

body.platform-mobile .tab-bar::-webkit-scrollbar {
  display: none;
}

body.platform-mobile .tab-bar.is-hidden {
  display: none;
}

body.platform-mobile .tab-btn {
  flex: 0 0 auto;
  min-width: 104px;
  min-height: 48px;
  padding: 8px 12px;
  border-radius: 18px;
  font-size: 11px;
}

body.platform-mobile .tab-btn.mobile-surface-scoped-hidden {
  display: none;
}

body.platform-mobile #mobile-middle-surface-top {
  transition: background 140ms ease, border-color 140ms ease;
}

body.platform-mobile #middle-panel[data-mobile-surface="combat"] #mobile-middle-surface-top {
  background:
    radial-gradient(circle at top left, rgba(121, 47, 47, 0.22), transparent 32%),
    linear-gradient(180deg, rgba(31, 20, 25, 0.98), rgba(13, 11, 17, 0.96));
}

body.platform-mobile #middle-panel[data-mobile-surface="skills"] #mobile-middle-surface-top {
  background:
    radial-gradient(circle at top left, rgba(70, 122, 213, 0.18), transparent 34%),
    linear-gradient(180deg, rgba(20, 24, 35, 0.98), rgba(12, 13, 21, 0.96));
}

body.platform-mobile #middle-panel[data-mobile-surface="bounty"] #mobile-middle-surface-top {
  background:
    radial-gradient(circle at top left, rgba(241, 197, 115, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(36, 27, 21, 0.98), rgba(14, 12, 18, 0.96));
}

body.platform-mobile .right-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 14px 12px;
}

body.platform-mobile .right-tab {
  min-height: 58px;
  border-radius: 18px;
  font-size: 10px;
  gap: 5px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(180deg, rgba(25, 23, 34, 0.98), rgba(14, 13, 22, 0.96));
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

body.platform-mobile .right-tab.active {
  border-color: rgba(241, 197, 115, 0.3);
  background:
    radial-gradient(circle at top, rgba(241, 197, 115, 0.14), transparent 70%),
    linear-gradient(180deg, rgba(52, 40, 28, 0.98), rgba(20, 17, 24, 0.96));
  transform: translateY(-1px);
}

body.platform-mobile .right-tab:active:not(.active) {
  transform: translateY(1px);
}

body.platform-mobile #right-panel [data-mobile-hidden="true"] {
  display: none !important;
}

/* Duplicate Bounty access stays on desktop, but mobile uses the dedicated bottom nav surface. */

/* ── Touch responsiveness: eliminate 300ms tap delay on all mobile controls ── */
body.platform-mobile button,
body.platform-mobile .mobile-nav-btn,
body.platform-mobile .tab-btn,
body.platform-mobile .right-tab,
body.platform-mobile .mobile-journey-card,
body.platform-mobile .mj-card,
body.platform-mobile .mobile-hero-inline-link,
body.platform-mobile .mobile-skill-row,
body.platform-mobile [data-mobile-action],
body.platform-mobile [data-mobile-surface] {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── More surface: sectioned command grid (replaces flat journey cards) ── */
.mj-section {
  margin-bottom: 20px;
}

.mj-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.mj-section-label {
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(241, 197, 115, 0.65);
}

.mj-section-copy {
  max-width: 62%;
  font-size: 11px;
  line-height: 1.35;
  color: rgba(220, 212, 196, 0.58);
  text-align: right;
}

.mj-section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(104px, 1fr));
  gap: 8px;
}

.mj-card {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 104px;
  padding: 14px 8px 12px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top, rgba(241, 197, 115, 0.08), transparent 62%),
    linear-gradient(180deg, rgba(32, 28, 44, 0.98) 0%, rgba(18, 16, 28, 0.98) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 22px rgba(0, 0, 0, 0.16);
  color: rgba(220, 212, 195, 0.82);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
  cursor: pointer;
  appearance: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

.mj-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 38%);
  opacity: 0.8;
  pointer-events: none;
}

.mj-card i {
  font-size: 20px;
  color: rgba(241, 197, 115, 0.9);
  line-height: 1;
}

.mj-card span {
  max-width: 100%;
  line-height: 1.2;
}

.mj-card small {
  max-width: 100%;
  display: block;
  min-height: 26px;
  font-size: 9.5px;
  line-height: 1.3;
  color: rgba(222, 213, 196, 0.58);
}

.mj-card em {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(116, 229, 154, 0.24);
  background: rgba(116, 229, 154, 0.09);
  color: #baf7ca;
  font-size: 8px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mj-card:active {
  transform: translateY(1px);
  background:
    radial-gradient(circle at top, rgba(241, 197, 115, 0.12), transparent 65%),
    linear-gradient(180deg, rgba(43, 38, 60, 0.98) 0%, rgba(28, 24, 42, 0.98) 100%);
  border-color: rgba(241, 197, 115, 0.24);
}

/* ── Mobile surface: top-row helpers (legacy / fallback) ── */
.mobile-surface-top-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

body:not(.platform-mobile) .mobile-only-tab,
body:not(.platform-mobile) .mobile-only-tab-content {
  display: none !important;
}

body.platform-mobile .mobile-only-tab-content,
body.platform-mobile #monster-list,
body.platform-mobile #combat-panel,
body.platform-mobile #training-actions,
body.platform-mobile #dungeons-panel,
body.platform-mobile [data-tab-group="right"][data-tab-content] {
  min-height: 0;
}

body.platform-mobile [data-tab-group="middle"][data-tab-content] {
  padding: 0 14px calc(18px + env(safe-area-inset-bottom));
  overflow: hidden;
}

body.platform-mobile .search-row {
  margin: 0 0 12px;
  min-height: 52px;
  padding: 0 14px;
  border-radius: 18px;
}

body.platform-mobile #monster-list {
  padding: 2px 0 0;
}

body.platform-mobile #combat-panel,
body.platform-mobile #training-actions,
body.platform-mobile #dungeons-panel,
body.platform-mobile [data-tab-group="right"][data-tab-content] {
  overflow-y: auto;
}

body.platform-mobile [data-tab-group="right"][data-tab-content] {
  padding: 0 14px calc(18px + env(safe-area-inset-bottom));
}

body.platform-mobile #combat-panel,
body.platform-mobile #training-actions,
body.platform-mobile #dungeons-panel {
  padding: 0 !important;
}

body.platform-mobile .monster-card {
  min-height: 90px;
  padding: 12px 14px;
  border-radius: 20px;
}

body.platform-mobile .combat-target {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

body.platform-mobile .combat-portrait-wrapper,
body.platform-mobile .combat-monster-img {
  width: 132px;
  height: 132px;
}

body.platform-mobile .combat-portrait-wrapper {
  align-self: center;
}

body.platform-mobile .combat-target-info {
  min-width: 0;
}

body.platform-mobile .combat-target-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
}

body.platform-mobile .combat-target-title {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1 1 auto;
}

body.platform-mobile .combat-target-name-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  flex-wrap: nowrap;
}

body.platform-mobile .combat-target-name-row .combat-monster-name {
  flex: 0 1 auto;
  min-width: 0;
}

body.platform-mobile .mobile-combat-retreat-btn {
  flex-shrink: 0;
  align-self: flex-start;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 12px;
  border: 1px solid rgba(248, 113, 113, 0.32);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.96), rgba(91, 16, 16, 0.98));
  color: #fff2f2;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
  box-shadow: 0 10px 18px rgba(109, 23, 23, 0.26);
}

body.platform-mobile .mobile-combat-retreat-btn:hover,
body.platform-mobile .mobile-combat-retreat-btn:focus-visible {
  border-color: rgba(252, 165, 165, 0.52);
}

body.platform-mobile .combat-mobile-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

body.platform-mobile .combat-mobile-action {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

body.platform-mobile .combat-mobile-action i {
  color: rgba(244, 199, 118, 0.9);
  font-size: 13px;
}

body.platform-mobile .combat-mobile-action span {
  line-height: 1;
}

body.platform-mobile .combat-panel-retreat {
  display: none;
}

body.platform-mobile .bounty-empty-state {
  flex-direction: column;
  padding: 14px;
}

body.platform-mobile .stats-overview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.platform-mobile .stats-progress-panel,
body.platform-mobile .stats-hall-panel {
  padding: 12px;
}

body.platform-mobile[data-mobile-combat-active="true"] #mobile-nav-bar {
  display: none;
}

body.platform-mobile #game-log,
body.platform-mobile #game-log-resizer {
  display: none;
}

body.platform-mobile #chat-bar {
  display: none;
}

body.platform-mobile #nav-bar {
  display: none;
}

body.platform-mobile #equipment-grid {
  grid-template-columns: repeat(3, minmax(76px, 86px));
  gap: 10px;
  padding: 2px 0 18px;
  margin: 0 auto;
}

body.platform-mobile .equip-slot {
  width: 76px;
  height: 76px;
  border-radius: 22px;
}

body.platform-mobile .slot-label {
  font-size: 10px;
}

body.platform-mobile #bank-grid {
  gap: 10px;
  padding: 12px 0 18px;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
}

body.platform-mobile #inventory-grid {
  gap: 10px;
  padding: 2px 0 18px;
}

body.platform-mobile .inv-slot,
body.platform-mobile .bank-slot {
  min-height: 78px;
  border-radius: 20px;
}

body.platform-mobile #equip-stats {
  margin-top: 8px;
  padding-top: 16px;
  padding-bottom: calc(94px + env(safe-area-inset-bottom));
}

body.platform-mobile #right-panel {
  min-height: 0;
  overflow: hidden;
}

body.platform-mobile #right-panel > [data-tab-group="right"][data-tab-content] {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
}

body.platform-mobile #right-panel[data-mobile-systems-tab="equipment"] [data-tab-content="equipment"] {
  scroll-padding-bottom: calc(110px + env(safe-area-inset-bottom));
}

body.platform-mobile .stat-cols,
body.platform-mobile .stat-other {
  gap: 12px;
  padding: 0;
}

body.platform-mobile .stat-col,
body.platform-mobile .stat-other .stat-row {
  border-radius: 16px;
}

body.platform-mobile #devotion-grid,
body.platform-mobile #bounty-content,
body.platform-mobile #stats-content,
body.platform-mobile #tools-panel {
  padding: 2px 0 18px;
}

body.platform-mobile #mobile-summary-name {
  font-size: 17px;
}

body.platform-mobile .mobile-summary-meta {
  font-size: 11px;
}

body.platform-mobile .mobile-summary-pill {
  min-height: 62px;
  padding: 10px 12px;
}

body.platform-mobile .mobile-hero-stat-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.platform-mobile .mobile-hero-quick-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.platform-mobile .mobile-hero-action-btn:last-child {
  grid-column: 1 / -1;
}

body.platform-mobile .mobile-hero-skill-preview,
body.platform-mobile .mobile-journey-actions {
  grid-template-columns: 1fr;
}

body.platform-mobile .mobile-activity-shell {
  min-height: 100%;
  padding: 16px;
  border-radius: 24px;
}

body.platform-mobile #mobile-activity-log {
  flex: 1 1 auto;
  min-height: 240px;
}

body.platform-mobile #mobile-nav-bar {
  grid-row: 4;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  padding-top: 0;
}

body.platform-mobile .mobile-nav-btn {
  min-height: 48px;
  padding: 7px 2px;
  border-radius: 14px;
  font-size: 8px;
  letter-spacing: 0.06em;
  transition: background 0.12s ease, border-color 0.12s ease, transform 0.12s ease;
}

body.platform-mobile #mobile-skills-modal .mobile-sheet-box {
  width: min(100%, 760px);
  max-height: calc(100dvh - 16px);
  border-radius: 24px;
}

body.platform-mobile #mobile-skills-modal .modal-body {
  max-height: none;
  min-height: 0;
  overflow-y: auto;
}

body.platform-mobile .mobile-skills-body {
  padding: 0 14px 18px;
}

body.platform-mobile .mobile-skills-copy,
body.platform-mobile .mobile-skill-group {
  border-radius: 24px;
  padding: 16px;
}

body.platform-mobile .mobile-skills-surface-shell {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

body.platform-mobile #mobile-skills-surface-list {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(4px + env(safe-area-inset-bottom));
}

body.platform-mobile .mobile-skill-row {
  min-height: 94px;
  padding: 14px;
  border-radius: 20px;
}

body.platform-mobile #tab-skills-browser {
  overflow: hidden;
}

body.platform-mobile .skill-progress-card {
  padding: 16px;
  border-radius: 22px;
}

body.platform-mobile .skill-progress-title {
  font-size: 18px;
}

body.platform-mobile .skill-progress-level {
  min-width: 54px;
  font-size: 13px;
}

body.platform-mobile .tt-live-grid {
  grid-template-columns: 1fr;
}

body.platform-mobile .modal {
  padding: max(8px, env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
}

body.platform-mobile .modal-box {
  width: min(100%, 920px);
  max-height: calc(100dvh - 16px);
  border-radius: 20px;
}

body.platform-mobile .modal-body {
  max-height: calc(100dvh - 120px);
  overflow: auto;
}

body.platform-mobile .mobile-surface-kicker {
  font-size: 9px;
}

body.platform-mobile .mobile-surface-title {
  font-size: 15px;
}

body.platform-mobile .mobile-surface-copy {
  display: none;
}

body.platform-mobile .quest-modal-box,
body.platform-mobile .hof-modal-box,
body.platform-mobile #ge-modal .modal-box,
body.platform-mobile .admin-modal-box,
body.platform-mobile .bug-report-modal-box {
  width: min(100%, calc(100vw - 16px));
}

body.platform-mobile .item-context-menu.mobile-context-menu {
  left: 10px !important;
  right: 10px !important;
  width: auto;
  max-width: none !important;
}

body.platform-mobile.orientation-landscape #mobile-summary-bar {
  padding: 7px 10px;
}

body.platform-mobile.orientation-landscape .mobile-summary-inline {
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.95fr);
}

body.platform-mobile.orientation-landscape .mobile-combat-summary-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.platform-mobile.orientation-landscape .combat-mobile-actions {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.platform-mobile.orientation-landscape .combat-target-name-row {
  gap: 8px;
}

body.platform-mobile.orientation-landscape .combat-target {
  flex-direction: row;
  align-items: flex-end;
}

body.platform-mobile.orientation-landscape .combat-portrait-wrapper,
body.platform-mobile.orientation-landscape .combat-monster-img {
  width: 148px;
  height: 148px;
}

body.platform-mobile.orientation-landscape .combat-portrait-wrapper {
  align-self: auto;
}

body.platform-mobile.orientation-landscape .mobile-hero-skill-preview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.platform-mobile.orientation-landscape .mobile-hero-quick-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.platform-mobile.orientation-landscape .mobile-hero-action-btn:last-child {
  grid-column: auto;
}

body.platform-mobile.orientation-landscape .mobile-journey-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

body.platform-mobile.orientation-landscape #game-header {
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "brand settings";
  padding: 6px 8px;
  row-gap: 0;
}

body.platform-mobile.orientation-landscape .game-header-status-row {
  display: none;
}

body.platform-mobile.orientation-landscape .game-header-left {
  grid-template-columns: 28px minmax(0, 1fr);
}

body.platform-mobile.orientation-landscape .game-header-logo-frame {
  width: 28px;
  height: 28px;
}

body.platform-mobile.orientation-landscape .game-header-title {
  font-size: 13px;
}

@media (max-width: 420px) {
  .mobile-summary-inline,
  .mobile-combat-summary-head {
    grid-template-columns: 1fr;
  }

  .mobile-summary-inline-focus {
    max-width: none;
  }

  body.platform-mobile .mobile-hero-stat-grid {
    grid-template-columns: 1fr;
  }

  body.platform-mobile .tab-btn {
    min-width: 112px;
  }
}

/* ─── MOBILE POLISH PASS (2026-04-02) ───────────────────────────────────────
   Targeted improvements for scroll fill, embedded headers, nav safe-area,
   leaderboard layout, and small-screen journey grid.
────────────────────────────────────────────────────────────────────────────── */

/* Middle tab content: must flex-fill the remaining height below the tab bar
   so the inner scrollable panels (#combat-panel, #training-actions, etc.)
   actually get a bounded height and can scroll instead of being clipped. */
body.platform-mobile [data-tab-group="middle"][data-tab-content] {
  flex: 1 1 auto;
  min-height: 0;
}

/* Right tab content: same fix — fill remaining space below the right tab bar. */
body.platform-mobile [data-tab-group="right"][data-tab-content] {
  flex: 1 1 auto;
  min-height: 0;
}

/* Compact the embedded surface-top description headers in Adventure + Gear.
   These panels are used while gaming and the intro copy wastes scroll space. */
body.platform-mobile .mobile-surface-top--embedded {
  padding: 10px 16px 8px;
  gap: 2px;
}

body.platform-mobile .mobile-surface-top--embedded .mobile-surface-kicker {
  font-size: 9px;
}

body.platform-mobile .mobile-surface-top--embedded .mobile-surface-title {
  font-size: 14px;
  font-weight: 800;
}

body.platform-mobile .mobile-surface-top--embedded .mobile-surface-copy {
  display: none;
}

/* Nav bar safe-area: on devices with a home indicator the OS can intrude into
   the nav button area. Use safe-area-inset-bottom on the nav bar itself so the
   grid gap (from #game-screen padding) doesn't land under the home indicator. */
body.platform-mobile #mobile-nav-bar {
  padding-bottom: max(4px, env(safe-area-inset-bottom));
}

/* Leaderboard (Hall of Heroes) table on mobile — ensure rows don't overflow. */
body.platform-mobile .hof-table {
  font-size: 13px;
}

body.platform-mobile .hof-modal-box {
  max-height: calc(100dvh - 16px);
}

body.platform-mobile .hof-modal-body {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
  max-height: calc(100dvh - 96px);
}

body.platform-mobile .hof-player-name {
  font-size: 13px;
  line-height: 1.25;
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

body.platform-mobile .hof-player-meta {
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.platform-mobile .hof-value {
  font-size: 13px;
  min-width: 100px;
  justify-self: end;
  align-self: start;
}

body.platform-mobile .hof-table-row {
  grid-template-columns: 30px 18px minmax(0, 1fr) minmax(100px, auto);
  gap: 8px;
  padding: 10px 8px;
  align-items: start;
}

body.platform-mobile .hof-table-head {
  grid-template-columns: 30px 18px minmax(0, 1fr) minmax(100px, auto);
  gap: 8px;
  padding: 4px 8px 6px;
}

body.platform-mobile .hof-sidebar {
  display: flex;
  align-items: center;
  overflow-x: auto;
  scrollbar-width: none;
  gap: 8px;
  padding: 10px 14px;
  flex-wrap: nowrap;
  border-right: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.platform-mobile .hof-sidebar::-webkit-scrollbar {
  display: none;
}

body.platform-mobile .hof-sidebar-section {
  display: contents;
}

body.platform-mobile .hof-sidebar-label {
  display: none;
}

body.platform-mobile .hof-cat-btn {
  width: auto;
  flex: 0 0 auto;
  min-height: 38px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 11px;
  white-space: nowrap;
}

body.platform-mobile .hof-cat-btn.active {
  border-left: none;
  padding-left: 14px;
}

body.platform-mobile .hof-content {
  padding: 12px 12px calc(18px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

body.platform-mobile .hof-category-header {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 4px 10px;
}

body.platform-mobile .hof-mode-cell img {
  width: 16px;
  height: 16px;
}

body.platform-mobile .hof-search-input {
  font-size: 13px;
  padding: 8px 30px 8px 30px;
}

body.platform-mobile .hof-page-btn {
  width: 36px;
  height: 36px;
  font-size: 12px;
}

body.platform-mobile .hof-page-info {
  font-size: 12px;
}

/* Journey actions — single column on very narrow phones (< 375px) */
@media (max-width: 374px) {
  body.platform-mobile .mobile-journey-actions {
    grid-template-columns: 1fr;
  }
}

/* Auction House / GE modal — full width + scrollable body on mobile */
body.platform-mobile #ge-modal .modal-box {
  max-height: calc(100dvh - 16px);
}

body.platform-mobile #ge-modal .modal-body {
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}

/* Bank modal body safe scroll */
body.platform-mobile #bank-modal .modal-body {
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}

/* Quests modal safe scroll */
body.platform-mobile #quests-modal .modal-body {
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}

/* Milestones modal safe scroll */
body.platform-mobile #milestones-modal .modal-body {
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}

/* Settings / Cloud modal */
body.platform-mobile #settings-modal .modal-box {
  max-height: calc(100dvh - 16px);
}

body.platform-mobile #settings-modal .modal-body {
  max-height: calc(100dvh - 110px);
  overflow-y: auto;
}

/* Landscape: show nav bar buttons slightly smaller to preserve vertical space */
body.platform-mobile.orientation-landscape #mobile-nav-bar {
  gap: 4px;
}

body.platform-mobile.orientation-landscape .mobile-nav-btn {
  min-height: 40px;
  font-size: 7px;
  padding: 6px 2px;
}

/* Landscape: compact embedded surface headers even further */
body.platform-mobile.orientation-landscape .mobile-surface-top--embedded {
  padding: 6px 14px 6px;
}

body.platform-mobile.orientation-landscape .mobile-surface-top--embedded .mobile-surface-title {
  font-size: 12px;
}

/* Journey hero intro section: compact on landscape */
body.platform-mobile.orientation-landscape .mobile-journey-hero {
  padding: 0 2px 8px;
}

body.platform-mobile.orientation-landscape .mobile-journey-title {
  font-size: 16px;
}

body.platform-mobile.orientation-landscape .mobile-journey-copy,
body.platform-mobile.orientation-landscape .mobile-journey-mode-note {
  display: none;
}

/* ─── MOBILE RESCUE PASS — TAB DISPLAY + SCROLL CHAIN FIX (2026-04-02c) ─────
   initTabs() in main.js sets content.style.display = 'block' for all tabs
   that aren't in the flexColTabs set. On mobile, middle and right panel tab
   content divs MUST be display:flex so their inner flex:1 scroll containers
   (#training-actions, #combat-panel, #dungeons-panel, inventory grids, etc.)
   get a bounded height and can scroll instead of being clipped by
   overflow:hidden on the parent panel shell.

   CSS !important specifically overrides the JS-set inline style. This is the
   correct pattern: JS controls which tab is *visible*, CSS controls *layout*.
──────────────────────────────────────────────────────────────────────────────*/

/* Middle panel active tabs: must be flex-column so the inner scroller (flex:1)
   gets a real bounded height. Without this the inner div grows to content
   height, overflows, and gets clipped by #middle-panel overflow:hidden. */
body.platform-mobile [data-tab-group="middle"][data-tab-content].active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow: hidden !important;
}

/* Right panel active tabs: same fix. Equipment/devotion/tools already got
   flex from JS, but inventory/bounty/stats/tools did not. This normalises
   all right-panel tabs to flex-column with overflow-y scroll. */
body.platform-mobile [data-tab-group="right"][data-tab-content].active {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Right panel tab children: never let flex squash inner grids or lists */
body.platform-mobile [data-tab-group="right"][data-tab-content].active > * {
  flex-shrink: 0;
}

/* Inner scroll panels: restore useful padding now the flex chain is intact.
   The outer tab-content provides left/right inset via its own padding rule;
   these inner panels need bottom safe-area so the last card clears iOS home
   indicator when scrolled to the end. */
body.platform-mobile #combat-panel,
body.platform-mobile #training-actions,
body.platform-mobile #dungeons-panel {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding: 4px 0 calc(20px + env(safe-area-inset-bottom)) !important;
}

/* Monster list: same chain — flex:1, scroll to bottom with safe area */
body.platform-mobile #monster-list {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* Skills modal: set explicit height (not just max-height) so the modal-body
   flex:1 fills all available space rather than collapsing to min-content. */
body.platform-mobile #mobile-skills-modal .mobile-sheet-box {
  height: calc(100dvh - 16px);
}

/* Skills modal body: explicit flex fill + scroll */
body.platform-mobile #mobile-skills-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}

/* Training tab: add a short-cut button on mobile pointing to Skills screen */
body.platform-mobile .training-tab-empty {
  padding: 32px 20px 40px;
}

/* Right panel tab contents: safe-area bottom padding is on the container
   so content is never hidden under the iOS home bar */
body.platform-mobile [data-tab-group="right"][data-tab-content] {
  padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
}

/* Equipment + Stats tabs: ensure equip-stats section is reachable when scrolled */
body.platform-mobile #equip-stats {
  padding-bottom: 8px;
}

/* Devotion tab: fix flex-direction after JS override */
body.platform-mobile [data-tab-content="devotion"][data-tab-group="right"].active {
  overflow-y: auto !important;
  overflow-x: hidden !important;
}

/* Hazard footer watermark: hide on mobile — it overlaps the bottom nav bar */
body.platform-mobile #hazard-footer {
  display: none;
}

/* ─── GLOBAL SEARCH ─────────────────────────────────────────────────────────── */

.gs-modal {
  align-items: flex-start;
  padding-top: 12vh;
}

.gs-modal-box {
  width: min(640px, 96vw);
  padding: 0;
  border-radius: 18px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(14, 18, 28, 0.97);
  box-shadow: 0 24px 80px rgba(0,0,0,0.72), 0 0 0 1px rgba(212,175,55,0.08);
  overflow: hidden;
}

.gs-search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(212, 175, 55, 0.1);
}

.gs-search-icon {
  color: var(--text-gold);
  font-size: 15px;
  flex-shrink: 0;
}

.gs-input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  font-size: 16px;
  font-family: inherit;
  caret-color: var(--text-gold);
}

.gs-input::placeholder {
  color: rgba(201, 185, 154, 0.45);
}

.gs-esc-hint {
  font-size: 10px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}

.gs-results {
  max-height: 52vh;
  overflow-y: auto;
  padding: 6px 0;
}

.gs-empty {
  padding: 32px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.gs-category-header {
  padding: 8px 18px 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-gold);
  opacity: 0.7;
}

.gs-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 18px;
  cursor: pointer;
  transition: background 0.12s;
}

.gs-result:hover,
.gs-result.gs-result--focused {
  background: rgba(212, 175, 55, 0.08);
}

.gs-result-icon {
  font-size: 16px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-gold);
  opacity: 0.8;
}

.gs-result-body {
  flex: 1;
  min-width: 0;
}

.gs-result-label {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-result-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gs-result-tag {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-gold);
  opacity: 0.6;
  flex-shrink: 0;
}

/* RNG yield tag in action list */
.yield-rng-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #a78bfa;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 4px;
  padding: 1px 5px;
  vertical-align: middle;
}

/* Search nav button highlight */
.nav-btn--search {
  color: var(--text-gold);
  border-color: rgba(212, 175, 55, 0.25);
}

/* ─── CODEX UI FANTASY REFRESH PASS ─────────────────────────────────────── */
:root {
  --bg-panel: rgba(11, 15, 25, 0.9);
  --bg-panel-2: rgba(19, 25, 39, 0.92);
  --bg-panel-3: rgba(30, 37, 56, 0.9);
  --bg-input: rgba(6, 10, 19, 0.9);
  --border: rgba(129, 152, 197, 0.18);
  --border-gold: rgba(244, 198, 113, 0.46);
  --text-main: #e8dfcf;
  --text-bright: #fff4de;
  --text-muted: rgba(202, 202, 214, 0.72);
  --text-gold: #f5cf86;
  --text-blue: #8fd3ff;
  --text-purple: #c1a9ff;
  --accent: #7c67ff;
  --accent-hover: #9281ff;
  --shell-radius: 26px;
  --surface-radius: 18px;
  --surface-radius-sm: 14px;
  --panel-line: rgba(150, 169, 215, 0.16);
  --panel-line-strong: rgba(239, 195, 110, 0.32);
  --panel-shell:
    linear-gradient(180deg, rgba(22, 26, 38, 0.985), rgba(10, 11, 19, 0.965));
  --panel-shell-elevated:
    linear-gradient(180deg, rgba(25, 31, 46, 0.99), rgba(12, 14, 23, 0.975));
  --panel-strip:
    linear-gradient(180deg, rgba(39, 45, 67, 0.92), rgba(22, 25, 38, 0.94));
  --panel-shadow-xl:
    0 28px 52px rgba(1, 4, 11, 0.48),
    0 8px 22px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

html,
body {
  background:
    radial-gradient(circle at 50% 0%, rgba(246, 176, 94, 0.1), transparent 24%),
    radial-gradient(circle at 18% 6%, rgba(118, 100, 242, 0.13), transparent 28%),
    radial-gradient(circle at 82% 0%, rgba(90, 171, 255, 0.12), transparent 26%),
    #070911;
  color: var(--text-main);
}

body {
  text-shadow: none;
}

.screen {
  transition:
    opacity 0.34s ease,
    visibility 0.34s ease,
    transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
  transform: translateY(14px) scale(0.992);
}

.screen.is-visible {
  transform: translateY(0) scale(1);
}

#main-game-ui {
  background:
    linear-gradient(180deg, rgba(8, 10, 16, 0.18), rgba(4, 6, 10, 0.6)),
    radial-gradient(circle at 18% 18%, rgba(88, 188, 255, 0.12), transparent 20%),
    radial-gradient(circle at 78% 16%, rgba(130, 92, 255, 0.13), transparent 22%),
    radial-gradient(circle at 50% 100%, rgba(255, 176, 94, 0.09), transparent 28%),
    var(--titans-legacy-bg) var(--titans-legacy-bg-position)/cover no-repeat;
}

#main-game-ui::before {
  background:
    radial-gradient(circle at 50% 14%, rgba(255, 207, 120, 0.12), transparent 24%),
    radial-gradient(circle at 28% 90%, rgba(86, 156, 255, 0.08), transparent 24%),
    linear-gradient(180deg, rgba(6, 8, 14, 0.12), rgba(4, 5, 9, 0.42));
}

#main-game-ui::after {
  background:
    radial-gradient(circle at center, transparent 36%, rgba(4, 6, 10, 0.08) 78%, rgba(4, 6, 10, 0.22) 100%),
    linear-gradient(90deg, rgba(4, 6, 10, 0.16), transparent 14%, transparent 86%, rgba(4, 6, 10, 0.16)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 20%, rgba(4, 6, 10, 0.18));
}

#splash-screen .splash-shell {
  position: relative;
  overflow: hidden;
}

.splash-ambient-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.splash-ambient-layer::before {
  content: '';
  position: absolute;
  inset: -18%;
  background:
    linear-gradient(115deg, transparent 0 36%, rgba(255, 226, 173, 0.055) 46%, transparent 58%),
    radial-gradient(circle at 50% 22%, rgba(255, 213, 138, 0.16), transparent 26%);
  opacity: 0.9;
  transform: translate3d(-1.5%, 0, 0);
  animation: splashLightSweep 18s ease-in-out infinite;
}

.splash-ambient-glow {
  position: absolute;
  width: min(54vw, 520px);
  aspect-ratio: 1;
  border-radius: 50%;
  filter: blur(22px);
  opacity: 0.28;
  transform: translate3d(0, 0, 0);
}

.splash-ambient-glow--gold {
  left: -12%;
  bottom: -20%;
  background: radial-gradient(circle, rgba(255, 190, 98, 0.44), transparent 64%);
  animation: splashGlowDriftGold 14s ease-in-out infinite;
}

.splash-ambient-glow--blue {
  right: -14%;
  top: -18%;
  background: radial-gradient(circle, rgba(94, 171, 255, 0.34), transparent 62%);
  animation: splashGlowDriftBlue 16s ease-in-out infinite;
}

/* Hub panel: clip horizontal overflow (preserves border-radius decoration clipping)
   but allow vertical scroll so all character slots, Hall of Heroes, Patch Notes,
   and the footer remain reachable when content exceeds the viewport height. */
#char-select-hub .hub-panel {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}

#splash-screen .splash-shell::before,
#char-select-hub .hub-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at top left, rgba(255, 203, 128, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(108, 156, 255, 0.14), transparent 26%),
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.04) 34%, transparent 62%);
  opacity: 0.95;
}

.splash-shell {
  width: min(100%, 900px);
  gap: 18px;
  padding: 48px 44px 40px;
  border-radius: 34px;
  border: 1px solid rgba(240, 195, 117, 0.26);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 216, 139, 0.14), transparent 26%),
    radial-gradient(circle at 12% 16%, rgba(102, 172, 255, 0.14), transparent 22%),
    radial-gradient(circle at 88% 18%, rgba(154, 106, 255, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(23, 26, 39, 0.94), rgba(8, 10, 17, 0.94));
  box-shadow:
    0 36px 86px rgba(0, 0, 0, 0.5),
    0 14px 30px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(14px);
}

.splash-status-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: rgba(240, 217, 171, 0.76);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.splash-status-line span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid rgba(240, 200, 126, 0.2);
  background: rgba(255, 255, 255, 0.035);
}

.title-emblem {
  width: 112px;
  height: 112px;
  border-radius: 32px;
  border: 1px solid rgba(245, 202, 126, 0.32);
  background:
    radial-gradient(circle at 30% 26%, rgba(255, 236, 196, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(63, 46, 26, 0.9), rgba(22, 19, 15, 0.92));
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.34),
    0 0 26px rgba(245, 188, 92, 0.12),
    inset 0 1px 0 rgba(255, 249, 235, 0.12);
  animation: tlCrestFloat 6s ease-in-out infinite;
}

.title-emblem-logo {
  filter:
    drop-shadow(0 18px 26px rgba(0, 0, 0, 0.28))
    drop-shadow(0 0 16px rgba(245, 188, 92, 0.14));
}

.title-logo {
  font-size: clamp(40px, 5.2vw, 64px);
  letter-spacing: 0.2em;
  color: #fff1cf;
  text-shadow:
    0 0 24px rgba(255, 195, 91, 0.16),
    0 10px 24px rgba(0, 0, 0, 0.4);
}

.title-subtitle {
  color: rgba(225, 232, 247, 0.82);
  max-width: 620px;
  letter-spacing: 0.14em;
  line-height: 1.5;
}

.platform-launch-panel {
  border-radius: 24px;
  border-color: rgba(240, 194, 110, 0.28);
  background:
    radial-gradient(circle at top left, rgba(255, 210, 129, 0.1), transparent 30%),
    radial-gradient(circle at top right, rgba(101, 167, 255, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(29, 32, 47, 0.96), rgba(12, 15, 25, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 231, 0.04),
    0 20px 38px rgba(0, 0, 0, 0.26);
}

.platform-launch-copy,
.platform-launch-note,
.hub-copy,
.hub-community-copy,
.hub-cloud-user-email,
.hub-cloud-account-meta,
.cloud-account-meta {
  color: rgba(226, 223, 233, 0.78);
}

.platform-choice-btn {
  border-color: rgba(155, 173, 214, 0.16);
  border-radius: 20px;
  background:
    radial-gradient(circle at top left, rgba(255, 203, 128, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(32, 35, 51, 0.98), rgba(14, 16, 27, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 26px rgba(0, 0, 0, 0.18);
}

.platform-choice-btn:hover {
  border-color: rgba(239, 196, 115, 0.36);
  background:
    radial-gradient(circle at top left, rgba(255, 216, 145, 0.13), transparent 36%),
    linear-gradient(180deg, rgba(39, 42, 61, 0.99), rgba(16, 18, 30, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 18px 32px rgba(0, 0, 0, 0.22);
  transform: translateY(-2px);
}

.platform-choice-btn.active {
  border-color: rgba(246, 202, 120, 0.44);
  background:
    radial-gradient(circle at top left, rgba(255, 218, 145, 0.18), transparent 36%),
    radial-gradient(circle at bottom right, rgba(129, 103, 255, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(51, 43, 31, 0.98), rgba(20, 18, 27, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 245, 216, 0.08),
    0 18px 34px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(248, 213, 142, 0.08);
}

.splash-play-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 30px 0 22px;
  border-radius: 18px;
  border: 1px solid rgba(252, 211, 142, 0.38);
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 248, 225, 0.2), transparent 24%),
    linear-gradient(135deg, rgba(255, 181, 94, 0.98), rgba(132, 105, 255, 0.95));
  color: #180f17;
  box-shadow:
    0 18px 34px rgba(66, 47, 146, 0.32),
    0 10px 24px rgba(255, 169, 73, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.splash-play-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.22);
  color: rgba(24, 15, 23, 0.9);
}

.splash-play-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1;
}

.splash-play-label {
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.splash-play-subline {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  color: rgba(24, 15, 23, 0.74);
}

.splash-play-btn:hover {
  transform: translateY(-2px);
  box-shadow:
    0 22px 40px rgba(66, 47, 146, 0.38),
    0 12px 28px rgba(255, 169, 73, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
}

.hub-panel {
  border-radius: 32px;
  border-color: rgba(238, 194, 116, 0.24);
  background:
    radial-gradient(circle at top left, rgba(244, 199, 118, 0.12), transparent 24%),
    radial-gradient(circle at top right, rgba(102, 171, 255, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(17, 20, 31, 0.95), rgba(8, 10, 18, 0.95));
  box-shadow:
    0 36px 92px rgba(0, 0, 0, 0.58),
    0 14px 32px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.hub-title {
  font-size: clamp(30px, 3.2vw, 42px);
  color: #fff0d0;
  letter-spacing: 0.03em;
}

.hub-kicker,
.hub-column-eyebrow {
  color: rgba(240, 208, 149, 0.68);
}

.hub-column {
  position: relative;
  border-radius: 22px;
  border-color: rgba(151, 170, 214, 0.16);
  background:
    linear-gradient(180deg, rgba(26, 30, 45, 0.98), rgba(12, 14, 23, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 34px rgba(0, 0, 0, 0.18);
}

.hub-column:nth-child(1) {
  background:
    radial-gradient(circle at top left, rgba(247, 198, 109, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(29, 30, 42, 0.98), rgba(12, 14, 23, 0.97));
}

.hub-column:nth-child(2) {
  background:
    radial-gradient(circle at top left, rgba(110, 185, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(24, 31, 47, 0.98), rgba(11, 14, 23, 0.97));
}

.hub-column:nth-child(3) {
  background:
    radial-gradient(circle at top left, rgba(166, 111, 255, 0.14), transparent 30%),
    linear-gradient(180deg, rgba(29, 27, 47, 0.98), rgba(12, 14, 23, 0.97));
}

.hub-column-title {
  color: #fff2d6;
}

.cs-slot-card,
.cloud-slot-row,
.save-conflict-card,
.admin-summary-card,
.admin-key-card,
.admin-report-card,
.closed-beta-summary,
.bug-report-context {
  border-radius: 18px;
  border-color: rgba(153, 174, 221, 0.16);
  background:
    linear-gradient(180deg, rgba(27, 31, 45, 0.98), rgba(13, 15, 24, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 30px rgba(0, 0, 0, 0.14);
}

.cs-slot-card:hover,
.cloud-slot-row:hover,
.admin-report-card:hover {
  border-color: rgba(239, 196, 115, 0.28);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 22px 36px rgba(0, 0, 0, 0.18);
}

#game-header {
  min-height: 58px;
  height: 58px;
  border-color: rgba(240, 195, 110, 0.28);
  background:
    linear-gradient(135deg, rgba(27, 31, 46, 0.97), rgba(13, 16, 27, 0.95)),
    radial-gradient(circle at top, rgba(237, 192, 102, 0.16), transparent 34%);
  box-shadow:
    0 24px 44px rgba(0, 0, 0, 0.34),
    0 10px 24px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.game-header-logo-frame {
  border-color: rgba(244, 204, 126, 0.34);
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 240, 201, 0.18), transparent 26%),
    linear-gradient(180deg, rgba(72, 53, 28, 0.94), rgba(33, 25, 19, 0.94));
}

.game-header-title {
  letter-spacing: 0.14em;
  color: #fff3d6;
}

.panel {
  border-color: var(--panel-line);
  background:
    linear-gradient(180deg, rgba(23, 26, 38, 0.98), rgba(10, 12, 19, 0.96));
  box-shadow: var(--panel-shadow-xl);
}

#left-panel {
  background:
    radial-gradient(circle at top left, rgba(90, 174, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(23, 26, 38, 0.98), rgba(10, 12, 19, 0.96));
}

#middle-panel {
  background:
    radial-gradient(circle at top left, rgba(246, 193, 108, 0.11), transparent 30%),
    radial-gradient(circle at top right, rgba(128, 100, 255, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(24, 28, 42, 0.985), rgba(10, 12, 19, 0.965));
}

#right-panel {
  background:
    radial-gradient(circle at top right, rgba(102, 171, 255, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(25, 31, 46, 0.99), rgba(11, 13, 22, 0.97));
}

.panel-header,
.modal-header {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(42, 47, 70, 0.95), rgba(22, 25, 38, 0.96));
}

.panel-header::after,
.modal-header::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.06) 46%, transparent 70%);
  opacity: 0.55;
}

#char-info {
  background:
    radial-gradient(circle at top left, rgba(255, 209, 129, 0.1), transparent 32%),
    linear-gradient(180deg, rgba(33, 36, 52, 0.98), rgba(16, 18, 27, 0.96));
}

.char-name {
  color: #fff5e2;
}

.char-cb,
.skill-progress-level,
.mobile-hero-chip,
.mobile-quest-marks,
.quest-modal-marks {
  box-shadow: inset 0 1px 0 rgba(255, 246, 224, 0.06);
}

.skill-tile {
  min-height: 88px;
  padding: 10px 11px;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 0 10px;
  border-radius: 14px;
  border-color: rgba(160, 177, 218, 0.14);
  background:
    linear-gradient(180deg, rgba(29, 33, 49, 0.98), rgba(14, 16, 25, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 10px 18px rgba(0, 0, 0, 0.1);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.skill-tile:hover {
  border-color: rgba(238, 196, 114, 0.28);
  background:
    radial-gradient(circle at top left, rgba(252, 205, 129, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(35, 39, 57, 0.99), rgba(16, 18, 28, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 26px rgba(0, 0, 0, 0.14);
  transform: translateY(-2px);
}

.skill-tile.is-focused {
  border-color: rgba(111, 189, 255, 0.3);
  background:
    radial-gradient(circle at top left, rgba(97, 177, 255, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(25, 34, 53, 0.99), rgba(13, 16, 27, 0.97));
}

.skill-tile.is-training {
  border-color: rgba(246, 203, 121, 0.34);
  background:
    radial-gradient(circle at top left, rgba(249, 205, 123, 0.16), transparent 34%),
    radial-gradient(circle at top right, rgba(122, 95, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(42, 34, 45, 0.99), rgba(17, 16, 26, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 250, 238, 0.05),
    0 18px 30px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(249, 205, 123, 0.08);
}

.skill-art-icon {
  border-radius: 10px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 236, 194, 0.18), transparent 28%),
    linear-gradient(180deg, rgba(74, 59, 32, 0.9), rgba(25, 22, 17, 0.92));
  border-color: rgba(240, 195, 110, 0.2);
}

.skill-name,
.monster-name,
.quest-detail-title,
.bounty-master-name,
.dungeon-card-name,
.shop-card-name,
.tool-card-title,
.hof-category-title,
.hof-player-name,
.bestiary-name,
.archive-title-name,
.milestone-achievement-name {
  color: #fff4dd;
}

.skill-progress-card,
.tt-live-card,
.tt-live-empty,
.combat-target,
.combat-stat,
.combat-automation-card,
.fallen-loot-panel,
.devotion-summary-card,
.prayer-tile,
.stats-card,
.bounty-master-card,
.bounty-task-card,
.shop-card,
.tool-card,
.quest-row,
.quest-detail-section,
.quest-detail-pane,
.bestiary-row,
.hof-table-row,
.milestone-achievement-card,
.archive-realm-title-card,
.title-archive-summary-card,
.archive-skill-title-card,
.mobile-hero-card,
.mobile-hero-section-card,
.mobile-activity-shell,
.mobile-skill-group,
.mobile-skills-copy {
  border-radius: 18px;
  border-color: rgba(156, 176, 219, 0.14);
  background:
    linear-gradient(180deg, rgba(29, 33, 49, 0.98), rgba(13, 15, 24, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 28px rgba(0, 0, 0, 0.14);
}

.training-action,
.ge-result-row,
.ge-quick-item,
.dungeon-card,
.dungeon-detail-panel,
.quest-row,
.shop-item,
.outfit-entry,
.admin-report-detail,
.save-conflict-line {
  border-radius: 16px;
  border-color: rgba(156, 176, 219, 0.14);
  background:
    linear-gradient(180deg, rgba(29, 33, 49, 0.98), rgba(13, 15, 24, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 14px 24px rgba(0, 0, 0, 0.12);
}

.training-action,
.monster-card,
.dungeon-card,
.quest-row,
.shop-card,
.tool-card,
.milestone-achievement-card,
.archive-realm-title-card,
.hof-table-row,
.bestiary-row,
.ge-result-row {
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease;
}

.training-action:hover,
.monster-card:hover,
.dungeon-card:hover,
.quest-row:hover,
.shop-card:hover,
.tool-card:hover,
.milestone-achievement-card:hover,
.archive-realm-title-card:hover,
.hof-table-row:hover,
.bestiary-row:hover,
.ge-result-row:hover {
  transform: translateY(-2px);
  border-color: rgba(239, 196, 115, 0.28);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 20px 34px rgba(0, 0, 0, 0.16);
}

.training-action.active,
.monster-card.active,
.quest-row.is-selected,
.lore-card.active,
.prayer-tile.active,
.right-tab.active,
.tab-btn.active,
.mobile-nav-btn.active,
.archive-view-btn.active {
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 234, 0.07),
    0 20px 36px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(247, 208, 127, 0.1);
}

.training-action.active {
  border-color: rgba(247, 208, 127, 0.34);
  background:
    radial-gradient(circle at top left, rgba(247, 208, 127, 0.18), transparent 34%),
    radial-gradient(circle at top right, rgba(117, 97, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(45, 36, 52, 0.99), rgba(18, 17, 28, 0.97));
  animation: tlActiveCardPulse 3.6s ease-in-out infinite;
}

.monster-card.active,
.combat-target,
.fight-btn.fighting {
  border-color: rgba(255, 146, 109, 0.34);
  background:
    radial-gradient(circle at top left, rgba(255, 154, 110, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(123, 95, 255, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(48, 31, 40, 0.98), rgba(18, 14, 22, 0.96));
}

.quest-row.is-selected,
.quest-detail-pane,
.quest-detail-section {
  border-color: rgba(104, 182, 255, 0.26);
  background:
    radial-gradient(circle at top left, rgba(103, 181, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(27, 33, 49, 0.99), rgba(13, 16, 25, 0.97));
}

.tt-live-summary,
.tt-actions-heading,
.quest-filter-row,
.leaderboard-controls,
.mobile-quests-toolbar,
.shops-header,
.dungeon-tab-hero,
.milestone-archive-section,
.patch-notes-version-stamp {
  border-radius: 18px;
  border: 1px solid rgba(156, 176, 219, 0.14);
  background:
    linear-gradient(180deg, rgba(31, 36, 54, 0.96), rgba(15, 18, 28, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 26px rgba(0, 0, 0, 0.12);
}

.tt-live-summary,
.quest-filter-row,
.leaderboard-controls,
.mobile-quests-toolbar {
  padding: 12px 14px;
}

.tt-live-card-label,
.tt-actions-heading,
.quest-filter-label,
.milestone-archive-heading,
.shops-header-sub,
.quest-detail-subtitle,
.quest-detail-label,
.dungeon-card-label,
.dungeon-detail-label,
.dungeon-detail-subtitle,
.hof-sidebar-label {
  color: rgba(240, 209, 148, 0.72);
}

.consume-row,
.consume-item,
.tt-live-consumes .consume-item {
  border-radius: 999px;
}

.consume-item,
.quest-detail-meta-chip,
.dungeon-chip,
.mobile-summary-inline-focus,
.mobile-combat-pill,
.mobile-combat-summary-focus,
.admin-key-state,
.admin-report-pill,
.closed-beta-status,
.save-conflict-pill,
.cs-slot-flag,
.bounty-badge,
.bounty-req-tag,
.dungeon-card-state,
.mobile-skill-row-cta {
  border-color: rgba(157, 178, 220, 0.16);
  background: rgba(255, 255, 255, 0.055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.quest-detail-meta-chip.is-titan,
.mobile-skill-row-cta,
.dungeon-card.unlocked .dungeon-card-state,
.skill-progress-meta-pill--mastered {
  border-color: rgba(74, 222, 128, 0.22);
  background: rgba(74, 222, 128, 0.09);
}

.dungeon-chip.is-threat,
.ui-tt-chip.quest {
  background: rgba(140, 112, 255, 0.12);
  border-color: rgba(168, 132, 255, 0.18);
}

.action-header,
.combat-target-head,
.tool-card-header,
.shop-detail-header,
.quest-detail-header,
.milestone-achievement-head,
.archive-title-card-head {
  gap: 12px;
}

.search-row,
.ge-search-row,
.quest-filter-row .search-input,
.hof-search-input,
.cloud-input,
.cc-name-input,
.export-area,
.import-area {
  border-radius: 16px;
}

.search-row,
.ge-search-row,
.cloud-input,
.cc-name-input,
.hof-search-input,
.export-area,
.import-area {
  border-color: rgba(158, 179, 220, 0.18);
  background:
    linear-gradient(180deg, rgba(14, 18, 30, 0.94), rgba(8, 11, 19, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.search-row:focus-within,
.ge-search-row:focus-within,
.cloud-input:focus,
.cc-name-input:focus,
.hof-search-input:focus,
.export-area:focus,
.import-area:focus {
  border-color: rgba(244, 199, 118, 0.38);
  box-shadow:
    0 0 0 1px rgba(244, 199, 118, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.tab-btn,
.right-tab,
.nav-btn,
.mobile-nav-btn,
.archive-view-btn,
.hof-cat-btn {
  transition:
    transform 0.14s ease,
    border-color 0.14s ease,
    background 0.14s ease,
    color 0.14s ease,
    box-shadow 0.14s ease;
}

.tab-btn:hover,
.right-tab:hover,
.nav-btn:hover,
.mobile-nav-btn:hover,
.archive-view-btn:hover,
.hof-cat-btn:hover {
  transform: translateY(-1px);
}

.tab-btn.active,
.right-tab.active,
.mobile-nav-btn.active,
.archive-view-btn.active,
.hof-cat-btn.active {
  border-color: rgba(245, 203, 122, 0.34);
  background:
    radial-gradient(circle at top, rgba(246, 204, 123, 0.16), transparent 74%),
    linear-gradient(180deg, rgba(60, 50, 37, 0.98), rgba(22, 20, 28, 0.96));
  color: #fff6ea;
}

.right-tab.active i,
.mobile-nav-btn.active i,
.hof-cat-btn.active i {
  color: #f7d99e;
}

.nav-btn,
.mobile-nav-btn,
.right-tab,
.tab-btn,
.btn-outline,
.btn-primary,
.fight-btn,
.train-btn,
.quest-action-btn,
.shop-visit-btn,
.tool-upgrade-btn,
.shop-btn,
.ge-action-btn,
.ge-confirm-btn,
.ge-cancel-btn,
.cs-play-btn,
.cs-delete-btn,
.cs-create-btn,
.splash-play-btn,
.platform-choice-btn,
.dungeon-card-btn,
.unlock-notice-btn,
.mobile-hero-action-btn,
.mobile-hero-inline-link,
.mobile-skill-row,
.mobile-journey-card {
  transition:
    transform 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.skill-tile,
.training-action,
.monster-card,
.dungeon-card,
.quest-row,
.shop-card,
.tool-card,
.bestiary-row,
.hof-table-row,
.mobile-skill-row,
.mobile-journey-card,
.cs-slot-card,
.inv-slot,
.bank-slot,
.equip-slot {
  -webkit-tap-highlight-color: transparent;
}

.nav-btn:active:not(:disabled),
.mobile-nav-btn:active:not(:disabled),
.right-tab:active:not(:disabled),
.tab-btn:active:not(:disabled),
.btn-outline:active:not(:disabled),
.btn-primary:active:not(:disabled),
.fight-btn:active:not(:disabled),
.train-btn:active:not(:disabled),
.quest-action-btn:active:not(:disabled),
.shop-visit-btn:active:not(:disabled),
.tool-upgrade-btn:active:not(:disabled),
.shop-btn:active:not(:disabled),
.ge-action-btn:active:not(:disabled),
.ge-confirm-btn:active:not(:disabled),
.ge-cancel-btn:active:not(:disabled),
.cs-play-btn:active:not(:disabled),
.cs-delete-btn:active:not(:disabled),
.cs-create-btn:active:not(:disabled),
.splash-play-btn:active:not(:disabled),
.platform-choice-btn:active:not(:disabled),
.dungeon-card-btn:active:not(:disabled),
.unlock-notice-btn:active:not(:disabled),
.mobile-hero-action-btn:active:not(:disabled),
.mobile-skill-row:active:not(:disabled),
.mobile-journey-card:active:not(:disabled) {
  transform: translateY(1px);
}

.skill-tile:active,
.training-action:active,
.monster-card:active,
.dungeon-card:active,
.quest-row:active,
.mobile-skill-row:active,
.mobile-journey-card:active,
.cs-slot-card:active,
.inv-slot:active,
.bank-slot:active,
.equip-slot:active {
  transform: translateY(1px) scale(0.995);
}

.nav-btn:focus-visible,
.mobile-nav-btn:focus-visible,
.right-tab:focus-visible,
.tab-btn:focus-visible,
.btn-outline:focus-visible,
.btn-primary:focus-visible,
.fight-btn:focus-visible,
.train-btn:focus-visible,
.quest-action-btn:focus-visible,
.shop-visit-btn:focus-visible,
.tool-upgrade-btn:focus-visible,
.shop-btn:focus-visible,
.ge-action-btn:focus-visible,
.ge-confirm-btn:focus-visible,
.ge-cancel-btn:focus-visible,
.dungeon-card-btn:focus-visible,
.mobile-hero-action-btn:focus-visible,
.mobile-skill-row:focus-visible,
.mobile-journey-card:focus-visible,
.skill-tile:focus-visible,
.training-action:focus-visible,
.monster-card:focus-visible,
.dungeon-card:focus-visible,
.quest-row:focus-visible,
.cs-slot-card:focus-visible,
.inv-slot:focus-visible,
.bank-slot:focus-visible,
.equip-slot:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px rgba(244, 199, 118, 0.18),
    0 0 0 5px rgba(92, 143, 229, 0.14),
    0 18px 34px rgba(0, 0, 0, 0.18);
}

.btn-outline,
.ge-cancel-btn,
.quest-action-btn[data-quest-action="pause"],
.quest-action-btn[data-quest-action="blocked"],
.archive-view-btn,
.hof-cat-btn {
  border-color: rgba(156, 176, 219, 0.16);
  background:
    linear-gradient(180deg, rgba(30, 34, 50, 0.98), rgba(14, 17, 27, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 18px rgba(0, 0, 0, 0.12);
}

.btn-primary,
.train-btn,
.quest-action-btn[data-quest-action="start"],
.quest-action-btn[data-quest-action="resume"],
.shop-visit-btn,
.tool-upgrade-btn:not(.disabled),
.shop-btn--convert,
.shop-btn--outfit,
.ge-action-btn,
.ge-confirm-btn,
.cs-play-btn,
.cs-create-btn,
.unlock-notice-btn,
.dungeon-card-btn.btn-primary {
  border: 1px solid rgba(207, 190, 255, 0.36);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.16), transparent 24%),
    linear-gradient(135deg, rgba(102, 92, 255, 0.98), rgba(76, 147, 255, 0.96));
  color: #fdfaf3;
  box-shadow:
    0 14px 26px rgba(71, 73, 176, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.btn-primary:hover:not(:disabled),
.train-btn:hover:not(:disabled),
.quest-action-btn[data-quest-action="start"]:hover:not(:disabled),
.quest-action-btn[data-quest-action="resume"]:hover:not(:disabled),
.shop-visit-btn:hover:not(:disabled),
.tool-upgrade-btn:hover:not(:disabled),
.shop-btn--convert:hover:not(:disabled),
.shop-btn--outfit:hover:not(:disabled),
.ge-action-btn:hover:not(:disabled),
.ge-confirm-btn:hover:not(:disabled),
.cs-play-btn:hover:not(:disabled),
.cs-create-btn:hover:not(:disabled),
.unlock-notice-btn:hover:not(:disabled) {
  box-shadow:
    0 18px 32px rgba(71, 73, 176, 0.34),
    0 10px 20px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.fight-btn,
.btn-danger,
.combat-panel-retreat,
.mobile-combat-retreat-btn {
  border: 1px solid rgba(255, 175, 142, 0.3);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.16), transparent 24%),
    linear-gradient(135deg, rgba(255, 142, 96, 0.98), rgba(191, 70, 102, 0.96));
  color: #fff5ee;
  box-shadow:
    0 14px 26px rgba(150, 54, 72, 0.28),
    0 8px 18px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

.fight-btn:hover:not(:disabled),
.btn-danger:hover:not(:disabled),
.combat-panel-retreat:hover:not(:disabled),
.mobile-combat-retreat-btn:hover:not(:disabled) {
  box-shadow:
    0 18px 32px rgba(150, 54, 72, 0.34),
    0 10px 20px rgba(0, 0, 0, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.combat-stats-row {
  gap: 12px;
}

.combat-stat {
  padding: 12px 10px;
  border: 1px solid rgba(157, 176, 219, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(27, 31, 46, 0.98), rgba(12, 14, 23, 0.96));
}

.style-btn {
  border-radius: 14px;
  border-color: rgba(157, 176, 219, 0.18);
  background:
    linear-gradient(180deg, rgba(26, 29, 44, 0.98), rgba(13, 15, 24, 0.96));
  color: rgba(232, 224, 210, 0.72);
}

.style-btn.active {
  border-color: rgba(246, 203, 122, 0.3);
  background:
    radial-gradient(circle at top, rgba(246, 203, 122, 0.16), transparent 72%),
    linear-gradient(180deg, rgba(59, 50, 36, 0.98), rgba(23, 19, 26, 0.96));
  color: #fff5e7;
}

.fallen-loot-panel {
  border-color: rgba(246, 203, 122, 0.24);
  background:
    radial-gradient(circle at top left, rgba(246, 203, 122, 0.16), transparent 30%),
    radial-gradient(circle at top right, rgba(108, 171, 255, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(36, 36, 49, 0.98), rgba(15, 17, 27, 0.96));
}

.fallen-loot-chip,
.dungeon-hero-chip.is-unlocked,
.save-conflict-pill.is-newer {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#inventory-grid,
#bank-grid {
  gap: 10px;
}

.inv-slot,
.bank-slot,
.equip-slot {
  border-color: rgba(160, 177, 218, 0.16);
  transition:
    transform 0.12s ease,
    border-color 0.12s ease,
    background 0.12s ease,
    box-shadow 0.12s ease;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 20px rgba(0, 0, 0, 0.1);
}

.inv-slot.filled,
.bank-slot.filled,
.equip-slot.filled {
  border-color: rgba(240, 195, 110, 0.18);
  background:
    radial-gradient(circle at top left, rgba(245, 202, 121, 0.12), transparent 28%),
    linear-gradient(180deg, rgba(40, 36, 48, 0.98), rgba(18, 17, 26, 0.96));
}

.inv-slot:hover,
.bank-slot:hover,
.equip-slot:hover {
  transform: translateY(-1px);
  border-color: rgba(240, 195, 110, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 16px 24px rgba(0, 0, 0, 0.14);
}

.item-context-menu {
  border-radius: 20px;
  backdrop-filter: blur(14px) saturate(1.05);
}

.item-menu-btn,
.ge-preset-btn,
.hof-page-btn,
.shop-back-btn,
.mobile-surface-back-btn {
  border-radius: 12px;
}

.item-menu-btn {
  transition:
    transform 0.12s ease,
    background 0.12s ease,
    border-color 0.12s ease,
    box-shadow 0.12s ease;
}

.item-menu-btn:hover {
  transform: translateY(-1px);
}

.quest-row {
  border-width: 1px;
}

.quest-row.status-ready {
  border-color: rgba(84, 214, 124, 0.24);
}

.quest-row.status-blocked {
  border-color: rgba(255, 151, 132, 0.2);
}

.quest-detail-pane,
.quest-detail-section.section-span-2 {
  gap: 14px;
}

.quest-action-btn {
  border-radius: 14px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 10px 18px rgba(0, 0, 0, 0.12);
}

.quest-stage-meter,
.quest-stage-fill,
.skill-progress-track,
.tt-xp-bar-bg,
.mobile-skill-row-bar,
.tool-progress-wrap {
  border-radius: 999px;
}

.patch-notes-version-stamp {
  margin-bottom: 16px;
}

.patch-notes-version-label {
  color: #fff3d9;
}

.patch-notes-date {
  color: rgba(200, 208, 223, 0.72);
}

.patch-notes-list li {
  margin-bottom: 8px;
  color: rgba(230, 226, 235, 0.8);
}

.bestiary-row,
.hof-table-row {
  padding: 12px 14px;
}

.hof-table-row.rank-1,
.hof-table-row.rank-2,
.hof-table-row.rank-3 {
  background:
    linear-gradient(180deg, rgba(37, 34, 50, 0.98), rgba(17, 16, 25, 0.96));
}

.milestone-achievement-card.is-ready,
.archive-realm-title-card.is-unlocked,
.archive-realm-title-card.is-equipped {
  background:
    radial-gradient(circle at top left, rgba(246, 203, 122, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(42, 37, 51, 0.98), rgba(17, 16, 26, 0.96));
}

.modal {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-box {
  opacity: 0;
  transform: translateY(18px) scale(0.985);
  border-color: rgba(239, 194, 110, 0.28);
  background:
    radial-gradient(circle at top left, rgba(244, 199, 118, 0.12), transparent 28%),
    radial-gradient(circle at top right, rgba(103, 173, 255, 0.1), transparent 24%),
    linear-gradient(180deg, rgba(24, 28, 42, 0.99), rgba(9, 11, 18, 0.98));
  transition:
    opacity 0.2s ease,
    transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.modal.open .modal-box {
  opacity: 1;
  transform: translateY(0) scale(1);
}

#game-log,
#chat-bar {
  border-color: rgba(157, 176, 219, 0.14);
  background:
    linear-gradient(180deg, rgba(14, 18, 29, 0.96), rgba(8, 10, 18, 0.94));
}

#game-log {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 28px rgba(0, 0, 0, 0.14);
}

#chat-send-btn {
  border-color: rgba(240, 196, 114, 0.2);
}

#nav-bar {
  gap: 10px;
}

.nav-btn {
  border-color: rgba(157, 176, 219, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 20px rgba(0, 0, 0, 0.12);
}

.nav-btn--search {
  background:
    radial-gradient(circle at top, rgba(246, 203, 122, 0.16), transparent 68%),
    linear-gradient(180deg, rgba(50, 42, 31, 0.98), rgba(19, 18, 24, 0.96));
}

#ge-modal .modal-box {
  width: min(760px, 96vw);
}

.ge-top-bar {
  background:
    linear-gradient(180deg, rgba(29, 35, 52, 0.98), rgba(15, 19, 30, 0.96));
  border-bottom-color: rgba(157, 176, 219, 0.14);
}

.ge-mode-tab {
  border-radius: 16px 16px 0 0;
  border-color: rgba(157, 176, 219, 0.16);
  background:
    linear-gradient(180deg, rgba(34, 39, 58, 0.98), rgba(16, 19, 30, 0.96));
}

.ge-mode-tab.active {
  background:
    radial-gradient(circle at top, rgba(245, 202, 121, 0.14), transparent 72%),
    linear-gradient(180deg, rgba(54, 46, 34, 0.98), rgba(21, 19, 27, 0.96));
}

.ge-txn-box {
  border-top-color: rgba(157, 176, 219, 0.14);
  background:
    linear-gradient(180deg, rgba(24, 29, 44, 0.98), rgba(11, 13, 22, 0.96));
}

.mobile-hero-card,
.mobile-hero-section-card,
.mobile-activity-shell,
.mobile-skill-group,
.mobile-skills-copy,
.mobile-summary-pill,
.mobile-quests-toolbar,
.mobile-quest-detail-pane,
.mobile-combat-subview-body,
.mobile-journey-card,
.mobile-skill-row,
.mobile-nav-btn {
  border-color: rgba(158, 177, 220, 0.16);
}

.mobile-hero-card,
.mobile-hero-section-card,
.mobile-skill-group {
  background:
    radial-gradient(circle at top left, rgba(244, 199, 118, 0.11), transparent 30%),
    radial-gradient(circle at top right, rgba(104, 173, 255, 0.11), transparent 24%),
    linear-gradient(180deg, rgba(30, 34, 49, 0.98), rgba(12, 14, 23, 0.96));
}

.mobile-nav-btn.active,
body.platform-mobile .right-tab.active,
body.platform-mobile .tab-btn.active {
  background:
    radial-gradient(circle at top, rgba(246, 203, 122, 0.18), transparent 72%),
    linear-gradient(180deg, rgba(60, 50, 36, 0.99), rgba(21, 19, 28, 0.97));
}

body.platform-mobile .panel {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 22px 38px rgba(0, 0, 0, 0.24);
}

body.platform-mobile #mobile-summary-bar {
  border-color: rgba(157, 176, 219, 0.18);
  background:
    radial-gradient(circle at top left, rgba(97, 176, 255, 0.18), transparent 28%),
    radial-gradient(circle at top right, rgba(246, 203, 122, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(27, 31, 46, 0.98), rgba(11, 13, 22, 0.96));
}

body.platform-mobile #middle-panel[data-mobile-surface="combat"] #mobile-middle-surface-top {
  background:
    radial-gradient(circle at top left, rgba(255, 148, 106, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(35, 24, 31, 0.98), rgba(14, 11, 18, 0.96));
}

body.platform-mobile #middle-panel[data-mobile-surface="skills"] #mobile-middle-surface-top {
  background:
    radial-gradient(circle at top left, rgba(97, 176, 255, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(24, 29, 43, 0.98), rgba(12, 14, 23, 0.96));
}

body.platform-mobile #middle-panel[data-mobile-surface="bounty"] #mobile-middle-surface-top {
  background:
    radial-gradient(circle at top left, rgba(246, 203, 122, 0.2), transparent 32%),
    linear-gradient(180deg, rgba(36, 28, 22, 0.98), rgba(14, 12, 19, 0.96));
}

@keyframes tlCrestFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes splashLightSweep {
  0%, 100% { transform: translate3d(-1.5%, 0, 0); opacity: 0.74; }
  50% { transform: translate3d(1.5%, -1%, 0); opacity: 1; }
}

@keyframes splashGlowDriftGold {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(4%, -2%, 0) scale(1.04); }
}

@keyframes splashGlowDriftBlue {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-3%, 3%, 0) scale(1.03); }
}

@keyframes tlActiveCardPulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255, 248, 234, 0.07),
      0 20px 36px rgba(0, 0, 0, 0.2),
      0 0 0 1px rgba(247, 208, 127, 0.1);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255, 248, 234, 0.08),
      0 24px 40px rgba(0, 0, 0, 0.24),
      0 0 0 1px rgba(247, 208, 127, 0.16),
      0 0 26px rgba(247, 208, 127, 0.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen,
  .modal,
  .modal-box,
  .splash-ambient-layer::before,
  .splash-ambient-glow,
  .title-emblem,
  .training-action.active,
  .resume-loading-shell,
  .resume-loading-progress-track::after,
  .resume-loading-pulse-row span,
  .nav-btn,
  .mobile-nav-btn,
  .right-tab,
  .tab-btn,
  .platform-choice-btn,
  .skill-tile,
  .monster-card,
  .dungeon-card,
  .quest-row,
  .shop-card,
  .tool-card,
  .milestone-achievement-card,
  .archive-realm-title-card,
  .hof-table-row,
  .bestiary-row,
  .ge-result-row,
  .splash-play-btn,
  .btn-primary,
  .btn-outline,
  .fight-btn,
  .train-btn,
  .quest-action-btn,
  .tool-upgrade-btn,
  .shop-btn,
  .mobile-journey-card,
  .mobile-skill-row {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* ─── CODEX TRANSLUCENCY + FITTING PASS ─────────────────────────────────── */
:root {
  --panel-shell:
    linear-gradient(180deg, rgba(22, 26, 38, 0.9), rgba(9, 11, 18, 0.82));
  --panel-shell-elevated:
    linear-gradient(180deg, rgba(25, 31, 46, 0.92), rgba(10, 12, 21, 0.84));
  --panel-strip:
    linear-gradient(180deg, rgba(42, 48, 71, 0.84), rgba(19, 23, 37, 0.84));
}

.panel,
.modal-box,
.splash-shell,
.hub-panel {
  background-clip: padding-box;
}

.panel {
  background:
    linear-gradient(180deg, rgba(22, 26, 39, 0.9), rgba(9, 11, 18, 0.82));
  backdrop-filter: blur(5px) saturate(1.03);
}

.panel::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 214, 144, 0.08), transparent 26%),
    radial-gradient(circle at 84% 0%, rgba(94, 168, 255, 0.08), transparent 24%);
  opacity: 0.95;
}

#left-panel {
  background:
    radial-gradient(circle at top left, rgba(92, 178, 255, 0.13), transparent 30%),
    linear-gradient(180deg, rgba(23, 27, 40, 0.9), rgba(9, 11, 18, 0.82));
}

#middle-panel {
  background:
    radial-gradient(circle at top left, rgba(246, 196, 110, 0.12), transparent 30%),
    radial-gradient(circle at top right, rgba(125, 101, 255, 0.09), transparent 24%),
    linear-gradient(180deg, rgba(23, 28, 42, 0.88), rgba(9, 11, 18, 0.8));
}

#right-panel {
  background:
    radial-gradient(circle at top right, rgba(102, 173, 255, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(24, 31, 47, 0.9), rgba(10, 12, 21, 0.82));
}

#char-info,
.skill-progress-card,
.tt-live-summary,
.quest-detail-pane,
.dungeon-tab-hero,
.mobile-hero-card,
.mobile-hero-section-card,
.mobile-skill-group,
.mobile-activity-shell,
.mobile-skills-copy,
.mobile-quests-toolbar,
.mobile-quest-detail-pane,
.mobile-combat-subview-body,
.modal-box {
  background:
    radial-gradient(circle at top left, rgba(255, 214, 144, 0.07), transparent 28%),
    radial-gradient(circle at top right, rgba(97, 176, 255, 0.06), transparent 24%),
    linear-gradient(180deg, rgba(28, 33, 49, 0.94), rgba(10, 12, 20, 0.88));
}

.skill-tile,
.training-action,
.monster-card,
.quest-row,
.dungeon-card,
.ge-result-row,
.ge-quick-item,
.shop-card,
.tool-card,
.bestiary-row,
.hof-table-row,
.milestone-achievement-card,
.archive-realm-title-card,
.title-archive-summary-card,
.archive-skill-title-card,
.combat-stat,
.combat-automation-card,
.fallen-loot-panel,
.devotion-summary-card,
.prayer-tile,
.stats-card,
.bounty-master-card,
.bounty-task-card,
.mobile-skill-row,
.mobile-journey-card,
.mobile-summary-pill {
  background:
    linear-gradient(180deg, rgba(29, 34, 50, 0.84), rgba(12, 15, 24, 0.74));
  border-color: rgba(159, 178, 220, 0.16);
  backdrop-filter: none;
}

.training-action:hover,
.monster-card:hover,
.quest-row:hover,
.dungeon-card:hover,
.ge-result-row:hover,
.shop-card:hover,
.tool-card:hover,
.bestiary-row:hover,
.hof-table-row:hover,
.milestone-achievement-card:hover,
.archive-realm-title-card:hover,
.mobile-skill-row:hover,
.mobile-journey-card:hover {
  background:
    radial-gradient(circle at top left, rgba(255, 213, 144, 0.09), transparent 32%),
    linear-gradient(180deg, rgba(34, 39, 57, 0.9), rgba(14, 17, 27, 0.8));
}

#game-log,
#chat-bar,
.search-row,
.ge-search-row,
.quest-filter-row,
.leaderboard-controls,
.shops-header,
.patch-notes-version-stamp {
  background:
    linear-gradient(180deg, rgba(17, 21, 33, 0.84), rgba(8, 10, 17, 0.76));
}

.tab-btn,
.right-tab,
.nav-btn,
.mobile-nav-btn,
.archive-view-btn,
.hof-cat-btn {
  background:
    linear-gradient(180deg, rgba(31, 35, 52, 0.8), rgba(14, 17, 27, 0.76));
}

.tab-btn.active,
.right-tab.active,
.mobile-nav-btn.active,
.archive-view-btn.active,
.hof-cat-btn.active,
.nav-btn--search {
  background:
    radial-gradient(circle at top, rgba(246, 204, 123, 0.16), transparent 74%),
    linear-gradient(180deg, rgba(58, 49, 37, 0.88), rgba(20, 18, 27, 0.84));
}

.skill-bar-bg,
.skill-progress-track,
.mobile-skill-row-bar,
.tt-xp-bar-bg {
  background: rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}

.skill-bar-fill,
.skill-progress-fill,
.mobile-skill-row-fill,
.tt-xp-bar-fill {
  box-shadow:
    0 0 14px rgba(246, 204, 123, 0.14),
    0 0 8px rgba(97, 176, 255, 0.12);
}

#skills-panel {
  gap: 8px;
}

.skill-tile {
  min-height: 96px;
  padding: 11px 12px;
  align-items: start;
}

.skill-copy {
  gap: 4px;
}

.skill-head {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.skill-name {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  line-height: 1.15;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.skill-level {
  flex: 0 0 auto;
  margin-top: 1px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(244, 199, 118, 0.12);
  border: 1px solid rgba(244, 199, 118, 0.18);
  font-size: 10px;
  line-height: 1;
}

.skill-meta {
  align-items: center;
}

.skill-submeta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2px;
  font-size: 9px;
  line-height: 1.25;
  color: rgba(212, 219, 232, 0.72);
}

.skill-submeta span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.skill-submeta span:first-child {
  white-space: nowrap;
}

.skill-submeta span:last-child {
  white-space: normal;
  color: rgba(206, 201, 189, 0.66);
}

.mobile-skill-row {
  min-height: 94px;
  align-items: start;
}

.mobile-skill-row-top {
  align-items: flex-start;
}

.mobile-skill-row-name {
  min-width: 0;
  line-height: 1.18;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mobile-skill-row-level {
  flex-shrink: 0;
  white-space: nowrap;
}

.mobile-skill-row-xp {
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.mobile-hero-overview {
  align-items: stretch;
}

.mobile-hero-chip {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tt-live-card strong,
.mobile-summary-inline-focus strong,
.mobile-combat-summary-focus strong,
.mobile-combat-pill strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quest-row-main,
.dungeon-card-top,
.dungeon-card-footer,
.hof-player,
.bestiary-info {
  min-width: 0;
}

.modal {
  backdrop-filter: blur(6px) saturate(1.02);
}

.modal-box {
  backdrop-filter: blur(9px) saturate(1.03);
}

body.platform-mobile .panel {
  backdrop-filter: blur(3px) saturate(1.01);
}

body.platform-mobile .modal,
body.platform-mobile .mobile-quest-detail-screen,
body.platform-mobile .mobile-combat-subview {
  backdrop-filter: blur(4px);
}

body.platform-mobile .modal-box {
  backdrop-filter: blur(5px) saturate(1.02);
}

body.platform-mobile .mobile-skill-row,
body.platform-mobile .mobile-journey-card,
body.platform-mobile .mobile-nav-btn,
body.platform-mobile .right-tab,
body.platform-mobile .tab-btn {
  transition-duration: 0.12s;
}

@media (max-width: 1240px) {
  .skill-tile {
    min-height: 92px;
  }
}

/* ─── CHARACTER HUB COMMAND-DECK PASS ───────────────────────────────────── */
#char-select-hub .hub-panel {
  width: min(1460px, calc(100vw - 40px));
  padding: 40px 42px 34px;
  gap: 32px;
  border-radius: 34px;
  background:
    radial-gradient(circle at 10% 0%, rgba(255, 204, 122, 0.14), transparent 24%),
    radial-gradient(circle at 100% 0%, rgba(96, 169, 255, 0.14), transparent 24%),
    linear-gradient(180deg, rgba(19, 23, 35, 0.96), rgba(8, 10, 18, 0.95));
  box-shadow:
    0 42px 104px rgba(0, 0, 0, 0.58),
    0 18px 36px rgba(0, 0, 0, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#char-select-hub .hub-header {
  gap: 12px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(237, 196, 116, 0.14);
}

#char-select-hub .hub-copy,
#char-select-hub .hub-community-copy,
#char-select-hub .hub-cloud-account-meta,
#char-select-hub .hub-cloud-user-email {
  color: rgba(235, 232, 242, 0.84);
}

#char-select-hub .hub-copy {
  max-width: 860px;
  font-size: 14px;
  line-height: 1.65;
}

#char-select-hub .hub-status {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 16px;
  border-color: rgba(118, 152, 214, 0.22);
  background:
    linear-gradient(180deg, rgba(28, 36, 55, 0.92), rgba(15, 19, 31, 0.92));
  font-size: 13px;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(8px) saturate(1.02);
}

#char-select-hub .hub-grid {
  grid-template-columns: minmax(0, 1.45fr) minmax(360px, 0.95fr);
  grid-template-areas:
    "local cloud"
    "local community";
  gap: 28px;
}

#char-select-hub .hub-column {
  position: relative;
  padding: 26px 26px 24px;
  gap: 18px;
  border-radius: 24px;
  border-color: rgba(163, 183, 226, 0.16);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 24px 42px rgba(0, 0, 0, 0.2);
}

#char-select-hub .hub-column::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(140deg, rgba(255, 255, 255, 0.05), transparent 36%),
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.04), transparent 24%);
  opacity: 0.78;
}

#char-select-hub .hub-column > * {
  position: relative;
  z-index: 1;
}

#char-select-hub .hub-column-local {
  grid-area: local;
}

#char-select-hub .hub-column-cloud {
  grid-area: cloud;
}

#char-select-hub .hub-column-community {
  grid-area: community;
}

#char-select-hub .hub-column-header {
  gap: 8px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

#char-select-hub .hub-column-title {
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

#char-select-hub .hub-column-note {
  max-width: 54ch;
  font-size: 12.5px;
  line-height: 1.58;
  color: rgba(217, 214, 228, 0.74);
}

#char-select-hub .hub-save-slots {
  display: grid;
  gap: 16px;
}

#char-select-hub .hub-cloud-panel {
  gap: 14px;
}

#char-select-hub .hub-cloud-auth-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

#char-select-hub .hub-cloud-status.hub-cloud-toast,
#char-select-hub .cloud-save-status.hub-cloud-toast {
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 16px;
  border-color: rgba(110, 182, 255, 0.2);
  background:
    linear-gradient(180deg, rgba(20, 33, 52, 0.92), rgba(12, 19, 30, 0.9));
  color: rgba(237, 241, 249, 0.9);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#char-select-hub .hub-cloud-user-email {
  font-size: 15px;
  font-weight: 700;
  color: #fff3da;
}

#char-select-hub .hub-cloud-account-meta,
#char-select-hub .closed-beta-summary-copy,
#char-select-hub .cloud-slot-meta,
#char-select-hub .hub-community-copy {
  font-size: 12px;
  line-height: 1.58;
  color: rgba(225, 223, 236, 0.8);
}

#char-select-hub .closed-beta-panel {
  gap: 10px;
  margin: 4px 0 0;
}

#char-select-hub .closed-beta-summary,
#char-select-hub .cloud-slot-row {
  padding: 14px 16px;
  border-radius: 16px;
  border-color: rgba(163, 183, 226, 0.16);
  background:
    radial-gradient(circle at top left, rgba(255, 205, 128, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(28, 33, 48, 0.95), rgba(13, 16, 25, 0.93));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 16px 28px rgba(0, 0, 0, 0.12);
}

#char-select-hub .closed-beta-summary-title,
#char-select-hub .cloud-slot-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff4de;
}

#char-select-hub .closed-beta-status {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(117, 168, 255, 0.16);
  background: rgba(19, 27, 41, 0.78);
  font-size: 12px;
  line-height: 1.5;
}

#char-select-hub .closed-beta-redeem-row {
  gap: 10px;
}

#char-select-hub .cloud-slot-badge {
  padding: 4px 10px;
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

#char-select-hub .hub-cloud-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: auto;
}

#char-select-hub .hub-cloud-actions > * {
  min-width: 0;
}

#char-select-hub .hub-community-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: auto;
}

#char-select-hub .hub-community-btn,
#char-select-hub .hub-cloud-auth-row .btn-outline,
#char-select-hub .hub-cloud-actions .btn-outline,
#char-select-hub .hub-cloud-actions .btn-primary,
#char-select-hub .cloud-google-btn,
#char-select-hub .hub-back-btn {
  min-height: 48px;
  border-radius: 14px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

#char-select-hub .hub-community-btn,
#char-select-hub .hub-cloud-auth-row .btn-outline,
#char-select-hub .hub-cloud-actions .btn-outline,
#char-select-hub .cloud-google-btn,
#char-select-hub .hub-back-btn {
  border-color: rgba(238, 194, 116, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(244, 240, 232, 0.9);
}

#char-select-hub .hub-community-btn:hover,
#char-select-hub .hub-cloud-auth-row .btn-outline:hover,
#char-select-hub .hub-cloud-actions .btn-outline:hover,
#char-select-hub .cloud-google-btn:hover,
#char-select-hub .hub-back-btn:hover {
  border-color: rgba(241, 202, 131, 0.38);
  background: rgba(255, 255, 255, 0.08);
}

#char-select-hub .hub-cloud-actions .btn-primary {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 246, 226, 0.22), transparent 22%),
    linear-gradient(135deg, rgba(247, 194, 111, 0.98), rgba(143, 111, 255, 0.94));
  border-color: rgba(255, 225, 160, 0.42);
  color: #160f14;
  box-shadow:
    0 18px 28px rgba(72, 51, 144, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

#char-select-hub .hub-cloud-actions .btn-primary:hover {
  transform: translateY(-1px);
  box-shadow:
    0 22px 34px rgba(72, 51, 144, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

#char-select-hub .hub-footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(237, 196, 116, 0.12);
}

#char-select-hub .hub-footer-copy {
  max-width: 640px;
  color: rgba(219, 216, 229, 0.76);
  font-size: 12.5px;
  line-height: 1.55;
}

#char-select-hub .hub-back-btn {
  padding: 0 18px;
  flex: 0 0 auto;
}

#char-select-hub .cs-slot-card {
  border-radius: 22px;
  border-color: rgba(165, 185, 228, 0.16);
  background:
    radial-gradient(circle at top left, rgba(255, 204, 123, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(28, 33, 48, 0.97), rgba(12, 15, 24, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 18px 32px rgba(0, 0, 0, 0.16);
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    box-shadow 0.16s ease,
    background 0.16s ease;
}

#char-select-hub .cs-slot-card.cs-is-cloud-linked {
  background:
    radial-gradient(circle at top right, rgba(96, 169, 255, 0.11), transparent 30%),
    radial-gradient(circle at top left, rgba(255, 204, 123, 0.08), transparent 32%),
    linear-gradient(180deg, rgba(28, 33, 48, 0.97), rgba(12, 15, 24, 0.95));
}

#char-select-hub .cs-slot-card.cs-is-active {
  border-color: rgba(241, 201, 126, 0.3);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 22px 36px rgba(0, 0, 0, 0.22),
    0 0 0 1px rgba(241, 201, 126, 0.08);
}

#char-select-hub .cs-slot-card.cs-is-resuming {
  border-color: rgba(123, 188, 255, 0.42);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 26px 42px rgba(16, 33, 66, 0.34),
    0 0 0 1px rgba(123, 188, 255, 0.14);
}

#char-select-hub .cs-slot-card:hover {
  border-color: rgba(241, 201, 126, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 26px 40px rgba(0, 0, 0, 0.2);
}

#char-select-hub .cs-slot-filled {
  flex-direction: column;
}

#char-select-hub .cs-slot-mode-bar {
  width: auto;
  height: 5px;
}

#char-select-hub .cs-slot-inner {
  padding: 18px 20px 14px;
  gap: 14px;
  align-items: flex-start;
}

#char-select-hub .cs-slot-avatar {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border-color: rgba(240, 205, 132, 0.14);
  background:
    linear-gradient(180deg, rgba(47, 41, 31, 0.96), rgba(20, 18, 16, 0.94));
  font-size: 16px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 10px 18px rgba(0, 0, 0, 0.16);
}

#char-select-hub .cs-card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

#char-select-hub .cs-char-name {
  margin-bottom: 0;
  font-size: 18px;
  gap: 8px;
}

#char-select-hub .cs-char-name-text {
  line-height: 1.1;
}

#char-select-hub .cs-slot-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid rgba(165, 185, 228, 0.16);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(232, 230, 241, 0.82);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

#char-select-hub .cs-mode-badge {
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

#char-select-hub .cs-char-stats {
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: rgba(224, 222, 233, 0.82);
}

#char-select-hub .cs-stat-item {
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(165, 185, 228, 0.15);
  background: rgba(255, 255, 255, 0.055);
  line-height: 1;
  font-weight: 600;
}

#char-select-hub .cs-stat-item i {
  font-size: 11px;
}

#char-select-hub .cs-char-meta {
  font-size: 11px;
  color: rgba(221, 218, 233, 0.72);
  letter-spacing: 0.02em;
}

#char-select-hub .cs-current-action {
  position: relative;
  overflow: hidden;
  gap: 4px;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(165, 185, 228, 0.15);
  background:
    linear-gradient(180deg, rgba(26, 32, 48, 0.9), rgba(12, 15, 24, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#char-select-hub .cs-current-action.is-live {
  border-color: rgba(241, 201, 126, 0.3);
  background:
    radial-gradient(circle at top left, rgba(241, 201, 126, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(42, 34, 28, 0.95), rgba(17, 18, 26, 0.92));
}

#char-select-hub .cs-current-action.is-idle {
  border-color: rgba(165, 185, 228, 0.12);
}

#char-select-hub .cs-current-action-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(243, 214, 156, 0.74);
}

#char-select-hub .cs-current-action-value {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  color: #fff4df;
}

#char-select-hub .cs-slot-flags {
  gap: 8px;
  margin-top: 10px;
}

#char-select-hub .cs-slot-flag {
  gap: 6px;
  padding: 6px 10px;
  font-size: 11px;
  letter-spacing: 0.01em;
}

#char-select-hub .cs-slot-owner {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(215, 210, 227, 0.76);
}

#char-select-hub .cs-slot-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 14px 20px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  background:
    linear-gradient(180deg, rgba(18, 21, 31, 0.92), rgba(10, 12, 20, 0.96));
}

#char-select-hub .cs-slot-actions.is-single {
  grid-template-columns: auto;
  justify-content: end;
}

#char-select-hub .cs-play-btn,
#char-select-hub .cs-delete-btn {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 14px;
  font-weight: 700;
}

#char-select-hub .cs-play-btn {
  background:
    radial-gradient(circle at 18% 22%, rgba(255, 246, 226, 0.22), transparent 22%),
    linear-gradient(135deg, rgba(247, 194, 111, 0.98), rgba(143, 111, 255, 0.94));
  border-color: rgba(255, 225, 160, 0.42);
  color: #160f14;
  box-shadow:
    0 18px 28px rgba(72, 51, 144, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

#char-select-hub .cs-play-btn.is-busy {
  border-color: rgba(129, 205, 255, 0.46);
  background:
    radial-gradient(circle at 18% 22%, rgba(232, 246, 255, 0.26), transparent 22%),
    linear-gradient(135deg, rgba(96, 158, 255, 0.98), rgba(82, 211, 255, 0.95));
  color: #091421;
  box-shadow:
    0 18px 30px rgba(24, 78, 158, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.24);
}

#char-select-hub .cs-play-btn.is-busy:disabled,
#char-select-hub .cs-delete-btn:disabled,
#char-select-hub .cs-create-btn:disabled {
  opacity: 1;
  cursor: progress;
}

#char-select-hub .cs-play-btn:hover {
  transform: translateY(-1px);
  box-shadow:
    0 22px 34px rgba(72, 51, 144, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

#char-select-hub .cs-delete-btn {
  padding: 0 16px;
  border-color: rgba(248, 113, 113, 0.24);
  background: rgba(94, 24, 31, 0.12);
  color: #ffb7b7;
}

#char-select-hub .cs-delete-btn:hover {
  border-color: rgba(248, 113, 113, 0.38);
  background: rgba(94, 24, 31, 0.18);
}

#char-select-hub .cs-slot-locked {
  min-height: 124px;
  padding: 18px 20px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(27, 31, 44, 0.97), rgba(12, 14, 23, 0.95));
}

#char-select-hub .cs-slot-locked-title {
  font-size: 16px;
}

#char-select-hub .cs-slot-locked-text,
#char-select-hub .cs-slot-locked-note {
  color: rgba(220, 217, 231, 0.78);
}

#char-select-hub .cs-slot-empty {
  min-height: 128px;
  padding: 18px 20px;
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(27, 31, 44, 0.95), rgba(12, 14, 23, 0.94));
}

#char-select-hub .cs-slot-empty-label {
  color: #f1ebdd;
  font-size: 14px;
  font-weight: 700;
}

#char-select-hub .cs-slot-empty-sub,
#char-select-hub .cs-slot-number {
  color: rgba(214, 209, 225, 0.72);
}

#char-select-hub .cs-slot-empty-icon {
  border-color: rgba(241, 201, 126, 0.22);
  color: rgba(241, 201, 126, 0.82);
  background: rgba(255, 255, 255, 0.025);
}

#char-select-hub .cs-create-btn {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 14px;
  border-color: rgba(255, 225, 160, 0.34);
  background:
    linear-gradient(135deg, rgba(247, 194, 111, 0.96), rgba(143, 111, 255, 0.9));
  color: #160f14;
  box-shadow:
    0 14px 24px rgba(72, 51, 144, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

#char-select-hub .cs-create-btn:hover {
  transform: translateY(-1px);
}

.resume-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  pointer-events: none;
  opacity: 0;
  background:
    radial-gradient(circle at top, rgba(98, 119, 255, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(6, 9, 18, 0.22), rgba(4, 7, 14, 0.68));
  backdrop-filter: blur(0px);
  transition:
    opacity 0.18s ease,
    backdrop-filter 0.22s ease;
}

.resume-loading-overlay.is-visible {
  opacity: 1;
  pointer-events: auto;
  backdrop-filter: blur(10px) saturate(1.05);
}

.resume-loading-shell {
  width: min(100%, 460px);
  padding: 24px 24px 22px;
  border-radius: 24px;
  border: 1px solid rgba(137, 183, 255, 0.22);
  background:
    radial-gradient(circle at top left, rgba(255, 213, 138, 0.11), transparent 30%),
    radial-gradient(circle at top right, rgba(109, 166, 255, 0.14), transparent 28%),
    linear-gradient(180deg, rgba(18, 24, 38, 0.97), rgba(8, 11, 20, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 24px 60px rgba(0, 0, 0, 0.36);
  transform: translateY(8px) scale(0.985);
  transition: transform 0.2s ease;
}

.resume-loading-overlay.is-visible .resume-loading-shell {
  transform: translateY(0) scale(1);
}

.resume-loading-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(157, 191, 255, 0.86);
}

.resume-loading-name {
  margin-top: 10px;
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  line-height: 1.1;
  color: #fff4de;
}

.resume-loading-title {
  margin: 10px 0 0;
  font-size: 17px;
  font-weight: 700;
  color: rgba(244, 245, 252, 0.94);
}

.resume-loading-detail {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: rgba(219, 225, 240, 0.78);
}

.resume-loading-stage-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 16px;
}

.resume-loading-stage {
  position: relative;
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 10px 6px 30px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(218, 227, 244, 0.68);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.resume-loading-stage::before {
  content: '';
  position: absolute;
  left: 10px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: 1px solid rgba(158, 191, 255, 0.36);
  background: rgba(158, 191, 255, 0.14);
}

.resume-loading-stage.is-active {
  border-color: rgba(117, 205, 255, 0.26);
  background: rgba(96, 165, 250, 0.11);
  color: rgba(237, 246, 255, 0.94);
}

.resume-loading-stage.is-active::before {
  background: #78d6ff;
  box-shadow: 0 0 12px rgba(120, 214, 255, 0.46);
}

.resume-loading-stage.is-complete {
  color: rgba(190, 242, 207, 0.86);
}

.resume-loading-stage.is-complete::before {
  border-color: rgba(134, 239, 172, 0.42);
  background: #86efac;
  box-shadow: none;
}

.resume-loading-progress-track {
  position: relative;
  overflow: hidden;
  height: 10px;
  margin-top: 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.24);
}

.resume-loading-progress-track::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  transform: translateX(-100%);
  animation: resumeProgressSheen 1.6s ease-in-out infinite;
}

.resume-loading-progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(114, 183, 255, 0.98), rgba(117, 230, 255, 0.94) 48%, rgba(255, 214, 122, 0.96));
  box-shadow:
    0 0 18px rgba(96, 176, 255, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: width 0.18s ease;
}

.resume-loading-tip {
  margin-top: 12px;
  min-height: 18px;
  color: rgba(240, 214, 165, 0.76);
  font-size: 11px;
  line-height: 1.45;
}

.resume-loading-pulse-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

.resume-loading-pulse-row span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(156, 205, 255, 0.78);
  animation: resumePulse 1s ease-in-out infinite;
}

.resume-loading-pulse-row span:nth-child(2) {
  animation-delay: 0.16s;
}

.resume-loading-pulse-row span:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes resumePulse {
  0%, 100% {
    transform: translateY(0);
    opacity: 0.38;
  }
  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

@keyframes resumeProgressSheen {
  0% { transform: translateX(-100%); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateX(100%); opacity: 0; }
}

@media (max-width: 1320px) {
  #char-select-hub .hub-panel {
    width: min(1280px, calc(100vw - 28px));
    padding: 34px 32px 28px;
  }

  #char-select-hub .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas:
      "local local"
      "cloud community";
  }
}

@media (max-width: 960px) {
  #char-select-hub .hub-panel {
    width: calc(100% - 20px);
    padding: 20px 18px 18px;
    gap: 22px;
  }

  #char-select-hub .hub-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "local"
      "cloud"
      "community";
    gap: 16px;
  }

  #char-select-hub .hub-column {
    padding: 20px 18px;
  }

  #char-select-hub .hub-community-actions,
  #char-select-hub .hub-cloud-actions {
    grid-template-columns: 1fr;
  }

  #char-select-hub .hub-footer {
    flex-direction: column;
    align-items: stretch;
  }

  #char-select-hub .hub-back-btn {
    width: 100%;
    justify-content: center;
  }
}

body.platform-mobile #char-select-hub .hub-panel {
  width: min(100%, calc(100% - 12px));
  margin: 8px auto 14px;
  padding: 18px 14px calc(18px + env(safe-area-inset-bottom));
  gap: 18px;
  max-height: calc(100dvh - 96px);
}

body.platform-mobile #char-select-hub .hub-header {
  padding-bottom: 14px;
}

body.platform-mobile #char-select-hub .hub-copy {
  font-size: 13px;
}

body.platform-mobile #char-select-hub .hub-column-title {
  font-size: 21px;
}

body.platform-mobile #char-select-hub .hub-column-note,
body.platform-mobile #char-select-hub .hub-community-copy,
body.platform-mobile #char-select-hub .hub-footer-copy {
  font-size: 12px;
}

body.platform-mobile #char-select-hub .cs-slot-inner {
  padding: 16px 16px 12px;
  gap: 12px;
}

body.platform-mobile #char-select-hub .cs-card-topline {
  flex-direction: column;
  align-items: flex-start;
}

body.platform-mobile .resume-loading-overlay {
  padding: 16px;
}

body.platform-mobile .resume-loading-shell {
  width: min(100%, 420px);
  padding: 20px 18px 18px;
  border-radius: 20px;
}

body.platform-mobile .resume-loading-name {
  font-size: 22px;
}

body.platform-mobile .resume-loading-title {
  font-size: 16px;
}

body.platform-mobile .resume-loading-stage-list {
  gap: 6px;
}

body.platform-mobile .resume-loading-stage {
  min-height: 26px;
  font-size: 10px;
}

body.platform-mobile #offline-report {
  max-width: calc(100vw - 24px);
}

body.platform-mobile .report-row {
  gap: 9px;
  font-size: 11px;
}

body.platform-mobile #char-select-hub .cs-slot-actions {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  padding: 0 16px 16px;
  border-top: 0;
  background: transparent;
}

body.platform-mobile #char-select-hub .cs-slot-actions.is-single {
  grid-template-columns: 1fr;
}

body.platform-mobile #char-select-hub .hub-cloud-auth-row,
body.platform-mobile #char-select-hub .hub-community-actions,
body.platform-mobile #char-select-hub .hub-cloud-actions {
  grid-template-columns: 1fr;
}

/* ─── SHARED MASTERY TREE ───────────────────────────────────────────────── */

#mastery-tree-modal .mastery-tree-modal-box {
  width: min(1820px, calc(100vw - 14px));
  max-width: 1800px;
  height: min(1072px, calc(100vh - 14px));
  display: flex;
  flex-direction: column;
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.10), transparent 28%),
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(8, 12, 22, 0.99), rgba(5, 9, 17, 0.99));
  box-shadow:
    0 28px 70px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

#mastery-help-modal .mastery-help-modal-box {
  width: min(1180px, calc(100vw - 20px));
  max-width: 1180px;
  height: min(920px, calc(100vh - 28px));
  display: flex;
  flex-direction: column;
  border-radius: 28px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.13), transparent 30%),
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.10), transparent 32%),
    linear-gradient(180deg, rgba(8, 13, 24, 0.99), rgba(6, 10, 18, 0.99));
  box-shadow:
    0 28px 76px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255,255,255,0.04);
}

.mastery-tree-modal-subtitle {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.5;
  color: #9fb1ca;
}

#mastery-tree-modal .mastery-tree-modal-header {
  padding: 10px 14px;
}

#mastery-tree-modal .mastery-tree-modal-subtitle {
  display: none;
}

#mastery-tree-modal .mastery-tree-modal-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
}

.mastery-help-modal-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
}

#mastery-tree-modal-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  padding: 14px 16px 16px;
}

#mastery-help-modal-panel {
  height: 100%;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  overflow: hidden;
  padding: 18px;
}

#mastery-panel {
  padding: 12px;
}

.mastery-empty-state {
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10, 12, 20, 0.88);
  color: var(--text-muted);
  font-size: 12px;
}

.mastery-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mastery-shell--modal {
  flex: 1;
  min-height: 0;
  gap: 10px;
}

.mastery-overview-shell {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.mastery-help-shell {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 0;
}

.mastery-help-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.95fr);
  gap: 16px;
  padding: 20px 22px;
  border-radius: 24px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.14), transparent 32%),
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.10), transparent 34%),
    linear-gradient(180deg, rgba(14, 20, 36, 0.98), rgba(7, 11, 20, 0.98));
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

.mastery-help-kicker {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #93c5fd;
}

.mastery-help-title {
  margin-top: 8px;
  font-size: 30px;
  line-height: 1.05;
  font-weight: 900;
  color: #f8fafc;
}

.mastery-help-copy {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.65;
  color: #c7d5e7;
}

.mastery-help-stat-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-self: stretch;
}

.mastery-help-stat {
  padding: 14px 14px 15px;
  border-radius: 18px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mastery-help-stat span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.mastery-help-stat strong {
  font-size: 19px;
  line-height: 1.15;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
}

.mastery-help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
}

.mastery-help-card {
  padding: 18px 18px 17px;
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.025));
  box-shadow:
    0 16px 42px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255,255,255,0.03);
}

.mastery-help-card--wide {
  grid-column: 1 / -1;
}

.mastery-help-card-title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.03em;
  color: #f8fafc;
}

.mastery-help-list {
  margin: 12px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #d5e1ee;
}

.mastery-help-band-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.mastery-help-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
}

.mastery-help-band span,
.mastery-help-cost-line {
  font-size: 11px;
  color: #b9c9dd;
}

.mastery-help-band strong,
.mastery-help-cost-points {
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
}

.mastery-help-band em {
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
  color: #93c5fd;
}

.mastery-help-footnote {
  margin-top: 12px;
  font-size: 11px;
  line-height: 1.55;
  color: #94a9c4;
}

.mastery-help-cost-grid,
.mastery-help-tree-grid {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.mastery-help-cost-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.mastery-help-cost-card,
.mastery-help-tree-group {
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
}

.mastery-help-cost-head,
.mastery-help-tree-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #f8fafc;
}

.mastery-help-cost-points {
  display: inline-flex;
  margin-top: 6px;
  color: #bbf7d0;
}

.mastery-help-branch-list {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mastery-help-branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--branch-accent, #94a3b8) 24%, rgba(255,255,255,0.08));
  background: color-mix(in srgb, var(--branch-accent, #94a3b8) 10%, rgba(255,255,255,0.03));
  font-size: 11px;
  font-weight: 700;
  color: #eef5ff;
}

.mastery-hero,
.mastery-board-card,
.mastery-detail-card,
.mastery-overview-path-card,
.mastery-hint-card {
  border-radius: 20px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 32%),
    radial-gradient(circle at top right, rgba(52, 211, 153, 0.10), transparent 34%),
    linear-gradient(180deg, rgba(12, 17, 30, 0.98), rgba(6, 10, 19, 0.98));
  box-shadow:
    0 22px 56px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255,255,255,0.02);
}

.mastery-hero {
  padding: 18px 20px;
}

.mastery-hero--modal {
  padding: 10px 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  flex-shrink: 0;
}

.mastery-hero--modal .mastery-hero-copy {
  margin-bottom: 0;
  flex: 1;
  min-width: 0;
}

.mastery-hero-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.mastery-hero-threshold {
  min-width: 260px;
  max-width: 340px;
  padding: 11px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.mastery-hero-threshold span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.mastery-hero-threshold strong {
  font-size: 13px;
  color: #f8fafc;
}

.mastery-hero-lower {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(240px, 0.85fr);
  gap: 12px;
  align-items: stretch;
}

.mastery-entry-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mastery-entry-btn {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 11px 14px;
  background: rgba(255,255,255,0.04);
  color: #dbe5f2;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.mastery-entry-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.14);
}

.mastery-entry-btn--primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
  border-color: transparent;
}

.mastery-hero-copy {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

.mastery-title {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #f8e7b5;
  text-transform: uppercase;
}

.mastery-subtitle {
  font-size: 12px;
  color: #9fb1ca;
  line-height: 1.5;
  max-width: 620px;
}

.mastery-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.mastery-stat-card {
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  overflow: hidden;
}

.mastery-stat-card span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mastery-stat-card strong {
  font-size: 18px;
  line-height: 1.15;
  color: #f8fafc;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.mastery-progress-card {
  margin-top: 12px;
  padding: 12px 13px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02));
}

.mastery-progress-card--modal {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.mastery-progress-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.mastery-progress-head span {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.mastery-progress-head strong {
  font-size: 12px;
  color: #f8fafc;
}

.mastery-progress-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.06);
  overflow: hidden;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.35);
}

.mastery-progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(245, 158, 11, 0.95), rgba(52, 211, 153, 0.92));
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.25);
}

.mastery-next-row {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11px;
  color: #9fb1ca;
  flex-wrap: wrap;
}

.mastery-next-row span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mastery-modal-pts-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.06);
  font-size: 11px;
  font-weight: 700;
  color: #dbe5f2;
  white-space: nowrap;
  letter-spacing: 0.02em;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.mastery-modal-pts-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(203, 213, 225, 0.55);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.04);
}

.mastery-modal-pts-badge--avail {
  border-color: rgba(74, 222, 128, 0.36);
  background:
    linear-gradient(180deg, rgba(74, 222, 128, 0.18), rgba(74, 222, 128, 0.08));
  color: #bbf7d0;
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.08),
    0 0 0 1px rgba(74, 222, 128, 0.12),
    0 6px 16px rgba(34, 197, 94, 0.14);
  animation: masteryBadgePulse 2.4s ease-in-out infinite;
}

.mastery-modal-pts-badge--avail::before {
  background: #86efac;
  box-shadow:
    0 0 0 2px rgba(134, 239, 172, 0.22),
    0 0 8px rgba(74, 222, 128, 0.55);
}

@keyframes masteryBadgePulse {
  0%, 100% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.08),
      0 0 0 1px rgba(74, 222, 128, 0.12),
      0 6px 16px rgba(34, 197, 94, 0.14);
  }
  50% {
    box-shadow:
      inset 0 1px 0 rgba(255,255,255,0.10),
      0 0 0 1px rgba(74, 222, 128, 0.24),
      0 8px 22px rgba(34, 197, 94, 0.26);
  }
}

@media (prefers-reduced-motion: reduce) {
  .mastery-modal-pts-badge--avail {
    animation: none;
  }
}

.mastery-modal-xp-line {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  margin-left: auto;
}

.mastery-legacy-note {
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  border: 1px solid rgba(96, 165, 250, 0.22);
  background: rgba(59, 130, 246, 0.08);
  color: #bfdbfe;
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mastery-tree-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.mastery-tree-switch--modal {
  gap: 8px;
  flex-shrink: 0;
}

/* ── Condensed modal topbar: tree-switch | meta in one row ── */
.mastery-topbar--modal {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  flex-shrink: 0;
  padding: 7px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background:
    radial-gradient(circle at 0% 0%, rgba(245, 158, 11, 0.08), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(52, 211, 153, 0.06), transparent 36%),
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  box-shadow:
    0 8px 20px rgba(0, 0, 0, 0.20),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.mastery-topbar--modal .mastery-tree-switch--modal {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  gap: 8px;
}

.mastery-topbar--modal .mastery-tree-switch-btn {
  padding: 6px 10px;
  border-radius: 12px;
  flex: 1 1 0;
  min-width: 0;
}

.mastery-topbar--modal .mastery-tree-switch-icon {
  width: 30px;
  height: 30px;
  font-size: 13px;
}

.mastery-topbar--modal .mastery-tree-switch-copy strong {
  font-size: 11px;
}

.mastery-topbar--modal .mastery-tree-switch-copy span {
  font-size: 9px;
}

.mastery-topbar-meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mastery-topbar-meta .mastery-modal-xp-line {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
  margin-left: 0;
}

.mastery-toolbar-btn {
  appearance: none;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.04);
  color: #dbe5f2;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.mastery-toolbar-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.06);
}

.mastery-toolbar-btn--primary {
  border-color: color-mix(in srgb, var(--branch-accent, #60a5fa) 20%, transparent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--branch-accent, #60a5fa) 70%, #2563eb 30%), #1d4ed8);
  color: #fff;
}

.mastery-reset-note {
  font-size: 10px;
  color: #fcd34d;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.08);
  white-space: nowrap;
}

/* Paid full-reset control for the Mastery Tree. Sits in the modal topbar. */
.mastery-reset-btn {
  appearance: none;
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.55), rgba(76, 5, 25, 0.45));
  color: #fecaca;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  padding: 6px 9px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
}
.mastery-reset-btn:hover:not(:disabled) {
  border-color: rgba(248, 113, 113, 0.8);
  color: #fff1f2;
}
.mastery-reset-btn:active:not(:disabled) {
  transform: translateY(1px);
}
.mastery-reset-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.mastery-reset-btn--armed {
  background: linear-gradient(180deg, rgba(190, 18, 60, 0.85), rgba(127, 29, 29, 0.85));
  border-color: rgba(254, 205, 211, 0.9);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25), 0 8px 18px rgba(0, 0, 0, 0.35);
  animation: mastery-reset-pulse 1.1s ease-in-out infinite;
}

@keyframes mastery-reset-pulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(248, 113, 113, 0.25), 0 8px 18px rgba(0, 0, 0, 0.35); }
  50% { box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.55), 0 8px 22px rgba(0, 0, 0, 0.4); }
}

@media (max-width: 760px) {
  .mastery-topbar--modal {
    padding: 8px 10px;
    gap: 10px;
  }
  .mastery-topbar-meta {
    width: 100%;
    justify-content: space-between;
  }
  .mastery-reset-note {
    width: 100%;
    text-align: center;
    white-space: normal;
  }
  .mastery-topbar--modal .mastery-tree-switch--modal {
    flex: 1 1 100%;
  }
}

.mastery-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.95fr);
  gap: 14px;
  align-items: start;
}

.mastery-overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mastery-overview-path-card,
.mastery-hint-card {
  padding: 16px;
}

.mastery-overview-path-head,
.mastery-hint-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.mastery-overview-path-tree,
.mastery-overview-path-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.mastery-overview-path-tree {
  background: rgba(255,255,255,0.04);
  color: #dbe5f2;
  border: 1px solid rgba(255,255,255,0.07);
}

.mastery-overview-path-badge {
  background: color-mix(in srgb, var(--tree-accent, #f59e0b) 16%, transparent);
  color: color-mix(in srgb, var(--tree-accent, #f59e0b) 72%, white 12%);
  border: 1px solid color-mix(in srgb, var(--tree-accent, #f59e0b) 26%, transparent);
}

.mastery-overview-path-name,
.mastery-hint-title {
  margin-top: 12px;
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
}

.mastery-overview-path-next,
.mastery-hint-next {
  margin-top: 6px;
  font-size: 12px;
  font-weight: 700;
  color: color-mix(in srgb, var(--branch-accent, #94a3b8) 74%, white 10%);
}

.mastery-overview-path-copy,
.mastery-hint-copy {
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: #c6d4e5;
}

.mastery-overview-path-route,
.mastery-hint-route {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mastery-overview-path-route span,
.mastery-hint-route span {
  padding: 6px 9px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--branch-accent, #94a3b8) 22%, transparent);
  background: color-mix(in srgb, var(--branch-accent, #94a3b8) 10%, transparent);
  color: #e5eef9;
  font-size: 11px;
}

.mastery-overview-actions,
.mastery-hint-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mastery-overview-btn,
.mastery-hint-btn {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255,255,255,0.04);
  color: #dbe5f2;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.mastery-overview-btn:hover,
.mastery-hint-btn:hover {
  transform: translateY(-1px);
}

.mastery-overview-btn--primary,
.mastery-hint-btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, color-mix(in srgb, var(--branch-accent, #94a3b8) 70%, #1d4ed8 30%), #1d4ed8);
  color: #fff;
}

.mastery-hint-kicker {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.mastery-hint-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--branch-accent, #94a3b8) 22%, transparent), transparent 70%),
    rgba(255,255,255,0.04);
  color: var(--branch-accent, #94a3b8);
  border: 1px solid color-mix(in srgb, var(--branch-accent, #94a3b8) 24%, transparent);
  font-size: 18px;
}

.mastery-tree-switch-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
  color: #d8e1ef;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.mastery-tree-switch-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.mastery-tree-switch-btn.is-active {
  border-color: color-mix(in srgb, var(--tree-accent, #f59e0b) 58%, white 12%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--tree-accent, #f59e0b) 18%, transparent), rgba(255,255,255,0.04));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--tree-accent, #f59e0b) 28%, transparent),
    0 12px 28px rgba(0, 0, 0, 0.24);
}

.mastery-tree-switch-icon {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, rgba(255,255,255,0.16), transparent 62%),
    rgba(255,255,255,0.06);
  color: #f8e7b5;
  font-size: 15px;
}

.mastery-tree-switch-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.mastery-tree-switch-copy strong {
  font-size: 13px;
  color: #f8fafc;
}

.mastery-tree-switch-copy span {
  font-size: 11px;
  color: var(--text-muted);
}

.mastery-tree-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.9fr);
  gap: 14px;
}

.mastery-tree-layout--modal {
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(0, 3fr) minmax(286px, 332px);
  gap: 12px;
  align-items: stretch;
  overflow: hidden;
}

.mastery-side-column {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: stretch;
  overflow-y: auto;
  min-height: 0;
  position: static;
}

.mastery-board-card {
  display: flex;
  flex-direction: column;
  padding: 10px 10px 12px;
  min-height: 0;
  min-width: 0;
}

.mastery-board-viewport {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: auto;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.02);
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.35) transparent;
  cursor: grab;
  touch-action: none;
}

.mastery-board-viewport[data-dragging="true"] {
  cursor: grabbing;
}

.mastery-board-stage {
  position: relative;
  width: calc(1180px * var(--mastery-board-scale, 1));
  height: calc(780px * var(--mastery-board-scale, 1));
  flex: 0 0 auto;
}

.mastery-board-viewport::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
.mastery-board-viewport::-webkit-scrollbar-track {
  background: transparent;
}
.mastery-board-viewport::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
.mastery-board-viewport::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.48);
  background-clip: padding-box;
}

.mastery-detail-card {
  padding: 14px;
}

.mastery-board-status,
.mastery-board-nav {
  position: absolute;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mastery-board-status {
  top: 12px;
  left: 12px;
  flex-wrap: wrap;
  max-width: calc(100% - 136px);
}

.mastery-board-nav {
  top: 12px;
  right: 12px;
}

.mastery-board-status-chip,
.mastery-board-mini-btn {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(7, 11, 20, 0.78);
  backdrop-filter: blur(12px);
  color: #e7edf8;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.03em;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.mastery-board-status-chip i {
  color: color-mix(in srgb, var(--tree-accent, #f59e0b) 70%, #ffffff 18%);
}

.mastery-board-status-chip.is-muted {
  color: #c7d5e7;
  background: rgba(7, 11, 20, 0.68);
}

.mastery-board-mini-btn {
  appearance: none;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.mastery-board-mini-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.16);
  background: rgba(13, 18, 31, 0.88);
}

.mastery-board-mini-btn--suggested {
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 28%, rgba(255,255,255,0.08));
  color: #f8fafc;
}

.mastery-branch-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  flex-shrink: 0;
}

.mastery-branch-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 11px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.02));
  color: #dbe5f2;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, opacity 0.16s ease;
  white-space: nowrap;
}

.mastery-branch-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.05);
}

.mastery-branch-pill.is-focused {
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 72%, white 10%);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--branch-accent, #94a3b8) 18%, transparent), rgba(255,255,255,0.04));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--branch-accent, #94a3b8) 24%, transparent);
}

.mastery-branch-pill.is-suggested:not(.is-focused) {
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 34%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--branch-accent, #94a3b8) 16%, transparent);
}

.mastery-branch-pill.is-dimmed {
  opacity: 0.48;
}

.mastery-branch-pill-icon {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--branch-accent, #94a3b8) 22%, transparent), transparent 70%),
    rgba(255,255,255,0.06);
  color: var(--branch-accent, #94a3b8);
  font-size: 11px;
  flex: 0 0 auto;
}

.mastery-branch-pill-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mastery-branch-pill-copy strong {
  font-size: 10px;
  color: #f8fafc;
}

.mastery-branch-pill-copy span {
  font-size: 8px;
  color: var(--text-muted);
}

.mastery-board-shell {
  position: relative;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.02), transparent 16%),
    linear-gradient(180deg, rgba(4, 7, 14, 1), rgba(8, 12, 22, 1));
}

.mastery-board-shell--modal {
  position: absolute;
  inset: 0 auto auto 0;
  width: 1180px;
  height: 780px;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  aspect-ratio: auto;
  transform-origin: top left;
  will-change: transform;
}

.mastery-board-shell[data-tree="combat"] {
  background:
    radial-gradient(circle at 50% 16%, rgba(245, 158, 11, 0.10), transparent 20%),
    radial-gradient(circle at 14% 74%, rgba(248, 113, 113, 0.10), transparent 18%),
    radial-gradient(circle at 84% 26%, rgba(96, 165, 250, 0.10), transparent 20%),
    radial-gradient(circle at 50% 84%, rgba(192, 132, 252, 0.08), transparent 20%),
    linear-gradient(180deg, rgba(4, 7, 14, 1), rgba(8, 12, 22, 1));
}

.mastery-board-shell[data-tree="skilling"] {
  background:
    radial-gradient(circle at 50% 16%, rgba(103, 232, 249, 0.10), transparent 18%),
    radial-gradient(circle at 18% 28%, rgba(134, 239, 172, 0.12), transparent 20%),
    radial-gradient(circle at 82% 76%, rgba(252, 165, 165, 0.09), transparent 18%),
    radial-gradient(circle at 20% 78%, rgba(252, 211, 77, 0.08), transparent 18%),
    linear-gradient(180deg, rgba(4, 7, 14, 1), rgba(8, 12, 22, 1));
}

.mastery-board-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 10% 14%, rgba(255,255,255,0.22) 0 1px, transparent 1px),
    radial-gradient(circle at 22% 82%, rgba(255,255,255,0.16) 0 1px, transparent 1px),
    radial-gradient(circle at 76% 18%, rgba(255,255,255,0.16) 0 1px, transparent 1px),
    radial-gradient(circle at 86% 68%, rgba(255,255,255,0.14) 0 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.12) 0 1px, transparent 1px);
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
}

.mastery-board-orbit {
  position: absolute;
  inset: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, 0.12);
  pointer-events: none;
  z-index: 0;
}

.mastery-board-orbit--outer {
  width: 90%;
  height: 90%;
}

.mastery-board-orbit--middle {
  width: 66%;
  height: 66%;
  border-color: rgba(148, 163, 184, 0.08);
}

.mastery-board-orbit--inner {
  width: 34%;
  height: 34%;
  border-color: rgba(255,255,255,0.08);
}

.mastery-board-links {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.mastery-link {
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 1.05;
  fill: none;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(0, 0, 0, 0.14));
  transition: stroke 0.16s ease, stroke-width 0.16s ease, opacity 0.16s ease, filter 0.16s ease;
}

.mastery-link.is-connected {
  stroke: rgba(148, 163, 184, 0.26);
}

.mastery-link.is-available {
  stroke: rgba(96, 165, 250, 0.46);
}

.mastery-link.is-spent {
  stroke: rgba(74, 222, 128, 0.58);
  stroke-width: 1.15;
}

.mastery-link.is-focus {
  stroke: color-mix(in srgb, var(--branch-accent, #94a3b8) 70%, #f8fafc 20%);
  stroke-width: 1.7;
  filter: drop-shadow(0 0 18px color-mix(in srgb, var(--branch-accent, #94a3b8) 30%, transparent));
}

.mastery-link.is-dimmed {
  opacity: 0.18;
}

.mastery-branch-region {
  position: absolute;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--branch-accent, #94a3b8) 16%, transparent);
  background:
    radial-gradient(circle at center, color-mix(in srgb, var(--branch-accent, #94a3b8) 12%, transparent), transparent 70%);
  box-shadow: inset 0 0 30px color-mix(in srgb, var(--branch-accent, #94a3b8) 8%, transparent);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.mastery-branch-region.is-focused {
  opacity: 0.92;
  transform: scale(1);
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 30%, white 8%);
  box-shadow:
    inset 0 0 40px color-mix(in srgb, var(--branch-accent, #94a3b8) 12%, transparent),
    0 0 26px color-mix(in srgb, var(--branch-accent, #94a3b8) 10%, transparent);
}

.mastery-branch-region.is-suggested:not(.is-focused) {
  opacity: 0.56;
  transform: scale(0.995);
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 24%, transparent);
  box-shadow: inset 0 0 36px color-mix(in srgb, var(--branch-accent, #94a3b8) 12%, transparent);
}

.mastery-branch-region.is-dimmed {
  opacity: 0.10;
}

.mastery-branch-region-marker {
  display: none;
}

.mastery-core-node,
.mastery-tree-node-slot {
  position: absolute;
  transform: translate(-50%, -50%);
}

.mastery-core-node {
  width: 118px;
  height: 118px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  z-index: 3;
}

.mastery-core-node-ring {
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--tree-accent, #f59e0b) 26%, white 10%);
  box-shadow:
    0 0 0 10px color-mix(in srgb, var(--tree-accent, #f59e0b) 8%, transparent),
    0 0 38px color-mix(in srgb, var(--tree-accent, #f59e0b) 24%, transparent);
  background:
    radial-gradient(circle, color-mix(in srgb, var(--tree-accent, #f59e0b) 20%, transparent), rgba(15, 23, 42, 0.30) 58%, transparent 75%);
}

.mastery-core-node-sigil {
  position: relative;
  z-index: 1;
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  color: #f8fafc;
  font-size: 18px;
  box-shadow: 0 0 16px color-mix(in srgb, var(--tree-accent, #f59e0b) 22%, transparent);
}

.mastery-core-node-label {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 82px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  color: rgba(248, 250, 252, 0.80);
  margin-top: 0;
}

.mastery-tree-node-slot {
  width: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 4;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.mastery-tree-node-slot--small {
  width: 82px;
}

.mastery-tree-node {
  position: relative;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.mastery-tree-node-slot--notable .mastery-tree-node {
  width: 74px;
  height: 74px;
}

.mastery-tree-node:hover {
  transform: scale(1.08);
  filter: brightness(1.04);
}

.mastery-tree-node-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.42);
  background:
    radial-gradient(circle at 35% 30%, rgba(255,255,255,0.16), rgba(15, 23, 42, 0.84) 52%, rgba(8, 12, 22, 1) 100%);
  box-shadow: 0 0 0 6px rgba(255,255,255,0.015);
}

.mastery-tree-node-slot--notable .mastery-tree-node-ring {
  border-width: 3px;
  box-shadow:
    0 0 0 8px rgba(255,255,255,0.018),
    0 0 26px color-mix(in srgb, var(--branch-accent, #f59e0b) 22%, transparent);
}

.mastery-tree-node-aura {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--branch-accent, #94a3b8) 26%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, var(--branch-accent, #94a3b8) 10%, transparent), transparent 74%);
}

.mastery-tree-node-core {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  color: var(--branch-accent, #94a3b8);
  font-size: 16px;
}

.mastery-tree-node-slot--small .mastery-tree-node-core {
  font-size: 0;
}

.mastery-tree-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 35%, #ffffff, color-mix(in srgb, var(--branch-accent, #94a3b8) 80%, transparent) 58%, transparent 100%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--branch-accent, #94a3b8) 24%, transparent);
}

.mastery-tree-node-slot.is-available .mastery-tree-node-ring {
  border-color: rgba(96, 165, 250, 0.52);
}

.mastery-tree-node-slot.is-awaiting .mastery-tree-node-ring {
  border-color: rgba(148, 163, 184, 0.48);
}

.mastery-tree-node-slot.is-unlocked .mastery-tree-node-ring {
  border-color: rgba(74, 222, 128, 0.72);
  box-shadow:
    0 0 0 8px rgba(74, 222, 128, 0.06),
    0 0 28px rgba(74, 222, 128, 0.24);
}

.mastery-tree-node-slot.is-path-focus .mastery-tree-node-ring {
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 68%, #f8fafc 14%);
  box-shadow:
    0 0 0 8px color-mix(in srgb, var(--branch-accent, #94a3b8) 10%, transparent),
    0 0 24px color-mix(in srgb, var(--branch-accent, #94a3b8) 24%, transparent);
}

.mastery-tree-node-slot.is-hinted .mastery-tree-node-ring {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 56%, white 10%);
}

.mastery-tree-node-slot.is-locked {
  opacity: 0.5;
}

.mastery-tree-node-slot.is-dimmed {
  opacity: 0.14;
}

.mastery-tree-node-slot.is-selected .mastery-tree-node-ring {
  border-color: color-mix(in srgb, var(--branch-accent, #f59e0b) 58%, #f8d68b 18%);
  box-shadow:
    0 0 0 9px rgba(255,255,255,0.05),
    0 0 34px color-mix(in srgb, var(--branch-accent, #f59e0b) 56%, #f59e0b 18%);
}

.mastery-tree-node-slot.is-selected .mastery-tree-node {
  transform: scale(1.05);
}

.mastery-tree-node-check {
  position: absolute;
  inset: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  color: #bbf7d0;
  font-size: 14px;
}

.mastery-tree-node-slot--notable .mastery-tree-node-check {
  font-size: 18px;
}

/* v3 cost chip — shown on notable (>1pt) locked/awaiting nodes so players
   can see at a glance that this will take a bigger investment. */
.mastery-tree-node-cost {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  color: #1a1305;
  background: linear-gradient(180deg, #fde68a, #f59e0b);
  border: 1px solid rgba(120, 53, 15, 0.55);
  box-shadow: 0 1px 0 rgba(255,255,255,0.2) inset, 0 1px 3px rgba(0,0,0,0.35);
  font-variant-numeric: tabular-nums;
  z-index: 3;
  pointer-events: none;
}
.mastery-tree-node-slot.is-unlocked .mastery-tree-node-cost { display: none; }
.mastery-tree-node-slot.is-dimmed .mastery-tree-node-cost { opacity: 0.45; }

.mastery-detail-cost {
  color: #fde68a !important;
  font-weight: 700;
}
.mastery-detail-cost i {
  margin-right: 3px;
  font-size: 10px;
  color: #fbbf24;
}

.mastery-tree-node-label {
  position: absolute;
  left: 50%;
  z-index: 2;
  min-width: 68px;
  max-width: 132px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(8px);
  text-align: center;
  font-size: 10px;
  line-height: 1.25;
  color: #dbe5f2;
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.55);
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

.mastery-tree-node-slot.is-label-below .mastery-tree-node-label {
  top: calc(100% + 8px);
  transform: translate(-50%, 6px);
}

.mastery-tree-node-slot.is-label-above .mastery-tree-node-label {
  bottom: calc(100% + 8px);
  transform: translate(-50%, -6px);
}

.mastery-tree-node-slot.is-label-visible .mastery-tree-node-label,
.mastery-tree-node-slot:hover .mastery-tree-node-label,
.mastery-tree-node-slot:focus-within .mastery-tree-node-label {
  opacity: 1;
  transform: translate(-50%, 0);
}

.mastery-tree-node-slot:hover .mastery-tree-node-label,
.mastery-tree-node-slot:focus-within .mastery-tree-node-label {
  z-index: 6;
}

.mastery-tree-node-slot--notable .mastery-tree-node-label {
  font-size: 11px;
  font-weight: 800;
  color: #f8fafc;
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 20%, rgba(255,255,255,0.08));
}

.mastery-tree-node-slot.is-selected .mastery-tree-node-label,
.mastery-tree-node-slot.is-path-focus .mastery-tree-node-label {
  color: #f8fafc;
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 26%, rgba(255,255,255,0.08));
}

.mastery-detail-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: start;
  position: static;
}

.mastery-detail-empty {
  padding: 18px;
  border-radius: 14px;
  border: 1px dashed rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.03);
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.mastery-detail-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mastery-detail-crest {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.mastery-detail-crest-icon {
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--branch-accent, #94a3b8) 20%, transparent), transparent 68%),
    rgba(255,255,255,0.04);
  border: 1px solid color-mix(in srgb, var(--branch-accent, #94a3b8) 24%, transparent);
  color: var(--branch-accent, #94a3b8);
  font-size: 18px;
  flex: 0 0 auto;
}

.mastery-detail-crest-copy {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mastery-detail-state {
  align-self: flex-start;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  border: 1px solid rgba(255,255,255,0.08);
}

.mastery-detail-state.is-unlocked {
  color: #bbf7d0;
  background: rgba(74, 222, 128, 0.12);
}

.mastery-detail-state.is-ready {
  color: #bfdbfe;
  background: rgba(96, 165, 250, 0.12);
}

.mastery-detail-state.is-locked {
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
}

.mastery-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  font-size: 10px;
  color: var(--text-muted);
}

.mastery-detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.04);
}

.mastery-detail-name {
  font-size: 22px;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.1;
}

.mastery-detail-desc {
  font-size: 13px;
  line-height: 1.55;
  color: #d7e2ef;
}

.mastery-detail-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mastery-detail-effect-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--branch-accent, #94a3b8) 18%, rgba(255,255,255,0.08));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--branch-accent, #94a3b8) 14%, transparent), rgba(255,255,255,0.04));
  color: #eef5ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mastery-detail-block {
  padding: 11px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.07);
  background: rgba(255,255,255,0.03);
}

.mastery-detail-block--covers {
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 22%, rgba(255,255,255,0.08));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--branch-accent, #94a3b8) 9%, transparent), rgba(255,255,255,0.03));
}
.mastery-detail-covers-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.mastery-detail-covers-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #e6ecff;
  border: 1px solid color-mix(in srgb, var(--branch-accent, #94a3b8) 28%, rgba(255,255,255,0.08));
  background: rgba(255,255,255,0.04);
  letter-spacing: 0.01em;
}
.mastery-detail-covers-pill i {
  color: color-mix(in srgb, var(--branch-accent, #94a3b8) 85%, #ffffff);
  font-size: 11px;
}

.mastery-detail-block--path {
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.03));
}

.mastery-detail-block--hint {
  background: rgba(96, 165, 250, 0.06);
  border-color: rgba(96, 165, 250, 0.18);
}

.mastery-detail-block-label {
  margin-bottom: 5px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-muted);
}

.mastery-detail-block-copy {
  font-size: 12px;
  line-height: 1.55;
  color: #d7e2ef;
}

.mastery-detail-path-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.mastery-detail-inline-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mastery-detail-path-node {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255,255,255,0.04);
  color: #dbe5f2;
  font-size: 11px;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.mastery-detail-path-node:hover {
  transform: translateY(-1px);
}

.mastery-detail-path-node.is-selected {
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 56%, white 10%);
  background: color-mix(in srgb, var(--branch-accent, #94a3b8) 18%, transparent);
  color: #f8fafc;
}

.mastery-detail-path-node.is-unlocked {
  border-color: rgba(74, 222, 128, 0.28);
  color: #dff7e7;
}

.mastery-detail-path-node.is-available {
  border-color: rgba(96, 165, 250, 0.24);
  background: rgba(96, 165, 250, 0.10);
  color: #dbeafe;
}

.mastery-detail-path-node.is-suggested {
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 36%, transparent);
  color: #f8fafc;
}

.mastery-detail-path-link {
  width: 18px;
  height: 1px;
  background: rgba(148, 163, 184, 0.32);
}

.mastery-feedback {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 11px;
  border: 1px solid rgba(255,255,255,0.07);
}

.mastery-feedback.tone-warn {
  color: #fecaca;
  background: rgba(248, 113, 113, 0.10);
  border-color: rgba(248, 113, 113, 0.22);
}

.mastery-feedback.tone-muted {
  color: var(--text-muted);
  background: rgba(255,255,255,0.04);
}

.mastery-detail-actions {
  margin-top: auto;
}

.mastery-detail-btn {
  width: 100%;
  border: 0;
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  cursor: pointer;
  transition: transform 0.16s ease, opacity 0.16s ease;
  text-align: center;
}

.mastery-detail-btn:hover:not(:disabled) {
  transform: translateY(-1px);
}

.mastery-detail-btn.is-unlock {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff;
}

.mastery-detail-btn.is-refund {
  background: rgba(248, 113, 113, 0.12);
  color: #fca5a5;
  border: 1px solid rgba(248, 113, 113, 0.24);
}

.mastery-detail-btn.is-disabled {
  background: rgba(255,255,255,0.05);
  color: #94a3b8;
  border: 1px solid rgba(255,255,255,0.08);
}

.mastery-detail-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

@media (max-width: 1280px) {
  .mastery-toolbar,
  .mastery-overview-grid,
  .mastery-tree-layout {
    grid-template-columns: 1fr;
  }
  .mastery-tree-layout--modal {
    grid-template-columns: minmax(0, 2.35fr) minmax(276px, 314px);
  }
}

@media (max-width: 960px) {
  #mastery-tree-modal .mastery-tree-modal-box {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }
  #mastery-help-modal .mastery-help-modal-box {
    width: calc(100vw - 16px);
    height: calc(100vh - 16px);
  }
  #mastery-help-modal-panel {
    padding: 14px;
  }
  .mastery-help-hero {
    grid-template-columns: 1fr;
  }
  .mastery-help-grid {
    grid-template-columns: 1fr;
  }
  .mastery-help-card--wide {
    grid-column: auto;
  }
  .mastery-tree-layout--modal {
    grid-template-columns: 1fr;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
  }
  .mastery-board-card {
    min-height: auto;
  }
  .mastery-board-viewport {
    min-height: 620px;
    flex: 0 0 auto;
  }
  .mastery-side-column {
    overflow: visible;
  }
  .mastery-hero--modal {
    flex-wrap: wrap;
  }
  .mastery-next-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .mastery-board-shell {
    min-height: 420px;
  }
  .mastery-core-node {
    width: 96px;
    height: 96px;
  }
  .mastery-detail-crest {
    flex-direction: column;
  }
  .mastery-progress-head,
  .mastery-next-row {
    width: 100%;
  }
  .mastery-branch-region-marker {
    display: none;
  }
  .mastery-branch-pill-copy span {
    display: none;
  }
}

@media (max-width: 720px) {
  #mastery-tree-modal-panel {
    padding: 12px;
  }
  #mastery-help-modal-panel {
    padding: 12px;
  }
  .mastery-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .mastery-help-stat-row {
    grid-template-columns: 1fr;
  }
  .mastery-tree-layout {
    gap: 12px;
  }
  .mastery-board-card,
  .mastery-detail-card,
  .mastery-hero {
    padding: 14px;
  }
  .mastery-hero--modal {
    gap: 10px;
  }
  .mastery-title {
    font-size: 15px;
  }
  .mastery-subtitle {
    font-size: 11px;
  }
  .mastery-hero-threshold {
    padding: 10px 12px;
  }
  .mastery-hero-threshold span {
    font-size: 9px;
  }
  .mastery-hero-threshold strong {
    font-size: 12px;
  }
  .mastery-stat-card {
    padding: 10px 11px;
  }
  .mastery-stat-card strong {
    font-size: 18px;
  }
  .mastery-tree-switch-btn {
    padding: 10px 12px;
  }
  .mastery-tree-switch-icon {
    width: 36px;
    height: 36px;
  }
  .mastery-tree-switch-copy strong {
    font-size: 12px;
  }
  .mastery-tree-switch-copy span {
    font-size: 10px;
  }
  .mastery-branch-pill-row {
    display: flex;
    gap: 8px;
    margin: 0 -2px 10px;
    padding: 2px 2px 6px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }
  .mastery-branch-pill-row::-webkit-scrollbar {
    display: none;
  }
  .mastery-branch-pill {
    min-width: 180px;
    flex: 0 0 180px;
  }
  .mastery-board-shell {
    min-height: 430px;
  }
  .mastery-board-viewport {
    min-height: 560px;
  }
  .mastery-detail-inline-actions,
  .mastery-topbar-meta {
    width: 100%;
  }
  .mastery-topbar--modal {
    gap: 8px;
    padding: 6px 8px;
  }
  .mastery-topbar-meta {
    gap: 6px;
    justify-content: flex-start;
    align-items: center;
  }
  .mastery-toolbar-btn {
    width: auto;
    padding: 6px 8px;
  }
  .mastery-reset-btn {
    flex: 1 1 180px;
    min-width: 0;
  }
  .mastery-topbar-meta .mastery-modal-xp-line {
    display: none;
  }
  .mastery-board-status {
    top: 10px;
    left: 10px;
    max-width: calc(100% - 88px);
    gap: 6px;
  }
  .mastery-board-nav {
    top: 10px;
    right: 10px;
    gap: 6px;
  }
  .mastery-board-status-chip,
  .mastery-board-mini-btn {
    min-height: 30px;
    padding: 6px 9px;
    font-size: 9px;
  }
  .mastery-tree-node-slot {
    width: 92px;
  }
  .mastery-tree-node-slot--small {
    width: 84px;
  }
  .mastery-tree-node-label {
    max-width: 92px;
    font-size: 9px;
  }
  .mastery-entry-actions,
  .mastery-overview-actions,
  .mastery-hint-actions {
    flex-direction: column;
  }
  .mastery-entry-btn,
  .mastery-overview-btn,
  .mastery-hint-btn {
    width: 100%;
  }
}

@media (max-width: 640px) {
  #mastery-tree-modal .mastery-tree-modal-box {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  #mastery-help-modal .mastery-help-modal-box {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    border-radius: 0;
  }
  #mastery-tree-modal .mastery-tree-modal-header {
    padding: 12px 14px;
  }
  #mastery-help-modal .mastery-help-modal-header {
    padding: 12px 14px;
  }
  #mastery-tree-modal .mastery-tree-modal-subtitle {
    display: none;
  }
  #mastery-help-modal .mastery-tree-modal-subtitle {
    display: none;
  }
  #mastery-tree-modal-panel {
    padding: 10px;
  }
  #mastery-help-modal-panel {
    padding: 10px;
  }
  .mastery-subtitle {
    display: none;
  }
  .mastery-help-title {
    font-size: 24px;
  }
  .mastery-hero--modal,
  .mastery-board-card,
  .mastery-detail-card,
  .mastery-hint-card {
    border-radius: 18px;
  }
  .mastery-board-viewport {
    min-height: 520px;
  }
}

/* ─── MASTERY TREE PREMIUM OVERHAUL — 2026-04-29 ─────────────────────────── */
.mastery-board-card {
  background:
    radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--tree-accent, #f59e0b) 16%, transparent), transparent 28%),
    radial-gradient(circle at 90% 100%, rgba(56, 189, 248, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(12, 17, 30, 0.98), rgba(3, 7, 18, 0.99));
}

.mastery-board-viewport {
  cursor: grab;
  touch-action: none;
  overscroll-behavior: contain;
  scroll-behavior: auto;
  border-color: color-mix(in srgb, var(--tree-accent, #f59e0b) 18%, rgba(255,255,255,0.08));
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--tree-accent, #f59e0b) 9%, transparent), transparent 46%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.86), rgba(2, 6, 23, 0.98));
}

.mastery-board-viewport[data-dragging="true"] {
  cursor: grabbing;
}

.mastery-board-shell {
  border-color: color-mix(in srgb, var(--tree-accent, #f59e0b) 18%, rgba(255,255,255,0.08));
  background:
    radial-gradient(circle at center, rgba(255,255,255,0.026), transparent 17%),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.018) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.014) 0 1px, transparent 1px 72px),
    linear-gradient(180deg, rgba(4, 7, 14, 1), rgba(5, 10, 21, 1));
}

.mastery-board-shell::before {
  content: "";
  position: absolute;
  inset: 10%;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--tree-accent, #f59e0b) 16%, transparent);
  background: radial-gradient(circle, color-mix(in srgb, var(--tree-accent, #f59e0b) 7%, transparent), transparent 62%);
  filter: blur(0.2px);
  pointer-events: none;
  z-index: 0;
}

.mastery-board-stage {
  transition: width 0.16s ease, height 0.16s ease;
}

.mastery-branch-region {
  opacity: 0.24;
  border-radius: 34px;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--branch-accent, #94a3b8) 12%, transparent), transparent 62%),
    linear-gradient(180deg, color-mix(in srgb, var(--branch-accent, #94a3b8) 6%, transparent), transparent);
}

.mastery-branch-region.is-focused,
.mastery-branch-region.is-suggested:not(.is-focused) {
  opacity: 0.88;
}

.mastery-branch-region-marker {
  display: inline-flex;
  position: absolute;
  top: 12px;
  left: 14px;
  align-items: center;
  gap: 7px;
  max-width: calc(100% - 28px);
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--branch-accent, #94a3b8) 28%, rgba(255,255,255,0.08));
  background: rgba(3, 7, 18, 0.52);
  color: color-mix(in srgb, var(--branch-accent, #94a3b8) 72%, white 18%);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 10px 24px rgba(0,0,0,0.22);
}

.mastery-link {
  stroke-width: 1.25;
  stroke-dasharray: 1 7;
}

.mastery-link.is-connected {
  stroke-dasharray: 3 5;
}

.mastery-link.is-available {
  stroke: rgba(125, 211, 252, 0.62);
  stroke-width: 1.65;
  stroke-dasharray: 7 5;
  filter: drop-shadow(0 0 14px rgba(56, 189, 248, 0.28));
}

.mastery-link.is-spent {
  stroke: rgba(134, 239, 172, 0.76);
  stroke-width: 1.7;
  stroke-dasharray: none;
  filter: drop-shadow(0 0 14px rgba(74, 222, 128, 0.24));
}

.mastery-link.is-focus {
  stroke-width: 2.35;
  stroke-dasharray: none;
}

.mastery-core-node {
  width: 132px;
  height: 132px;
}

.mastery-core-node-ring {
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.28), transparent 18%),
    radial-gradient(circle, color-mix(in srgb, var(--tree-accent, #f59e0b) 24%, transparent), rgba(15, 23, 42, 0.48) 58%, transparent 75%);
  box-shadow:
    0 0 0 12px color-mix(in srgb, var(--tree-accent, #f59e0b) 9%, transparent),
    0 0 48px color-mix(in srgb, var(--tree-accent, #f59e0b) 30%, transparent),
    inset 0 0 28px rgba(255,255,255,0.05);
}

.mastery-tree-node {
  width: 52px;
  height: 52px;
}

.mastery-tree-node-slot--small .mastery-tree-node {
  width: 48px;
  height: 48px;
}

.mastery-tree-node-slot--notable .mastery-tree-node {
  width: 88px;
  height: 88px;
}

.mastery-tree-node-ring {
  border-color: rgba(148, 163, 184, 0.34);
  background:
    radial-gradient(circle at 32% 26%, rgba(255,255,255,0.22), transparent 16%),
    radial-gradient(circle at 50% 56%, color-mix(in srgb, var(--branch-accent, #94a3b8) 14%, rgba(15, 23, 42, 0.88)), rgba(8, 12, 22, 1) 76%);
  box-shadow:
    0 0 0 7px rgba(255,255,255,0.014),
    inset 0 0 18px rgba(255,255,255,0.025);
}

.mastery-tree-node-slot--notable .mastery-tree-node-ring {
  box-shadow:
    0 0 0 10px color-mix(in srgb, var(--branch-accent, #94a3b8) 7%, transparent),
    0 0 34px color-mix(in srgb, var(--branch-accent, #f59e0b) 28%, transparent),
    inset 0 0 24px rgba(255,255,255,0.04);
}

.mastery-tree-node-slot.is-available .mastery-tree-node-ring {
  border-color: rgba(125, 211, 252, 0.86);
  box-shadow:
    0 0 0 9px rgba(56, 189, 248, 0.08),
    0 0 32px rgba(56, 189, 248, 0.34),
    inset 0 0 22px rgba(125, 211, 252, 0.08);
}

.mastery-tree-node-slot.is-unlocked .mastery-tree-node-ring {
  background:
    radial-gradient(circle at 34% 28%, rgba(255,255,255,0.24), transparent 16%),
    radial-gradient(circle at 50% 56%, color-mix(in srgb, var(--branch-accent, #22c55e) 24%, rgba(6, 78, 59, 0.72)), rgba(5, 46, 22, 0.95) 78%);
  border-color: rgba(134, 239, 172, 0.9);
  box-shadow:
    0 0 0 10px rgba(74, 222, 128, 0.07),
    0 0 34px rgba(74, 222, 128, 0.34),
    inset 0 0 24px rgba(187, 247, 208, 0.08);
}

.mastery-tree-node-slot.is-selected .mastery-tree-node-ring {
  border-color: color-mix(in srgb, var(--branch-accent, #f59e0b) 56%, #fde68a 30%);
  box-shadow:
    0 0 0 12px color-mix(in srgb, var(--branch-accent, #f59e0b) 13%, transparent),
    0 0 46px color-mix(in srgb, var(--branch-accent, #f59e0b) 58%, #f59e0b 18%),
    inset 0 0 26px rgba(255,255,255,0.07);
}

.mastery-tree-node-slot.is-locked {
  opacity: 0.38;
}

.mastery-tree-node-slot.is-dimmed {
  opacity: 0.18;
}

.mastery-tree-node-cost {
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  font-size: 11px;
}

.mastery-tree-node-label {
  max-width: 168px;
  padding: 6px 10px;
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 24%, rgba(255,255,255,0.08));
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.96), rgba(3, 7, 18, 0.94));
  white-space: nowrap;
}

.mastery-board-status {
  max-width: calc(100% - 220px);
}

.mastery-board-status-chip--hint {
  color: rgba(219, 234, 254, 0.76);
}

.mastery-detail-card {
  border-color: color-mix(in srgb, var(--branch-accent, #94a3b8) 18%, rgba(255,255,255,0.08));
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--branch-accent, #94a3b8) 14%, transparent), transparent 34%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.98), rgba(3, 7, 18, 0.98));
}

.mastery-detail-name {
  font-size: clamp(22px, 2.2vw, 30px);
}

.mastery-detail-meta span,
.mastery-detail-effect-pill,
.mastery-detail-covers-pill,
.mastery-detail-path-node {
  white-space: nowrap;
}

.mastery-detail-block {
  border-color: rgba(255,255,255,0.09);
  background:
    radial-gradient(circle at 0% 0%, color-mix(in srgb, var(--branch-accent, #94a3b8) 7%, transparent), transparent 38%),
    rgba(255,255,255,0.035);
}

.mastery-detail-btn {
  min-height: 44px;
  box-shadow:
    0 16px 28px rgba(0,0,0,0.24),
    inset 0 1px 0 rgba(255,255,255,0.08);
}

.mastery-detail-btn.is-unlock {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--branch-accent, #38bdf8) 52%, #2563eb 48%), #1d4ed8);
}

@media (max-width: 960px) {
  .mastery-board-status {
    position: static;
    max-width: none;
    margin: 8px 84px 8px 8px;
  }

  .mastery-board-nav {
    top: 10px;
    right: 10px;
  }

  .mastery-board-status-chip--hint {
    display: none;
  }
}

@media (max-width: 640px) {
  .mastery-board-viewport {
    min-height: 560px;
  }

  .mastery-core-node {
    width: 108px;
    height: 108px;
  }

  .mastery-tree-node,
  .mastery-tree-node-slot--small .mastery-tree-node {
    width: 46px;
    height: 46px;
  }

  .mastery-tree-node-slot--notable .mastery-tree-node {
    width: 76px;
    height: 76px;
  }

  .mastery-branch-region-marker {
    display: none;
  }

  .mastery-detail-meta,
  .mastery-detail-effects,
  .mastery-detail-covers-row,
  .mastery-detail-path-row {
    gap: 6px;
  }

  .mastery-detail-path-node {
    max-width: 100%;
    white-space: normal;
  }
}


/* ─── MASTERY TREE LARGE EXPANSION — 2026-04-29 ─────────────────────────── */
#mastery-tree-modal .mastery-tree-modal-box {
  width: min(1920px, calc(100vw - 18px));
  height: calc(100vh - 18px);
}

.mastery-tree-layout--modal {
  grid-template-columns: minmax(0, 1fr);
  position: relative;
  gap: 0;
  overflow: hidden;
}

.mastery-board-card {
  position: relative;
  min-height: 0;
  padding: 12px;
}

.mastery-board-viewport {
  min-height: min(78vh, 920px);
  border-radius: 28px;
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.045),
    inset 0 0 96px rgba(0,0,0,0.34),
    0 24px 70px rgba(0,0,0,0.34);
}

.mastery-board-stage {
  width: calc(2200px * var(--mastery-board-scale, 1));
  height: calc(1320px * var(--mastery-board-scale, 1));
}

.mastery-board-shell {
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--tree-accent, #f59e0b) 12%, transparent), transparent 20%),
    radial-gradient(circle at 50% 50%, rgba(255,255,255,0.035), transparent 36%),
    repeating-radial-gradient(circle at 50% 50%, rgba(255,255,255,0.018) 0 1px, transparent 1px 124px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.014) 0 1px, transparent 1px 88px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.012) 0 1px, transparent 1px 88px),
    linear-gradient(180deg, #050814, #030712 58%, #020617);
}

.mastery-side-column {
  position: absolute;
  top: 86px;
  right: 22px;
  bottom: 20px;
  z-index: 18;
  width: min(390px, 30vw);
  max-width: calc(100% - 44px);
  min-height: 0;
  overflow: visible;
  pointer-events: none;
}

.mastery-side-column > * {
  pointer-events: auto;
}

.mastery-side-column.is-collapsed {
  width: min(270px, 25vw);
  bottom: auto;
}

.mastery-detail-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 36px;
  margin: 0 0 8px auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: linear-gradient(180deg, rgba(15,23,42,0.92), rgba(3,7,18,0.92));
  color: #e5e7eb;
  font-weight: 850;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  box-shadow: 0 14px 34px rgba(0,0,0,0.32);
}

.mastery-detail-toggle:hover {
  border-color: color-mix(in srgb, var(--tree-accent, #f59e0b) 38%, rgba(255,255,255,0.14));
  color: #fff7ed;
}

.mastery-side-column .mastery-detail-card {
  max-height: calc(100% - 46px);
  overflow: auto;
  backdrop-filter: blur(18px);
  box-shadow:
    0 24px 80px rgba(0,0,0,0.48),
    inset 0 1px 0 rgba(255,255,255,0.06);
}

.mastery-detail-card--collapsed {
  padding: 14px;
}

.mastery-board-links {
  overflow: visible;
}

.mastery-link {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
  stroke-width: 2.1;
  stroke-dasharray: none;
  opacity: 0.58;
}

.mastery-link.is-connected {
  stroke-width: 2.3;
  stroke-dasharray: 6 9;
  opacity: 0.68;
}

.mastery-link.is-available {
  stroke-width: 3;
  stroke-dasharray: 12 8;
  opacity: 0.94;
}

.mastery-link.is-spent {
  stroke-width: 3.2;
  opacity: 0.98;
}

.mastery-link.is-focus {
  stroke-width: 4.2;
  opacity: 1;
}

.mastery-branch-region {
  border: 1px solid color-mix(in srgb, var(--branch-accent, #94a3b8) 12%, transparent);
  box-shadow: inset 0 0 42px color-mix(in srgb, var(--branch-accent, #94a3b8) 7%, transparent);
}

.mastery-branch-region-marker {
  top: 16px;
  left: 18px;
  padding: 7px 11px;
  backdrop-filter: blur(10px);
}

.mastery-branch-pill-row {
  overflow-x: auto;
  scrollbar-width: thin;
  padding-bottom: 4px;
}

.mastery-tree-node-slot.is-label-visible .mastery-tree-node-label,
.mastery-tree-node-slot:hover .mastery-tree-node-label,
.mastery-tree-node-slot:focus-within .mastery-tree-node-label {
  z-index: 25;
}

.mastery-tree-node-label {
  box-shadow: 0 14px 32px rgba(0,0,0,0.34);
}

@media (max-width: 1280px) {
  .mastery-side-column {
    width: min(360px, 34vw);
  }
}

@media (max-width: 960px) {
  .mastery-tree-layout--modal {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
  }

  .mastery-board-viewport {
    min-height: 64vh;
  }

  .mastery-side-column,
  .mastery-side-column.is-collapsed {
    position: relative;
    right: auto;
    bottom: auto;
    top: auto;
    width: 100%;
    max-width: none;
    padding: 0 4px 4px;
    z-index: 1;
  }

  .mastery-detail-toggle {
    margin-left: auto;
    margin-right: 6px;
  }

  .mastery-side-column .mastery-detail-card {
    max-height: none;
  }
}

@media (max-width: 640px) {
  .mastery-board-card {
    padding: 8px;
  }

  .mastery-board-viewport {
    min-height: 62vh;
    border-radius: 22px;
  }

  .mastery-detail-toggle span {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}


/* ─── MASTERY TREE FREE-PAN NAVIGATION — 2026-04-29 ─────────────────────── */
#mastery-tree-modal .mastery-tree-modal-box {
  width: min(1960px, calc(100vw - 10px));
  height: calc(100dvh - 10px);
  max-height: calc(100dvh - 10px);
  overflow: hidden;
}

#mastery-tree-modal .mastery-tree-modal-body,
#mastery-tree-modal-panel,
.mastery-shell--modal,
.mastery-tree-layout--modal,
.mastery-board-card {
  min-height: 0;
  overflow: hidden;
}

.mastery-shell--modal {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.mastery-topbar--modal {
  flex: 0 0 auto;
}

.mastery-tree-layout--modal {
  flex: 1 1 auto;
}

.mastery-board-card {
  height: 100%;
}

.mastery-board-viewport {
  min-height: 0;
  height: 100%;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  user-select: none;
  -webkit-user-select: none;
  overscroll-behavior: none;
  touch-action: none;
  contain: layout paint;
}

.mastery-board-viewport::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.mastery-board-viewport,
.mastery-board-viewport * {
  -webkit-tap-highlight-color: transparent;
}

.mastery-board-viewport[data-panning="true"] .mastery-tree-node,
.mastery-board-viewport[data-panning="true"] .mastery-tree-node-label,
.mastery-board-viewport[data-panning="true"] .mastery-core-node-label {
  pointer-events: none;
}

.mastery-board-viewport[data-dragging="true"] {
  cursor: grabbing;
}

.mastery-side-column .mastery-detail-card {
  overscroll-behavior: contain;
}

/* ─── MASTERY TREE INTERACTION CONTINUATION — 2026-04-29 ────────────────── */
.mastery-board-viewport {
  cursor: grab;
}

.mastery-board-viewport :where(.mastery-tree-node-slot, .mastery-tree-node, .mastery-tree-node *, .mastery-tree-node-label) {
  cursor: pointer;
}

.mastery-board-viewport[data-dragging="true"] :where(.mastery-tree-node-slot, .mastery-tree-node, .mastery-tree-node *, .mastery-tree-node-label) {
  cursor: pointer;
}

.mastery-board-viewport[data-panning="true"] {
  cursor: grabbing;
}

.mastery-tree-node {
  touch-action: manipulation;
  -webkit-user-drag: none;
}

.mastery-tree-node:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--branch-accent, #38bdf8) 78%, white 16%);
  outline-offset: 7px;
  border-radius: 999px;
}

.mastery-tree-node-slot {
  cursor: pointer;
  isolation: isolate;
}

.mastery-tree-node-slot::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  transform: translate(-50%, -50%) scale(0.82);
  background: radial-gradient(circle, color-mix(in srgb, var(--branch-accent, #94a3b8) 15%, transparent), transparent 68%);
  opacity: 0;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.mastery-tree-node-slot--notable::before {
  width: 130px;
  height: 130px;
}

.mastery-tree-node-slot:hover::before,
.mastery-tree-node-slot:focus-within::before {
  opacity: 0.8;
  transform: translate(-50%, -50%) scale(1);
}

.mastery-tree-node-slot.is-available::before {
  opacity: 0.52;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.2), transparent 70%);
}

.mastery-tree-node-slot.is-selected::before {
  opacity: 0.92;
  background:
    radial-gradient(circle, color-mix(in srgb, var(--branch-accent, #f59e0b) 24%, transparent), transparent 72%);
}

.mastery-tree-node-slot.is-selected .mastery-tree-node {
  filter: saturate(1.18) brightness(1.08);
}

.mastery-tree-node-slot.is-selected .mastery-tree-node::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--branch-accent, #f59e0b) 48%, rgba(255,255,255,0.16));
  box-shadow:
    0 0 22px color-mix(in srgb, var(--branch-accent, #f59e0b) 30%, transparent),
    inset 0 0 18px rgba(255,255,255,0.035);
  pointer-events: none;
}

.mastery-tree-node-slot.is-available .mastery-tree-node-aura {
  border-color: rgba(125, 211, 252, 0.48);
  background:
    radial-gradient(circle, rgba(56, 189, 248, 0.16), transparent 70%);
}

.mastery-tree-node-slot.is-unlocked .mastery-tree-node-check {
  text-shadow: 0 0 12px rgba(134, 239, 172, 0.72);
}

.mastery-tree-node-slot.is-locked .mastery-tree-node {
  filter: grayscale(0.16) brightness(0.78);
}

.mastery-link {
  pointer-events: stroke;
}

.mastery-link:hover {
  opacity: 1;
  stroke-width: 3.8;
  filter: drop-shadow(0 0 16px color-mix(in srgb, var(--branch-accent, #94a3b8) 28%, transparent));
}

.mastery-board-shell::after {
  background-image:
    radial-gradient(circle at 12% 18%, rgba(255,255,255,0.24) 0 1px, transparent 1px),
    radial-gradient(circle at 26% 74%, rgba(255,255,255,0.18) 0 1px, transparent 1px),
    radial-gradient(circle at 73% 20%, rgba(255,255,255,0.18) 0 1px, transparent 1px),
    radial-gradient(circle at 88% 68%, rgba(255,255,255,0.16) 0 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--tree-accent, #f59e0b) 20%, transparent) 0 1px, transparent 1px);
  opacity: 0.72;
}

.mastery-detail-toggle {
  cursor: pointer;
}

.mastery-detail-card {
  box-shadow:
    0 28px 88px rgba(0,0,0,0.5),
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 0 0 1px color-mix(in srgb, var(--branch-accent, #94a3b8) 10%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .mastery-tree-node-slot::before,
  .mastery-tree-node,
  .mastery-tree-node-ring,
  .mastery-link {
    transition: none !important;
  }
}

@media (max-width: 960px) {
  #mastery-tree-modal .mastery-tree-modal-box {
    width: calc(100vw - 8px);
    height: calc(100dvh - 8px);
    max-height: calc(100dvh - 8px);
  }

  .mastery-tree-layout--modal {
    overflow: hidden;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
  }

  .mastery-board-card {
    min-height: 0;
  }

  .mastery-board-viewport {
    min-height: 0;
    height: 100%;
    overflow: auto;
  }

  .mastery-side-column,
  .mastery-side-column.is-collapsed {
    position: relative;
    width: 100%;
    max-width: none;
    max-height: min(34dvh, 300px);
    overflow: hidden;
    padding: 0 4px 4px;
  }

  .mastery-side-column .mastery-detail-card {
    max-height: calc(min(34dvh, 300px) - 44px);
    overflow: auto;
  }
}

@media (max-width: 640px) {
  .mastery-board-viewport {
    min-height: 0;
  }

  .mastery-branch-pill-row {
    scrollbar-width: none;
  }

  .mastery-branch-pill-row::-webkit-scrollbar {
    display: none;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESOURCE / LOOT GAIN POPUP (2026-04-19 — gain-popup-v1)
   Premium Melvor-style float popups for item/gold gains.
   Stage is fixed to upper-right of viewport; stacks vertically.
═══════════════════════════════════════════════════════════════ */
.gain-popup-stage {
  position: fixed;
  top: 72px;
  right: 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 9999;
  pointer-events: none;
  max-height: calc(100vh - 100px);
  overflow: hidden;
}

.gain-popup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(20, 26, 38, 0.96), rgba(14, 18, 28, 0.96));
  border: 1px solid rgba(120, 170, 255, 0.35);
  box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  color: #e6edf7;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 500;
  max-width: 320px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
  animation: gainPopupIn 220ms cubic-bezier(0.2, 0.8, 0.2, 1.2) forwards;
  will-change: transform, opacity;
}

.gain-popup.is-leaving {
  animation: gainPopupOut 420ms cubic-bezier(0.4, 0.0, 0.6, 1) forwards;
}

.gain-popup.is-bumped {
  animation: gainPopupBump 260ms cubic-bezier(0.2, 0.8, 0.2, 1.2);
}

.gain-popup--gold {
  border-color: rgba(245, 200, 90, 0.55);
  background: linear-gradient(135deg, rgba(42, 32, 14, 0.96), rgba(26, 20, 10, 0.96));
}

/* Rare / unique / very-low-weight drops — premium purple pill with a gentle
   violet glow. Strong enough to catch the eye, restrained enough not to
   spam the HUD when multiple rare drops arrive in a row. */
.gain-popup--rare {
  border-color: rgba(196, 142, 255, 0.75);
  background: linear-gradient(135deg, rgba(48, 26, 78, 0.96), rgba(22, 12, 38, 0.96));
  box-shadow:
    0 6px 18px -8px rgba(0, 0, 0, 0.75),
    0 0 0 1px rgba(220, 180, 255, 0.10) inset,
    0 0 18px -4px rgba(180, 120, 255, 0.55);
}
.gain-popup--rare .gain-popup-qty {
  color: #e5c4ff;
  text-shadow: 0 0 8px rgba(196, 142, 255, 0.55);
}
.gain-popup--rare .gain-popup-name {
  color: #f3e7ff;
  font-weight: 600;
}
.gain-popup--rare .gain-popup-icon {
  background: rgba(196, 142, 255, 0.12);
  box-shadow: 0 0 0 1px rgba(196, 142, 255, 0.35) inset;
}

.gain-popup-icon {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.gain-popup-icon > img,
.gain-popup-icon > .item-icon {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain;
  margin: 0 !important;
  padding: 0 !important;
  font-size: 16px !important;
  line-height: 1 !important;
}

.gain-popup-icon--coin {
  background: radial-gradient(circle at 30% 30%, #ffe58a, #c78a1e);
  color: #3a2605;
  font-weight: 700;
  font-size: 14px;
}

.gain-popup-qty {
  color: #9cf07a;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.gain-popup--gold .gain-popup-qty {
  color: #ffdf87;
}

.gain-popup-name {
  color: #e6edf7;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

@keyframes gainPopupIn {
  0%   { opacity: 0; transform: translateY(-12px) scale(0.92); }
  60%  { opacity: 1; transform: translateY(2px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes gainPopupOut {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-20px) scale(0.96); }
}

@keyframes gainPopupBump {
  0%   { transform: translateY(0) scale(1); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.75); }
  40%  { transform: translateY(-2px) scale(1.06); box-shadow: 0 8px 24px -6px rgba(120, 200, 255, 0.45); }
  100% { transform: translateY(0) scale(1); box-shadow: 0 6px 18px -8px rgba(0, 0, 0, 0.75); }
}

@media (max-width: 640px) {
  .gain-popup-stage {
    top: 58px;
    right: 8px;
    gap: 4px;
  }
  .gain-popup {
    font-size: 12px;
    padding: 5px 10px 5px 6px;
    max-width: 240px;
  }
  .gain-popup-icon {
    width: 22px;
    height: 22px;
  }
  .gain-popup-name {
    max-width: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gain-popup,
  .gain-popup.is-leaving,
  .gain-popup.is-bumped {
    animation-duration: 1ms !important;
  }
}

/* SKILL LEVEL-UP CELEBRATIONS (2026-04-28)
   Non-blocking premium popup with milestone fireworks for 99 / 120 / 200M. */
.level-up-stage {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 10020;
  display: grid;
  gap: 10px;
  width: min(430px, calc(100vw - 28px));
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.level-up-popup {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(246, 204, 123, 0.34);
  border-radius: 14px;
  background:
    radial-gradient(circle at 18% 0%, rgba(246, 204, 123, 0.18), transparent 38%),
    linear-gradient(180deg, rgba(32, 29, 22, 0.98), rgba(12, 14, 21, 0.98));
  box-shadow:
    0 22px 54px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    0 0 30px rgba(246, 204, 123, 0.12);
  color: #fff4dd;
  opacity: 0;
  transform: translateY(10px) scale(0.96);
  animation: levelPopupIn 260ms cubic-bezier(0.2, 0.8, 0.2, 1.15) forwards;
}

.level-up-popup.is-leaving {
  animation: levelPopupOut 320ms ease forwards;
}

.level-up-popup--milestone {
  border-color: rgba(255, 219, 132, 0.68);
  box-shadow:
    0 24px 62px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 238, 180, 0.1) inset,
    0 0 44px rgba(255, 201, 83, 0.26);
}

.level-up-popup-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(246, 204, 123, 0.32);
  background:
    radial-gradient(circle at 30% 22%, rgba(255, 239, 192, 0.24), transparent 32%),
    linear-gradient(180deg, rgba(83, 61, 25, 0.9), rgba(22, 18, 12, 0.96));
  overflow: hidden;
}

.level-up-popup-icon img,
.level-up-popup-icon .skill-art-icon,
.level-up-popup-icon .level-up-skill-icon {
  width: 42px !important;
  height: 42px !important;
  object-fit: contain;
}

.level-up-popup-icon--summary {
  color: #ffe29a;
  font-size: 26px;
}

.level-up-popup-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.level-up-popup-kicker {
  color: #f6cc7b;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.level-up-popup-title {
  color: #fff7e8;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.08;
}

.level-up-popup-level {
  color: #d9e6ff;
  font-size: 13px;
  font-weight: 800;
}

.level-up-popup-level span {
  color: #f6cc7b;
  padding: 0 4px;
}

.level-up-popup-message {
  color: rgba(230, 237, 247, 0.82);
  font-size: 12px;
  line-height: 1.35;
}

.level-up-popup-list {
  display: grid;
  gap: 3px;
  color: rgba(230, 237, 247, 0.84);
  font-size: 11px;
}

.level-up-popup-list b {
  color: #ffe8af;
  font-weight: 850;
}

.level-fireworks-layer {
  position: fixed;
  inset: 0;
  z-index: 10010;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 28%, rgba(255, 217, 132, 0.12), transparent 34%);
  transition: opacity 180ms ease;
}

.level-fireworks-layer.is-active {
  opacity: 1;
}

.level-firework-spark {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: hsl(var(--hue), 94%, 64%);
  box-shadow: 0 0 14px hsl(var(--hue), 94%, 64%);
  animation: levelFireworkSpark 1250ms ease-out var(--delay) forwards;
}

.skill-level.is-virtual,
.skill-detail-level.is-virtual,
.mobile-skill-row-level.is-virtual,
.skill-progress-level.is-virtual {
  border-color: rgba(132, 212, 255, 0.32);
  color: #bcecff;
  background: rgba(83, 174, 230, 0.13);
}

@keyframes levelPopupIn {
  0% { opacity: 0; transform: translateY(12px) scale(0.94); }
  70% { opacity: 1; transform: translateY(-2px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes levelPopupOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(0.97); }
}

@keyframes levelFireworkSpark {
  0% { opacity: 0; transform: translate(0, 0) scale(0.3); }
  14% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(0.05); }
}

@media (max-width: 640px) {
  .level-up-stage {
    top: 46%;
    width: min(360px, calc(100vw - 18px));
  }
  .level-up-popup {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-radius: 12px;
  }
  .level-up-popup-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
  }
  .level-up-popup-title {
    font-size: 17px;
  }
  .level-up-popup-message {
    font-size: 11px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .level-up-popup,
  .level-up-popup.is-leaving,
  .level-firework-spark {
    animation-duration: 1ms !important;
  }
  .level-fireworks-layer {
    transition: none !important;
    background: radial-gradient(circle at 50% 28%, rgba(255, 217, 132, 0.18), transparent 34%);
  }
}

/* OPEN-BETA DESIGN SYSTEM NORMALIZATION (2026-04-28)
   Shared primitives only: cards, buttons, tabs, modals, chips, progress,
   empty states, tooltips, mobile spacing, and reduced-motion behavior. */
:root {
  --ui-surface-base: rgba(13, 16, 26, 0.92);
  --ui-surface-raised: rgba(28, 33, 49, 0.92);
  --ui-surface-hover: rgba(35, 40, 58, 0.94);
  --ui-surface-active: rgba(58, 48, 34, 0.94);
  --ui-border-muted: rgba(158, 178, 220, 0.16);
  --ui-border-strong: rgba(244, 199, 118, 0.34);
  --ui-border-danger: rgba(255, 151, 132, 0.28);
  --ui-text-soft: rgba(232, 226, 214, 0.78);
  --ui-text-faint: rgba(202, 202, 214, 0.62);
  --ui-gold: #f5cf86;
  --ui-blue: #8fd3ff;
  --ui-green: #74e59a;
  --ui-red: #ff9b83;
  --ui-radius-xs: 4px;
  --ui-radius-sm: 6px;
  --ui-radius-md: 8px;
  --ui-gap-xs: 4px;
  --ui-gap-sm: 6px;
  --ui-gap-md: 8px;
  --ui-gap-lg: 12px;
  --ui-gap-xl: 16px;
  --ui-ease-standard: cubic-bezier(0.22, 1, 0.36, 1);
  --ui-motion-fast: 120ms;
  --ui-motion-normal: 180ms;
  --ui-shadow-flat: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --ui-shadow-raised:
    0 14px 24px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --ui-shadow-hover:
    0 18px 30px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  --ui-focus-ring:
    0 0 0 2px rgba(244, 199, 118, 0.24),
    0 0 0 5px rgba(92, 143, 229, 0.14);
}

:where(
  .skill-progress-card,
  .tt-live-card,
  .tt-live-empty,
  .combat-stat,
  .combat-automation-card,
  .devotion-summary-card,
  .stats-card,
  .bounty-master-card,
  .bounty-task-card,
  .shop-card,
  .tool-card,
  .quest-detail-section,
  .quest-detail-pane,
  .bestiary-row,
  .hof-table-row,
  .milestone-achievement-card,
  .archive-realm-title-card,
  .title-archive-summary-card,
  .archive-skill-title-card,
  .mobile-hero-card,
  .mobile-hero-section-card,
  .mobile-activity-shell,
  .mobile-skill-group,
  .mobile-skills-copy,
  .mobile-journey-card,
  .mj-card,
  .cs-slot-card,
  .cloud-slot-row,
  .admin-summary-card,
  .admin-key-card,
  .admin-report-card
) {
  border-radius: var(--ui-radius-md);
  border-color: var(--ui-border-muted);
  background:
    radial-gradient(circle at 16% 0%, rgba(244, 199, 118, 0.07), transparent 28%),
    linear-gradient(180deg, var(--ui-surface-raised), var(--ui-surface-base));
  box-shadow: var(--ui-shadow-raised);
}

:where(
  .training-action,
  .monster-card,
  .dungeon-card,
  .quest-row,
  .shop-item,
  .outfit-entry,
  .ge-result-row,
  .ge-quick-item,
  .save-conflict-line
) {
  border-radius: var(--ui-radius-md);
  border-color: var(--ui-border-muted);
  background: linear-gradient(180deg, var(--ui-surface-raised), var(--ui-surface-base));
  box-shadow: var(--ui-shadow-flat);
}

@media (hover: hover) and (pointer: fine) {
  :where(
    .training-action,
    .monster-card,
    .dungeon-card,
    .quest-row,
    .shop-card,
    .tool-card,
    .bestiary-row,
    .hof-table-row,
    .milestone-achievement-card,
    .archive-realm-title-card,
    .mobile-skill-row,
    .mobile-journey-card,
    .mj-card,
    .ge-result-row,
    .cs-slot-card,
    .cloud-slot-row
  ):hover {
    border-color: var(--ui-border-strong);
    background:
      radial-gradient(circle at 18% 0%, rgba(244, 199, 118, 0.1), transparent 30%),
      linear-gradient(180deg, var(--ui-surface-hover), var(--ui-surface-base));
    box-shadow: var(--ui-shadow-hover);
    transform: translateY(-1px);
  }
}

:where(
  .btn-primary,
  .btn-outline,
  .btn-danger,
  .fight-btn,
  .train-btn,
  .quest-action-btn,
  .shop-visit-btn,
  .tool-upgrade-btn,
  .shop-btn,
  .ge-action-btn,
  .ge-confirm-btn,
  .ge-cancel-btn,
  .dungeon-card-btn,
  .unlock-notice-btn,
  .item-menu-btn,
  .ge-preset-btn,
  .hof-page-btn,
  .shop-back-btn,
  .modal-close,
  .mobile-surface-back-btn,
  .mobile-combat-subview-close,
  .mobile-quest-detail-close
) {
  min-height: 34px;
  border-radius: var(--ui-radius-md);
  transition:
    transform var(--ui-motion-fast) var(--ui-ease-standard),
    border-color var(--ui-motion-fast) ease,
    background var(--ui-motion-fast) ease,
    color var(--ui-motion-fast) ease,
    box-shadow var(--ui-motion-fast) ease,
    filter var(--ui-motion-fast) ease;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.btn-outline,
.ge-cancel-btn,
.item-menu-btn,
.ge-preset-btn,
.hof-page-btn,
.shop-back-btn,
.mobile-surface-back-btn,
.mobile-combat-subview-close,
.mobile-quest-detail-close {
  border-color: var(--ui-border-muted);
  background: linear-gradient(180deg, rgba(31, 36, 54, 0.92), rgba(13, 16, 26, 0.9));
  color: var(--ui-text-soft);
  box-shadow: var(--ui-shadow-flat);
}

.btn-primary,
.train-btn,
.quest-action-btn[data-quest-action="start"],
.quest-action-btn[data-quest-action="resume"],
.shop-visit-btn,
.tool-upgrade-btn:not(.disabled),
.shop-btn--convert,
.shop-btn--outfit,
.ge-action-btn,
.ge-confirm-btn,
.cs-play-btn,
.cs-create-btn,
.unlock-notice-btn {
  border-color: rgba(207, 190, 255, 0.38);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.16), transparent 26%),
    linear-gradient(135deg, rgba(104, 94, 255, 0.98), rgba(72, 148, 255, 0.96));
  color: #fffaf1;
  box-shadow:
    0 13px 24px rgba(69, 76, 177, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn-danger,
.fight-btn,
.combat-panel-retreat,
.mobile-combat-retreat-btn {
  border-color: var(--ui-border-danger);
  background:
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.14), transparent 26%),
    linear-gradient(135deg, rgba(255, 140, 96, 0.98), rgba(190, 68, 100, 0.96));
  color: #fff5ee;
}

@media (hover: hover) and (pointer: fine) {
  :where(
    .btn-primary,
    .btn-outline,
    .btn-danger,
    .fight-btn,
    .train-btn,
    .quest-action-btn,
    .shop-visit-btn,
    .tool-upgrade-btn,
    .shop-btn,
    .ge-action-btn,
    .ge-confirm-btn,
    .ge-cancel-btn,
    .dungeon-card-btn,
    .unlock-notice-btn,
    .item-menu-btn,
    .ge-preset-btn,
    .hof-page-btn,
    .shop-back-btn,
    .modal-close,
    .mobile-surface-back-btn
  ):hover:not(:disabled) {
    border-color: var(--ui-border-strong);
    filter: brightness(1.06);
    transform: translateY(-1px);
    box-shadow: var(--ui-shadow-hover);
  }
}

:where(
  .btn-primary,
  .btn-outline,
  .btn-danger,
  .fight-btn,
  .train-btn,
  .quest-action-btn,
  .shop-visit-btn,
  .tool-upgrade-btn,
  .shop-btn,
  .ge-action-btn,
  .ge-confirm-btn,
  .ge-cancel-btn,
  .dungeon-card-btn,
  .unlock-notice-btn,
  .item-menu-btn,
  .ge-preset-btn,
  .hof-page-btn,
  .shop-back-btn,
  .modal-close,
  .mobile-surface-back-btn,
  .tab-btn,
  .right-tab,
  .nav-btn,
  .mobile-nav-btn,
  .platform-choice-btn,
  .cc-mode-card,
  .mobile-skill-row,
  .mobile-journey-card,
  .mj-card
):active:not(:disabled) {
  transform: translateY(1px) scale(0.995);
  filter: brightness(0.97);
}

:where(
  .tab-btn,
  .right-tab,
  .nav-btn,
  .mobile-nav-btn,
  .ge-mode-tab,
  .archive-view-btn,
  .hof-cat-btn
) {
  border-radius: var(--ui-radius-md);
  border-color: var(--ui-border-muted);
  background: linear-gradient(180deg, rgba(31, 36, 54, 0.86), rgba(13, 16, 26, 0.82));
  color: var(--ui-text-soft);
}

:where(
  .tab-btn.active,
  .right-tab.active,
  .mobile-nav-btn.active,
  .ge-mode-tab.active,
  .archive-view-btn.active,
  .hof-cat-btn.active
) {
  border-color: var(--ui-border-strong);
  background:
    radial-gradient(circle at top, rgba(245, 203, 122, 0.18), transparent 72%),
    linear-gradient(180deg, var(--ui-surface-active), rgba(20, 18, 27, 0.92));
  color: #fff6ea;
  box-shadow:
    var(--ui-shadow-raised),
    0 0 0 1px rgba(247, 208, 127, 0.08);
}

:where(
  .nav-btn,
  .mobile-nav-btn,
  .right-tab,
  .tab-btn,
  .btn-outline,
  .btn-primary,
  .btn-danger,
  .fight-btn,
  .train-btn,
  .quest-action-btn,
  .shop-visit-btn,
  .tool-upgrade-btn,
  .shop-btn,
  .ge-action-btn,
  .ge-confirm-btn,
  .ge-cancel-btn,
  .dungeon-card-btn,
  .modal-close,
  .mobile-surface-back-btn,
  .platform-choice-btn,
  .cc-mode-card,
  .skill-tile,
  .training-action,
  .monster-card,
  .dungeon-card,
  .quest-row,
  .cs-slot-card,
  .inv-slot,
  .bank-slot,
  .equip-slot,
  .mobile-skill-row,
  .mobile-journey-card,
  .mj-card,
  .ge-mode-tab,
  input,
  textarea,
  select
):focus-visible {
  outline: none;
  box-shadow: var(--ui-focus-ring), var(--ui-shadow-raised);
}

:where(
  .btn-primary,
  .btn-outline,
  .btn-danger,
  .fight-btn,
  .train-btn,
  .quest-action-btn,
  .shop-visit-btn,
  .tool-upgrade-btn,
  .shop-btn,
  .ge-action-btn,
  .ge-confirm-btn,
  .ge-cancel-btn,
  .dungeon-card-btn,
  .unlock-notice-btn,
  .tab-btn,
  .right-tab,
  .nav-btn,
  .mobile-nav-btn
):disabled,
:where(.disabled, .is-disabled) {
  cursor: not-allowed;
  opacity: 0.54;
  filter: saturate(0.75);
  transform: none !important;
}

.modal {
  background: rgba(3, 5, 10, 0.62);
  backdrop-filter: blur(8px) saturate(1.02);
}

.modal-box,
.gs-modal-box,
.daily-modal-box,
.mastery-tree-modal-box,
.mastery-help-modal-box {
  border-radius: var(--ui-radius-md);
  border: 1px solid rgba(239, 194, 110, 0.28);
  background:
    radial-gradient(circle at 16% 0%, rgba(244, 199, 118, 0.11), transparent 30%),
    radial-gradient(circle at 100% 0%, rgba(103, 173, 255, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(24, 28, 42, 0.98), rgba(9, 11, 18, 0.97));
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.58),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.modal-header {
  min-height: 48px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(244, 199, 118, 0.14);
  background:
    linear-gradient(180deg, rgba(42, 47, 70, 0.9), rgba(19, 23, 36, 0.9));
}

.modal-title {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: #fff2d6;
  line-height: 1.2;
}

.modal-close {
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ui-text-soft);
}

.modal-body {
  color: var(--ui-text-soft);
}

.modal-footer {
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid rgba(244, 199, 118, 0.1);
  background: rgba(5, 8, 15, 0.28);
}

:where(
  .consume-item,
  .quest-detail-meta-chip,
  .dungeon-chip,
  .mobile-summary-inline-focus,
  .mobile-combat-pill,
  .mobile-combat-summary-focus,
  .admin-key-state,
  .admin-report-pill,
  .closed-beta-status,
  .save-conflict-pill,
  .cs-slot-flag,
  .cs-slot-chip,
  .cs-mode-badge,
  .bounty-badge,
  .bounty-req-tag,
  .dungeon-card-state,
  .mobile-skill-row-cta,
  .platform-recommended-badge,
  .resume-loading-stage,
  .pn-badge,
  .cc-perk,
  .mastery-modal-pts-badge,
  .mastery-board-status-chip,
  .mastery-overview-path-badge,
  .fallen-loot-chip,
  .dungeon-hero-chip
) {
  border-radius: 999px;
  border: 1px solid var(--ui-border-muted);
  background: rgba(255, 255, 255, 0.055);
  color: var(--ui-text-soft);
  box-shadow: var(--ui-shadow-flat);
}

:where(.pn-badge.new, .platform-recommended-badge, .dungeon-hero-chip.is-unlocked, .save-conflict-pill.is-newer) {
  border-color: rgba(116, 229, 154, 0.24);
  background: rgba(116, 229, 154, 0.09);
  color: #baf7ca;
}

:where(.pn-badge.fix, .dungeon-chip.is-threat, .ui-tt-chip.quest) {
  border-color: rgba(168, 132, 255, 0.2);
  background: rgba(140, 112, 255, 0.12);
}

:where(
  .skill-bar-bg,
  .skill-progress-track,
  .mobile-skill-row-bar,
  .tt-xp-bar-bg,
  .quest-stage-meter,
  .tool-progress-wrap,
  .daily-task-progress,
  .daily-progress-bar,
  .resume-loading-progress-track,
  .dungeon-progress-bar-wrap,
  .mastery-progress-bar
) {
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.06);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    inset 0 -1px 0 rgba(0, 0, 0, 0.24);
}

:where(
  .skill-bar-fill,
  .skill-progress-fill,
  .mobile-skill-row-fill,
  .tt-xp-bar-fill,
  .quest-stage-fill,
  .tool-progress-bar,
  .daily-progress-bar span,
  .resume-loading-progress-bar,
  .dungeon-progress-bar-inner,
  .mastery-progress-bar span
) {
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(245, 207, 134, 0.96), rgba(143, 211, 255, 0.92));
  box-shadow:
    0 0 14px rgba(245, 207, 134, 0.16),
    0 0 8px rgba(143, 211, 255, 0.12);
  transition: width var(--ui-motion-normal) ease, transform var(--ui-motion-normal) ease;
}

:where(
  .training-tab-empty,
  .tt-live-empty,
  .quest-detail-empty,
  .bounty-empty-state,
  .mobile-activity-empty,
  .gs-empty,
  .mastery-empty-state
) {
  border-radius: var(--ui-radius-md);
  border: 1px solid rgba(158, 178, 220, 0.16);
  background:
    radial-gradient(circle at top, rgba(244, 199, 118, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(26, 30, 45, 0.9), rgba(10, 12, 20, 0.84));
  color: var(--ui-text-soft);
  box-shadow: var(--ui-shadow-flat);
}

:where(
  #global-q-tooltip,
  #global-ui-tooltip,
  .ui-tooltip-card,
  .item-context-menu
) {
  border-radius: var(--ui-radius-md);
  border-color: rgba(244, 199, 118, 0.24);
  background:
    radial-gradient(circle at 12% 0%, rgba(244, 199, 118, 0.1), transparent 30%),
    linear-gradient(180deg, rgba(20, 24, 36, 0.98), rgba(8, 10, 17, 0.98));
  box-shadow:
    0 18px 46px rgba(0, 0, 0, 0.54),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

body.platform-mobile {
  --ui-mobile-page-gap: 8px;
  --ui-mobile-panel-pad: 14px;
}

body.platform-mobile #game-screen {
  gap: var(--ui-mobile-page-gap);
}

body.platform-mobile .panel,
body.platform-mobile .modal-box,
body.platform-mobile .mobile-quest-detail-pane,
body.platform-mobile .mobile-combat-subview-body {
  border-radius: var(--ui-radius-md);
}

body.platform-mobile .tab-btn,
body.platform-mobile .right-tab,
body.platform-mobile .mobile-nav-btn,
body.platform-mobile .btn-primary,
body.platform-mobile .btn-outline,
body.platform-mobile .btn-danger,
body.platform-mobile .fight-btn,
body.platform-mobile .train-btn,
body.platform-mobile .quest-action-btn,
body.platform-mobile .shop-btn,
body.platform-mobile .ge-action-btn,
body.platform-mobile .ge-confirm-btn,
body.platform-mobile .ge-cancel-btn {
  min-height: 44px;
}

body.platform-mobile .mobile-surface-scroll,
body.platform-mobile [data-tab-group="right"][data-tab-content] {
  overscroll-behavior: contain;
}

body.platform-mobile .modal {
  padding: max(8px, env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
}

body.platform-mobile .modal-body {
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 420px) {
  body.platform-mobile .modal-header,
  body.platform-mobile .modal-footer {
    padding-inline: 12px;
  }

  body.platform-mobile .mobile-surface-scroll,
  body.platform-mobile #mobile-hero-panel .mobile-surface-scroll,
  body.platform-mobile #mobile-journey-grid.mobile-surface-scroll,
  body.platform-mobile #mobile-quests-panel .mobile-surface-scroll {
    padding-inline: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --ui-motion-fast: 1ms;
    --ui-motion-normal: 1ms;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }

  :where(
    .btn-primary,
    .btn-outline,
    .btn-danger,
    .fight-btn,
    .train-btn,
    .quest-action-btn,
    .shop-visit-btn,
    .tool-upgrade-btn,
    .shop-btn,
    .ge-action-btn,
    .ge-confirm-btn,
    .ge-cancel-btn,
    .dungeon-card-btn,
    .unlock-notice-btn,
    .item-menu-btn,
    .modal-close,
    .tab-btn,
    .right-tab,
    .nav-btn,
    .mobile-nav-btn,
    .platform-choice-btn,
    .cc-mode-card,
    .skill-tile,
    .training-action,
    .monster-card,
    .dungeon-card,
    .quest-row,
    .shop-card,
    .tool-card,
    .ge-result-row,
    .mobile-skill-row,
    .mobile-journey-card,
    .mj-card,
    .modal,
    .modal-box,
    .gain-popup,
    .gain-popup.is-leaving,
    .gain-popup.is-bumped
  ) {
    animation: none !important;
    transition: none !important;
    transform: none !important;
  }
}

/* OPEN-BETA UI PHASE 2: CHARACTER HUB + CREATE CHARACTER POLISH (2026-04-28)
   Presentation-only refinements for hub hierarchy, local/cloud clarity,
   create-character cards, mobile fit, and safe action affordances. */
:root {
  --hub-phase2-gold: rgba(245, 207, 134, 0.94);
  --hub-phase2-blue: rgba(143, 211, 255, 0.92);
  --hub-phase2-green: rgba(116, 229, 154, 0.9);
  --hub-phase2-red: rgba(255, 155, 131, 0.92);
  --hub-phase2-line: rgba(165, 185, 228, 0.18);
  --hub-phase2-line-strong: rgba(245, 207, 134, 0.34);
  --hub-phase2-panel:
    radial-gradient(circle at 8% 0%, rgba(245, 207, 134, 0.1), transparent 26%),
    radial-gradient(circle at 96% 0%, rgba(143, 211, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(23, 28, 43, 0.96), rgba(8, 10, 18, 0.95));
  --hub-phase2-card:
    radial-gradient(circle at 0% 0%, rgba(245, 207, 134, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(28, 33, 49, 0.94), rgba(11, 14, 23, 0.92));
}

#char-select-hub .hub-panel {
  width: min(1480px, calc(100vw - 36px));
  padding: 34px 36px 28px;
  gap: 24px;
  border-radius: 20px;
  border-color: rgba(245, 207, 134, 0.28);
  background: var(--hub-phase2-panel);
}

#char-select-hub .hub-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-bottom: 16px;
}

#char-select-hub .hub-title {
  font-size: clamp(32px, 3vw, 44px);
  line-height: 1.04;
  color: #fff3d9;
  font-weight: 800;
  letter-spacing: -0.01em;
}

#char-select-hub .hub-copy {
  max-width: 760px;
  font-size: 14px;
  line-height: 1.52;
  color: rgba(232, 226, 214, 0.78);
}

#char-select-hub .hub-status {
  align-self: flex-start;
  width: auto;
  min-width: 0;
  max-width: min(100%, 600px);
  border-radius: 999px;
  padding: 10px 13px;
  border: 1px solid rgba(165, 185, 228, 0.2);
  background: rgba(20, 30, 52, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  font-size: 12.4px;
  line-height: 1.45;
}

#char-select-hub .hub-grid {
  grid-template-columns: minmax(520px, 1.5fr) minmax(340px, 0.92fr);
  gap: 18px;
}

#char-select-hub .hub-column {
  padding: 18px;
  gap: 14px;
  border-radius: 12px;
  border-color: var(--hub-phase2-line);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.035), transparent 26%),
    linear-gradient(180deg, rgba(24, 29, 43, 0.92), rgba(10, 13, 22, 0.9));
}

#char-select-hub .hub-column-local {
  border-color: rgba(245, 207, 134, 0.22);
}

#char-select-hub .hub-column-cloud {
  border-color: rgba(143, 211, 255, 0.22);
}

#char-select-hub .hub-column-community {
  border-color: rgba(193, 169, 255, 0.18);
}

#char-select-hub .hub-column-header {
  position: relative;
  min-height: 66px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-areas:
    "icon eyebrow"
    "icon title"
    "note note";
  align-items: center;
  gap: 2px 10px;
  padding-bottom: 12px;
}

#char-select-hub .hub-column-header::before {
  grid-area: icon;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid rgba(245, 207, 134, 0.18);
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 246, 226, 0.16), transparent 28%),
    linear-gradient(180deg, rgba(46, 42, 33, 0.94), rgba(18, 17, 15, 0.92));
  color: var(--hub-phase2-gold);
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
}

#char-select-hub .hub-column-local .hub-column-header::before {
  content: "\f0c7";
}

#char-select-hub .hub-column-cloud .hub-column-header::before {
  content: "\f0c2";
  border-color: rgba(143, 211, 255, 0.2);
  color: var(--hub-phase2-blue);
}

#char-select-hub .hub-column-community .hub-column-header::before {
  content: "\f091";
  border-color: rgba(193, 169, 255, 0.2);
  color: rgba(210, 194, 255, 0.92);
}

#char-select-hub .hub-column-eyebrow {
  grid-area: eyebrow;
  line-height: 1;
  letter-spacing: 0.16em;
}

#char-select-hub .hub-column-title {
  grid-area: title;
  font-size: 22px;
  line-height: 1.12;
}

#char-select-hub .hub-column-note {
  grid-area: note;
  max-width: none;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(217, 214, 228, 0.72);
}

#char-select-hub .hub-save-slots {
  gap: 12px;
}

#char-select-hub .cs-slot-card,
#char-select-hub .cloud-slot-row,
#char-select-hub .closed-beta-summary,
#char-select-hub .closed-beta-panel,
#char-select-hub .cloud-slot-preview-empty {
  border-radius: 10px;
  border-color: var(--hub-phase2-line);
  background: var(--hub-phase2-card);
}

#char-select-hub .cs-slot-card {
  overflow: hidden;
  box-shadow:
    0 16px 28px rgba(0, 0, 0, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

#char-select-hub .cs-slot-card.cs-is-cloud-linked {
  border-color: rgba(143, 211, 255, 0.24);
  background:
    radial-gradient(circle at 100% 0%, rgba(143, 211, 255, 0.12), transparent 32%),
    var(--hub-phase2-card);
}

#char-select-hub .cs-slot-card.cs-is-active {
  border-color: var(--hub-phase2-line-strong);
}

#char-select-hub .cs-slot-mode-bar {
  height: 4px;
}

#char-select-hub .cs-slot-inner {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  padding: 14px 16px 12px;
  gap: 12px;
}

#char-select-hub .cs-slot-avatar {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  padding: 7px;
}
#char-select-hub .cs-slot-avatar-icon.mode-icon {
  width: 100%;
  height: 100%;
  font-size: 21px;
}

#char-select-hub .cs-card-topline {
  align-items: center;
  margin-bottom: 7px;
}

#char-select-hub .cs-char-name {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
  gap: 7px;
}

#char-select-hub .cs-char-name-text {
  min-width: 0;
  max-width: 100%;
  font-weight: 700;
  overflow-wrap: anywhere;
}

#char-select-hub .cs-mode-badge,
#char-select-hub .cs-slot-chip,
#char-select-hub .cs-slot-flag,
#char-select-hub .cloud-slot-badge {
  border-radius: 999px;
}

#char-select-hub .cs-char-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

#char-select-hub .cs-stat-item {
  min-height: 25px;
  padding: 5px 9px;
}

#char-select-hub .cs-current-action {
  margin-top: 9px;
  padding: 10px 12px;
  border-radius: 8px;
}

#char-select-hub .cs-current-action-label {
  letter-spacing: 0.12em;
}

#char-select-hub .cs-current-action-value {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

#char-select-hub .cs-slot-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

#char-select-hub .cs-slot-flag {
  max-width: 100%;
  min-height: 26px;
  padding: 5px 9px;
  line-height: 1.2;
}

#char-select-hub .cs-slot-flag.is-cloud {
  border-color: rgba(143, 211, 255, 0.24);
  background: rgba(143, 211, 255, 0.08);
  color: rgba(218, 241, 255, 0.95);
}

#char-select-hub .cs-slot-flag.is-local {
  border-color: rgba(245, 207, 134, 0.22);
  background: rgba(245, 207, 134, 0.075);
  color: rgba(248, 230, 190, 0.92);
}

#char-select-hub .cs-slot-flag.is-beta.is-active,
#char-select-hub .closed-beta-status[data-tone="success"] {
  border-color: rgba(116, 229, 154, 0.24);
  background: rgba(116, 229, 154, 0.08);
  color: rgba(202, 255, 219, 0.94);
}

#char-select-hub .cs-slot-owner {
  min-width: 0;
  overflow-wrap: anywhere;
}

#char-select-hub .cs-slot-actions {
  grid-template-columns: minmax(0, 1fr) minmax(112px, auto);
  gap: 10px;
  padding: 12px 16px 16px;
}

#char-select-hub .cs-play-btn,
#char-select-hub .cs-delete-btn,
#char-select-hub .cs-create-btn,
#char-select-hub .hub-cloud-actions .btn-primary,
#char-select-hub .hub-cloud-actions .btn-outline,
#char-select-hub .hub-community-btn,
#char-select-hub .hub-cloud-auth-row .btn-outline,
#char-select-hub .cloud-google-btn,
#char-select-hub .hub-back-btn {
  min-height: 44px;
  border-radius: 8px;
}

#char-select-hub .cs-delete-btn {
  border-color: rgba(255, 155, 131, 0.28);
  background: rgba(255, 155, 131, 0.08);
  color: rgba(255, 210, 199, 0.95);
}

#char-select-hub .cs-slot-empty {
  min-height: 112px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
}

#char-select-hub .cs-slot-empty-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

#char-select-hub .cs-slot-number {
  align-self: start;
  justify-self: end;
  white-space: nowrap;
}

#char-select-hub .cs-slot-empty .cs-create-btn {
  grid-column: 1 / -1;
  width: 100%;
}

#char-select-hub .cs-slot-locked {
  min-height: 112px;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 12px;
  padding: 16px;
  border-radius: 10px;
}

#char-select-hub .cs-slot-locked-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
}

#char-select-hub .cs-slot-locked-title,
#char-select-hub .cs-slot-locked-text,
#char-select-hub .cs-slot-locked-note {
  overflow-wrap: anywhere;
}

#char-select-hub .cloud-auth-form {
  gap: 8px;
}

#char-select-hub .cloud-input,
#char-select-hub .cc-name-input {
  min-height: 42px;
  border-radius: 8px;
}

#char-select-hub .hub-cloud-status.hub-cloud-toast,
#char-select-hub .cloud-save-status.hub-cloud-toast {
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.35;
  min-height: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  border: 1px solid transparent;
  background: transparent;
  opacity: 0;
  transform: translateY(-3px);
  overflow: hidden;
  pointer-events: none;
  transition:
    opacity 220ms ease,
    transform 220ms ease,
    max-height 220ms ease,
    padding 220ms ease,
    margin 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease;
}

#char-select-hub .hub-cloud-status.hub-cloud-toast.is-visible,
#char-select-hub .cloud-save-status.hub-cloud-toast.is-visible {
  max-height: 72px;
  margin: 0 0 12px 0;
  padding: 8px 12px;
  opacity: 1;
  transform: translateY(0);
  border-color: rgba(143, 211, 255, 0.22);
  background:
    linear-gradient(180deg, rgba(23, 32, 53, 0.88), rgba(13, 17, 28, 0.9));
}

#char-select-hub .hub-cloud-status.hub-cloud-toast[data-tone="success"],
#char-select-hub .cloud-save-status.hub-cloud-toast[data-tone="success"] {
  border-color: rgba(116, 229, 154, 0.26);
  background:
    linear-gradient(180deg, rgba(29, 78, 47, 0.7), rgba(11, 28, 18, 0.85));
}

#char-select-hub .hub-cloud-status.hub-cloud-toast[data-tone="warn"],
#char-select-hub .cloud-save-status.hub-cloud-toast[data-tone="warn"] {
  border-color: rgba(251, 191, 36, 0.26);
  background:
    linear-gradient(180deg, rgba(84, 63, 16, 0.72), rgba(30, 22, 8, 0.86));
}

#char-select-hub .hub-cloud-status.hub-cloud-toast[data-tone="error"],
#char-select-hub .cloud-save-status.hub-cloud-toast[data-tone="error"] {
  border-color: rgba(248, 113, 113, 0.26);
  background:
    linear-gradient(180deg, rgba(91, 27, 27, 0.76), rgba(34, 12, 12, 0.86));
}

#char-select-hub .cloud-slot-preview {
  gap: 8px;
}

#char-select-hub .cloud-slot-row {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 12px;
}

#char-select-hub .cloud-slot-name,
#char-select-hub .cloud-slot-meta {
  min-width: 0;
  overflow-wrap: anywhere;
}

#char-select-hub .cloud-slot-preview-empty {
  padding: 14px;
  border-style: dashed;
  color: rgba(217, 214, 228, 0.74);
}

#char-select-hub .closed-beta-panel {
  padding: 12px;
  border: 1px solid rgba(143, 211, 255, 0.14);
}

#char-select-hub .closed-beta-redeem-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

#char-select-hub .hub-footer {
  padding-top: 6px;
}

.char-create-box {
  width: min(820px, calc(100vw - 32px));
  max-width: 820px;
  border-radius: 12px;
}

.char-create-box .modal-header {
  min-height: 56px;
}

.char-create-body {
  padding: 18px;
  gap: 16px;
}

.cc-section {
  gap: 8px;
}

.cc-label {
  color: rgba(245, 207, 134, 0.78);
  letter-spacing: 0.13em;
}

.cc-name-input {
  min-height: 46px;
  border-radius: 8px;
  font-size: 15px;
}

.cc-status {
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid rgba(165, 185, 228, 0.18);
  background: rgba(255, 255, 255, 0.045);
  line-height: 1.4;
}

.cc-status[data-tone="warn"] {
  border-color: rgba(245, 207, 134, 0.26);
  background: rgba(245, 207, 134, 0.08);
}

.cc-status[data-tone="error"] {
  border-color: rgba(255, 155, 131, 0.28);
  background: rgba(255, 155, 131, 0.08);
}

.cc-modes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.cc-mode-card {
  min-width: 0;
  min-height: 232px;
  align-items: flex-start;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  border-radius: 10px;
  border-color: var(--hub-phase2-line);
  background: var(--hub-phase2-card);
}

.cc-mode-card:hover {
  transform: translateY(-1px);
}

.cc-mode-card.selected {
  border-color: var(--hub-phase2-line-strong);
  background:
    radial-gradient(circle at top left, rgba(245, 207, 134, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(40, 36, 48, 0.96), rgba(13, 16, 25, 0.94));
}

.cc-mode-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
}

.cc-mode-info {
  min-width: 0;
  width: 100%;
}

.cc-mode-name {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.cc-mode-card.selected .cc-mode-name::after {
  content: "Selected";
  flex: 0 0 auto;
  margin-left: auto;
  padding: 3px 7px;
  border-radius: 999px;
  border: 1px solid rgba(116, 229, 154, 0.24);
  background: rgba(116, 229, 154, 0.08);
  color: rgba(202, 255, 219, 0.94);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cc-mode-desc {
  min-height: 58px;
  color: rgba(224, 221, 233, 0.78);
}

.cc-mode-perks {
  gap: 5px;
}

.cc-perk {
  min-height: 23px;
  padding: 4px 8px;
  line-height: 1.15;
}

.cc-create-btn {
  position: sticky;
  bottom: -1px;
  min-height: 50px;
  border-radius: 8px;
  margin-top: 2px;
  z-index: 2;
}

@media (max-width: 1180px) {
  #char-select-hub .hub-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "local"
      "cloud"
      "community";
  }

  #char-select-hub .hub-column-community {
    min-height: auto;
  }
}

@media (max-width: 760px) {
  #char-select-hub .hub-header {
    gap: 8px;
  }

  #char-select-hub .hub-status {
    width: min(100%, 560px);
    max-width: 100%;
    padding: 9px 12px;
    font-size: 11px;
  }

  #char-select-hub .cs-slot-inner,
  #char-select-hub .cs-slot-empty,
  #char-select-hub .cs-slot-locked {
    grid-template-columns: 1fr;
  }

  #char-select-hub .cs-slot-avatar,
  #char-select-hub .cs-slot-empty-icon,
  #char-select-hub .cs-slot-locked-icon {
    display: none;
  }

  #char-select-hub .cs-slot-number,
  #char-select-hub .cs-slot-locked-badge {
    justify-self: start;
  }

  #char-select-hub .closed-beta-redeem-row,
  #char-select-hub .cloud-slot-row {
    grid-template-columns: 1fr;
  }

  .cc-modes {
    grid-template-columns: 1fr;
  }

  .cc-mode-card {
    min-height: auto;
  }

  .cc-mode-desc {
    min-height: 0;
  }
}

body.platform-mobile #char-select-hub .hub-panel {
  width: min(100%, calc(100% - 10px));
  margin: 6px auto 10px;
  padding: 14px 12px calc(14px + env(safe-area-inset-bottom));
  gap: 14px;
  border-radius: 12px;
  max-height: calc(100dvh - 88px);
}

body.platform-mobile #char-select-hub .hub-header {
  gap: 5px;
  padding-bottom: 12px;
}

body.platform-mobile #char-select-hub .hub-title {
  font-size: 28px;
}

body.platform-mobile #char-select-hub .hub-copy {
  font-size: 12px;
  line-height: 1.42;
}

body.platform-mobile #char-select-hub .hub-column {
  padding: 14px;
}

body.platform-mobile #char-select-hub .hub-column-header {
  grid-template-columns: 30px minmax(0, 1fr);
  min-height: 58px;
}

body.platform-mobile #char-select-hub .hub-column-header::before {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 13px;
}

body.platform-mobile #char-select-hub .hub-column-title {
  font-size: 19px;
}

body.platform-mobile #char-select-hub .hub-column-note,
body.platform-mobile #char-select-hub .hub-community-copy,
body.platform-mobile #char-select-hub .hub-footer-copy {
  font-size: 11.5px;
  line-height: 1.42;
}

body.platform-mobile #char-select-hub .cs-slot-inner {
  padding: 13px 13px 10px;
}

body.platform-mobile #char-select-hub .cs-card-topline {
  gap: 8px;
}

body.platform-mobile #char-select-hub .cs-char-name {
  font-size: 16px;
}

body.platform-mobile #char-select-hub .cs-slot-actions {
  padding: 0 13px 13px;
  gap: 8px;
}

body.platform-mobile #char-select-hub .cs-play-btn,
body.platform-mobile #char-select-hub .cs-delete-btn,
body.platform-mobile #char-select-hub .cs-create-btn,
body.platform-mobile #char-select-hub .hub-cloud-actions .btn-primary,
body.platform-mobile #char-select-hub .hub-cloud-actions .btn-outline,
body.platform-mobile #char-select-hub .hub-community-btn,
body.platform-mobile #char-select-hub .hub-cloud-auth-row .btn-outline,
body.platform-mobile #char-select-hub .cloud-google-btn,
body.platform-mobile #char-select-hub .hub-back-btn {
  min-height: 44px;
}

body.platform-mobile .char-create-box {
  width: min(100%, calc(100vw - 12px));
  max-height: calc(100dvh - 12px);
  border-radius: 12px;
}

body.platform-mobile .char-create-body {
  padding: 14px;
  gap: 12px;
}

body.platform-mobile .cc-name-input {
  font-size: 16px;
}

body.platform-mobile .cc-create-btn {
  min-height: 48px;
}

@media (prefers-reduced-motion: reduce) {
  #char-select-hub .cs-slot-card,
  #char-select-hub .cs-play-btn,
  #char-select-hub .cs-delete-btn,
  #char-select-hub .cs-create-btn,
  #char-select-hub .hub-cloud-actions .btn-primary,
  .cc-mode-card,
  .cc-create-btn {
    transition: none !important;
    transform: none !important;
  }
}

/* OPEN-BETA UI PHASE 3: CORE GAMEPLAY SCREEN POLISH (2026-04-28)
   UI-only late cascade for high-traffic gameplay surfaces. */
:root {
  --phase3-card-radius: var(--ui-radius-md, 8px);
  --phase3-line: rgba(164, 184, 224, 0.17);
  --phase3-line-strong: rgba(244, 199, 118, 0.35);
  --phase3-line-hot: rgba(255, 152, 112, 0.34);
  --phase3-surface:
    radial-gradient(circle at 12% 0%, rgba(244, 199, 118, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(28, 32, 47, 0.98), rgba(12, 14, 23, 0.96));
  --phase3-surface-hover:
    radial-gradient(circle at 12% 0%, rgba(244, 199, 118, 0.13), transparent 32%),
    linear-gradient(180deg, rgba(34, 39, 57, 0.99), rgba(14, 17, 27, 0.97));
  --phase3-surface-active:
    radial-gradient(circle at 12% 0%, rgba(244, 199, 118, 0.18), transparent 34%),
    radial-gradient(circle at 100% 0%, rgba(113, 167, 255, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(45, 37, 51, 0.99), rgba(17, 16, 27, 0.97));
  --phase3-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 12px 22px rgba(0, 0, 0, 0.13);
  --phase3-shadow-hover:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 18px 30px rgba(0, 0, 0, 0.18);
  --phase3-transition:
    transform 140ms ease,
    border-color 140ms ease,
    background 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease;
}

#combat-panel,
#training-actions,
#dungeons-panel,
#inventory-grid,
#bank-grid,
#bounty-content,
#ge-panel,
#settings-modal .modal-body {
  scrollbar-gutter: stable;
}

:where(
  .combat-target,
  .combat-stat,
  .combat-automation-card,
  .fallen-loot-panel,
  .training-action,
  .tt-live-card,
  .tt-live-empty,
  .skill-progress-card,
  .action-details,
  .monster-card,
  .dungeon-tab-hero,
  .dungeon-card,
  .dungeon-detail-panel,
  .dungeon-loot-card,
  .dungeon-threat-row,
  .dungeon-progress-banner,
  .dungeon-clear-reward-row,
  .shop-card,
  .shop-item,
  .shop-detail-token-hint,
  .ge-result-row,
  .ge-quick-item,
  .ge-txn-panel,
  .ge-hint,
  .ge-loading,
  .bounty-stat-card,
  .bounty-task-card,
  .bounty-master-card,
  .bounty-master-section,
  .bounty-empty-state,
  .stats-card,
  .stats-progress-panel,
  .stats-hall-panel,
  .settings-section
) {
  border-radius: var(--phase3-card-radius);
  border-color: var(--phase3-line);
  background: var(--phase3-surface);
  box-shadow: var(--phase3-shadow);
  transition: var(--phase3-transition);
}

:where(
  .training-action.active,
  .monster-card.active,
  .dungeon-card.unlocked,
  .daily-task-card.is-ready,
  .bounty-task-status.ready,
  .ge-mode-tab.active
) {
  border-color: var(--phase3-line-strong);
  background: var(--phase3-surface-active);
}

:where(
  .monster-card.active,
  .combat-target,
  .fight-btn.fighting
) {
  border-color: var(--phase3-line-hot);
}

@media (hover: hover) and (pointer: fine) {
  :where(
    .monster-card,
    .training-action,
    .dungeon-card,
    .shop-card,
    .shop-item,
    .ge-result-row,
    .ge-quick-item,
    .bounty-task-card,
    .bounty-master-card,
    .settings-section
  ):hover {
    transform: translateY(-1px);
    border-color: var(--phase3-line-strong);
    background: var(--phase3-surface-hover);
    box-shadow: var(--phase3-shadow-hover);
  }
}

  :where(
    .fight-btn,
    .train-btn,
    .combat-panel-retreat,
  .mobile-combat-retreat-btn,
  .combat-mobile-action,
  .dungeon-card-btn,
  .daily-claim-btn,
  .bounty-skip-btn,
  .shop-visit-btn,
  .shop-back-btn,
  .shop-btn,
  .ge-action-btn,
  .ge-confirm-btn,
  .ge-cancel-btn,
  .ge-preset-btn,
  .ge-qty-step,
  .ge-txn-close,
  .item-menu-btn,
  .modal-close
) {
  min-height: 36px;
  border-radius: var(--phase3-card-radius);
  transition: var(--phase3-transition);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

:where(
  .fight-btn,
  .train-btn,
  .combat-panel-retreat,
  .mobile-combat-retreat-btn,
  .combat-mobile-action,
  .dungeon-card-btn,
  .daily-claim-btn,
  .bounty-skip-btn,
  .shop-visit-btn,
  .shop-back-btn,
  .shop-btn,
  .ge-action-btn,
  .ge-confirm-btn,
  .ge-cancel-btn,
  .ge-preset-btn,
  .ge-qty-step,
  .ge-txn-close,
  .item-menu-btn,
  .modal-close,
    .monster-card,
    .training-action,
    .dungeon-card,
    .shop-card,
    .shop-item,
    .ge-result-row,
    .ge-quick-item,
    .bounty-task-card,
    .bounty-master-card,
    .settings-section,
    .inv-slot,
    .bank-slot,
  .equip-slot
):focus-visible {
  outline: none;
  box-shadow: var(--ui-focus-ring), var(--phase3-shadow-hover);
}

:where(
  .inv-slot,
  .bank-slot,
  .equip-slot
) {
  border-radius: var(--phase3-card-radius);
  border-color: var(--phase3-line);
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 199, 118, 0.07), transparent 30%),
    linear-gradient(180deg, rgba(22, 25, 38, 0.98), rgba(10, 12, 20, 0.96));
}

:where(
  .inv-slot.filled,
  .bank-slot.filled,
  .equip-slot.filled
) {
  border-color: rgba(244, 199, 118, 0.22);
  background:
    radial-gradient(circle at 50% 0%, rgba(244, 199, 118, 0.14), transparent 32%),
    linear-gradient(180deg, rgba(39, 34, 47, 0.98), rgba(17, 16, 26, 0.96));
}

.combat-stats-row,
.fallen-loot-grid,
.daily-task-list,
.bounty-summary-grid,
.bounty-master-list,
.shop-cards,
.shop-items,
.ge-results-list,
.ge-quick-grid,
.dungeon-grid,
.dungeon-detail-grid,
.stats-grid {
  gap: 10px;
}

.ge-search-row,
.ge-qty-wrap,
.search-row,
.cloud-input,
.cc-name-input {
  border-radius: var(--phase3-card-radius);
}

.ge-result-name,
.ge-quick-label,
.shop-item-name,
.shop-card-name,
.daily-task-title,
.bounty-master-name,
.bounty-task-header h4,
.dungeon-card-name,
.stats-card-value {
  overflow-wrap: anywhere;
}

body.platform-mobile :where(
  .fight-btn,
  .train-btn,
  .combat-panel-retreat,
  .mobile-combat-retreat-btn,
  .combat-mobile-action,
  .dungeon-card-btn,
  .daily-claim-btn,
  .bounty-skip-btn,
  .shop-visit-btn,
  .shop-back-btn,
  .shop-btn,
  .ge-action-btn,
  .ge-confirm-btn,
  .ge-cancel-btn,
  .ge-preset-btn,
  .ge-qty-step,
  .item-menu-btn
) {
  min-height: 44px;
}

body.platform-mobile :where(
  .monster-card,
  .training-action,
  .dungeon-card,
  .shop-card,
  .shop-item,
  .ge-result-row,
  .ge-quick-item,
  .bounty-task-card,
  .bounty-master-card,
  .stats-card,
  .settings-section
) {
  transform: none;
}

body.platform-mobile :where(
  #combat-panel,
  #training-actions,
  #dungeons-panel,
  #bounty-content,
  #inventory-grid,
  #bank-grid
) {
  overscroll-behavior: contain;
}

@media (max-width: 640px) {
  .combat-stats-row,
  .bounty-summary-grid,
  .dungeon-detail-grid,
  .stats-grid {
    gap: 8px;
  }

  .ge-result-row,
  .shop-item {
    align-items: stretch;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(
    .combat-target,
    .combat-stat,
    .combat-automation-card,
    .fallen-loot-panel,
    .training-action,
    .tt-live-card,
    .skill-progress-card,
    .monster-card,
    .dungeon-card,
    .shop-card,
    .shop-item,
    .ge-result-row,
    .ge-quick-item,
    .ge-txn-panel,
    .daily-task-card,
    .bounty-task-card,
    .bounty-master-card,
    .stats-card,
    .settings-section,
    .fight-btn,
    .train-btn,
    .combat-panel-retreat,
    .mobile-combat-retreat-btn,
    .combat-mobile-action,
    .dungeon-card-btn,
    .daily-claim-btn,
    .bounty-skip-btn,
    .shop-visit-btn,
    .shop-back-btn,
    .shop-btn,
    .ge-action-btn,
    .ge-confirm-btn,
    .ge-cancel-btn,
    .ge-preset-btn,
    .ge-qty-step,
    .ge-txn-close,
    .item-menu-btn,
    .inv-slot,
    .bank-slot,
    .equip-slot
  ) {
    transition: none !important;
    animation: none !important;
    transform: none !important;
  }
}

/* ─── COMBAT + BOUNTY TRUST POLISH (2026-04-29) ─────────────────────────── */
.combat-status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.combat-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(156, 176, 219, 0.16);
  background: rgba(255, 255, 255, 0.055);
  color: rgba(232, 224, 210, 0.82);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.combat-status-pill.is-live {
  border-color: rgba(248, 113, 113, 0.24);
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
}

.combat-status-pill.is-bounty {
  border-color: rgba(168, 85, 247, 0.28);
  background: rgba(88, 28, 135, 0.22);
  color: #e9d5ff;
}

.combat-status-pill.is-loot {
  border-color: rgba(250, 204, 21, 0.25);
  background: rgba(113, 63, 18, 0.2);
  color: #fde68a;
}

.bounty-task-header-tags {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.bounty-reward-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.bounty-reward-cell {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(244, 199, 118, 0.16);
  background:
    radial-gradient(circle at top left, rgba(244, 199, 118, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(20, 24, 38, 0.94), rgba(9, 12, 21, 0.92));
}

.bounty-reward-label {
  display: block;
  margin-bottom: 4px;
  color: rgba(240, 209, 148, 0.76);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.bounty-reward-cell strong {
  display: block;
  color: #fff4dd;
  font-size: 13px;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

.bounty-reward-cell small {
  display: block;
  margin-top: 4px;
  color: #facc15;
  font-size: 10px;
  line-height: 1.35;
}

body.platform-mobile .combat-status-strip {
  gap: 5px;
}

body.platform-mobile .combat-status-pill {
  min-height: 28px;
  max-width: 100%;
  white-space: normal;
}

body.platform-mobile .bounty-task-header {
  align-items: flex-start;
  flex-direction: column;
}

body.platform-mobile .bounty-task-header-tags {
  justify-content: flex-start;
}

body.platform-mobile .bounty-reward-preview {
  grid-template-columns: 1fr;
}

/* SKILLS PANEL UI REWORK (2026-04-28)
   Compact skill tiles: icon + level by default, full skill details on hover/focus/tap. */
#skills-panel {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 8px;
  align-content: start;
  overflow: visible;
}

.skill-tile {
  position: relative;
  min-height: 58px;
  padding: 9px 10px;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 0 10px;
  align-items: center;
  overflow: visible;
  border-radius: 10px;
  border-color: rgba(221, 184, 112, 0.18);
  background:
    radial-gradient(circle at 18% 0%, rgba(246, 204, 123, 0.1), transparent 38%),
    linear-gradient(180deg, rgba(28, 33, 49, 0.94), rgba(11, 13, 22, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 8px 18px rgba(0, 0, 0, 0.12);
  transform: none;
}

.skill-tile:hover,
.skill-tile:focus-visible,
.skill-tile.is-detail-open {
  border-color: rgba(246, 204, 123, 0.42);
  background:
    radial-gradient(circle at 18% 0%, rgba(246, 204, 123, 0.16), transparent 40%),
    radial-gradient(circle at 100% 0%, rgba(99, 179, 255, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(35, 40, 59, 0.98), rgba(14, 16, 27, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 12px 22px rgba(0, 0, 0, 0.16),
    0 0 0 1px rgba(246, 204, 123, 0.06);
  transform: none;
}

.skill-tile.is-training {
  border-color: rgba(246, 204, 123, 0.48);
}

.skill-tile .item-icon,
.skill-sprite,
.skill-icon,
.skill-tile .skill-art-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
}

.skill-tile .skill-art-icon {
  border-radius: 8px;
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 236, 194, 0.2), transparent 30%),
    linear-gradient(180deg, rgba(72, 54, 25, 0.92), rgba(21, 18, 13, 0.94));
  border-color: rgba(240, 195, 110, 0.22);
}

.skill-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 7px;
}

.skill-head {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  justify-items: end;
  min-width: 0;
}

.skill-name {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  word-break: normal;
  overflow-wrap: normal;
  pointer-events: none;
}

.skill-level {
  flex: 0 0 auto;
  justify-self: end;
  margin: 0;
  padding: 4px 8px;
  border-radius: 999px;
  color: #ffe8af;
  background: rgba(246, 204, 123, 0.13);
  border: 1px solid rgba(246, 204, 123, 0.22);
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.skill-meta {
  display: block;
  min-width: 0;
}

.skill-bar-bg {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.skill-bar-fill {
  height: 100%;
  border-radius: inherit;
  transition: width 0.24s ease;
}

.skill-submeta {
  display: none;
}

.skill-detail-popover {
  position: fixed;
  z-index: 120;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  width: min(250px, calc(100vw - 24px));
  min-width: min(220px, calc(100vw - 24px));
  max-width: min(280px, calc(100vw - 16px));
  box-sizing: border-box;
  gap: 7px;
  padding: 10px 12px;
  color: #eff0f5;
  border: 1px solid rgba(246, 204, 123, 0.24);
  border-radius: 12px;
  background:
    radial-gradient(circle at top left, rgba(246, 204, 123, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(21, 24, 36, 0.98), rgba(9, 11, 18, 0.98));
  box-shadow:
    0 18px 34px rgba(0, 0, 0, 0.36),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  opacity: 0;
  transform: translateY(4px) scale(0.985);
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.skill-detail-popover.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.skill-detail-title {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  align-items: center;
  column-gap: 12px;
  padding-bottom: 7px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.skill-detail-title strong {
  min-width: 0;
  color: #fff4dd;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.18;
  white-space: normal;
  overflow: hidden;
  text-overflow: clip;
  word-break: normal;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.skill-detail-level {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  color: #ffe8af;
  background: rgba(246, 204, 123, 0.13);
  border: 1px solid rgba(246, 204, 123, 0.22);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
}

.skill-detail-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(74px, auto) minmax(0, 1fr);
  align-items: baseline;
  column-gap: 14px;
  row-gap: 2px;
}

.skill-detail-row b {
  color: rgba(207, 218, 237, 0.7);
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.skill-detail-row em {
  min-width: 0;
  color: #fff4dd;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.25;
  white-space: nowrap;
  text-wrap: nowrap;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: normal;
  word-break: normal;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.skill-detail-row[data-skill-detail-row="xp"] em,
.skill-detail-row[data-skill-detail-row="progress"] em,
.skill-detail-row[data-skill-detail-row="mastery"] em {
  white-space: nowrap;
}

.mobile-skill-row {
  position: relative;
  min-height: 72px;
  padding-bottom: 12px;
}

.mobile-skill-row-name {
  display: block;
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.16;
  -webkit-line-clamp: unset;
  -webkit-box-orient: initial;
  word-break: normal;
  overflow-wrap: normal;
}

.mobile-skill-row-xp {
  display: none;
}

.mobile-skill-row-detail {
  position: static;
  grid-column: 2 / -1;
  display: none;
  align-items: start;
  gap: 4px;
  margin-top: -2px;
  color: rgba(230, 221, 204, 0.82);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.32;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  opacity: 0;
  transform: none;
  pointer-events: none;
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.mobile-skill-row-detail strong,
.mobile-skill-row-detail span {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  word-break: normal;
  overflow-wrap: normal;
}

.mobile-skill-row-detail strong {
  flex: 0 1 auto;
  color: #fff4dd;
  font-weight: 850;
}

.mobile-skill-row-detail span {
  display: block;
}

@media (max-width: 1240px) {
  .skill-tile {
    min-height: 60px;
    padding: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skill-detail-popover,
  .mobile-skill-row-detail,
  .skill-bar-fill {
    transition: none !important;
    transform: none !important;
  }
}

/* ─── SETTINGS & SAVE REFRESH ───────────────────────────────────────────── */
#settings-modal .settings-save-modal-box {
  width: min(980px, calc(100vw - 28px));
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-color: rgba(245, 189, 100, 0.2);
  background:
    radial-gradient(circle at top left, rgba(245, 189, 100, 0.1), transparent 32%),
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.12), transparent 30%),
    linear-gradient(180deg, rgba(18, 22, 34, 0.98), rgba(8, 10, 17, 0.98));
}

#settings-modal .settings-save-header {
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    linear-gradient(90deg, rgba(245, 189, 100, 0.08), transparent 54%),
    rgba(255, 255, 255, 0.018);
}

.settings-save-title-block {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.settings-save-subtitle {
  color: rgba(215, 225, 242, 0.72);
  font-size: 12px;
  line-height: 1.45;
}

#settings-modal .settings-save-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  grid-template-areas:
    "slots cloud"
    "export cloud"
    "import community"
    "platform tour";
  align-items: start;
  gap: 14px;
  scrollbar-gutter: stable;
}

#settings-modal .settings-section {
  margin: 0;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid rgba(226, 188, 111, 0.12);
  background:
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.045), transparent 36%),
    linear-gradient(180deg, rgba(23, 27, 40, 0.94), rgba(12, 14, 22, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 16px 36px rgba(0, 0, 0, 0.2);
}

@media (hover: hover) and (pointer: fine) {
  #settings-modal .settings-section:hover {
    transform: none;
    border-color: rgba(226, 188, 111, 0.12);
    background:
      radial-gradient(circle at top left, rgba(255, 255, 255, 0.045), transparent 36%),
      linear-gradient(180deg, rgba(23, 27, 40, 0.94), rgba(12, 14, 22, 0.94));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.045),
      0 16px 36px rgba(0, 0, 0, 0.2);
  }
}

.settings-section--slots { grid-area: slots; }
.settings-section--export { grid-area: export; }
.settings-section--import { grid-area: import; }
.settings-section--cloud { grid-area: cloud; }
#settings-modal .settings-section--community { grid-area: community; }
#settings-modal .settings-section--admin { grid-area: admin; }
#settings-modal .settings-section:has(.platform-choice-row--settings) { grid-area: platform; }
#settings-modal .settings-section:has(#replay-onboarding-btn) { grid-area: tour; }

.settings-section-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

#settings-modal .settings-label {
  margin: 0;
  color: rgba(245, 213, 152, 0.88);
  font-weight: 900;
}

.settings-label--icon {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 10px !important;
}

.settings-section-copy,
#settings-modal .community-note {
  color: rgba(203, 213, 225, 0.72);
  font-size: 11px;
  line-height: 1.5;
}

.settings-section-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid rgba(125, 211, 252, 0.18);
  background: rgba(14, 165, 233, 0.08);
  color: #bae6fd;
  font-size: 10px;
  font-weight: 800;
}

.settings-save-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#settings-save-slots .cs-slot-card {
  border-radius: 18px;
  border-color: rgba(255, 255, 255, 0.09);
  background:
    radial-gradient(circle at top left, rgba(245, 189, 100, 0.09), transparent 38%),
    linear-gradient(135deg, rgba(23, 24, 37, 0.98), rgba(12, 13, 21, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 12px 28px rgba(0, 0, 0, 0.22);
  cursor: default;
}

#settings-save-slots .cs-slot-card:hover {
  transform: none;
  border-color: rgba(245, 189, 100, 0.22);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.055),
    0 14px 32px rgba(0, 0, 0, 0.26);
}

#settings-save-slots .cs-slot-filled {
  display: grid;
  grid-template-columns: 6px minmax(0, 1fr) 132px;
  align-items: stretch;
}

#settings-save-slots .cs-slot-inner {
  padding: 14px;
  gap: 12px;
}

#settings-save-slots .cs-slot-avatar {
  width: 44px;
  height: 44px;
  border-color: rgba(245, 189, 100, 0.18);
  background:
    radial-gradient(circle, rgba(245, 189, 100, 0.14), rgba(15, 23, 42, 0.72));
}

#settings-save-slots .cs-card-topline {
  gap: 10px;
  margin-bottom: 6px;
}

#settings-save-slots .cs-char-name-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

#settings-save-slots .cs-char-stats {
  gap: 8px;
  margin-bottom: 7px;
}

#settings-save-slots .cs-stat-item,
#settings-save-slots .cs-slot-chip,
#settings-save-slots .cs-mode-badge {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  padding: 4px 8px;
}

#settings-save-slots .cs-current-action {
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.035);
}

#settings-save-slots .cs-current-action-value,
#settings-save-slots .cs-slot-owner {
  overflow-wrap: normal;
  word-break: normal;
}

#settings-save-slots .cs-slot-actions {
  min-width: 0;
  padding: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.07);
  background: rgba(0, 0, 0, 0.16);
}

#settings-save-slots .cs-play-btn,
#settings-save-slots .cs-delete-btn,
#settings-save-slots .cs-create-btn,
#settings-save-slots .cs-slot-locked-btn {
  min-height: 40px;
  border-radius: 12px;
}

#settings-save-slots .cs-delete-btn {
  margin-top: 4px;
  border-color: rgba(248, 113, 113, 0.2);
  background: rgba(127, 29, 29, 0.12);
}

#settings-save-slots .cs-slot-protected {
  border-color: rgba(125, 211, 252, 0.18);
  background:
    radial-gradient(circle at top left, rgba(125, 211, 252, 0.1), transparent 34%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.98), rgba(11, 13, 20, 0.98));
}

#settings-save-slots .cs-slot-locked {
  padding: 16px;
  background: transparent;
}

#settings-save-slots .cs-slot-locked-icon {
  border-color: rgba(125, 211, 252, 0.24);
  background: rgba(14, 165, 233, 0.09);
  color: #bae6fd;
}

#settings-save-slots .cs-slot-locked-title {
  color: #e0f2fe;
}

#settings-save-slots .cs-slot-locked-text,
#settings-save-slots .cs-slot-locked-note {
  color: rgba(219, 234, 254, 0.74);
}

#settings-save-slots .cs-slot-locked-actions {
  gap: 10px;
}

#settings-save-slots .cs-slot-locked-btn:not(.is-secondary) {
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(34, 197, 94, 0.12);
  color: #bbf7d0;
}

#settings-save-slots .cs-slot-locked-btn.is-secondary {
  border-color: rgba(248, 113, 113, 0.2);
  background: rgba(127, 29, 29, 0.1);
  color: #fecaca;
}

#settings-save-slots .cs-slot-empty {
  border-radius: 18px;
  padding: 16px;
  background:
    radial-gradient(circle at left, rgba(245, 189, 100, 0.08), transparent 40%),
    rgba(255, 255, 255, 0.025);
}

#settings-modal .settings-code-area {
  width: 100%;
  min-height: 82px;
  margin: 0;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.86), rgba(5, 7, 12, 0.86));
  color: rgba(226, 232, 240, 0.92);
  font-size: 11px;
  line-height: 1.45;
  resize: vertical;
  user-select: text;
}

#settings-modal .export-area::placeholder,
#settings-modal .import-area::placeholder {
  color: rgba(148, 163, 184, 0.58);
}

.settings-export-btn,
.settings-import-btn {
  white-space: nowrap;
}

.settings-section--import .settings-code-area {
  margin: 10px 0 8px;
}

.settings-cloud-auth-actions,
.settings-cloud-actions,
.settings-cloud-session-actions,
.community-btn-row {
  display: flex;
  gap: 8px;
}

.settings-cloud-actions {
  margin-top: 8px;
}

.settings-cloud-session-actions {
  margin-top: 8px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

#settings-modal .cloud-save-status,
#settings-modal .cloud-auth-form,
#settings-modal .closed-beta-panel,
#settings-modal .cloud-slot-preview,
#settings-modal .platform-choice-row--settings {
  border-radius: 14px;
}

#settings-modal .cloud-input {
  min-height: 38px;
}

@media (max-width: 860px) {
  #settings-modal .settings-save-body {
    grid-template-columns: 1fr;
    grid-template-areas:
      "slots"
      "cloud"
      "community"
      "export"
      "import"
      "platform"
      "tour"
      "admin";
  }

  #settings-save-slots .cs-slot-filled {
    grid-template-columns: 5px minmax(0, 1fr);
  }

  #settings-save-slots .cs-slot-actions {
    grid-column: 2;
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-direction: row;
  }
}

body.platform-mobile #settings-modal .settings-save-modal-box {
  width: calc(100vw - 12px);
  max-height: calc(100dvh - 12px);
}

body.platform-mobile #settings-modal .settings-save-body {
  max-height: calc(100dvh - 104px);
  padding: 12px;
  gap: 10px;
}

body.platform-mobile #settings-modal .settings-section {
  padding: 12px;
  border-radius: 16px;
}

body.platform-mobile .settings-section-head,
body.platform-mobile .settings-cloud-auth-actions,
body.platform-mobile .settings-cloud-actions,
body.platform-mobile .settings-cloud-session-actions,
body.platform-mobile #settings-save-slots .cs-slot-locked-actions {
  flex-direction: column;
  align-items: stretch;
}

body.platform-mobile .settings-section-chip {
  justify-content: center;
  white-space: normal;
}

body.platform-mobile #settings-save-slots .cs-slot-filled {
  display: flex;
  flex-direction: column;
}

body.platform-mobile #settings-save-slots .cs-slot-mode-bar {
  width: auto;
  height: 5px;
}

body.platform-mobile #settings-save-slots .cs-slot-actions {
  width: 100%;
  padding: 0 14px 14px;
  flex-direction: row;
  border: 0;
  background: transparent;
}

body.platform-mobile #settings-save-slots .cs-play-btn,
body.platform-mobile #settings-save-slots .cs-delete-btn,
body.platform-mobile #settings-save-slots .cs-create-btn,
body.platform-mobile #settings-save-slots .cs-slot-locked-btn,
body.platform-mobile .settings-export-btn,
body.platform-mobile .settings-import-btn {
  min-height: 44px;
}

/* ─── SETTINGS & SAVE EMERGENCY LAYOUT FIX ───────────────────────────────── */
#settings-modal .settings-save-modal-box {
  width: min(1360px, calc(100vw - 28px));
  max-height: min(92vh, 960px);
}

#settings-modal .settings-save-body {
  grid-template-columns: minmax(680px, 1fr) minmax(360px, 420px);
  grid-template-areas:
    "slots cloud"
    "export community"
    "import platform"
    "tour tour"
    "admin admin";
  gap: 16px;
  padding: 18px;
}

#settings-modal .settings-section--slots,
#settings-modal .settings-section--cloud {
  min-width: 0;
}

#settings-save-slots .cs-slot-filled {
  grid-template-columns: 6px minmax(0, 1fr) minmax(136px, 156px);
}

#settings-save-slots .cs-slot-inner {
  min-width: 0;
  align-items: flex-start;
}

#settings-save-slots .cs-slot-details {
  min-width: 0;
}

#settings-save-slots .cs-card-topline {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 12px;
}

#settings-save-slots .cs-char-name {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

#settings-save-slots .cs-char-name-text {
  flex: 1 1 220px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  word-break: normal;
}

#settings-save-slots .cs-mode-badge,
#settings-save-slots .cs-slot-chip,
#settings-save-slots .cs-stat-item,
#settings-save-slots .cs-slot-flag {
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

#settings-save-slots .cs-char-stats,
#settings-save-slots .cs-slot-flags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

#settings-save-slots .cs-current-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

#settings-save-slots .cs-current-action-label {
  flex: 0 0 auto;
}

#settings-save-slots .cs-current-action-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#settings-save-slots .cs-slot-owner {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#settings-save-slots .cs-slot-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 9px;
}

#settings-save-slots .cs-play-btn,
#settings-save-slots .cs-delete-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-inline: 12px;
}

#settings-modal .settings-section--cloud {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

#settings-modal .closed-beta-redeem-row,
#settings-modal .settings-cloud-actions,
#settings-modal .settings-cloud-session-actions,
#settings-modal .settings-cloud-auth-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
}

#settings-modal .closed-beta-redeem-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

#settings-modal .closed-beta-redeem-row .cloud-input,
#settings-modal .cloud-input {
  min-width: 0;
  width: 100%;
}

#settings-modal .cloud-slot-row,
#settings-modal .closed-beta-summary,
#settings-modal .cloud-save-status,
#settings-modal .closed-beta-status,
#settings-modal .cloud-account-meta {
  min-width: 0;
  overflow-wrap: normal;
  word-break: normal;
}

@media (max-width: 1179px) {
  #settings-modal .settings-save-modal-box {
    width: min(920px, calc(100vw - 22px));
  }

  #settings-modal .settings-save-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "slots"
      "cloud"
      "community"
      "export"
      "import"
      "platform"
      "tour"
      "admin";
  }
}

@media (max-width: 720px) {
  #settings-save-slots .cs-slot-filled {
    display: flex;
    flex-direction: column;
  }

  #settings-save-slots .cs-slot-mode-bar {
    width: auto;
    height: 5px;
  }

  #settings-save-slots .cs-card-topline,
  #settings-save-slots .cs-current-action,
  .settings-section-head {
    flex-direction: column;
    align-items: stretch;
  }

  #settings-save-slots .cs-current-action-value {
    text-align: left;
  }

  #settings-save-slots .cs-slot-actions {
    width: 100%;
    padding: 0 14px 14px;
    flex-direction: row;
    border-left: 0;
    border-top: 0;
    background: transparent;
  }

  #settings-modal .closed-beta-redeem-row,
  #settings-modal .settings-cloud-actions,
  #settings-modal .settings-cloud-session-actions,
  #settings-modal .settings-cloud-auth-actions {
    grid-template-columns: 1fr;
  }

  #settings-modal .settings-save-body {
    padding: 12px;
  }
}

/* Emergency correction: bypass the global 640px modal cap for Settings & Save. */
#settings-modal .settings-save-modal-box {
  max-width: min(1360px, calc(100vw - 28px));
}

@media (max-width: 1179px) {
  #settings-modal .settings-save-modal-box {
    max-width: min(920px, calc(100vw - 22px));
  }
}

body.platform-mobile #settings-modal .settings-save-modal-box {
  max-width: calc(100vw - 12px);
}

/* Emergency mobile width recovery for Settings & Save cards. */
body.platform-mobile #settings-modal .settings-save-modal-box {
  width: calc(100vw - 4px);
  max-width: calc(100vw - 4px);
}

body.platform-mobile #settings-modal .settings-save-body {
  padding: 8px;
}

body.platform-mobile #settings-modal .settings-section {
  padding: 10px;
}

body.platform-mobile #settings-save-slots .cs-slot-inner {
  padding: 12px;
}

body.platform-mobile #settings-save-slots .cs-slot-actions {
  padding: 0 12px 12px;
}

/* Final mobile padding trim so Settings save cards stay readable on narrow phones. */
body.platform-mobile #settings-modal .settings-save-body {
  padding: 6px;
}

body.platform-mobile #settings-modal .settings-section {
  padding: 8px;
}

/* ─── MOBILE PARITY / EXIT SAFETY REFRESH ───────────────────────────────── */
.mobile-exit-modal-box {
  width: min(440px, calc(100vw - 24px));
}

.mobile-exit-modal-body {
  display: grid;
  gap: 14px;
  padding: 18px;
  text-align: center;
}

.mobile-exit-crest {
  width: 58px;
  height: 58px;
  margin: 0 auto;
  display: grid;
  place-items: center;
  border-radius: 20px;
  border: 1px solid rgba(244, 199, 118, 0.22);
  background:
    radial-gradient(circle at 40% 20%, rgba(244, 199, 118, 0.2), transparent 58%),
    linear-gradient(180deg, rgba(34, 31, 46, 0.98), rgba(13, 15, 24, 0.96));
  color: #f4c776;
  font-size: 23px;
}

.mobile-exit-copy {
  display: grid;
  gap: 8px;
  color: rgba(232, 224, 209, 0.82);
}

.mobile-exit-copy p,
.mobile-exit-copy h3 {
  margin: 0;
}

.mobile-exit-copy h3 {
  color: #fff3db;
  font-size: 22px;
  line-height: 1.15;
}

.mobile-exit-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(244, 199, 118, 0.76);
}

.mobile-exit-limit {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(206, 198, 183, 0.62);
}

.mobile-exit-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

body.platform-mobile .mobile-exit-actions .btn-outline,
body.platform-mobile .mobile-exit-actions .btn-primary {
  min-height: 48px;
}

body.platform-mobile .mj-section {
  margin-bottom: 16px;
}

body.platform-mobile .mj-section-head {
  align-items: flex-start;
}

body.platform-mobile .mj-section-copy {
  max-width: 58%;
  font-size: 10px;
}

body.platform-mobile .mj-card {
  min-height: 106px;
  border-radius: 20px;
}

body.platform-mobile #mastery-tree-modal .mastery-tree-modal-box {
  width: calc(100vw - 6px);
  max-width: calc(100vw - 6px);
  height: calc(100dvh - 8px);
  max-height: calc(100dvh - 8px);
}

body.platform-mobile #mastery-tree-modal .mastery-tree-modal-body {
  overflow: hidden;
}

body.platform-mobile #mastery-tree-modal-panel,
body.platform-mobile #mastery-tree-modal .mastery-shell--modal,
body.platform-mobile #mastery-tree-modal .mastery-tree-layout--modal,
body.platform-mobile #mastery-tree-modal .mastery-board-card {
  min-height: 0;
}

body.platform-mobile #mastery-tree-modal .mastery-board-viewport {
  min-height: 56dvh;
  cursor: grab;
  overscroll-behavior: none;
  touch-action: none;
}

body.platform-mobile #mastery-tree-modal .mastery-board-viewport[data-dragging="true"],
body.platform-mobile #mastery-tree-modal .mastery-board-viewport[data-panning="true"] {
  cursor: grabbing;
}

body.platform-mobile #mastery-tree-modal .mastery-tree-node,
body.platform-mobile #mastery-tree-modal .mastery-tree-node-slot {
  cursor: pointer;
  touch-action: manipulation;
}

body.platform-mobile #mastery-tree-modal .mastery-side-column,
body.platform-mobile #mastery-tree-modal .mastery-side-column.is-collapsed {
  max-height: 34dvh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

@media (max-width: 390px) {
  body.platform-mobile .mj-section-head {
    display: block;
  }

  body.platform-mobile .mj-section-copy {
    max-width: none;
    margin-top: 4px;
    text-align: left;
  }

  body.platform-mobile .mj-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ─── LOADOUT POWER DISPLAY CARD ───────────────────────────────────────────── */
.loadout-power-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(232, 207, 133, 0.26);
  border-radius: 18px;
  padding: 14px;
  margin: 0 0 14px;
  background:
    radial-gradient(circle at 12% 0%, rgba(232, 207, 133, 0.17), transparent 34%),
    linear-gradient(145deg, rgba(31, 25, 18, 0.94), rgba(12, 16, 24, 0.94));
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.loadout-power-card.compact {
  margin-top: -2px;
}

.loadout-power-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.loadout-power-kicker {
  min-height: 22px;
  color: #d9b86a;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.loadout-power-title {
  color: #fff4d2;
  font-size: 1.02rem;
  font-weight: 900;
}

.loadout-power-value {
  color: #10131c;
  min-width: 72px;
  padding: 8px 10px;
  border-radius: 14px;
  text-align: center;
  background: linear-gradient(135deg, #ffe9a6, #c9912e);
  box-shadow: 0 10px 22px rgba(201, 145, 46, 0.24);
  white-space: nowrap;
}

.loadout-power-copy {
  margin-top: 8px;
  color: rgba(244, 236, 214, 0.78);
  font-size: 0.82rem;
  line-height: 1.35;
}

.loadout-power-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.loadout-power-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  padding: 5px 8px;
  border: 1px solid rgba(232, 207, 133, 0.22);
  border-radius: 999px;
  color: #f5dfae;
  background: rgba(255, 255, 255, 0.055);
  font-size: 0.76rem;
  font-weight: 800;
  white-space: nowrap;
}

.loadout-power-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.loadout-power-grid > div {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.18);
}

.loadout-power-grid span {
  display: block;
  color: rgba(234, 224, 202, 0.66);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.loadout-power-grid strong {
  display: block;
  margin-top: 2px;
  color: #fff3cc;
  font-size: 0.98rem;
  white-space: nowrap;
}

@media (max-width: 720px) {
  .loadout-power-card {
    padding: 12px;
    border-radius: 16px;
  }

  .loadout-power-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .loadout-power-value {
    min-width: 64px;
  }
}

/* ─── GEAR SET BONUS FOUNDATION ────────────────────────────────────────────── */
.gear-set-panel {
  border: 1px solid rgba(116, 198, 157, 0.24);
  border-radius: 16px;
  padding: 12px;
  margin: 0 0 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(116, 198, 157, 0.13), transparent 32%),
    linear-gradient(145deg, rgba(14, 25, 22, 0.92), rgba(10, 14, 21, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.gear-set-panel.compact {
  margin-top: -2px;
}

.gear-set-panel.is-empty {
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.035);
}

.gear-set-panel-head,
.gear-set-row-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.gear-set-kicker {
  color: #8ee0b8;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gear-set-title {
  color: #eefdf4;
  font-size: 0.98rem;
  font-weight: 900;
}

.gear-set-count {
  min-width: 30px;
  padding: 5px 8px;
  border-radius: 999px;
  color: #102319;
  background: linear-gradient(135deg, #bdf3d6, #63c796);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.gear-set-panel p {
  margin: 8px 0 0;
  color: rgba(232, 245, 238, 0.72);
  font-size: 0.82rem;
  line-height: 1.35;
}

.gear-set-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.gear-set-row {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 9px;
  background: rgba(0, 0, 0, 0.17);
}

.gear-set-row-top strong {
  color: #f3fff8;
  font-size: 0.88rem;
}

.gear-set-row-top span {
  color: rgba(189, 243, 214, 0.78);
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
}

.gear-set-effects {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.gear-set-effects em {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 7px;
  border-radius: 999px;
  color: #dff9ea;
  background: rgba(116, 198, 157, 0.12);
  font-size: 0.74rem;
  font-style: normal;
  font-weight: 800;
}

.unique-passive-panel {
  border-color: rgba(125, 211, 252, 0.2);
  background:
    radial-gradient(circle at top right, rgba(125, 211, 252, 0.13), transparent 36%),
    linear-gradient(145deg, rgba(14, 31, 45, 0.95), rgba(7, 13, 22, 0.9));
}

.unique-passive-panel .gear-set-kicker {
  color: rgba(186, 230, 253, 0.78);
}

.unique-passive-panel .gear-set-count {
  color: #081722;
  background: linear-gradient(135deg, #bae6fd, #38bdf8);
}

.unique-passive-row .gear-set-effects em {
  color: #e0f2fe;
  background: rgba(56, 189, 248, 0.12);
}

/* ─── COMBAT BUILD SUMMARY CLARITY ─────────────────────────────────────────── */
.combat-build-summary {
  margin: 0 0 12px;
  padding: 14px;
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 17px;
  background:
    radial-gradient(circle at top left, rgba(251, 191, 36, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(36, 25, 12, 0.94), rgba(10, 14, 24, 0.92));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.22);
}

.combat-build-summary.compact {
  padding: 12px;
}

.combat-build-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.combat-build-kicker {
  color: rgba(253, 230, 138, 0.78);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.combat-build-head h4 {
  margin: 3px 0 0;
  color: #fff7db;
  font-size: 1rem;
  line-height: 1.15;
}

.combat-build-head strong {
  color: #111827;
  padding: 7px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fde68a, #f59e0b);
  font-size: 0.94rem;
  font-weight: 950;
  white-space: nowrap;
}

.combat-build-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.combat-build-stats span,
.combat-build-bonus {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 9px;
  background: rgba(0, 0, 0, 0.18);
}

.combat-build-stats b,
.combat-build-bonus strong {
  display: block;
  color: #fef3c7;
  font-size: 0.9rem;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-build-stats small,
.combat-build-bonus span,
.combat-build-bonus em,
.combat-build-context {
  color: rgba(254, 243, 199, 0.68);
  font-size: 0.72rem;
  line-height: 1.3;
}

.combat-build-bonuses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.combat-build-bonus em {
  display: block;
  margin-top: 3px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.combat-build-bonus.is-empty {
  grid-column: 1 / -1;
}

.combat-build-bonus.is-empty em {
  white-space: normal;
}

.combat-build-context {
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 720px) {
  .gear-set-panel {
    padding: 11px;
    border-radius: 15px;
  }

  .gear-set-row-top {
    align-items: flex-start;
  }

  .combat-build-summary {
    padding: 11px;
    border-radius: 15px;
  }

  .combat-build-head {
    align-items: stretch;
  }

  .combat-build-stats,
  .combat-build-bonuses {
    grid-template-columns: 1fr;
  }
}

/* ─── SECOND EMERGENCY REAL-MOBILE SPLASH SCROLL FIX ───────────────────────── */
@media (max-width: 760px), (max-height: 720px), (pointer: coarse) {
  html.splash-active-root,
  html.splash-active-root body {
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  body.splash-active {
    position: relative;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    touch-action: pan-y;
  }

  body.splash-active #splash-screen.screen {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    height: auto;
    align-items: stretch;
    justify-content: flex-start;
    padding: max(12px, env(safe-area-inset-top)) 12px calc(40px + env(safe-area-inset-bottom));
    overflow: visible;
    transform: none;
    touch-action: pan-y;
  }

  body.splash-active #splash-screen .splash-shell {
    width: min(100%, 620px);
    min-height: auto;
    height: auto;
    margin: 0 auto;
    padding: 22px 14px calc(52px + env(safe-area-inset-bottom));
    overflow: visible;
    justify-content: flex-start;
  }

  body.splash-active #splash-screen .platform-launch-panel,
  body.splash-active #splash-screen .splash-play-btn {
    flex: 0 0 auto;
  }

  body.splash-active #splash-screen .splash-play-btn {
    position: relative;
    z-index: 2;
    width: min(100%, 360px);
    margin-bottom: max(18px, env(safe-area-inset-bottom));
  }
}

/* ─── EMERGENCY ANDROID NO-SCROLL MOBILE ENTRY FIX ───────────────────────────
   Android Chrome/Brave can still fail touch scrolling when the app shell has
   global fixed/overflow locks. Do not require scrolling to enter on mobile. */
@media (max-width: 760px), (max-height: 720px), (pointer: coarse) {
  body.splash-active #splash-screen.screen {
    position: fixed;
    inset: 0;
    width: 100%;
    min-height: 0;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100svh;
    max-height: 100dvh;
    align-items: stretch;
    justify-content: center;
    padding: max(8px, env(safe-area-inset-top)) 10px calc(82px + env(safe-area-inset-bottom));
    overflow: hidden;
    touch-action: manipulation;
  }

  body.splash-active #splash-screen .splash-shell {
    width: min(100%, 560px);
    min-height: 0;
    height: 100%;
    max-height: 100%;
    margin: 0 auto;
    padding: 8px 10px 0;
    overflow: hidden;
    gap: clamp(6px, 1.25vh, 10px);
    justify-content: flex-start;
  }

  body.splash-active #splash-screen .splash-status-line {
    gap: 6px;
    margin-bottom: 0;
    font-size: clamp(0.58rem, 2.1vw, 0.68rem);
  }

  body.splash-active #splash-screen .splash-status-line span {
    min-height: 22px;
    padding: 4px 8px;
  }

  body.splash-active #splash-screen .title-emblem {
    width: clamp(58px, 15vw, 84px);
    height: clamp(58px, 15vw, 84px);
    margin-bottom: 0;
  }

  body.splash-active #splash-screen .title-logo {
    font-size: clamp(1.8rem, 8.2vw, 2.65rem);
    line-height: 0.9;
    margin: 0;
  }

  body.splash-active #splash-screen .title-subtitle {
    max-width: 34ch;
    margin: 0 auto;
    font-size: clamp(0.76rem, 2.8vw, 0.9rem);
    line-height: 1.2;
  }

  body.splash-active #splash-screen .platform-launch-panel {
    width: 100%;
    padding: clamp(8px, 1.6vh, 12px);
    border-radius: 16px;
    gap: 7px;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  body.splash-active #splash-screen .platform-launch-kicker {
    font-size: 0.62rem;
  }

  body.splash-active #splash-screen .platform-launch-copy,
  body.splash-active #splash-screen .platform-launch-note {
    font-size: clamp(0.66rem, 2.25vw, 0.78rem);
    line-height: 1.25;
  }

  body.splash-active #splash-screen .platform-choice-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    align-items: stretch;
  }

  body.splash-active #splash-screen .platform-choice-btn {
    min-height: clamp(92px, 17vh, 124px);
    padding: 12px 9px 10px;
    border-radius: 14px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
  }

  body.splash-active #splash-screen .platform-choice-icon {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  body.splash-active #splash-screen .platform-choice-title {
    font-size: 0.9rem;
  }

  body.splash-active #splash-screen .platform-choice-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.68rem;
    line-height: 1.16;
  }

  body.splash-active #splash-screen .platform-recommended-badge {
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    padding: 3px 7px;
    font-size: 0.55rem;
  }

  body.splash-active #splash-screen .platform-check-icon {
    top: 7px;
    right: 7px;
    width: 20px;
    height: 20px;
    font-size: 0.6rem;
  }

  body.splash-active #splash-screen .splash-play-btn {
    position: fixed;
    z-index: 20;
    left: 12px;
    right: 12px;
    bottom: max(10px, env(safe-area-inset-bottom));
    width: min(420px, calc(100vw - 24px));
    min-height: 58px;
    margin: 0 auto;
    padding: 10px 18px;
    border-radius: 18px;
    box-shadow: 0 -10px 36px rgba(5, 8, 14, 0.52), 0 16px 36px rgba(249, 115, 22, 0.32);
    touch-action: manipulation;
  }

  body.splash-active #splash-screen .splash-play-icon {
    width: 32px;
    height: 32px;
  }

  body.splash-active #splash-screen .splash-play-label {
    font-size: 1rem;
  }

  body.splash-active #splash-screen .splash-play-subline {
    font-size: 0.68rem;
  }
}

@media (max-width: 380px), (max-height: 660px) {
  body.splash-active #splash-screen.screen {
    padding-top: max(6px, env(safe-area-inset-top));
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  body.splash-active #splash-screen .splash-shell {
    gap: 5px;
    padding-inline: 6px;
  }

  body.splash-active #splash-screen .title-emblem {
    width: 52px;
    height: 52px;
  }

  body.splash-active #splash-screen .title-logo {
    font-size: clamp(1.55rem, 7.6vw, 2.15rem);
  }

  body.splash-active #splash-screen .title-subtitle,
  body.splash-active #splash-screen .platform-launch-copy,
  body.splash-active #splash-screen .platform-launch-note {
    font-size: 0.65rem;
  }

  body.splash-active #splash-screen .platform-choice-btn {
    min-height: 86px;
    padding: 10px 7px 8px;
  }

  body.splash-active #splash-screen .platform-choice-icon {
    width: 30px;
    height: 30px;
  }

  body.splash-active #splash-screen .platform-choice-desc {
    -webkit-line-clamp: 1;
  }

  body.splash-active #splash-screen .splash-play-btn {
    min-height: 54px;
    padding-block: 8px;
  }
}

/* ─── BUILD SUMMARY + SET BONUS CLARITY POLISH ─────────────────────────────── */
.build-help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 5px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  color: rgba(253, 230, 138, 0.88);
  background: rgba(0, 0, 0, 0.22);
  font-size: 0.72rem;
  vertical-align: middle;
  cursor: help;
}

.build-help-icon:hover,
.build-help-icon:focus-visible {
  color: #fff7db;
  border-color: rgba(253, 230, 138, 0.42);
  background: rgba(251, 191, 36, 0.16);
}

.loadout-power-stat {
  cursor: help;
}

.loadout-power-stat span i {
  margin-left: 4px;
  color: rgba(253, 230, 138, 0.72);
  font-size: 0.72rem;
}

.gear-set-count {
  min-width: 62px;
}

.gear-set-row.has-active-bonus {
  border-color: rgba(116, 198, 157, 0.2);
  background:
    linear-gradient(145deg, rgba(116, 198, 157, 0.09), rgba(0, 0, 0, 0.2));
}

.gear-set-progress {
  height: 7px;
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.08);
}

.gear-set-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #63c796, #bdf3d6);
  box-shadow: 0 0 14px rgba(99, 199, 150, 0.32);
}

.gear-set-thresholds {
  display: grid;
  gap: 6px;
  margin-top: 9px;
}

.gear-set-threshold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 11px;
  background: rgba(0, 0, 0, 0.16);
}

.gear-set-threshold span {
  flex: 0 0 auto;
  color: rgba(189, 243, 214, 0.72);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gear-set-threshold strong {
  min-width: 0;
  color: rgba(232, 245, 238, 0.72);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: right;
}

.gear-set-threshold.is-active {
  border-color: rgba(116, 198, 157, 0.24);
  background: rgba(116, 198, 157, 0.12);
}

.gear-set-threshold.is-active strong {
  color: #eafff1;
}

.gear-set-threshold.is-inactive {
  opacity: 0.72;
}

.gear-set-next {
  margin: 8px 0 0;
  color: rgba(232, 245, 238, 0.68);
  font-size: 0.76rem;
  line-height: 1.3;
}

.gear-set-next.is-complete {
  color: rgba(189, 243, 214, 0.82);
}

@media (max-width: 720px) {
  .build-help-icon {
    width: 24px;
    height: 24px;
  }

  .gear-set-threshold {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .gear-set-threshold strong {
    text-align: left;
  }
}

/* ─── MOBILE NAVIGATION + FEATURE PARITY POLISH ────────────────────────────── */
body.platform-mobile .right-tabs {
  display: none !important;
}

body.platform-mobile #right-panel[data-mobile-systems-tab="stats"] [data-tab-content="stats"].active {
  padding-top: 6px;
}

body.platform-mobile #right-panel[data-mobile-systems-tab="stats"] #stats-content {
  border-radius: 18px;
  overflow: hidden;
}

body.platform-mobile #mobile-journey-grid.mobile-surface-scroll {
  padding-top: 10px;
}

body.platform-mobile .mj-section {
  margin-bottom: 14px;
}

body.platform-mobile .mj-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

body.platform-mobile .mj-card {
  min-height: 96px;
  padding: 12px 8px 10px;
  user-select: none;
}

body.platform-mobile .mj-card small {
  min-height: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

body.platform-mobile .mobile-activity-shell {
  gap: 10px;
}

body.platform-mobile .mobile-activity-log {
  min-height: 0;
  max-height: none;
  -webkit-overflow-scrolling: touch;
}

body.platform-mobile #mobile-activity-log {
  min-height: 260px;
}

body.platform-mobile #splash-screen .platform-launch-panel {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 18px 38px rgba(0, 0, 0, 0.24);
}

body.platform-mobile #splash-screen .splash-play-btn {
  backdrop-filter: blur(10px);
}

body.platform-mobile #mastery-tree-modal .mastery-tree-modal-box {
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  border-radius: 0;
}

body.platform-mobile #mastery-tree-modal .mastery-tree-modal-header {
  padding: max(8px, env(safe-area-inset-top)) 12px 8px;
}

body.platform-mobile #mastery-tree-modal-panel {
  padding: 8px;
}

body.platform-mobile #mastery-tree-modal .mastery-shell--modal {
  gap: 8px;
}

body.platform-mobile #mastery-tree-modal .mastery-topbar--modal {
  padding: 6px;
  gap: 6px;
  border-radius: 14px;
}

body.platform-mobile #mastery-tree-modal .mastery-topbar--modal .mastery-tree-switch--modal {
  gap: 6px;
}

body.platform-mobile #mastery-tree-modal .mastery-tree-switch-btn {
  min-height: 42px;
  padding: 6px 8px;
}

body.platform-mobile #mastery-tree-modal .mastery-tree-switch-icon,
body.platform-mobile #mastery-tree-modal .mastery-tree-switch-copy span,
body.platform-mobile #mastery-tree-modal .mastery-modal-xp-line {
  display: none;
}

body.platform-mobile #mastery-tree-modal .mastery-topbar-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  width: 100%;
  gap: 6px;
}

body.platform-mobile #mastery-tree-modal .mastery-modal-pts-badge,
body.platform-mobile #mastery-tree-modal .mastery-toolbar-btn,
body.platform-mobile #mastery-tree-modal .mastery-reset-btn {
  min-height: 38px;
  justify-content: center;
  padding: 6px 8px;
  font-size: 10px;
  min-width: 0;
}

body.platform-mobile #mastery-tree-modal .mastery-tree-layout--modal {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  overflow: hidden;
}

body.platform-mobile #mastery-tree-modal .mastery-board-card {
  min-height: 0;
  padding: 7px;
  border-radius: 18px;
}

body.platform-mobile #mastery-tree-modal .mastery-board-viewport {
  min-height: 0;
  height: 100%;
  border-radius: 18px;
  touch-action: none;
  overscroll-behavior: none;
}

body.platform-mobile #mastery-tree-modal .mastery-board-status {
  left: 8px;
  top: 8px;
  max-width: calc(100% - 78px);
}

body.platform-mobile #mastery-tree-modal .mastery-board-nav {
  right: 8px;
  top: 8px;
}

body.platform-mobile #mastery-tree-modal .mastery-board-status-chip,
body.platform-mobile #mastery-tree-modal .mastery-board-mini-btn {
  min-height: 32px;
  padding: 6px 8px;
}

body.platform-mobile #mastery-tree-modal .mastery-side-column,
body.platform-mobile #mastery-tree-modal .mastery-side-column.is-collapsed {
  position: relative;
  inset: auto;
  width: 100%;
  max-width: none;
  max-height: min(34dvh, 260px);
  padding: 0;
  overflow-y: auto;
  z-index: 2;
  pointer-events: auto;
  -webkit-overflow-scrolling: touch;
}

body.platform-mobile #mastery-tree-modal .mastery-detail-toggle {
  position: sticky;
  top: 0;
  z-index: 3;
  width: 100%;
  margin: 0 0 6px;
  min-height: 34px;
  border-radius: 14px;
}

body.platform-mobile #mastery-tree-modal .mastery-side-column .mastery-detail-card {
  max-height: none;
  border-radius: 18px;
  padding: 12px;
}

body.platform-mobile #mastery-tree-modal .mastery-detail-head,
body.platform-mobile #mastery-tree-modal .mastery-detail-crest {
  gap: 10px;
}

body.platform-mobile #mastery-tree-modal .mastery-detail-meta,
body.platform-mobile #mastery-tree-modal .mastery-detail-effects,
body.platform-mobile #mastery-tree-modal .mastery-detail-path-row,
body.platform-mobile #mastery-tree-modal .mastery-detail-actions {
  gap: 6px;
}

body.platform-mobile #mastery-tree-modal .mastery-detail-actions {
  position: sticky;
  bottom: 0;
  padding-top: 8px;
  background: linear-gradient(180deg, transparent, rgba(7, 11, 20, 0.96) 35%);
}

body.platform-mobile #mastery-tree-modal .mastery-detail-btn {
  width: 100%;
  min-height: 44px;
}

/* DUNGEON POLISH + REWARD BALANCE PASS */
.dungeon-card-chest {
  background: linear-gradient(135deg, rgba(245, 184, 83, 0.12), rgba(88, 61, 30, 0.16));
  border-color: rgba(245, 184, 83, 0.24);
}

.dungeon-card-chest-copy span:first-child {
  color: #f7d28a;
  font-weight: 800;
}

.dungeon-chip.is-hidden-boss,
.dungeon-threat-row.is-hidden {
  color: rgba(233, 222, 199, 0.82);
  background: linear-gradient(135deg, rgba(88, 74, 57, 0.28), rgba(30, 26, 22, 0.48));
  border-color: rgba(233, 222, 199, 0.18);
}

.dungeon-threat-row.is-hidden .dungeon-threat-name::before {
  content: "?";
  display: inline-grid;
  place-items: center;
  width: 1.35rem;
  height: 1.35rem;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: rgba(245, 184, 83, 0.12);
  border: 1px solid rgba(245, 184, 83, 0.24);
  color: #f7d28a;
  font-size: 0.72rem;
  font-weight: 900;
}

.dungeon-loot-card.is-hidden {
  background: linear-gradient(135deg, rgba(31, 33, 42, 0.92), rgba(18, 18, 24, 0.96));
  border-style: dashed;
}

.dungeon-clear-footer-note {
  color: rgba(237, 228, 211, 0.82);
}

body.platform-mobile .dungeon-card-chest-copy,
body.platform-mobile .dungeon-detail-boss-chest-copy,
body.platform-mobile .dungeon-clear-footer-note {
  line-height: 1.45;
}

/* EQUIPMENT LOADOUT POWER TOOLTIP + SCROLL FIX */
#right-panel > [data-tab-group="right"][data-tab-content="equipment"],
#right-panel > [data-tab-group="right"][data-tab-content="equipment"].active {
  flex: 1 1 auto;
  min-height: 0;
  max-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable both-edges;
  scrollbar-width: thin;
  padding-bottom: 56px;
  scroll-padding-bottom: 56px;
}

#equipment-grid,
#equip-stats {
  min-height: 0;
}

.loadout-power-card .loadout-power-head {
  align-items: center;
}

.loadout-power-card .loadout-power-kicker {
  min-height: 0;
  display: inline-flex;
  align-items: center;
}

#global-ui-tooltip {
  max-width: min(380px, calc(100vw - 28px));
}

.ui-tooltip-card {
  min-width: 260px;
  padding: 16px 17px;
  gap: 11px;
  line-height: 1.45;
}

.ui-tooltip-card--compact {
  min-width: 230px;
}

.ui-tt-lines {
  display: grid;
  gap: 6px;
  color: rgba(237, 228, 211, 0.86);
  font-size: 0.84rem;
  line-height: 1.42;
}

.ui-tt-lines span {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.platform-mobile #right-panel[data-mobile-systems-tab="equipment"] [data-tab-content="equipment"],
body.platform-mobile #right-panel > [data-tab-group="right"][data-tab-content="equipment"].active {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(124px + env(safe-area-inset-bottom));
  scroll-padding-bottom: calc(124px + env(safe-area-inset-bottom));
}

body.platform-mobile .ui-tooltip-card {
  min-width: min(300px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
  padding: 16px;
}

/* ─── MOBILE HOME ONE-SCREEN FIT CONTINUATION ────────────────────────────────
   Keep Android/iOS entry usable without scroll: title, beta badges, platform
   choice, selected/recommended state, and Play all fit in the real viewport. */
@media (max-width: 760px), (max-height: 720px), (pointer: coarse) {
  body.splash-active #splash-screen.screen {
    display: flex !important;
    align-items: stretch;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    padding: max(7px, env(safe-area-inset-top)) 10px calc(76px + env(safe-area-inset-bottom));
    touch-action: manipulation;
  }

  body.splash-active #splash-screen .splash-shell {
    width: min(100%, 520px);
    height: 100%;
    max-height: 100%;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, 1fr);
    align-content: start;
    justify-items: center;
    gap: clamp(5px, 1.05vh, 9px);
    padding: 4px 8px 0;
    min-width: 0;
    overflow: hidden;
  }

  body.splash-active #splash-screen .splash-status-line {
    order: 1;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    max-width: 100%;
    gap: 6px;
  }

  body.splash-active #splash-screen .splash-status-line span {
    white-space: nowrap;
    min-width: 0;
    padding: 4px 7px;
    font-size: clamp(0.55rem, 2.25vw, 0.68rem);
    line-height: 1;
  }

  body.splash-active #splash-screen .title-emblem {
    order: 2;
    width: clamp(50px, 13.5vw, 72px);
    height: clamp(50px, 13.5vw, 72px);
    padding: 8px;
    border-radius: 18px;
  }

  body.splash-active #splash-screen .title-logo {
    order: 3;
    font-size: clamp(1.45rem, 7vw, 2.35rem);
    line-height: 0.95;
    letter-spacing: clamp(0.08em, 2.4vw, 0.18em);
    max-width: 100%;
    text-wrap: balance;
  }

  body.splash-active #splash-screen .title-subtitle {
    display: none;
  }

  body.splash-active #splash-screen .platform-launch-panel {
    order: 4;
    align-self: stretch;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    width: 100%;
    max-height: 100%;
    min-height: 0;
    padding: clamp(8px, 1.5vh, 12px);
    gap: 7px;
    overflow: hidden;
  }

  body.splash-active #splash-screen .platform-launch-kicker {
    font-size: clamp(0.58rem, 2.1vw, 0.7rem);
    letter-spacing: 0.16em;
  }

  body.splash-active #splash-screen .platform-launch-copy,
  body.splash-active #splash-screen .platform-launch-note {
    display: none;
  }

  body.splash-active #splash-screen .platform-choice-row {
    min-height: 0;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    align-items: stretch;
  }

  body.splash-active #splash-screen .platform-choice-btn {
    min-width: 0;
    min-height: 0;
    height: 100%;
    max-height: 138px;
    padding: clamp(22px, 4vh, 30px) 8px 10px;
    border-radius: 15px;
    gap: 6px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  body.splash-active #splash-screen .platform-choice-icon {
    flex: 0 0 auto;
    width: clamp(29px, 8vw, 38px);
    height: clamp(29px, 8vw, 38px);
  }

  body.splash-active #splash-screen .platform-choice-title {
    font-size: clamp(0.82rem, 3.2vw, 0.95rem);
  }

  body.splash-active #splash-screen .platform-choice-desc {
    max-width: 18ch;
    -webkit-line-clamp: 2;
    font-size: clamp(0.58rem, 2.45vw, 0.7rem);
    line-height: 1.16;
  }

  body.splash-active #splash-screen .platform-recommended-badge {
    max-width: calc(100% - 42px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  body.splash-active #splash-screen .splash-play-btn {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: max(9px, env(safe-area-inset-bottom));
    width: min(430px, calc(100vw - 24px));
    min-height: clamp(52px, 8.8vh, 62px);
    padding: 9px 16px;
    border-radius: 17px;
    transform: translateZ(0);
    will-change: transform;
  }
}

@media (max-width: 380px), (max-height: 660px) {
  body.splash-active #splash-screen.screen {
    padding: max(5px, env(safe-area-inset-top)) 8px calc(66px + env(safe-area-inset-bottom));
  }

  body.splash-active #splash-screen .splash-shell {
    gap: 4px;
    padding-inline: 4px;
  }

  body.splash-active #splash-screen .splash-status-line span {
    padding: 3px 6px;
    font-size: 0.52rem;
  }

  body.splash-active #splash-screen .title-emblem {
    width: 46px;
    height: 46px;
    padding: 7px;
  }

  body.splash-active #splash-screen .title-logo {
    font-size: clamp(1.28rem, 6.8vw, 1.8rem);
  }

  body.splash-active #splash-screen .platform-launch-panel {
    padding: 7px;
    gap: 5px;
  }

  body.splash-active #splash-screen .platform-launch-kicker {
    font-size: 0.55rem;
  }

  body.splash-active #splash-screen .platform-choice-row {
    gap: 6px;
  }

  body.splash-active #splash-screen .platform-choice-btn {
    max-height: 112px;
    padding: 19px 6px 7px;
    gap: 4px;
  }

  body.splash-active #splash-screen .platform-choice-icon {
    width: 27px;
    height: 27px;
  }

  body.splash-active #splash-screen .platform-choice-desc {
    -webkit-line-clamp: 1;
  }

  body.splash-active #splash-screen .splash-play-btn {
    min-height: 50px;
    padding-block: 7px;
  }
}

/* ─── FULL MOBILE QA FIT + PARITY GUARDRAILS ──────────────────────────────── */
body.platform-mobile #game-screen,
body.platform-mobile #main-game-ui,
body.platform-mobile #left-panel,
body.platform-mobile #middle-panel,
body.platform-mobile #right-panel,
body.platform-mobile #mobile-hero-panel,
body.platform-mobile #mobile-journey-panel,
body.platform-mobile #mobile-quests-panel,
body.platform-mobile .mobile-surface-shell {
  min-width: 0;
  min-height: 0;
}

body.platform-mobile .mobile-surface-scroll,
body.platform-mobile #middle-panel > [data-tab-content].active,
body.platform-mobile #right-panel > [data-tab-content].active,
body.platform-mobile #daily-panel,
body.platform-mobile #dungeons-panel,
body.platform-mobile #combat-panel,
body.platform-mobile #training-panel,
body.platform-mobile #skills-browser-panel,
body.platform-mobile #loot-panel {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scroll-padding-bottom: calc(112px + env(safe-area-inset-bottom));
}

body.platform-mobile #middle-panel > [data-tab-content].active,
body.platform-mobile #right-panel > [data-tab-content].active,
body.platform-mobile #daily-panel,
body.platform-mobile #dungeons-panel,
body.platform-mobile #loot-panel {
  padding-bottom: calc(104px + env(safe-area-inset-bottom));
}

body.platform-mobile .mj-card,
body.platform-mobile .daily-claim-btn,
body.platform-mobile .dungeon-card button,
body.platform-mobile .dungeon-detail-actions button,
body.platform-mobile #ge-modal button,
body.platform-mobile #settings-modal button,
body.platform-mobile #mastery-tree-modal button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body.platform-mobile .mj-card,
body.platform-mobile .dungeon-card,
body.platform-mobile .daily-task-card,
body.platform-mobile .combat-target,
body.platform-mobile .training-action,
body.platform-mobile .equip-slot,
body.platform-mobile .inv-slot,
body.platform-mobile .bank-slot {
  overflow-wrap: normal;
  word-break: normal;
}

body.platform-mobile #daily-modal .modal-box,
body.platform-mobile #bank-modal .modal-box,
body.platform-mobile #bestiary-modal .modal-box,
body.platform-mobile #leaderboard-modal .modal-box,
body.platform-mobile #patch-notes-modal .modal-box,
body.platform-mobile #bug-report-modal .modal-box,
body.platform-mobile #offline-modal .modal-box,
body.platform-mobile #dungeon-detail-modal .modal-box,
body.platform-mobile #dungeon-clear-modal .modal-box {
  width: calc(100vw - 12px);
  max-width: calc(100vw - 12px);
  max-height: calc(100dvh - 12px);
}

body.platform-mobile #daily-modal .modal-body,
body.platform-mobile #bank-modal .modal-body,
body.platform-mobile #bestiary-modal .modal-body,
body.platform-mobile #leaderboard-modal .modal-body,
body.platform-mobile #patch-notes-modal .modal-body,
body.platform-mobile #bug-report-modal .modal-body,
body.platform-mobile #offline-modal .modal-body,
body.platform-mobile #dungeon-detail-modal .modal-body,
body.platform-mobile #dungeon-clear-modal .modal-body {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(18px + env(safe-area-inset-bottom));
}

/* ─── GPT-IMAGE-2 UI ART REFRESH — 2026-04-29 ────────────────────────────── */
:root {
  --tl-ui-home-wallpaper: url("img/ui/generated/home_realm_wallpaper_20260429.webp");
  --tl-ui-character-backdrop: url("img/ui/generated/character_hub_backdrop_20260429.webp");
  --tl-ui-loading-backdrop: url("img/ui/generated/offline_loading_backdrop_20260429.webp");
  --tl-ui-mastery-backdrop: url("img/ui/generated/mastery_tree_backdrop_20260429.webp");
}

#splash-screen {
  background:
    radial-gradient(ellipse 58% 50% at 50% 38%, rgba(5, 4, 8, 0.30) 0%, rgba(5, 4, 8, 0.58) 54%, rgba(5, 4, 8, 0.90) 100%),
    linear-gradient(90deg, rgba(5, 4, 8, 0.50) 0%, rgba(5, 4, 8, 0.16) 36%, rgba(5, 4, 8, 0.20) 64%, rgba(5, 4, 8, 0.58) 100%),
    var(--tl-ui-home-wallpaper),
    var(--titans-legacy-bg) !important;
  background-size: cover, cover, cover, cover !important;
  background-position: center, center, center center, var(--titans-legacy-bg-position) !important;
  background-repeat: no-repeat !important;
}

#splash-screen::before {
  background:
    linear-gradient(180deg, rgba(3, 3, 6, 0.08), rgba(3, 3, 6, 0.36)),
    url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23f8e7b4' fill-opacity='0.018'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/svg%3E") !important;
  opacity: 0.82;
}

#char-select-hub {
  background:
    radial-gradient(ellipse 68% 48% at 50% 24%, rgba(8, 7, 11, 0.18) 0%, rgba(8, 7, 11, 0.62) 70%),
    linear-gradient(180deg, rgba(8, 6, 12, 0.18), rgba(8, 6, 12, 0.88)),
    var(--tl-ui-character-backdrop),
    var(--titans-legacy-bg) !important;
  background-size: cover, cover, cover, cover !important;
  background-position: center, center, center center, var(--titans-legacy-bg-position) !important;
  background-repeat: no-repeat !important;
}

#char-select-hub .hub-panel {
  background:
    linear-gradient(180deg, rgba(15, 11, 18, 0.88), rgba(9, 7, 12, 0.94)),
    rgba(10, 8, 16, 0.92) !important;
  border-color: rgba(231, 194, 118, 0.22);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 238, 191, 0.07);
  backdrop-filter: blur(5px);
}

.resume-loading-overlay {
  background:
    radial-gradient(ellipse 58% 46% at 50% 42%, rgba(5, 7, 12, 0.42) 0%, rgba(5, 7, 12, 0.80) 68%, rgba(5, 6, 10, 0.94) 100%),
    linear-gradient(180deg, rgba(4, 5, 9, 0.16), rgba(4, 5, 9, 0.86)),
    var(--tl-ui-loading-backdrop),
    #05060a !important;
  background-size: cover, cover, cover, cover !important;
  background-position: center, center, center center, center !important;
  background-repeat: no-repeat !important;
}

.resume-loading-shell {
  background:
    linear-gradient(180deg, rgba(12, 10, 17, 0.90), rgba(7, 8, 13, 0.94)),
    rgba(9, 8, 14, 0.92) !important;
  border-color: rgba(231, 194, 118, 0.24);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.66), inset 0 1px 0 rgba(255, 243, 205, 0.07);
  backdrop-filter: blur(5px);
}

#mastery-tree-modal .mastery-tree-modal-box {
  background:
    linear-gradient(180deg, rgba(16, 12, 20, 0.96), rgba(8, 7, 12, 0.98)),
    var(--bg-panel) !important;
}

.mastery-board-viewport {
  background:
    radial-gradient(circle at 50% 50%, rgba(246, 194, 92, 0.12), transparent 24%),
    linear-gradient(180deg, rgba(5, 5, 10, 0.24), rgba(5, 5, 10, 0.66)),
    var(--tl-ui-mastery-backdrop),
    #09070d !important;
  background-size: cover, cover, cover, cover !important;
  background-position: center, center, center center, center !important;
  background-repeat: no-repeat !important;
}

.mastery-board-shell,
.mastery-board-shell[data-tree="combat"],
.mastery-board-shell[data-tree="skilling"] {
  background:
    radial-gradient(circle at 50% 50%, rgba(244, 193, 95, 0.12), transparent 16%),
    radial-gradient(circle at 50% 50%, rgba(80, 124, 205, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(8, 7, 13, 0.36), rgba(8, 7, 13, 0.58)) !important;
}

@media (max-width: 720px) {
  #splash-screen {
    background-position: center, center, 47% center, var(--titans-legacy-bg-position) !important;
  }

  #char-select-hub {
    background-position: center, center, 50% center, var(--titans-legacy-bg-position) !important;
  }

  .resume-loading-overlay {
    background-position: center, center, 50% center, center !important;
  }

  .mastery-board-viewport {
    background-position: center, center, 50% center, center !important;
  }
}

/* ─── LARGE MOBILE UI FULL REFRESH — 2026-04-29 ────────────────────────────
   Mobile-only presentation pass. Keeps desktop, gameplay, save, cloud,
   economy, item data, combat formulas, and routing logic untouched. */
:root {
  --tl-mobile-radius-xl: 24px;
  --tl-mobile-radius-lg: 20px;
  --tl-mobile-radius-md: 16px;
  --tl-mobile-tap-min: 46px;
  --tl-mobile-nav-height: 64px;
  --tl-mobile-gutter: 10px;
  --tl-mobile-card-border: rgba(239, 199, 122, 0.16);
  --tl-mobile-card-border-strong: rgba(239, 199, 122, 0.34);
  --tl-mobile-card-bg:
    radial-gradient(circle at 12% 0%, rgba(239, 199, 122, 0.10), transparent 34%),
    linear-gradient(180deg, rgba(27, 25, 36, 0.98), rgba(10, 11, 18, 0.98));
  --tl-mobile-card-bg-cool:
    radial-gradient(circle at 10% 0%, rgba(85, 139, 232, 0.15), transparent 34%),
    linear-gradient(180deg, rgba(22, 24, 36, 0.98), rgba(9, 11, 18, 0.98));
  --tl-mobile-card-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.045),
    0 16px 32px rgba(0, 0, 0, 0.24);
  --tl-mobile-soft-transition:
    background-color 120ms ease,
    border-color 120ms ease,
    box-shadow 120ms ease,
    filter 120ms ease,
    transform 120ms ease;
}

body.platform-mobile,
body.platform-mobile #game-screen,
body.platform-mobile #main-game-ui {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.platform-mobile #game-screen {
  gap: 8px;
  padding: max(6px, env(safe-area-inset-top)) var(--tl-mobile-gutter) max(7px, env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 50% 0%, rgba(239, 199, 122, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(6, 5, 10, 0.84), rgba(4, 5, 9, 0.96)),
    var(--tl-ui-home-wallpaper),
    var(--titans-legacy-bg);
  background-size: cover, cover, cover, cover;
  background-position: center, center, 50% center, var(--titans-legacy-bg-position);
}

body.platform-mobile #game-header,
body.platform-mobile #mobile-summary-bar,
body.platform-mobile .panel,
body.platform-mobile .mobile-combat-subview-body,
body.platform-mobile .mobile-quest-detail-pane {
  border: 1px solid var(--tl-mobile-card-border);
  background: var(--tl-mobile-card-bg-cool);
  box-shadow: var(--tl-mobile-card-shadow);
  backdrop-filter: blur(8px);
}

body.platform-mobile #game-header {
  min-height: 52px;
  border-radius: var(--tl-mobile-radius-lg);
  padding: 8px 46px 8px 11px;
}

body.platform-mobile .game-header-title {
  color: #fff2d7;
  font-size: 13px;
  letter-spacing: 0.08em;
}

body.platform-mobile .game-header-eyebrow {
  color: rgba(239, 199, 122, 0.70);
}

body.platform-mobile #mobile-summary-bar {
  border-radius: var(--tl-mobile-radius-lg);
  padding: 9px 10px;
}

body.platform-mobile .mobile-summary-inline-name,
body.platform-mobile .mobile-combat-summary-title,
body.platform-mobile .mobile-surface-title,
body.platform-mobile .mobile-journey-title,
body.platform-mobile .mobile-hero-name-row {
  color: #fff5df;
  letter-spacing: -0.015em;
}

body.platform-mobile #panels-row {
  border-radius: var(--tl-mobile-radius-xl);
}

body.platform-mobile .panel {
  border-radius: var(--tl-mobile-radius-xl);
}

body.platform-mobile .mobile-surface-top,
body.platform-mobile .mobile-surface-top--embedded,
body.platform-mobile .mobile-combat-subview-top {
  padding: 11px 14px 9px;
  border-bottom: 1px solid rgba(239, 199, 122, 0.10);
  background:
    radial-gradient(circle at 0% 0%, rgba(239, 199, 122, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(27, 23, 34, 0.98), rgba(12, 12, 19, 0.96));
}

body.platform-mobile .mobile-surface-kicker,
body.platform-mobile .mobile-combat-subview-kicker,
body.platform-mobile .mobile-quest-detail-screen-kicker,
body.platform-mobile .mj-section-label {
  color: rgba(239, 199, 122, 0.78);
  font-size: 9px;
  letter-spacing: 0.16em;
}

body.platform-mobile .mobile-surface-title {
  font-size: 16px;
  line-height: 1.12;
}

body.platform-mobile .mobile-surface-scroll,
body.platform-mobile #middle-panel > [data-tab-content].active,
body.platform-mobile #right-panel > [data-tab-content].active,
body.platform-mobile #combat-panel,
body.platform-mobile #training-actions,
body.platform-mobile #dungeons-panel,
body.platform-mobile #loot-panel,
body.platform-mobile #daily-panel,
body.platform-mobile #skills-browser-panel {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scroll-padding-bottom: calc(var(--tl-mobile-nav-height) + 44px + env(safe-area-inset-bottom));
}

body.platform-mobile #middle-panel > [data-tab-content].active,
body.platform-mobile #right-panel > [data-tab-content].active,
body.platform-mobile #combat-panel,
body.platform-mobile #training-actions,
body.platform-mobile #dungeons-panel,
body.platform-mobile #loot-panel,
body.platform-mobile #daily-panel,
body.platform-mobile #skills-browser-panel {
  padding-bottom: calc(var(--tl-mobile-nav-height) + 34px + env(safe-area-inset-bottom)) !important;
}

body.platform-mobile #mobile-nav-bar {
  min-height: calc(var(--tl-mobile-nav-height) + env(safe-area-inset-bottom));
  gap: 7px;
  padding: 6px 5px max(6px, env(safe-area-inset-bottom));
  border: 1px solid rgba(239, 199, 122, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0%, rgba(239, 199, 122, 0.14), transparent 68%),
    linear-gradient(180deg, rgba(22, 20, 30, 0.94), rgba(7, 8, 14, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 -14px 38px rgba(0, 0, 0, 0.30);
  backdrop-filter: blur(14px);
}

body.platform-mobile .mobile-nav-btn {
  position: relative;
  min-width: 0;
  min-height: 52px;
  padding: 7px 2px 6px;
  border-radius: 17px;
  border-color: rgba(255, 255, 255, 0.075);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018));
  color: rgba(231, 222, 204, 0.70);
  font-size: 8px;
  letter-spacing: 0.07em;
  transform: translateZ(0);
  transition: var(--tl-mobile-soft-transition);
}

body.platform-mobile .mobile-nav-btn::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 5px;
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: rgba(239, 199, 122, 0);
  transform: translateX(-50%);
  transition: background-color 120ms ease, width 120ms ease;
}

body.platform-mobile .mobile-nav-btn i {
  font-size: 17px;
  color: rgba(239, 199, 122, 0.76);
}

body.platform-mobile .mobile-nav-btn.active {
  border-color: rgba(239, 199, 122, 0.42);
  color: #fff4de;
  background:
    radial-gradient(circle at 50% 0%, rgba(239, 199, 122, 0.26), transparent 70%),
    linear-gradient(180deg, rgba(55, 43, 28, 0.98), rgba(17, 16, 25, 0.98));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.065), 0 10px 22px rgba(0, 0, 0, 0.24);
}

body.platform-mobile .mobile-nav-btn.active::after {
  width: 28px;
  background: rgba(239, 199, 122, 0.9);
}

body.platform-mobile .mobile-nav-btn:active:not(.active),
body.platform-mobile button:active:not(:disabled),
body.platform-mobile .tab-btn:active:not(.active),
body.platform-mobile .right-tab:active:not(.active),
body.platform-mobile .mobile-hero-action-btn:active,
body.platform-mobile .mobile-skill-row:active,
body.platform-mobile .mj-card:active,
body.platform-mobile .mobile-journey-card:active {
  transform: scale(0.985);
  filter: brightness(1.08);
}

body.platform-mobile :where(
  .mobile-hero-card,
  .mobile-hero-section-card,
  .mobile-activity-shell,
  .mobile-skills-copy,
  .mobile-skill-group,
  .mobile-summary-pill,
  .mobile-hero-stat-card,
  .mobile-hero-journey-card,
  .mobile-quests-toolbar,
  .training-action,
  .combat-target,
  .combat-automation-card,
  .fallen-loot-panel,
  .dungeon-card,
  .dungeon-tab-hero,
  .daily-task-card,
  .daily-date-card,
  .daily-buff-card,
  .bounty-task-card,
  .bounty-master-card,
  .bounty-empty-state,
  .settings-section,
  .ge-txn-panel,
  .ge-hint,
  .shop-card,
  .shop-item,
  .stat-col,
  .stats-card,
  .loadout-power-card,
  .gear-set-summary,
  .special-weapon-effect-card
) {
  border-radius: var(--tl-mobile-radius-lg) !important;
  border-color: var(--tl-mobile-card-border) !important;
  background: var(--tl-mobile-card-bg) !important;
  box-shadow: var(--tl-mobile-card-shadow);
}

body.platform-mobile :where(.training-action, .daily-task-card, .combat-target, .dungeon-card, .bounty-task-card, .settings-section):not(button):active {
  transform: none;
}

body.platform-mobile .mobile-hero-action-btn,
body.platform-mobile .mobile-skill-row,
body.platform-mobile .mobile-journey-card,
body.platform-mobile .mj-card,
body.platform-mobile .tab-btn,
body.platform-mobile .right-tab,
body.platform-mobile .daily-claim-btn,
body.platform-mobile .dungeon-card-btn,
body.platform-mobile .combat-mobile-action,
body.platform-mobile #ge-modal button,
body.platform-mobile #settings-modal button,
body.platform-mobile #mastery-tree-modal button,
body.platform-mobile .btn-primary,
body.platform-mobile .btn-outline {
  min-height: var(--tl-mobile-tap-min);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

body.platform-mobile input,
body.platform-mobile textarea,
body.platform-mobile select,
body.platform-mobile .cloud-input,
body.platform-mobile .ge-search-input,
body.platform-mobile .hof-search-input {
  min-height: 44px;
  font-size: 16px !important;
  border-radius: 14px;
  user-select: text;
  -webkit-user-select: text;
}

body.platform-mobile .tab-bar,
body.platform-mobile .right-tabs,
body.platform-mobile .hof-sidebar {
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

body.platform-mobile .tab-btn,
body.platform-mobile .right-tab,
body.platform-mobile .hof-cat-btn {
  scroll-snap-align: start;
}

body.platform-mobile .tab-btn,
body.platform-mobile .right-tab {
  border-radius: 999px;
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(231, 222, 204, 0.72);
}

body.platform-mobile .tab-btn.active,
body.platform-mobile .right-tab.active {
  border-color: var(--tl-mobile-card-border-strong);
  background:
    radial-gradient(circle at 50% 0%, rgba(239, 199, 122, 0.20), transparent 70%),
    rgba(239, 199, 122, 0.08);
  color: #fff4de;
}

body.platform-mobile .mj-section {
  margin-bottom: 16px;
  padding: 12px;
  border-radius: var(--tl-mobile-radius-xl);
  border: 1px solid rgba(239, 199, 122, 0.12);
  background: rgba(255, 255, 255, 0.025);
}

body.platform-mobile .mj-section-head {
  align-items: flex-start;
  margin-bottom: 11px;
  padding-bottom: 9px;
  border-bottom-color: rgba(239, 199, 122, 0.10);
}

body.platform-mobile .mj-section-copy {
  max-width: 56%;
  font-size: 10px;
}

body.platform-mobile .mj-section-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

body.platform-mobile .mj-card {
  min-height: 94px;
  border-radius: 19px;
  background:
    radial-gradient(circle at 50% 0%, rgba(239, 199, 122, 0.12), transparent 62%),
    linear-gradient(180deg, rgba(31, 28, 42, 0.98), rgba(13, 13, 22, 0.98));
}

body.platform-mobile .mj-card i {
  font-size: 19px;
}

body.platform-mobile .mj-card small {
  -webkit-line-clamp: 2;
  min-height: 0;
}

body.platform-mobile #mobile-activity-log {
  min-height: 260px;
  border-radius: var(--tl-mobile-radius-lg);
}

body.platform-mobile #splash-screen.screen {
  background-position: center, center, 48% center, var(--titans-legacy-bg-position) !important;
}

body.platform-mobile #splash-screen .splash-shell {
  border-color: rgba(239, 199, 122, 0.20);
  background: linear-gradient(180deg, rgba(16, 14, 22, 0.76), rgba(7, 8, 13, 0.82));
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(7px);
}

body.platform-mobile #splash-screen .platform-launch-panel {
  border-color: rgba(239, 199, 122, 0.22);
  background:
    radial-gradient(circle at 50% 0%, rgba(239, 199, 122, 0.12), transparent 70%),
    linear-gradient(180deg, rgba(18, 17, 28, 0.90), rgba(8, 9, 16, 0.94));
}

body.platform-mobile #splash-screen .platform-choice-btn {
  border-color: rgba(255, 255, 255, 0.09);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.024));
}

body.platform-mobile #splash-screen .platform-choice-btn.is-selected,
body.platform-mobile #splash-screen .platform-choice-btn.selected,
body.platform-mobile #splash-screen .platform-choice-btn[aria-pressed="true"] {
  border-color: rgba(239, 199, 122, 0.46);
  box-shadow: inset 0 0 0 1px rgba(239, 199, 122, 0.18), 0 14px 30px rgba(0, 0, 0, 0.24);
}

body.platform-mobile #splash-screen .splash-play-btn {
  border: 1px solid rgba(255, 238, 191, 0.30);
  background:
    radial-gradient(circle at 16% 0%, rgba(255, 244, 214, 0.24), transparent 36%),
    linear-gradient(135deg, #f2b963 0%, #bf8151 42%, #7a5af8 100%);
  color: #161017;
  box-shadow: 0 -12px 38px rgba(5, 8, 14, 0.56), 0 18px 40px rgba(191, 129, 81, 0.30);
}

body.platform-mobile #char-select-hub .hub-panel {
  max-height: calc(100dvh - 12px);
  border-radius: var(--tl-mobile-radius-xl);
}

body.platform-mobile #char-select-hub .hub-grid,
body.platform-mobile #char-select-hub .hub-column,
body.platform-mobile #char-select-hub .hub-save-slots,
body.platform-mobile #char-select-hub .cloud-auth-form {
  gap: 10px;
}

body.platform-mobile #char-select-hub .hub-column,
body.platform-mobile #char-select-hub .cs-slot-card,
body.platform-mobile #char-select-hub .cloud-slot-row,
body.platform-mobile #char-select-hub .closed-beta-panel {
  border-radius: var(--tl-mobile-radius-lg);
}

body.platform-mobile #equipment-grid {
  grid-template-columns: repeat(3, minmax(74px, 1fr));
  max-width: 310px;
}

body.platform-mobile .equip-slot,
body.platform-mobile .inv-slot,
body.platform-mobile .bank-slot {
  border-radius: 18px;
  border-color: rgba(239, 199, 122, 0.12);
  background: linear-gradient(180deg, rgba(24, 23, 32, 0.98), rgba(10, 11, 18, 0.98));
}

body.platform-mobile #inventory-grid,
body.platform-mobile #bank-grid {
  grid-template-columns: repeat(auto-fill, minmax(74px, 1fr));
  gap: 9px;
}

/* ─── HOME + CHARACTER SELECTION PREMIUM VISUAL REFRESH — 2026-04-29 ─────── */
:root {
  --tl-ui-home-wallpaper: url("img/ui/generated/home_realm_wallpaper_v2_20260429.webp");
  --tl-ui-character-backdrop: url("img/ui/generated/character_hub_backdrop_v2_20260429.webp");
}

#splash-screen,
#char-select-hub {
  isolation: isolate;
}

#splash-screen > *,
#char-select-hub > * {
  position: relative;
  z-index: 1;
}

#splash-screen {
  background:
    radial-gradient(ellipse 64% 50% at 50% 36%, rgba(255, 185, 91, 0.12) 0%, rgba(8, 6, 9, 0.20) 42%, rgba(5, 4, 8, 0.78) 100%),
    linear-gradient(90deg, rgba(4, 4, 8, 0.60) 0%, rgba(4, 4, 8, 0.16) 34%, rgba(4, 4, 8, 0.18) 66%, rgba(4, 4, 8, 0.64) 100%),
    var(--tl-ui-home-wallpaper),
    var(--titans-legacy-bg) !important;
  background-size: cover, cover, cover, cover !important;
  background-position: center, center, 49% center, var(--titans-legacy-bg-position) !important;
}

#splash-screen::before,
#char-select-hub::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 78%, rgba(255, 151, 66, 0.12), transparent 26%),
    radial-gradient(circle at 84% 20%, rgba(255, 196, 111, 0.10), transparent 30%),
    radial-gradient(ellipse 74% 58% at 50% 42%, transparent 0%, rgba(2, 2, 5, 0.26) 70%, rgba(2, 2, 5, 0.62) 100%),
    linear-gradient(180deg, rgba(3, 3, 6, 0.04), rgba(3, 3, 6, 0.34)) !important;
  opacity: 1;
}

#splash-screen::after,
#char-select-hub::after {
  content: "";
  position: absolute;
  inset: -6%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 9% 82%, rgba(255, 141, 44, 0.28), transparent 17%),
    radial-gradient(circle at 88% 28%, rgba(255, 181, 72, 0.20), transparent 15%),
    radial-gradient(circle at 50% 92%, rgba(223, 116, 46, 0.11), transparent 26%);
  opacity: 0.52;
  mix-blend-mode: screen;
  animation: tl-firelight-breathe 5.6s ease-in-out infinite alternate;
}

#char-select-hub {
  background:
    radial-gradient(ellipse 68% 52% at 54% 26%, rgba(255, 188, 95, 0.11) 0%, rgba(8, 7, 11, 0.22) 42%, rgba(8, 7, 11, 0.74) 100%),
    linear-gradient(180deg, rgba(8, 6, 12, 0.08), rgba(8, 6, 12, 0.84)),
    var(--tl-ui-character-backdrop),
    var(--titans-legacy-bg) !important;
  background-size: cover, cover, cover, cover !important;
  background-position: center, center, 50% center, var(--titans-legacy-bg-position) !important;
}

@keyframes tl-firelight-breathe {
  0% {
    opacity: 0.38;
    filter: saturate(1) brightness(0.96);
    transform: translate3d(-0.4%, 0.2%, 0) scale(1);
  }
  45% {
    opacity: 0.56;
    filter: saturate(1.14) brightness(1.04);
  }
  100% {
    opacity: 0.46;
    filter: saturate(1.08) brightness(1.08);
    transform: translate3d(0.35%, -0.2%, 0) scale(1.015);
  }
}

#splash-screen .splash-shell {
  border-color: rgba(246, 207, 136, 0.28);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 220, 154, 0.10), transparent 54%),
    linear-gradient(180deg, rgba(16, 12, 18, 0.80), rgba(7, 7, 12, 0.88));
  box-shadow:
    0 30px 88px rgba(0, 0, 0, 0.58),
    0 0 60px rgba(229, 140, 50, 0.10),
    inset 0 1px 0 rgba(255, 241, 208, 0.10);
  backdrop-filter: blur(8px) saturate(1.08);
}

#splash-screen .title-logo {
  text-shadow:
    0 0 28px rgba(255, 195, 105, 0.22),
    0 4px 22px rgba(0, 0, 0, 0.58);
}

#splash-screen .splash-status-line span,
#splash-screen .platform-recommended-badge,
#splash-screen .platform-check-icon {
  border-color: rgba(244, 205, 132, 0.30);
  background:
    linear-gradient(180deg, rgba(255, 235, 184, 0.14), rgba(111, 72, 29, 0.18));
  box-shadow: inset 0 1px 0 rgba(255, 246, 218, 0.12), 0 8px 20px rgba(0, 0, 0, 0.22);
}

#splash-screen .platform-launch-panel {
  border-color: rgba(246, 207, 136, 0.30);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 222, 156, 0.16), transparent 34%),
    radial-gradient(circle at 88% 16%, rgba(130, 99, 255, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(20, 17, 25, 0.92), rgba(8, 8, 14, 0.95));
  box-shadow: inset 0 1px 0 rgba(255, 244, 215, 0.08), 0 20px 48px rgba(0, 0, 0, 0.34);
}

#splash-screen .platform-choice-btn {
  border-color: rgba(255, 236, 190, 0.14);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.026));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

#splash-screen .platform-choice-btn:hover {
  border-color: rgba(246, 207, 136, 0.36);
  transform: translateY(-1px);
}

#splash-screen .platform-choice-btn.active,
#splash-screen .platform-choice-btn.is-selected,
#splash-screen .platform-choice-btn.selected,
#splash-screen .platform-choice-btn[aria-pressed="true"] {
  border-color: rgba(246, 207, 136, 0.54);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 229, 165, 0.20), transparent 42%),
    linear-gradient(180deg, rgba(61, 43, 24, 0.62), rgba(18, 15, 21, 0.94));
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.34),
    inset 0 0 0 1px rgba(246, 207, 136, 0.14);
}

#splash-screen .splash-play-btn {
  border: 1px solid rgba(255, 235, 190, 0.36);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 246, 219, 0.28), transparent 34%),
    linear-gradient(135deg, #f2be68 0%, #c57e43 48%, #7659ec 100%);
  color: #161017;
  box-shadow:
    0 22px 52px rgba(197, 126, 67, 0.26),
    0 0 36px rgba(255, 182, 86, 0.12),
    inset 0 1px 0 rgba(255, 250, 231, 0.30);
}

#char-select-hub .hub-panel {
  border-color: rgba(245, 207, 134, 0.28);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 220, 154, 0.09), transparent 42%),
    linear-gradient(180deg, rgba(15, 11, 18, 0.86), rgba(8, 7, 12, 0.94)),
    rgba(10, 8, 16, 0.92) !important;
  box-shadow:
    0 32px 88px rgba(0, 0, 0, 0.66),
    0 0 54px rgba(255, 153, 65, 0.08),
    inset 0 1px 0 rgba(255, 238, 191, 0.08);
  backdrop-filter: blur(8px) saturate(1.08);
}

#char-select-hub .hub-column,
#char-select-hub .cs-slot-card,
#char-select-hub .cloud-slot-row,
#char-select-hub .closed-beta-summary,
#char-select-hub .closed-beta-panel,
#char-select-hub .cloud-slot-preview-empty {
  border-color: rgba(245, 207, 134, 0.16);
  background:
    radial-gradient(circle at 14% 0%, rgba(255, 228, 164, 0.075), transparent 36%),
    linear-gradient(180deg, rgba(24, 20, 28, 0.92), rgba(11, 10, 16, 0.94));
  box-shadow: inset 0 1px 0 rgba(255, 244, 215, 0.055), 0 14px 30px rgba(0, 0, 0, 0.20);
}

#char-select-hub .cs-slot-card {
  border-radius: 14px;
}

#char-select-hub .cs-slot-card:hover {
  border-color: rgba(246, 207, 136, 0.34);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.30),
    inset 0 1px 0 rgba(255, 244, 215, 0.07);
}

#char-select-hub .cs-slot-card.cs-is-active,
#char-select-hub .cs-slot-card.cs-is-cloud-linked {
  border-color: rgba(143, 211, 255, 0.28);
  background:
    radial-gradient(circle at 96% 0%, rgba(143, 211, 255, 0.13), transparent 34%),
    radial-gradient(circle at 14% 0%, rgba(255, 228, 164, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(25, 22, 32, 0.93), rgba(10, 10, 17, 0.95));
}

#char-select-hub .cs-slot-mode-bar {
  height: 5px;
  opacity: 0.95;
}

#char-select-hub .cs-slot-avatar,
#char-select-hub .cs-slot-empty-icon,
#char-select-hub .cs-slot-locked-icon,
#char-select-hub .hub-column-header::before {
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 244, 215, 0.08), 0 10px 22px rgba(0, 0, 0, 0.22);
}

#char-select-hub .cs-char-name {
  color: rgba(255, 239, 203, 0.98);
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.46);
}

#char-select-hub .cs-mode-badge,
#char-select-hub .cs-slot-chip,
#char-select-hub .cs-slot-flag,
#char-select-hub .cloud-slot-badge,
#char-select-hub .cs-stat-item,
#char-select-hub .hub-cloud-status.hub-cloud-toast.is-visible,
#char-select-hub .cloud-save-status.hub-cloud-toast.is-visible {
  border-radius: 999px;
  border: 1px solid rgba(245, 207, 134, 0.18);
  background:
    linear-gradient(180deg, rgba(255, 236, 190, 0.105), rgba(255, 236, 190, 0.035));
  box-shadow: inset 0 1px 0 rgba(255, 246, 218, 0.08);
}

#char-select-hub .cs-mode-badge.badge-regular {
  border-color: rgba(247, 198, 91, 0.34);
  background: linear-gradient(180deg, rgba(119, 79, 22, 0.80), rgba(54, 36, 17, 0.82));
  color: rgba(255, 230, 162, 0.98);
}

#char-select-hub .cs-mode-badge.badge-ironman {
  border-color: rgba(125, 211, 252, 0.34);
  background: linear-gradient(180deg, rgba(28, 62, 92, 0.82), rgba(12, 27, 43, 0.84));
  color: rgba(207, 238, 255, 0.98);
}

#char-select-hub .cs-mode-badge.badge-hardcore {
  border-color: rgba(248, 113, 113, 0.36);
  background: linear-gradient(180deg, rgba(95, 26, 26, 0.84), rgba(43, 13, 13, 0.86));
  color: rgba(255, 214, 214, 0.98);
}

#char-select-hub .cs-current-action {
  border: 1px solid rgba(143, 211, 255, 0.14);
  background:
    radial-gradient(circle at 0% 0%, rgba(143, 211, 255, 0.10), transparent 42%),
    linear-gradient(180deg, rgba(14, 21, 32, 0.78), rgba(8, 11, 18, 0.82));
}

#char-select-hub .cs-play-btn,
#char-select-hub .cs-create-btn,
#char-select-hub .hub-cloud-actions .btn-primary {
  border: 1px solid rgba(255, 235, 190, 0.30);
  background:
    radial-gradient(circle at 20% 0%, rgba(255, 246, 219, 0.22), transparent 36%),
    linear-gradient(135deg, #e9b35f 0%, #b9783f 52%, #5a48d5 100%);
  color: #161017;
  box-shadow: 0 14px 30px rgba(187, 120, 63, 0.20), inset 0 1px 0 rgba(255, 250, 231, 0.22);
}

#char-select-hub .cs-delete-btn {
  border-color: rgba(255, 155, 131, 0.30);
  background:
    linear-gradient(180deg, rgba(120, 45, 35, 0.24), rgba(54, 19, 18, 0.22));
  color: rgba(255, 219, 210, 0.96);
}

@media (prefers-reduced-motion: reduce) {
  #splash-screen::after,
  #char-select-hub::after {
    animation: none;
    opacity: 0.32;
    transform: none;
  }
}

@media (max-width: 720px) {
  #splash-screen {
    background-position: center, center, 48% center, var(--titans-legacy-bg-position) !important;
  }

  #char-select-hub {
    background-position: center, center, 51% center, var(--titans-legacy-bg-position) !important;
  }

  #splash-screen::after,
  #char-select-hub::after {
    opacity: 0.34;
  }
}

body.platform-mobile #splash-screen .splash-shell {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 220, 154, 0.10), transparent 52%),
    linear-gradient(180deg, rgba(16, 14, 22, 0.72), rgba(7, 8, 13, 0.82));
}

body.platform-mobile #char-select-hub .hub-panel {
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 220, 154, 0.075), transparent 42%),
    linear-gradient(180deg, rgba(13, 10, 18, 0.88), rgba(8, 7, 12, 0.94)) !important;
}

/* ─── HALL OF HEROES + GLOBAL BUTTON/TAB VISUAL REFRESH — 2026-04-29 ────── */
:root {
  --tl-premium-gold: #efc77a;
  --tl-premium-gold-soft: rgba(239, 199, 122, 0.18);
  --tl-premium-gold-line: rgba(239, 199, 122, 0.28);
  --tl-premium-blue: #8fd3ff;
  --tl-premium-card:
    radial-gradient(circle at 12% 0%, rgba(239, 199, 122, 0.105), transparent 34%),
    linear-gradient(180deg, rgba(24, 22, 33, 0.96), rgba(9, 10, 17, 0.96));
  --tl-premium-card-cool:
    radial-gradient(circle at 8% 0%, rgba(95, 154, 255, 0.13), transparent 36%),
    linear-gradient(180deg, rgba(20, 24, 37, 0.96), rgba(8, 10, 18, 0.96));
  --tl-premium-button:
    radial-gradient(circle at 18% 0%, rgba(255, 241, 204, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(48, 42, 35, 0.94), rgba(18, 17, 25, 0.94));
  --tl-premium-primary:
    radial-gradient(circle at 18% 0%, rgba(255, 246, 219, 0.22), transparent 36%),
    linear-gradient(135deg, #e9b35f 0%, #b9783f 52%, #5a48d5 100%);
}

#leaderboard-modal .hof-modal-box {
  width: min(1120px, 96vw);
  max-width: 1120px;
  border-radius: 24px;
  border: 1px solid rgba(239, 199, 122, 0.28);
  background:
    radial-gradient(circle at 16% 0%, rgba(239, 199, 122, 0.14), transparent 34%),
    radial-gradient(circle at 88% 8%, rgba(143, 211, 255, 0.10), transparent 32%),
    linear-gradient(180deg, rgba(18, 16, 25, 0.98), rgba(7, 8, 14, 0.99));
  box-shadow:
    0 34px 96px rgba(0, 0, 0, 0.72),
    0 0 58px rgba(239, 199, 122, 0.08),
    inset 0 1px 0 rgba(255, 244, 215, 0.08);
  overflow: hidden;
}

#leaderboard-modal .modal-header {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(239, 199, 122, 0.16);
  background:
    radial-gradient(circle at 0% 0%, rgba(239, 199, 122, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(26, 22, 32, 0.96), rgba(11, 11, 18, 0.94));
}

#leaderboard-modal .modal-title {
  color: #fff3dc;
  letter-spacing: 0.035em;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.44);
}

#leaderboard-modal .modal-title i {
  color: var(--tl-premium-gold);
  filter: drop-shadow(0 0 10px rgba(239, 199, 122, 0.34));
}

#leaderboard-modal .modal-close {
  border: 1px solid rgba(239, 199, 122, 0.20);
  background: rgba(255, 255, 255, 0.045);
  color: rgba(255, 239, 203, 0.88);
}

#leaderboard-modal .hof-modal-body {
  grid-template-columns: minmax(214px, 248px) minmax(0, 1fr);
  gap: 14px;
  max-height: min(76vh, 820px);
  padding: 14px;
  background:
    radial-gradient(circle at 78% 18%, rgba(143, 211, 255, 0.075), transparent 36%),
    linear-gradient(180deg, rgba(9, 8, 14, 0.30), rgba(5, 6, 10, 0.54));
}

#leaderboard-modal .hof-sidebar,
#leaderboard-modal .hof-content {
  border: 1px solid rgba(239, 199, 122, 0.16);
  border-radius: 18px;
  background: var(--tl-premium-card);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 215, 0.055),
    0 18px 42px rgba(0, 0, 0, 0.24);
}

#leaderboard-modal .hof-sidebar {
  padding: 10px;
  border-right: 1px solid rgba(239, 199, 122, 0.16);
  scrollbar-width: thin;
  scrollbar-color: rgba(239, 199, 122, 0.34) rgba(255, 255, 255, 0.035);
}

#leaderboard-modal .hof-sidebar::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

#leaderboard-modal .hof-sidebar::-webkit-scrollbar-track {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.035);
}

#leaderboard-modal .hof-sidebar::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(239, 199, 122, 0.30), rgba(143, 211, 255, 0.22));
}

#leaderboard-modal .hof-sidebar-section {
  margin-bottom: 10px;
}

#leaderboard-modal .hof-sidebar-label {
  padding: 8px 9px 6px;
  color: rgba(239, 199, 122, 0.78);
  font-size: 9px;
  letter-spacing: 0.18em;
}

#leaderboard-modal .hof-cat-btn {
  position: relative;
  min-height: 36px;
  gap: 9px;
  margin: 2px 0;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
  color: rgba(234, 229, 217, 0.82);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.01em;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    transform 140ms ease;
}

#leaderboard-modal .hof-cat-btn i {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.13), transparent 32%),
    linear-gradient(180deg, rgba(28, 27, 36, 0.96), rgba(10, 11, 18, 0.98));
  color: rgba(239, 199, 122, 0.72);
  font-size: 12px;
}

#leaderboard-modal .hof-cat-btn:hover:not(:disabled) {
  border-color: rgba(239, 199, 122, 0.22);
  color: #fff3dc;
  background:
    radial-gradient(circle at 18% 0%, rgba(239, 199, 122, 0.12), transparent 46%),
    linear-gradient(180deg, rgba(39, 34, 43, 0.92), rgba(14, 15, 23, 0.94));
}

#leaderboard-modal .hof-cat-btn.active {
  padding-left: 10px;
  border: 1px solid rgba(239, 199, 122, 0.42);
  color: #fff4dc;
  background:
    radial-gradient(circle at 18% 0%, rgba(239, 199, 122, 0.22), transparent 48%),
    linear-gradient(180deg, rgba(62, 48, 31, 0.92), rgba(17, 16, 25, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 215, 0.08),
    0 10px 22px rgba(0, 0, 0, 0.20);
}

#leaderboard-modal .hof-cat-btn.active::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffe6a7, #d28c3d);
  box-shadow: 0 0 12px rgba(239, 199, 122, 0.42);
}

#leaderboard-modal .hof-cat-btn.active i {
  border-color: rgba(239, 199, 122, 0.34);
  color: #ffe6a7;
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(180deg, rgba(101, 72, 33, 0.86), rgba(37, 27, 18, 0.92));
}

#leaderboard-modal .hof-cat-btn .hof-skill-icon {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  padding: 3px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.13), transparent 32%),
    linear-gradient(180deg, rgba(28, 27, 36, 0.96), rgba(10, 11, 18, 0.98));
  box-shadow: none;
}

#leaderboard-modal .hof-cat-btn .hof-skill-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  image-rendering: auto;
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.45));
}

#leaderboard-modal .hof-cat-btn.active .hof-skill-icon {
  border-color: rgba(239, 199, 122, 0.34);
  background:
    radial-gradient(circle at 35% 20%, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(180deg, rgba(101, 72, 33, 0.86), rgba(37, 27, 18, 0.92));
}

#leaderboard-modal .hof-cat-btn:disabled {
  opacity: 0.50;
  cursor: not-allowed;
}

#leaderboard-modal .hof-soon-tag {
  border-radius: 999px;
  border: 1px solid rgba(143, 211, 255, 0.18);
  background: rgba(143, 211, 255, 0.07);
  color: rgba(206, 235, 255, 0.76);
}

#leaderboard-modal .hof-content {
  padding: 14px;
  background: var(--tl-premium-card-cool);
}

#leaderboard-modal .hof-category-header {
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
  padding: 0 0 12px;
  border-bottom: 1px solid rgba(239, 199, 122, 0.14);
}

#leaderboard-modal .hof-category-title {
  color: #fff4dc;
  font-size: clamp(20px, 2vw, 28px);
  letter-spacing: -0.025em;
}

#leaderboard-modal .leaderboard-status {
  margin: 0;
  padding: 6px 10px;
  border: 1px solid rgba(143, 211, 255, 0.16);
  border-radius: 999px;
  background: rgba(143, 211, 255, 0.07);
  color: rgba(221, 241, 255, 0.82);
  white-space: nowrap;
}

#leaderboard-modal .hof-search-row {
  margin-bottom: 12px;
}

#leaderboard-modal .hof-search-wrap {
  min-height: 42px;
}

#leaderboard-modal .hof-search-icon {
  left: 14px;
  color: rgba(239, 199, 122, 0.72);
  font-size: 12px;
}

#leaderboard-modal .hof-search-input {
  min-height: 42px;
  padding: 10px 38px 10px 38px;
  border-radius: 14px;
  border-color: rgba(239, 199, 122, 0.16);
  background:
    linear-gradient(180deg, rgba(6, 8, 15, 0.86), rgba(3, 5, 10, 0.82));
  color: #fff4dc;
  font-size: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

#leaderboard-modal .hof-search-input:focus {
  border-color: rgba(143, 211, 255, 0.42);
  box-shadow:
    0 0 0 2px rgba(143, 211, 255, 0.11),
    inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

#leaderboard-modal .hof-search-clear {
  right: 10px;
  width: 26px;
  height: 26px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

#leaderboard-modal .leaderboard-list {
  gap: 8px;
}

#leaderboard-modal .hof-table {
  gap: 7px;
}

#leaderboard-modal .hof-table-head,
#leaderboard-modal .hof-table-row {
  grid-template-columns: 54px 42px minmax(0, 1fr) minmax(142px, auto);
}

#leaderboard-modal .hof-table-head {
  padding: 0 12px 4px;
  color: rgba(239, 199, 122, 0.62);
  font-size: 9px;
}

#leaderboard-modal .hof-table-row {
  min-height: 64px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(239, 199, 122, 0.13);
  background:
    radial-gradient(circle at 0% 0%, rgba(239, 199, 122, 0.08), transparent 34%),
    linear-gradient(180deg, rgba(22, 22, 33, 0.95), rgba(9, 10, 17, 0.97));
  box-shadow: inset 0 1px 0 rgba(255, 244, 215, 0.04);
}

#leaderboard-modal .hof-table-row:hover {
  border-color: rgba(239, 199, 122, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 215, 0.055),
    0 14px 32px rgba(0, 0, 0, 0.20);
}

#leaderboard-modal .hof-table-row.rank-1,
#leaderboard-modal .hof-table-row.rank-2,
#leaderboard-modal .hof-table-row.rank-3 {
  border-color: rgba(239, 199, 122, 0.36);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 217, 143, 0.18), transparent 36%),
    radial-gradient(circle at 100% 0%, rgba(143, 211, 255, 0.09), transparent 34%),
    linear-gradient(180deg, rgba(42, 32, 30, 0.98), rgba(12, 12, 19, 0.98));
}

#leaderboard-modal .hof-table-row.rank-2 {
  border-color: rgba(184, 212, 235, 0.30);
  background:
    radial-gradient(circle at 0% 0%, rgba(184, 212, 235, 0.15), transparent 36%),
    linear-gradient(180deg, rgba(30, 33, 42, 0.98), rgba(11, 12, 19, 0.98));
}

#leaderboard-modal .hof-table-row.rank-3 {
  border-color: rgba(211, 139, 76, 0.32);
  background:
    radial-gradient(circle at 0% 0%, rgba(211, 139, 76, 0.16), transparent 36%),
    linear-gradient(180deg, rgba(34, 27, 26, 0.98), rgba(11, 12, 19, 0.98));
}

#leaderboard-modal .hof-rank {
  min-width: 42px;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(143, 211, 255, 0.16);
  background: rgba(143, 211, 255, 0.07);
  color: rgba(221, 241, 255, 0.92);
  font-weight: 900;
}

#leaderboard-modal .hof-rank-1,
#leaderboard-modal .hof-rank-2,
#leaderboard-modal .hof-rank-3 {
  border-color: rgba(239, 199, 122, 0.42);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 248, 220, 0.24), transparent 58%),
    linear-gradient(180deg, rgba(118, 79, 27, 0.90), rgba(47, 31, 17, 0.94));
  color: #fff0bf;
  box-shadow: 0 0 18px rgba(239, 199, 122, 0.18);
}

#leaderboard-modal .hof-mode-cell {
  display: flex;
  align-items: center;
  justify-content: center;
}

#leaderboard-modal .hof-mode-icon,
#leaderboard-modal .mode-icon.hof-mode-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  object-fit: contain;
  border-radius: 12px;
  padding: 5px;
  border: 1px solid rgba(239, 199, 122, 0.18);
  background:
    radial-gradient(circle at 32% 22%, rgba(255, 246, 226, 0.18), transparent 30%),
    linear-gradient(180deg, rgba(37, 34, 42, 0.96), rgba(10, 11, 18, 0.98));
  color: var(--tl-premium-gold);
  box-shadow: inset 0 1px 0 rgba(255, 244, 215, 0.06), 0 8px 18px rgba(0, 0, 0, 0.22);
}

#leaderboard-modal .hof-player {
  min-width: 0;
  display: grid;
  gap: 4px;
}

#leaderboard-modal .hof-player-name {
  min-width: 0;
  color: #fff5df;
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#leaderboard-modal .hof-name-rank-1 {
  color: #ffe6a7;
  text-shadow: 0 0 16px rgba(239, 199, 122, 0.26);
}

#leaderboard-modal .hof-name-rank-2 {
  color: #d9efff;
}

#leaderboard-modal .hof-name-rank-3 {
  color: #ffd0a7;
}

#leaderboard-modal .hof-player-title.title-pill {
  width: fit-content;
  max-width: 100%;
  border-color: rgba(239, 199, 122, 0.24);
  background:
    linear-gradient(180deg, rgba(239, 199, 122, 0.14), rgba(239, 199, 122, 0.05));
}

#leaderboard-modal .hof-player-meta {
  color: rgba(225, 220, 209, 0.68);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#leaderboard-modal .hof-value {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
  color: #ffe1a1;
  font-weight: 900;
  text-align: right;
}

#leaderboard-modal .hof-value-line:first-child {
  font-size: 13px;
}

#leaderboard-modal .hof-value-line + .hof-value-line {
  color: rgba(221, 241, 255, 0.76);
  font-size: 11px;
  font-weight: 700;
}

#leaderboard-modal .hof-value-muted {
  color: rgba(217, 214, 228, 0.56) !important;
}

#leaderboard-modal .leaderboard-empty,
#leaderboard-modal .leaderboard-skill-note {
  border-radius: 16px;
  border: 1px solid rgba(239, 199, 122, 0.14);
  background: rgba(255, 255, 255, 0.035);
}

#leaderboard-modal .leaderboard-empty {
  padding: 18px;
  color: rgba(234, 229, 217, 0.72);
}

#leaderboard-modal .hof-pagination {
  padding-top: 14px;
}

#leaderboard-modal .hof-page-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border-color: rgba(239, 199, 122, 0.18);
  background: var(--tl-premium-button);
}

#leaderboard-modal .hof-page-btn:hover:not(:disabled) {
  border-color: rgba(239, 199, 122, 0.42);
  color: #ffe6a7;
}

.btn-primary,
.btn-outline,
.btn-danger,
.btn-link,
.nav-btn,
.tab-btn,
.right-tab,
.archive-view-btn,
.mobile-journey-card,
.mobile-hero-action-btn {
  border-radius: 14px;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease,
    filter 140ms ease,
    transform 140ms ease;
}

.btn-primary,
button.btn-primary,
.modal-footer .btn-primary {
  border: 1px solid rgba(255, 235, 190, 0.30);
  background: var(--tl-premium-primary);
  color: #161017;
  box-shadow:
    0 14px 30px rgba(187, 120, 63, 0.18),
    inset 0 1px 0 rgba(255, 250, 231, 0.22);
}

.btn-outline,
button.btn-outline,
.nav-btn,
.tab-btn,
.right-tab,
.archive-view-btn,
.modal-close,
.mobile-hero-action-btn {
  border-color: rgba(239, 199, 122, 0.16);
  background: var(--tl-premium-button);
  color: rgba(240, 232, 213, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 244, 215, 0.045);
}

.btn-primary:hover:not(:disabled),
.btn-outline:hover:not(:disabled),
.nav-btn:hover:not(:disabled),
.tab-btn:hover:not(:disabled),
.right-tab:hover:not(:disabled),
.archive-view-btn:hover:not(:disabled),
.modal-close:hover:not(:disabled),
.mobile-hero-action-btn:hover:not(:disabled) {
  border-color: rgba(239, 199, 122, 0.40);
  color: #fff4dc;
  filter: brightness(1.06);
  box-shadow:
    0 14px 30px rgba(0, 0, 0, 0.20),
    inset 0 1px 0 rgba(255, 244, 215, 0.07);
}

.btn-primary:disabled,
.btn-outline:disabled,
.btn-danger:disabled,
.nav-btn:disabled,
.tab-btn:disabled,
.right-tab:disabled {
  opacity: 0.46;
  filter: grayscale(0.18);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-danger,
.cs-delete-btn,
.delete-btn {
  border-color: rgba(255, 155, 131, 0.28);
  background:
    linear-gradient(180deg, rgba(118, 45, 36, 0.28), rgba(48, 17, 17, 0.26));
  color: rgba(255, 219, 210, 0.96);
}

.tab-btn,
.right-tab,
.nav-btn,
.archive-view-btn {
  border: 1px solid rgba(239, 199, 122, 0.12);
  background:
    linear-gradient(180deg, rgba(31, 35, 52, 0.82), rgba(14, 17, 27, 0.78));
}

.tab-btn.active,
.right-tab.active,
.nav-btn.active,
.archive-view-btn.active {
  border-color: rgba(239, 199, 122, 0.38);
  background:
    radial-gradient(circle at top, rgba(246, 204, 123, 0.20), transparent 74%),
    linear-gradient(180deg, rgba(61, 49, 35, 0.92), rgba(19, 18, 27, 0.88));
  color: #fff4dc;
  box-shadow: inset 0 1px 0 rgba(255, 244, 215, 0.07), 0 10px 24px rgba(0, 0, 0, 0.16);
}

.cs-mode-badge,
.title-pill,
.mobile-summary-mode-icon,
.char-mode-icon,
.cc-mode-icon,
.mode-icon {
  filter: saturate(1.05);
}

@media (hover: none) and (pointer: coarse) {
  .btn-primary:hover:not(:disabled),
  .btn-outline:hover:not(:disabled),
  .nav-btn:hover:not(:disabled),
  .tab-btn:hover:not(:disabled),
  .right-tab:hover:not(:disabled),
  .archive-view-btn:hover:not(:disabled),
  #leaderboard-modal .hof-cat-btn:hover:not(:disabled),
  #leaderboard-modal .hof-table-row:hover {
    transform: none;
    filter: none;
  }
}

@media (max-width: 820px) {
  #leaderboard-modal .hof-modal-body {
    grid-template-columns: 1fr;
    max-height: calc(100dvh - 108px);
    gap: 10px;
  }

  #leaderboard-modal .hof-sidebar {
    height: auto;
    max-height: 168px;
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 10px;
  }

  #leaderboard-modal .hof-sidebar-section {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 10px 0 0;
    vertical-align: top;
  }

  #leaderboard-modal .hof-sidebar-label {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 8px;
  }

  #leaderboard-modal .hof-cat-btn {
    width: auto;
    min-width: max-content;
    max-width: 180px;
  }

  #leaderboard-modal .hof-content {
    min-height: 0;
  }

  #leaderboard-modal .hof-table-head {
    display: none;
  }

  #leaderboard-modal .hof-table-row {
    grid-template-columns: 48px 38px minmax(0, 1fr);
    grid-template-areas:
      "rank mode player"
      "rank mode value";
    gap: 6px 9px;
    align-items: center;
  }

  #leaderboard-modal .hof-rank {
    grid-area: rank;
  }

  #leaderboard-modal .hof-mode-cell {
    grid-area: mode;
  }

  #leaderboard-modal .hof-player {
    grid-area: player;
  }

  #leaderboard-modal .hof-value {
    grid-area: value;
    justify-items: start;
    text-align: left;
  }
}

body.platform-mobile #leaderboard-modal .modal-box {
  width: calc(100vw - 10px);
  max-width: calc(100vw - 10px);
  max-height: calc(100dvh - 10px);
}

body.platform-mobile #leaderboard-modal .modal-header {
  padding: 13px 14px;
}

body.platform-mobile #leaderboard-modal .hof-modal-body {
  grid-template-columns: 1fr;
  gap: 10px;
  padding: 10px;
  max-height: calc(100dvh - 100px);
}

body.platform-mobile #leaderboard-modal .hof-sidebar {
  height: auto;
  max-height: 150px;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  padding: 9px;
}

body.platform-mobile #leaderboard-modal .hof-sidebar-section {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 10px 0 0;
  vertical-align: top;
}

body.platform-mobile #leaderboard-modal .hof-sidebar-label {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 8px;
}

body.platform-mobile #leaderboard-modal .hof-cat-btn {
  width: auto;
  min-width: max-content;
  max-width: 180px;
}

body.platform-mobile #leaderboard-modal .hof-category-header {
  align-items: flex-start;
  flex-direction: column;
  gap: 6px;
}

body.platform-mobile #leaderboard-modal .hof-category-title {
  font-size: 22px;
}

body.platform-mobile #leaderboard-modal .hof-table-row {
  grid-template-columns: 48px 38px minmax(0, 1fr);
  grid-template-areas:
    "rank mode player"
    "rank mode value";
  min-height: 70px;
  padding: 10px;
}

body.platform-mobile #leaderboard-modal .hof-rank {
  grid-area: rank;
}

body.platform-mobile #leaderboard-modal .hof-mode-cell {
  grid-area: mode;
}

body.platform-mobile #leaderboard-modal .hof-player {
  grid-area: player;
}

body.platform-mobile #leaderboard-modal .hof-value {
  grid-area: value;
  justify-items: start;
  text-align: left;
}

/* ─── MOBILE-ONLY CRITICAL FIT + END-TO-END LAYOUT REWORK — 2026-04-29 ───── */
body.platform-mobile {
  --tl-mobile-nav-height: 58px;
  --tl-mobile-screen-gap: 6px;
}

@media (max-width: 760px), (pointer: coarse) {
  html.splash-active-root,
  body.splash-active {
    width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 100vh;
    min-height: 100svh;
    min-height: 100dvh;
    overflow: hidden;
    background: #050509;
  }

  body.splash-active #splash-screen.screen,
  body.platform-mobile #splash-screen.screen {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 0;
    max-height: 100dvh;
    padding: max(6px, env(safe-area-inset-top)) 8px calc(72px + env(safe-area-inset-bottom));
    overflow: hidden;
    align-items: stretch;
    justify-content: center;
    touch-action: manipulation;
  }

  body.splash-active #splash-screen .splash-shell,
  body.platform-mobile #splash-screen .splash-shell {
    width: min(100%, 520px);
    height: 100%;
    min-height: 0;
    max-height: 100%;
    margin: 0 auto;
    padding: clamp(8px, 1.4vh, 13px) clamp(8px, 2.4vw, 14px);
    display: grid;
    grid-template-rows: auto auto auto auto minmax(0, auto);
    align-content: center;
    justify-items: center;
    gap: clamp(5px, 1.1vh, 10px);
    overflow: hidden;
    border-radius: clamp(18px, 5vw, 26px);
  }

  body.splash-active #splash-screen .splash-status-line,
  body.platform-mobile #splash-screen .splash-status-line {
    gap: 5px;
    max-width: 100%;
    font-size: clamp(0.53rem, 1.9vw, 0.66rem);
    letter-spacing: 0.08em;
    line-height: 1;
  }

  body.splash-active #splash-screen .splash-status-line span,
  body.platform-mobile #splash-screen .splash-status-line span {
    min-height: 19px;
    padding: 3px 7px;
    white-space: nowrap;
  }

  body.splash-active #splash-screen .title-emblem,
  body.platform-mobile #splash-screen .title-emblem {
    width: clamp(48px, 12.8vw, 72px);
    height: clamp(48px, 12.8vw, 72px);
    margin: 0;
    border-radius: clamp(16px, 4vw, 22px);
  }

  body.splash-active #splash-screen .title-logo,
  body.platform-mobile #splash-screen .title-logo {
    margin: 0;
    font-size: clamp(1.5rem, 7.25vw, 2.35rem);
    line-height: 0.92;
    letter-spacing: clamp(0.10em, 2.1vw, 0.16em);
    text-wrap: nowrap;
  }

  body.splash-active #splash-screen .title-subtitle,
  body.platform-mobile #splash-screen .title-subtitle {
    max-width: 34ch;
    margin: 0 auto;
    font-size: clamp(0.63rem, 2.35vw, 0.78rem);
    line-height: 1.18;
    letter-spacing: 0.055em;
  }

  body.splash-active #splash-screen .platform-launch-panel,
  body.platform-mobile #splash-screen .platform-launch-panel {
    width: 100%;
    min-height: 0;
    padding: clamp(8px, 1.6vh, 12px);
    gap: clamp(5px, 1vh, 8px);
    border-radius: clamp(14px, 4vw, 18px);
    overflow: hidden;
  }

  body.splash-active #splash-screen .platform-launch-kicker,
  body.platform-mobile #splash-screen .platform-launch-kicker {
    font-size: clamp(0.55rem, 1.85vw, 0.66rem);
    letter-spacing: 0.16em;
  }

  body.splash-active #splash-screen .platform-launch-copy,
  body.splash-active #splash-screen .platform-launch-note,
  body.platform-mobile #splash-screen .platform-launch-copy,
  body.platform-mobile #splash-screen .platform-launch-note {
    max-width: 36ch;
    margin-inline: auto;
    font-size: clamp(0.58rem, 2.05vw, 0.72rem);
    line-height: 1.18;
  }

  body.splash-active #splash-screen .platform-choice-row,
  body.platform-mobile #splash-screen .platform-choice-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(6px, 1.8vw, 9px);
  }

  body.splash-active #splash-screen .platform-choice-btn,
  body.platform-mobile #splash-screen .platform-choice-btn {
    min-height: clamp(74px, 14.5vh, 104px);
    padding: clamp(9px, 1.8vh, 12px) 7px 8px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    text-align: center;
    border-radius: 14px;
  }

  body.splash-active #splash-screen .platform-choice-icon,
  body.platform-mobile #splash-screen .platform-choice-icon {
    width: clamp(28px, 8vw, 36px);
    height: clamp(28px, 8vw, 36px);
    font-size: clamp(0.85rem, 3.4vw, 1.05rem);
  }

  body.splash-active #splash-screen .platform-choice-title,
  body.platform-mobile #splash-screen .platform-choice-title {
    font-size: clamp(0.78rem, 3vw, 0.92rem);
  }

  body.splash-active #splash-screen .platform-choice-desc,
  body.platform-mobile #splash-screen .platform-choice-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    max-width: 16ch;
    overflow: hidden;
    font-size: clamp(0.55rem, 2vw, 0.66rem);
    line-height: 1.12;
  }

  body.splash-active #splash-screen .platform-recommended-badge,
  body.platform-mobile #splash-screen .platform-recommended-badge {
    top: 5px;
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    padding: 2px 6px;
    font-size: 0.5rem;
    letter-spacing: 0.05em;
  }

  body.splash-active #splash-screen .platform-check-icon,
  body.platform-mobile #splash-screen .platform-check-icon {
    top: 6px;
    right: 6px;
    width: 19px;
    height: 19px;
    font-size: 0.58rem;
  }

  body.splash-active #splash-screen .splash-play-btn,
  body.platform-mobile #splash-screen .splash-play-btn {
    position: fixed;
    z-index: 30;
    left: 12px;
    right: 12px;
    bottom: max(9px, env(safe-area-inset-bottom));
    width: min(420px, calc(100vw - 24px));
    min-height: 56px;
    margin: 0 auto;
    padding: 9px 17px;
    border-radius: 18px;
    touch-action: manipulation;
  }

  body.splash-active #splash-screen .splash-play-icon,
  body.platform-mobile #splash-screen .splash-play-icon {
    width: 31px;
    height: 31px;
  }

  body.splash-active #splash-screen .splash-play-label,
  body.platform-mobile #splash-screen .splash-play-label {
    font-size: 0.98rem;
  }

  body.splash-active #splash-screen .splash-play-subline,
  body.platform-mobile #splash-screen .splash-play-subline {
    font-size: 0.66rem;
  }
}

@media (max-width: 380px), (max-height: 680px) {
  body.splash-active #splash-screen.screen,
  body.platform-mobile #splash-screen.screen {
    padding: max(5px, env(safe-area-inset-top)) 7px calc(68px + env(safe-area-inset-bottom));
  }

  body.splash-active #splash-screen .splash-shell,
  body.platform-mobile #splash-screen .splash-shell {
    gap: 4px;
    padding: 7px;
    align-content: start;
  }

  body.splash-active #splash-screen .platform-launch-copy,
  body.platform-mobile #splash-screen .platform-launch-copy {
    display: none;
  }

  body.splash-active #splash-screen .platform-choice-btn,
  body.platform-mobile #splash-screen .platform-choice-btn {
    min-height: clamp(68px, 13.6vh, 86px);
  }

  body.splash-active #splash-screen .platform-choice-desc,
  body.platform-mobile #splash-screen .platform-choice-desc {
    -webkit-line-clamp: 1;
  }

  body.splash-active #splash-screen .title-subtitle,
  body.splash-active #splash-screen .platform-launch-note,
  body.platform-mobile #splash-screen .title-subtitle,
  body.platform-mobile #splash-screen .platform-launch-note {
    font-size: 0.58rem;
  }
}

body.platform-mobile,
body.platform-mobile #main-game-ui {
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #050509;
}

body.platform-mobile #game-screen {
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: var(--tl-mobile-screen-gap);
  padding: max(4px, env(safe-area-inset-top)) var(--tl-mobile-gutter) max(4px, env(safe-area-inset-bottom));
  overflow: hidden;
}

body.platform-mobile #game-header {
  min-height: 48px;
  padding-top: 7px;
  padding-bottom: 7px;
}

body.platform-mobile #mobile-summary-bar {
  padding: 7px 9px;
}

body.platform-mobile #panels-row {
  min-height: 0;
  height: auto;
  overflow: hidden;
}

body.platform-mobile #left-panel,
body.platform-mobile #middle-panel,
body.platform-mobile #right-panel,
body.platform-mobile #mobile-hero-panel,
body.platform-mobile #mobile-journey-panel,
body.platform-mobile #mobile-quests-panel,
body.platform-mobile .mobile-surface-shell {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

body.platform-mobile .mobile-surface-top,
body.platform-mobile .mobile-surface-top--embedded,
body.platform-mobile .mobile-combat-subview-top {
  padding: 9px 12px 8px;
}

body.platform-mobile .mobile-surface-copy,
body.platform-mobile .mobile-combat-subview-desc {
  line-height: 1.25;
}

body.platform-mobile #mobile-nav-bar {
  flex: 0 0 auto;
  min-height: calc(var(--tl-mobile-nav-height) + env(safe-area-inset-bottom));
  padding: 5px 5px max(5px, env(safe-area-inset-bottom));
  margin: 0;
  border-radius: 20px;
}

body.platform-mobile .mobile-nav-btn {
  min-height: 48px;
  padding: 6px 2px 5px;
  border-radius: 15px;
}

body.platform-mobile .mobile-nav-btn i {
  font-size: 16px;
}

body.platform-mobile .mobile-surface-scroll,
body.platform-mobile #middle-panel > [data-tab-content].active,
body.platform-mobile #right-panel > [data-tab-content].active,
body.platform-mobile #combat-panel,
body.platform-mobile #training-actions,
body.platform-mobile #dungeons-panel,
body.platform-mobile #loot-panel,
body.platform-mobile #daily-panel,
body.platform-mobile #skills-browser-panel,
body.platform-mobile #training-panel {
  padding-bottom: calc(14px + env(safe-area-inset-bottom)) !important;
  scroll-padding-bottom: calc(18px + env(safe-area-inset-bottom)) !important;
}

body.platform-mobile #middle-panel > [data-tab-content],
body.platform-mobile #right-panel > [data-tab-content] {
  min-height: 0;
  max-height: 100%;
}

@media (max-height: 700px) {
  body.platform-mobile {
    --tl-mobile-nav-height: 54px;
    --tl-mobile-screen-gap: 5px;
  }

  body.platform-mobile #game-screen {
    padding-top: max(3px, env(safe-area-inset-top));
  }

  body.platform-mobile #game-header {
    min-height: 44px;
  }

  body.platform-mobile #mobile-summary-bar {
    padding: 6px 8px;
  }

  body.platform-mobile .mobile-nav-btn {
    min-height: 44px;
  }
}

body.platform-mobile #ge-modal .modal-box,
body.platform-mobile #settings-modal .modal-box,
body.platform-mobile #daily-modal .modal-box,
body.platform-mobile #dungeon-detail-modal .modal-box,
body.platform-mobile #dungeon-clear-modal .modal-box,
body.platform-mobile #offline-modal .modal-box,
body.platform-mobile #patch-notes-modal .modal-box,
body.platform-mobile #bug-report-modal .modal-box,
body.platform-mobile #leaderboard-modal .modal-box,
body.platform-mobile #bank-modal .modal-box {
  width: calc(100vw - 10px);
  max-width: calc(100vw - 10px);
  max-height: calc(100dvh - 10px);
  border-radius: var(--tl-mobile-radius-xl);
  border-color: rgba(239, 199, 122, 0.20);
  background:
    radial-gradient(circle at top left, rgba(239, 199, 122, 0.10), transparent 32%),
    linear-gradient(180deg, rgba(21, 19, 29, 0.98), rgba(8, 9, 15, 0.98));
}

body.platform-mobile #ge-modal .modal-body,
body.platform-mobile #settings-modal .modal-body,
body.platform-mobile #daily-modal .modal-body,
body.platform-mobile #dungeon-detail-modal .modal-body,
body.platform-mobile #dungeon-clear-modal .modal-body,
body.platform-mobile #offline-modal .modal-body,
body.platform-mobile #patch-notes-modal .modal-body,
body.platform-mobile #bug-report-modal .modal-body,
body.platform-mobile #leaderboard-modal .modal-body,
body.platform-mobile #bank-modal .modal-body {
  max-height: calc(100dvh - 108px);
  overflow-x: hidden;
  overflow-y: auto;
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}

body.platform-mobile .dungeon-detail-grid,
body.platform-mobile .dungeon-loot-grid,
body.platform-mobile .dungeon-grid,
body.platform-mobile .daily-summary,
body.platform-mobile .ge-main-grid,
body.platform-mobile .shop-grid,
body.platform-mobile .settings-grid,
body.platform-mobile .settings-layout {
  grid-template-columns: 1fr !important;
}

body.platform-mobile .dungeon-card,
body.platform-mobile .daily-task-card,
body.platform-mobile .combat-target,
body.platform-mobile .training-action,
body.platform-mobile .bounty-task-card {
  overflow-wrap: normal;
  word-break: normal;
}

body.platform-mobile #mastery-tree-modal .mastery-tree-modal-box {
  background:
    linear-gradient(180deg, rgba(12, 10, 18, 0.96), rgba(5, 7, 12, 0.98)),
    var(--tl-ui-mastery-backdrop) !important;
  background-size: cover !important;
  background-position: center !important;
}

body.platform-mobile #mastery-tree-modal .mastery-board-card {
  border-color: rgba(239, 199, 122, 0.18);
  background: rgba(7, 8, 14, 0.54) !important;
  backdrop-filter: blur(6px);
}

body.platform-mobile #mastery-tree-modal .mastery-board-viewport {
  min-height: 0;
  height: 100%;
  touch-action: none;
  overscroll-behavior: none;
}

body.platform-mobile #mastery-tree-modal .mastery-board-status,
body.platform-mobile #mastery-tree-modal .mastery-board-nav {
  backdrop-filter: blur(8px);
}

body.platform-mobile #mastery-tree-modal .mastery-side-column,
body.platform-mobile #mastery-tree-modal .mastery-side-column.is-collapsed {
  max-height: min(36dvh, 280px);
  border-radius: var(--tl-mobile-radius-lg);
}

body.platform-mobile .resume-loading-overlay {
  background-position: center, center, 50% center, center !important;
}

body.platform-mobile .resume-loading-shell {
  width: min(100%, calc(100vw - 20px));
  border-radius: var(--tl-mobile-radius-xl);
}

body.platform-mobile .mobile-hero-card,
body.platform-mobile .mobile-hero-section-card,
body.platform-mobile .mobile-skills-copy,
body.platform-mobile .mobile-skill-group,
body.platform-mobile .mobile-activity-shell,
body.platform-mobile .mobile-quests-toolbar {
  padding: 14px;
}

body.platform-mobile .mobile-hero-quick-actions,
body.platform-mobile .mobile-journey-actions,
body.platform-mobile .mobile-combat-summary-grid,
body.platform-mobile .combat-mobile-actions,
body.platform-mobile .mobile-hero-stat-grid {
  gap: 9px;
}

body.platform-mobile .mobile-journey-card,
body.platform-mobile .mobile-hero-action-btn,
body.platform-mobile .mobile-skill-row {
  border-color: var(--tl-mobile-card-border);
  background: var(--tl-mobile-card-bg-cool);
  box-shadow: var(--tl-mobile-card-shadow);
}

body.platform-mobile .combat-portrait-wrapper,
body.platform-mobile .combat-monster-img {
  max-width: min(132px, 38vw);
  max-height: min(132px, 38vw);
}

@media (max-width: 380px), (max-height: 660px) {
  body.platform-mobile #game-screen {
    gap: 6px;
    padding-inline: 7px;
  }

  body.platform-mobile #game-header {
    min-height: 48px;
    border-radius: 18px;
  }

  body.platform-mobile #mobile-summary-bar {
    padding: 7px 8px;
    border-radius: 18px;
  }

  body.platform-mobile #mobile-nav-bar {
    min-height: calc(58px + env(safe-area-inset-bottom));
    border-radius: 19px;
    gap: 5px;
  }

  body.platform-mobile .mobile-nav-btn {
    min-height: 46px;
    border-radius: 14px;
    font-size: 7px;
  }

  body.platform-mobile .mobile-nav-btn i {
    font-size: 15px;
  }

  body.platform-mobile .mj-section-grid {
    gap: 7px;
  }

  body.platform-mobile .mj-card {
    min-height: 86px;
    padding: 11px 6px 9px;
  }

  body.platform-mobile .mj-card small,
  body.platform-mobile .mj-section-copy {
    display: none;
  }
}

@media (hover: none), (pointer: coarse) {
  body.platform-mobile :where(.training-action, .daily-task-card, .dungeon-card, .combat-target, .settings-section, .shop-card, .shop-item):hover {
    transform: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.platform-mobile *,
  body.platform-mobile *::before,
  body.platform-mobile *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

/* ─── Mobile critical viewport + end-to-end fit rework - 2026-04-29 ───
   Late mobile-only overrides. Keep desktop untouched while resolving
   short-screen splash clipping and excess bottom-nav dead space. */
@media (max-width: 760px), (max-height: 720px), (pointer: coarse) {
  html.splash-active-root,
  body.splash-active {
    width: 100%;
    min-width: 0;
    min-height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    background: #05060a;
  }

  body.splash-active #splash-screen.screen {
    position: fixed;
    inset: 0;
    width: 100%;
    min-width: 0;
    height: 100vh;
    height: 100svh;
    height: 100dvh;
    min-height: 0;
    padding: max(6px, env(safe-area-inset-top)) 10px calc(68px + env(safe-area-inset-bottom));
    overflow: hidden;
    align-items: stretch;
    justify-content: center;
  }

  body.splash-active #splash-screen .splash-shell {
    width: min(100%, 560px);
    height: 100%;
    max-height: 100%;
    min-height: 0;
    padding: 5px 8px 0;
    display: grid;
    grid-template-rows: auto auto auto minmax(0, auto);
    align-content: center;
    justify-items: center;
    gap: clamp(4px, 1.05dvh, 9px);
    overflow: hidden;
  }

  body.splash-active #splash-screen .splash-status-line {
    max-width: 100%;
    flex-wrap: nowrap;
    gap: 5px;
  }

  body.splash-active #splash-screen .splash-status-line span {
    min-height: 20px;
    padding: 3px 7px;
    font-size: clamp(0.52rem, 2vw, 0.65rem);
    line-height: 1;
    white-space: nowrap;
  }

  body.splash-active #splash-screen .title-emblem {
    width: clamp(44px, 13vw, 70px);
    height: clamp(44px, 13vw, 70px);
    border-radius: clamp(15px, 4vw, 22px);
  }

  body.splash-active #splash-screen .title-logo {
    max-width: 100%;
    font-size: clamp(1.45rem, 7.2vw, 2.35rem);
    line-height: 0.92;
    letter-spacing: clamp(0.08em, 2.3vw, 0.14em);
    text-wrap: balance;
  }

  body.splash-active #splash-screen .title-subtitle {
    max-width: min(30ch, 92vw);
    font-size: clamp(0.62rem, 2.35vw, 0.78rem);
    line-height: 1.15;
  }

  body.splash-active #splash-screen .platform-launch-panel {
    width: 100%;
    max-width: 430px;
    min-height: 0;
    padding: clamp(7px, 1.35dvh, 12px);
    gap: 6px;
    border-radius: 17px;
    overflow: hidden;
  }

  body.splash-active #splash-screen .platform-launch-kicker {
    font-size: clamp(0.56rem, 2vw, 0.68rem);
    line-height: 1.1;
    letter-spacing: 0.18em;
  }

  body.splash-active #splash-screen .platform-launch-copy,
  body.splash-active #splash-screen .platform-choice-desc {
    display: none !important;
  }

  body.splash-active #splash-screen .platform-choice-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  body.splash-active #splash-screen .platform-choice-btn {
    min-width: 0;
    min-height: clamp(72px, 13.5dvh, 104px);
    padding: 10px 7px 8px;
    border-radius: 15px;
    gap: 5px;
  }

  body.splash-active #splash-screen .platform-choice-icon {
    width: clamp(27px, 8vw, 34px);
    height: clamp(27px, 8vw, 34px);
    font-size: clamp(0.9rem, 3.7vw, 1.08rem);
  }

  body.splash-active #splash-screen .platform-choice-title {
    font-size: clamp(0.68rem, 2.7vw, 0.82rem);
    line-height: 1.05;
  }

  body.splash-active #splash-screen .platform-recommended-badge {
    top: 6px;
    right: 6px;
    padding: 2px 5px;
    font-size: 0.48rem;
    letter-spacing: 0.1em;
  }

  body.splash-active #splash-screen .platform-check-icon {
    top: 6px;
    left: 6px;
    width: 18px;
    height: 18px;
    font-size: 0.58rem;
  }

  body.splash-active #splash-screen .platform-launch-note {
    max-width: 36ch;
    font-size: clamp(0.58rem, 2vw, 0.72rem);
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  body.splash-active #splash-screen .splash-play-btn {
    position: fixed;
    z-index: 12;
    left: 12px;
    right: 12px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: min(420px, calc(100vw - 24px));
    min-height: 54px;
    margin: 0 auto;
    border-radius: 18px;
    transform: translateZ(0);
  }

  body.splash-active #splash-screen .splash-play-btn:hover {
    transform: translateZ(0);
  }
}

@media (max-width: 380px), (max-height: 660px) {
  body.splash-active #splash-screen.screen {
    padding-inline: 8px;
    padding-bottom: calc(62px + env(safe-area-inset-bottom));
  }

  body.splash-active #splash-screen .splash-shell {
    gap: 4px;
    padding-top: 3px;
  }

  body.splash-active #splash-screen .title-subtitle,
  body.splash-active #splash-screen .platform-launch-note {
    display: none !important;
  }

  body.splash-active #splash-screen .platform-choice-btn {
    min-height: 68px;
    padding-block: 8px 7px;
  }

  body.splash-active #splash-screen .splash-play-btn {
    min-height: 52px;
    bottom: max(6px, env(safe-area-inset-bottom));
  }
}

body.platform-mobile {
  --tl-mobile-nav-height: 56px;
  --tl-mobile-screen-gap: 6px;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  background: #05060a;
  overscroll-behavior-x: none;
}

body.platform-mobile #main-game-ui {
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: #05060a;
}

body.platform-mobile #game-screen {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: var(--tl-mobile-screen-gap);
  padding: max(5px, env(safe-area-inset-top)) clamp(7px, 2vw, 10px) max(5px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

body.platform-mobile #game-header {
  min-height: 46px;
  padding: 7px 9px;
  border-radius: 18px;
}

body.platform-mobile #mobile-summary-bar {
  min-height: 0;
  padding: 6px 8px;
  border-radius: 17px;
}

body.platform-mobile #panels-row,
body.platform-mobile #middle-panel,
body.platform-mobile .mobile-surface-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

body.platform-mobile #middle-panel > [data-tab-content].active,
body.platform-mobile .mobile-surface-shell {
  min-width: 0;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

body.platform-mobile .mobile-surface-scroll,
body.platform-mobile .mobile-scroll,
body.platform-mobile #middle-panel > [data-tab-content].active,
body.platform-mobile #inventory-tab,
body.platform-mobile #bank-tab,
body.platform-mobile #equipment-tab,
body.platform-mobile #stats-tab,
body.platform-mobile #shops-tab,
body.platform-mobile #bounty-tab,
body.platform-mobile #dungeon-tab,
body.platform-mobile #daily-tab,
body.platform-mobile #settings-tab {
  min-height: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scroll-padding-bottom: calc(16px + env(safe-area-inset-bottom)) !important;
  padding-bottom: calc(12px + env(safe-area-inset-bottom)) !important;
}

body.platform-mobile #mobile-nav-bar {
  width: 100%;
  min-width: 0;
  height: calc(var(--tl-mobile-nav-height) + env(safe-area-inset-bottom));
  min-height: 0;
  flex: 0 0 auto;
  margin: 0;
  padding: 5px 5px max(5px, env(safe-area-inset-bottom));
  gap: 5px;
  border-radius: 19px 19px max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-bottom));
  align-self: stretch;
  background: linear-gradient(180deg, rgba(27, 18, 12, 0.98), rgba(9, 8, 9, 0.99)), #090809;
  box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 231, 181, 0.12);
}

body.platform-mobile .mobile-nav-btn {
  min-width: 0;
  min-height: 46px;
  padding: 6px 3px 5px;
  border-radius: 14px;
  touch-action: manipulation;
}

body.platform-mobile :is(.modal, .modal-content, .panel, .card, .inventory-grid, .bank-grid, .equipment-grid) {
  max-width: 100%;
}

body.platform-mobile :where(.mobile-nav-btn, button, [role="button"], .mj-card, .mobile-hero-action-btn) {
  -webkit-tap-highlight-color: rgba(229, 184, 91, 0.16);
}

body.platform-mobile :where(.settings-section, .daily-task-card, .dungeon-card, .shop-card, .shop-item, .leaderboard-row, .save-card) {
  -webkit-tap-highlight-color: transparent;
}

@media (max-height: 680px) {
  body.platform-mobile {
    --tl-mobile-nav-height: 52px;
    --tl-mobile-screen-gap: 5px;
  }

  body.platform-mobile #game-header {
    min-height: 42px;
    padding-block: 5px;
  }

  body.platform-mobile #mobile-summary-bar {
    padding-block: 5px;
  }

  body.platform-mobile .mobile-nav-btn {
    min-height: 42px;
    font-size: 7px;
  }

  body.platform-mobile .mobile-nav-btn i {
    font-size: 14px;
  }
}

/* Home + Character Selection animated background follow-up - 2026-04-30
   Distinct CSS-only ambience layers. No gameplay/save logic touched. */
#splash-screen {
  background:
    radial-gradient(ellipse 42% 34% at 50% 54%, rgba(91, 173, 255, 0.18) 0%, rgba(255, 188, 83, 0.12) 30%, rgba(8, 6, 9, 0.24) 52%, rgba(5, 4, 8, 0.80) 100%),
    radial-gradient(ellipse 74% 48% at 50% 70%, rgba(255, 130, 41, 0.12) 0%, transparent 58%),
    linear-gradient(90deg, rgba(4, 4, 8, 0.66) 0%, rgba(4, 4, 8, 0.16) 36%, rgba(4, 4, 8, 0.20) 64%, rgba(4, 4, 8, 0.66) 100%),
    var(--tl-ui-home-wallpaper),
    var(--titans-legacy-bg) !important;
  background-size: cover, cover, cover, cover, cover !important;
  background-position: center, center, center, 49% center, var(--titans-legacy-bg-position) !important;
}

#splash-screen::before {
  background:
    radial-gradient(ellipse 18% 24% at 50% 55%, rgba(115, 190, 255, 0.30) 0%, rgba(255, 201, 105, 0.18) 36%, transparent 72%),
    radial-gradient(ellipse 31% 12% at 50% 61%, rgba(91, 173, 255, 0.16), transparent 64%),
    radial-gradient(circle at 15% 73%, rgba(255, 142, 45, 0.16), transparent 20%),
    radial-gradient(circle at 86% 76%, rgba(255, 142, 45, 0.15), transparent 20%),
    radial-gradient(ellipse 78% 56% at 50% 44%, transparent 0%, rgba(2, 2, 5, 0.28) 72%, rgba(2, 2, 5, 0.66) 100%) !important;
  mix-blend-mode: screen;
  opacity: 0.86;
  animation: tl-home-portal-pulse 7.5s ease-in-out infinite;
}

#splash-screen::after {
  inset: -8%;
  background:
    radial-gradient(circle at 10% 78%, rgba(255, 132, 36, 0.36), transparent 16%),
    radial-gradient(circle at 89% 78%, rgba(255, 148, 44, 0.34), transparent 16%),
    radial-gradient(circle at 52% 57%, rgba(115, 190, 255, 0.18), transparent 14%),
    radial-gradient(2px 2px at 18% 84%, rgba(255, 184, 84, 0.42), transparent 55%),
    radial-gradient(2px 2px at 23% 78%, rgba(255, 208, 122, 0.30), transparent 55%),
    radial-gradient(1.5px 1.5px at 78% 80%, rgba(255, 184, 84, 0.34), transparent 55%),
    radial-gradient(2px 2px at 84% 73%, rgba(255, 208, 122, 0.28), transparent 55%);
  background-size: auto, auto, auto, 180px 180px, 220px 220px, 200px 200px, 240px 240px;
  opacity: 0.58;
  mix-blend-mode: screen;
  animation: tl-home-embers-and-fire 6.2s ease-in-out infinite alternate;
}

#splash-screen .splash-ambient-layer::before {
  background:
    conic-gradient(from 18deg at 50% 56%, transparent 0deg, rgba(111, 190, 255, 0.10) 32deg, transparent 72deg, rgba(255, 190, 91, 0.10) 118deg, transparent 166deg, rgba(111, 190, 255, 0.08) 226deg, transparent 310deg),
    radial-gradient(ellipse 22% 18% at 50% 55%, rgba(151, 213, 255, 0.16), transparent 66%);
  opacity: 0.46;
  animation: tl-home-portal-ring 18s linear infinite;
}

#splash-screen .splash-ambient-glow--gold {
  left: -9%;
  bottom: -15%;
  opacity: 0.32;
  animation: tl-home-torch-left 4.8s ease-in-out infinite alternate;
}

#splash-screen .splash-ambient-glow--blue {
  right: -8%;
  top: 8%;
  opacity: 0.22;
  animation: tl-home-portal-sideglow 8.4s ease-in-out infinite alternate;
}

#char-select-hub {
  background:
    radial-gradient(ellipse 54% 44% at 52% 34%, rgba(255, 180, 88, 0.08) 0%, rgba(8, 7, 11, 0.18) 44%, rgba(8, 7, 11, 0.78) 100%),
    linear-gradient(90deg, rgba(6, 5, 9, 0.48) 0%, rgba(6, 5, 9, 0.10) 44%, rgba(6, 5, 9, 0.54) 100%),
    linear-gradient(180deg, rgba(8, 6, 12, 0.05), rgba(8, 6, 12, 0.86)),
    var(--tl-ui-character-backdrop),
    var(--titans-legacy-bg) !important;
  background-size: cover, cover, cover, cover, cover !important;
  background-position: center, center, center, 50% center, var(--titans-legacy-bg-position) !important;
}

#char-select-hub::before {
  background:
    radial-gradient(circle at 14% 62%, rgba(255, 150, 54, 0.18), transparent 20%),
    radial-gradient(circle at 86% 41%, rgba(255, 166, 62, 0.16), transparent 18%),
    linear-gradient(100deg, transparent 0 28%, rgba(255, 222, 165, 0.045) 42%, transparent 58% 100%),
    radial-gradient(ellipse 70% 54% at 50% 38%, transparent 0%, rgba(2, 2, 5, 0.24) 72%, rgba(2, 2, 5, 0.58) 100%) !important;
  opacity: 0.78;
  mix-blend-mode: screen;
  animation: tl-hub-torch-flicker 6.8s ease-in-out infinite alternate;
}

#char-select-hub::after {
  inset: -6%;
  background:
    radial-gradient(circle at 13% 64%, rgba(255, 135, 39, 0.26), transparent 15%),
    radial-gradient(circle at 87% 42%, rgba(255, 160, 54, 0.22), transparent 15%),
    radial-gradient(1.5px 1.5px at 18% 58%, rgba(255, 210, 135, 0.22), transparent 60%),
    radial-gradient(1px 1px at 34% 44%, rgba(255, 232, 180, 0.16), transparent 60%),
    radial-gradient(1px 1px at 70% 35%, rgba(255, 232, 180, 0.14), transparent 60%),
    radial-gradient(1.5px 1.5px at 82% 49%, rgba(255, 210, 135, 0.20), transparent 60%);
  background-size: auto, auto, 240px 220px, 280px 240px, 260px 230px, 300px 250px;
  opacity: 0.42;
  mix-blend-mode: screen;
  animation: tl-hub-dust-drift 12s ease-in-out infinite alternate;
}

@keyframes tl-home-portal-pulse {
  0%, 100% { opacity: 0.70; filter: saturate(1) brightness(0.95); transform: scale(1); }
  45% { opacity: 0.96; filter: saturate(1.18) brightness(1.10); transform: scale(1.018); }
  68% { opacity: 0.78; filter: saturate(1.08) brightness(1.02); transform: scale(1.008); }
}

@keyframes tl-home-embers-and-fire {
  0% { opacity: 0.42; filter: brightness(0.92) saturate(1); transform: translate3d(-0.35%, 0.45%, 0) scale(1); }
  50% { opacity: 0.64; filter: brightness(1.10) saturate(1.18); }
  100% { opacity: 0.54; filter: brightness(1.04) saturate(1.10); transform: translate3d(0.35%, -0.45%, 0) scale(1.018); }
}

@keyframes tl-home-portal-ring {
  0% { opacity: 0.30; transform: rotate(0deg) scale(1); }
  50% { opacity: 0.52; transform: rotate(180deg) scale(1.02); }
  100% { opacity: 0.30; transform: rotate(360deg) scale(1); }
}

@keyframes tl-home-torch-left {
  0% { opacity: 0.24; transform: translate3d(-1%, 0.8%, 0) scale(1); }
  100% { opacity: 0.40; transform: translate3d(0.8%, -0.5%, 0) scale(1.035); }
}

@keyframes tl-home-portal-sideglow {
  0% { opacity: 0.16; transform: translate3d(0, 0, 0) scale(1); }
  100% { opacity: 0.30; transform: translate3d(-1.2%, 0.7%, 0) scale(1.025); }
}

@keyframes tl-hub-torch-flicker {
  0% { opacity: 0.56; filter: brightness(0.94) saturate(1); }
  42% { opacity: 0.76; filter: brightness(1.08) saturate(1.12); }
  100% { opacity: 0.62; filter: brightness(1.02) saturate(1.06); }
}

@keyframes tl-hub-dust-drift {
  0% { opacity: 0.28; transform: translate3d(-0.3%, 0.45%, 0); }
  100% { opacity: 0.46; transform: translate3d(0.35%, -0.45%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  #splash-screen::before,
  #splash-screen::after,
  #splash-screen .splash-ambient-layer::before,
  #splash-screen .splash-ambient-glow--gold,
  #splash-screen .splash-ambient-glow--blue,
  #char-select-hub::before,
  #char-select-hub::after {
    animation: none !important;
    transform: none !important;
  }

  #splash-screen::before { opacity: 0.72; }
  #splash-screen::after { opacity: 0.34; }
  #char-select-hub::before { opacity: 0.60; }
  #char-select-hub::after { opacity: 0.24; }
}

@media (max-width: 720px) {
  #splash-screen::before { opacity: 0.74; }
  #splash-screen::after { opacity: 0.38; }
  #char-select-hub::before { opacity: 0.62; }
  #char-select-hub::after { opacity: 0.28; }
}
