/* TSTP World — style.css */

/* ── CSS Custom Properties ────────────────────────────────────────────────── */
:root {
  --world-bg:         #050508;
  --world-surface:    #0a0a12;
  --world-surface-2:  #10101c;
  --world-border:     rgba(0, 240, 255, 0.10);
  --world-border-soft:rgba(255,255,255,0.07);
  --world-text:       #e4eaf5;
  --world-muted:      #7a8aaa;
  --world-accent:     #00f0ff;
  --world-gold:       #f0b429;
  --world-danger:     #ff4b6e;
  --world-purple:     #7c6cf0;
  --world-radius:     12px;
  --world-radius-sm:  7px;
  --world-font:       "Nunito Sans", system-ui, sans-serif;
  --world-font-display: "Exo 2", var(--world-font);

  /* Aliases for header reuse */
  --surface:    var(--world-surface);
  --surface-2:  var(--world-surface-2);
  --border:     var(--world-border);
  --text:       var(--world-text);
  --muted:      var(--world-muted);
  --accent:     var(--world-accent);
  --gold:       var(--world-gold);
  --danger:     var(--world-danger);
  --radius:     var(--world-radius);
  --radius-sm:  var(--world-radius-sm);
  --font:       var(--world-font);
  --font-display: var(--world-font-display);
}

/* ── Theme: Light ──────────────────────────────────────────────────────────── */
html[data-theme="light"] {
  --world-bg:          #f0f4fb;
  --world-surface:     #ffffff;
  --world-surface-2:   #e8edf8;
  --world-border:      rgba(0, 100, 220, 0.15);
  --world-border-soft: rgba(0,0,0,0.08);
  --world-text:        #1a2030;
  --world-muted:       #5a6a88;
  --world-accent:      #0066ff;
  --world-gold:        #c47e00;
  --world-danger:      #cc2244;
  --world-purple:      #5544cc;
  --surface:    var(--world-surface);
  --surface-2:  var(--world-surface-2);
  --border:     var(--world-border);
  --text:       var(--world-text);
  --muted:      var(--world-muted);
  --accent:     var(--world-accent);
  --gold:       var(--world-gold);
  --danger:     var(--world-danger);
  color-scheme: light;
}
html[data-theme="light"] body { background: var(--world-bg); color: var(--world-text); }
html[data-theme="light"] .fight-header-bar {
  background: linear-gradient(180deg, #ffffff 0%, #f0f4fb 100%);
  border-bottom: 1px solid rgba(0,100,220,0.15);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
html[data-theme="light"] .fight-header-brand .fight-title-bar { color: #0066ff; }
html[data-theme="light"] .arena-header-btn { background: #eef2ff; border-color: rgba(0,100,220,0.2); color: #1a2030; }
html[data-theme="light"] .arena-header-btn:hover { border-color: #0066ff; color: #0066ff; }
html[data-theme="light"] .wallet-hud { background: #eef2ff; border-color: rgba(0,100,220,0.3); color: #0066ff; }
html[data-theme="light"] .world-tab-nav { background: #e8edf8; border-bottom-color: rgba(0,100,220,0.12); }
html[data-theme="light"] .world-nav-btn { color: #5a6a88; }
html[data-theme="light"] .world-nav-btn.is-active { color: #0066ff; border-bottom-color: #0066ff; }
html[data-theme="light"] .world-game-card { background: #ffffff; border-color: rgba(0,100,220,0.12); }
html[data-theme="light"] .world-game-card:hover { border-color: #0066ff; }
html[data-theme="light"] .arena-dialog { background: #ffffff; border-color: rgba(0,100,220,0.18); }
html[data-theme="light"] .arena-dialog-inner { background: #ffffff; }
html[data-theme="light"] .fight-scanlines { display: none; }

/* ── Theme: Midnight ──────────────────────────────────────────────────────── */
html[data-theme="midnight"] {
  --world-bg:          #010206;
  --world-surface:     #050516;
  --world-surface-2:   #0a0a28;
  --world-border:      rgba(136, 102, 255, 0.18);
  --world-border-soft: rgba(255,255,255,0.05);
  --world-text:        #d0d8f8;
  --world-muted:       #6070a8;
  --world-accent:      #8866ff;
  --world-gold:        #aa88ff;
  --world-danger:      #ff4488;
  --world-purple:      #cc44ff;
  --surface:    var(--world-surface);
  --surface-2:  var(--world-surface-2);
  --border:     var(--world-border);
  --text:       var(--world-text);
  --muted:      var(--world-muted);
  --accent:     var(--world-accent);
  --gold:       var(--world-gold);
  --danger:     var(--world-danger);
}
html[data-theme="midnight"] body { background: var(--world-bg); color: var(--world-text); }
html[data-theme="midnight"] .fight-header-bar {
  background: linear-gradient(180deg, #08082a 0%, #050516 100%);
  border-bottom: 1px solid rgba(136,102,255,0.2);
  box-shadow: 0 2px 20px rgba(0,0,0,0.8), 0 1px 0 rgba(136,102,255,0.1);
}
html[data-theme="midnight"] .fight-header-brand .fight-title-bar { color: #aa88ff; text-shadow: 0 0 12px rgba(136,102,255,0.6); }
html[data-theme="midnight"] .arena-header-btn { background: #0a0a22; border-color: rgba(136,102,255,0.25); color: #8888cc; }
html[data-theme="midnight"] .arena-header-btn:hover { border-color: #8866ff; color: #aa88ff; }
html[data-theme="midnight"] .wallet-hud { background: #0a0a22; border-color: rgba(136,102,255,0.35); color: #aa88ff; }
html[data-theme="midnight"] .world-nav-btn.is-active { color: #8866ff; border-bottom-color: #8866ff; }
html[data-theme="midnight"] .world-game-card-play { background: #8866ff; }
html[data-theme="midnight"] .world-game-card-play:hover { background: #aa88ff; }

/* ── Theme: Neon ──────────────────────────────────────────────────────────── */
html[data-theme="neon"] {
  --world-bg:          #030809;
  --world-surface:     #061012;
  --world-surface-2:   #0a1a1e;
  --world-border:      rgba(0, 255, 136, 0.18);
  --world-border-soft: rgba(255,255,255,0.05);
  --world-text:        #ccffe8;
  --world-muted:       #449966;
  --world-accent:      #00ff88;
  --world-gold:        #ffff00;
  --world-danger:      #ff0066;
  --world-purple:      #ff00ff;
  --surface:    var(--world-surface);
  --surface-2:  var(--world-surface-2);
  --border:     var(--world-border);
  --text:       var(--world-text);
  --muted:      var(--world-muted);
  --accent:     var(--world-accent);
  --gold:       var(--world-gold);
  --danger:     var(--world-danger);
}
html[data-theme="neon"] body { background: var(--world-bg); color: var(--world-text); }
html[data-theme="neon"] .fight-header-bar {
  background: linear-gradient(180deg, #041210 0%, #061012 100%);
  border-bottom: 1px solid rgba(0,255,136,0.25);
  box-shadow: 0 2px 20px rgba(0,0,0,0.8), 0 1px 0 rgba(0,255,136,0.15);
}
html[data-theme="neon"] .fight-header-brand .fight-title-bar { color: #00ff88; text-shadow: 0 0 12px rgba(0,255,136,0.7); }
html[data-theme="neon"] .arena-header-btn { background: #041210; border-color: rgba(0,255,136,0.25); color: #449966; }
html[data-theme="neon"] .arena-header-btn:hover { border-color: #00ff88; color: #00ff88; }
html[data-theme="neon"] .wallet-hud { background: #041210; border-color: rgba(0,255,136,0.35); color: #00ff88; }
html[data-theme="neon"] .world-nav-btn.is-active { color: #00ff88; border-bottom-color: #00ff88; }
html[data-theme="neon"] .world-game-card { border-color: rgba(0,255,136,0.12); }
html[data-theme="neon"] .world-game-card:hover { border-color: #00ff88; box-shadow: 0 0 20px rgba(0,255,136,0.15); }
html[data-theme="neon"] .world-game-card-play { background: linear-gradient(135deg, #00ff88, #00cc66); color: #030809; }
html[data-theme="neon"] .world-game-card-play:hover { background: linear-gradient(135deg, #33ff99, #00ee77); box-shadow: 0 0 16px rgba(0,255,136,0.4); }
html[data-theme="neon"] .fight-scanlines { opacity: 0.3; }

/* ── Reset ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  margin: 0;
  background: var(--world-bg);
  color: var(--world-text);
  font-family: var(--world-font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

/* ── Header ───────────────────────────────────────────────────────────────── */
.fight-header-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem 0.6rem;
  padding: 0.35rem 0.75rem;
  background: linear-gradient(90deg, #070710 0%, #0b0b18 40%, #08080f 100%);
  border-bottom: 1px solid var(--world-border);
  box-shadow: 0 2px 20px rgba(0,0,0,0.6), 0 1px 0 rgba(0,240,255,0.06);
  flex-shrink: 0;
  width: 100%;
  box-sizing: border-box;
  position: relative;
  z-index: 100;
}

.fight-header-brand {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  flex: 0 0 auto;
  min-width: 0;
}

.fight-title {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: var(--accent);
  margin: 0;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(0,240,255,0.4);
}

.fight-title-bar {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2.5vw, 1.35rem);
  font-weight: 700;
  color: var(--accent);
  margin: 0;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(0,240,255,0.4);
}

.fight-kicker-inline { font-size: 1.1rem; color: var(--world-muted); }

.fight-header-player {
  flex: 0 1 auto;
  min-width: 0;
}

.fight-header-actions,
.fight-header-actions-slim {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex: 0 0 auto;
  flex-shrink: 0;
  margin-left: auto;
}

.wallet-hud {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.2rem 0.55rem;
  background: linear-gradient(135deg, var(--surface-2) 0%, rgba(240,180,41,0.08) 100%);
  border: 1px solid rgba(240,180,41,0.25);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--gold);
  white-space: nowrap;
  box-shadow: 0 0 8px rgba(240,180,41,0.12);
}

.wallet-hud-icon { font-size: 0.9rem; }

.header-player-hud-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.header-player-hud-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(0,240,255,0.35);
}

.arena-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.22rem 0.55rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  border: 1px solid var(--world-border-soft);
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.arena-header-btn:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(0,240,255,0.3);
}

/* ── Dock root ────────────────────────────────────────────────────────────── */
.dock-root {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Tab nav ──────────────────────────────────────────────────────────────── */
.world-tab-nav {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  flex-shrink: 0;
  border-bottom: 1px solid var(--world-border);
  background: var(--world-surface);
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}

.world-nav-btn {
  padding: 0.6rem 0.25rem;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--world-muted);
  font-family: var(--world-font-display);
  font-size: 0.80rem;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, text-shadow 0.15s;
  white-space: nowrap;
  text-align: center;
  letter-spacing: 0.02em;
}
.world-nav-btn:hover { color: var(--world-text); }
.world-nav-btn.is-active {
  color: var(--world-accent);
  border-bottom-color: var(--world-accent);
  text-shadow: 0 0 8px rgba(0,240,255,0.5);
}

/* ── Panels ───────────────────────────────────────────────────────────────── */
.dock-panel {
  display: none;
  flex-direction: column;
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.dock-panel.is-active { display: flex; }

/* ── Games grid ───────────────────────────────────────────────────────────── */
.world-games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
  padding: 1.25rem;
  align-content: start;
}

.world-game-card {
  background: linear-gradient(145deg, var(--world-surface) 0%, var(--world-surface-2) 100%);
  border: 1px solid var(--world-border-soft);
  border-radius: var(--world-radius);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.world-game-card:hover {
  border-color: var(--world-accent);
  box-shadow: 0 4px 24px rgba(0,240,255,0.15), 0 1px 0 rgba(0,240,255,0.08);
  transform: translateY(-3px);
}

.world-game-card-icon {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.world-game-card-title {
  font-family: var(--world-font-display);
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0;
  color: var(--world-text);
}

.world-game-card-desc {
  font-size: 0.82rem;
  color: var(--world-muted);
  margin: 0;
  flex: 1;
}

.world-game-card-play {
  margin-top: 0.5rem;
  text-decoration: none;
}

/* ── Jobs card ─────────────────────────────────────────────────────────────── */
.world-job-card {
  background: linear-gradient(145deg, var(--world-surface) 0%, var(--world-surface-2) 100%);
  border: 1px solid var(--world-border-soft);
  border-radius: var(--world-radius);
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.world-job-pay {
  font-size: 0.82rem;
  color: var(--world-gold);
  font-weight: 600;
  margin: 0;
}

.world-job-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
}

.world-job-diff {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--world-surface-2);
  border: 1px solid var(--world-border);
  color: var(--world-muted);
}
.world-job-diff--easy   { color: var(--world-accent); }
.world-job-diff--medium { color: var(--world-gold); }
.world-job-diff--hard   { color: var(--world-danger); }

.world-job-status-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--world-gold) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--world-gold) 40%, transparent);
  color: var(--world-gold);
}

/* ── Inner panel layouts ──────────────────────────────────────────────────── */
.world-profile-panel,
.world-bank-panel,
.world-jobs-panel {
  padding: 1.25rem;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
}

/* ── Visual Job Cards (redesigned) ────────────────────────────────────────── */
.world-jobs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 0.5rem;
}

.world-job-card {
  background: linear-gradient(145deg, var(--world-surface) 0%, var(--world-surface-2) 100%);
  border: 1px solid color-mix(in srgb, var(--job-color, var(--world-accent)) 20%, var(--world-border-soft));
  border-radius: var(--world-radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
  position: relative;
}
.world-job-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--job-color, var(--world-accent));
  opacity: 0.7;
}
.world-job-card--active {
  border-color: color-mix(in srgb, var(--job-color, var(--world-accent)) 50%, transparent);
  box-shadow: 0 0 20px color-mix(in srgb, var(--job-color, var(--world-accent)) 12%, transparent);
}
.world-job-card--active::before { opacity: 1; }
.world-job-card--active:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 24px color-mix(in srgb, var(--job-color, var(--world-accent)) 20%, transparent);
}
.world-job-card--locked {
  opacity: 0.55;
  filter: grayscale(40%);
}
.world-job-card-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1rem 0.5rem;
}
.world-job-card-icon {
  font-size: 2.2rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--job-color, var(--world-accent)) 40%, transparent));
}
.world-job-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}
.world-job-card-title {
  font-family: var(--world-font-display);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--world-text);
  margin: 0 0 0.35rem;
  padding: 0 1rem;
}
.world-job-card-desc {
  font-size: 0.85rem;
  color: var(--world-text);
  opacity: 0.85;
  margin: 0 0 0.3rem;
  padding: 0 1rem;
  line-height: 1.45;
}
.world-job-card-flavor {
  font-size: 0.78rem;
  color: var(--job-color, var(--world-accent));
  opacity: 0.8;
  font-style: italic;
  margin: 0 0 0.6rem;
  padding: 0 1rem;
}
.world-job-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 1rem 0.75rem;
}
.world-job-tag {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--job-color, var(--world-accent)) 10%, var(--world-surface-2));
  border: 1px solid color-mix(in srgb, var(--job-color, var(--world-accent)) 25%, transparent);
  color: var(--world-muted);
  white-space: nowrap;
}
.world-job-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-top: 1px solid var(--world-border-soft);
  margin-top: auto;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.world-job-pay {
  font-size: 0.82rem;
  color: var(--world-gold);
  font-weight: 700;
  margin: 0;
  white-space: nowrap;
}
.world-job-play-btn {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  background: var(--job-color, var(--world-accent));
  color: var(--world-bg);
  text-decoration: none;
  display: inline-block;
  transition: opacity 0.2s, transform 0.1s;
  white-space: nowrap;
}
.world-job-play-btn:hover { opacity: 0.85; transform: scale(1.03); }
.world-job-play-btn--locked,
.world-job-play-btn--soon {
  background: var(--world-surface-2);
  color: var(--world-muted);
  border: 1px solid var(--world-border);
  cursor: not-allowed;
}
.world-job-badge {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.world-job-badge--active {
  background: color-mix(in srgb, var(--job-color, var(--world-accent)) 20%, transparent);
  border: 1px solid color-mix(in srgb, var(--job-color, var(--world-accent)) 50%, transparent);
  color: var(--job-color, var(--world-accent));
  animation: job-pulse 2s ease-in-out infinite;
}
.world-job-badge--soon {
  background: color-mix(in srgb, var(--world-gold) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--world-gold) 35%, transparent);
  color: var(--world-gold);
}
.world-job-badge--locked {
  background: color-mix(in srgb, var(--world-muted) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--world-muted) 30%, transparent);
  color: var(--world-muted);
}
@keyframes job-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

/* ── Profile stats grid (expanded) ────────────────────────────────────────── */
.world-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
@media (max-width: 480px) { .world-stats-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── Recent game list ──────────────────────────────────────────────────────── */
.world-recent-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.world-recent-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 0.5rem;
  align-items: center;
  background: var(--world-surface-2);
  border: 1px solid var(--world-border-soft);
  border-radius: var(--world-radius-sm);
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
}
.world-recent-game { color: var(--world-text); font-weight: 600; text-transform: capitalize; }
.world-recent-result--win  { color: var(--world-accent); font-weight: 700; }
.world-recent-result--loss { color: var(--world-danger); }
.world-recent-score { color: var(--world-muted); }
.world-recent-delta.pos { color: var(--world-gold); }
.world-recent-delta.neg { color: var(--world-danger); }

/* ── Zen mode ─────────────────────────────────────────────────────────────── */
.world-zen-mode .world-tab-nav { display: none; }
.world-zen-mode .fight-header-bar { opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.world-zen-mode:hover .fight-header-bar { opacity: 1; pointer-events: all; }


/* ── Section title ────────────────────────────────────────────────────────── */
.world-section-title {
  font-family: var(--world-font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--world-text);
  margin: 0 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--world-border);
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.55rem 1.25rem;
  background: linear-gradient(135deg, var(--world-accent) 0%, #00c8e0 100%);
  color: #020d10;
  font-family: var(--world-font);
  font-size: 0.88rem;
  font-weight: 700;
  border: none;
  border-radius: var(--world-radius-sm);
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
  width: 100%;
  box-shadow: 0 0 12px rgba(0,240,255,0.3);
}
.btn-primary:hover   { opacity: 0.9; box-shadow: 0 0 20px rgba(0,240,255,0.5); }
.btn-primary:active  { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 1rem;
  background: var(--world-surface-2);
  color: var(--world-text);
  font-family: var(--world-font);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--world-border);
  border-radius: var(--world-radius-sm);
  cursor: pointer;
  transition: background 0.15s;
}
.btn-secondary:hover { background: var(--world-surface); }

/* ── Form inputs ──────────────────────────────────────────────────────────── */
.world-form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--world-muted);
  margin-bottom: 0.3rem;
}

.world-form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background: var(--world-surface-2);
  border: 1px solid var(--world-border);
  border-radius: var(--world-radius-sm);
  color: var(--world-text);
  font-family: var(--world-font);
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.15s;
  margin-bottom: 0.75rem;
}
.world-form-input:focus { border-color: var(--world-accent); }

.world-slider {
  width: 100%;
  accent-color: var(--world-accent);
  margin-bottom: 0.75rem;
}

/* ── XP bar ───────────────────────────────────────────────────────────────── */
.world-xp-bar-wrap {
  width: 100%;
  height: 8px;
  background: var(--world-surface-2);
  border: 1px solid var(--world-border);
  border-radius: 999px;
  overflow: hidden;
  margin: 0.5rem 0 0.25rem;
}

.world-xp-bar {
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--world-accent), var(--world-gold));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.world-xp-label {
  font-size: 0.78rem;
  color: var(--world-muted);
  margin: 0 0 1rem;
}

/* ── Level badge ──────────────────────────────────────────────────────────── */
.world-level-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.45rem;
  background: color-mix(in srgb, var(--world-gold) 15%, transparent);
  border: 1px solid color-mix(in srgb, var(--world-gold) 40%, transparent);
  border-radius: 999px;
  color: var(--world-gold);
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}
.world-level-badge--lg { font-size: 1rem; padding: 0.2rem 0.75rem; }

/* ── Profile ──────────────────────────────────────────────────────────────── */
.world-profile-avatar-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.world-profile-big-emoji { font-size: 3rem; line-height: 1; }

.world-avatar-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.5rem;
}

.world-avatar-opt {
  font-size: 1.5rem;
  padding: 0.3rem;
  background: var(--world-surface-2);
  border: 2px solid transparent;
  border-radius: var(--world-radius-sm);
  cursor: pointer;
  transition: border-color 0.15s;
  line-height: 1;
}
.world-avatar-opt.is-selected { border-color: var(--world-accent); }
.world-avatar-opt:hover { border-color: var(--world-muted); }

.world-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.world-stat-card {
  background: var(--world-surface);
  border: 1px solid var(--world-border);
  border-radius: var(--world-radius-sm);
  padding: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
}

.world-stat-val {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--world-accent);
  font-family: var(--world-font-display);
}

.world-stat-lbl {
  font-size: 0.75rem;
  color: var(--world-muted);
  font-weight: 600;
}

/* ── Balance display ──────────────────────────────────────────────────────── */
.world-balance-display {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.world-balance-icon   { font-size: 1.8rem; }
.world-balance-amount {
  font-family: var(--world-font-display);
  font-size: 2.5rem;
  font-weight: 800;
  color: var(--world-gold);
}
.world-balance-label  { font-size: 0.9rem; color: var(--world-muted); font-weight: 600; }

/* ── Transactions ─────────────────────────────────────────────────────────── */
.world-txn-list {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 1rem;
}

.world-txn-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 0.4rem;
  align-items: center;
  padding: 0.4rem 0.6rem;
  background: var(--world-surface-2);
  border: 1px solid var(--world-border);
  border-radius: var(--world-radius-sm);
  font-size: 0.8rem;
}

.world-txn-type   { font-weight: 700; color: var(--world-muted); text-transform: uppercase; font-size: 0.7rem; }
.world-txn-note   { color: var(--world-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.world-txn-date   { color: var(--world-muted); font-size: 0.72rem; white-space: nowrap; }
.world-txn-credit .world-txn-amount { color: var(--world-accent); font-weight: 700; }
.world-txn-debit  .world-txn-amount { color: var(--world-danger); font-weight: 700; }

/* ── Loans ────────────────────────────────────────────────────────────────── */
.world-loan-card {
  background: var(--world-surface);
  border: 1px solid var(--world-border);
  border-radius: var(--world-radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
}

.world-loan-status {
  display: inline-flex;
  padding: 0.15rem 0.5rem;
  background: color-mix(in srgb, var(--world-gold) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--world-gold) 30%, transparent);
  border-radius: 999px;
  color: var(--world-gold);
  font-size: 0.7rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.world-loan-repay-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-top: 0.5rem;
}

.world-repay-input {
  flex: 1;
  margin-bottom: 0 !important;
}

/* ── Muted text ───────────────────────────────────────────────────────────── */
.world-muted { color: var(--world-muted); font-size: 0.85rem; }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.world-toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--world-surface);
  border: 1px solid var(--world-border);
  border-radius: var(--world-radius);
  padding: 0.65rem 1.25rem;
  color: var(--world-text);
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0,0,0,0.5);
  z-index: 9999;
  pointer-events: none;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap;
}
.world-toast.is-visible {
  transform: translateX(-50%) translateY(0);
}

/* ── Jobs panel overrides ─────────────────────────────────────────────────── */
.world-jobs-panel .world-games-grid {
  padding: 0;
}

.world-loan-apply-form { margin-top: 1rem; }

/* ── Inventory grid ─────────────────────────────────────────────────────── */
.world-inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 0.75rem;
    padding: 1rem;
}
.world-inv-card {
    background: var(--surface, #1a2235);
    border: 1px solid var(--border, rgba(255,255,255,0.09));
    border-radius: 10px;
    padding: 0.75rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
}
.world-inv-icon { font-size: 2rem; }
.world-inv-name { font-size: 0.75rem; font-weight: 600; color: var(--text, #e4eaf5); word-break: break-word; }
.world-inv-qty  { font-size: 0.85rem; font-weight: 700; color: var(--accent, #00f0ff); }
.world-inv-type { font-size: 0.65rem; color: var(--text-muted, #7a8fa6); text-transform: uppercase; }

/* ── Hub compact nav ─────────────────────────────────────────────────────── */
body.world-nav-compact .world-tab-nav { padding: 0.15rem 0.5rem; }
body.world-nav-compact .world-nav-btn { padding: 0.3rem 0.6rem; font-size: 0.75rem; }
