:root {
  --bg: #090b12;
  --panel: rgba(18, 24, 33, .78);
  --panel-strong: rgba(27, 36, 49, .92);
  --text: #edf7ed;
  --muted: #9eada5;
  --emerald: #42e68f;
  --violet: #a46cff;
  --gold: #f4bd50;
  --red: #ff5c8a;
  --blue: #57a5ff;
  --line: rgba(255,255,255,.12);
  --radius: 8px;
  --hud-height: 76px;
  --hud-padding: 12px;
  --panel-gap: 12px;
  --bottom-bar-height: 52px;
  --safe-top: calc(var(--hud-height) + var(--hud-padding) * 2);
  --safe-bottom: calc(var(--bottom-bar-height) + var(--hud-padding) * 2);
  --panel-bg: rgba(8, 18, 15, .94);
  --panel-border: rgba(244, 189, 80, .34);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, Segoe UI, Arial, sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(66,230,143,.18), transparent 30%),
    radial-gradient(circle at 78% 16%, rgba(164,108,255,.16), transparent 28%),
    linear-gradient(135deg, #07080d, #10151b 42%, #14101b 100%);
  overflow-x: hidden;
}

button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: not-allowed; }

#engineBootOverlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    radial-gradient(circle at 50% 35%, rgba(66, 230, 143, .18), transparent 28rem),
    linear-gradient(180deg, rgba(4, 13, 9, .98), rgba(2, 7, 7, .98));
  transition: opacity .45s ease, visibility .45s ease;
}

#engineBootOverlay.loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.engine-boot-card {
  width: min(920px, 94vw);
  max-height: min(92vh, 820px);
  overflow: auto;
  border: 1px solid rgba(244, 189, 80, .55);
  background:
    linear-gradient(135deg, rgba(8, 28, 20, .95), rgba(7, 11, 18, .94)),
    repeating-linear-gradient(90deg, rgba(255,255,255,.025) 0 1px, transparent 1px 12px);
  box-shadow: 0 0 48px rgba(66, 230, 143, .14), inset 0 0 40px rgba(244, 189, 80, .04);
  padding: 1.4rem;
  text-align: left;
}

.engine-boot-head {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
}
.engine-boot-head img { width: 96px; height: auto; }
.engine-boot-head h1 { margin: .12rem 0; color: var(--gold); font-size: clamp(1.65rem, 5vw, 2.8rem); letter-spacing: 0; }
.engine-boot-head small,
#engineBootVersion { color: #67f6a0; font: 900 .72rem monospace; text-transform: uppercase; margin: 0; }
.engine-boot-message { margin: .4rem 0 1rem; color: var(--muted); }
.engine-boot-bar { height: 10px; border: 1px solid rgba(103, 246, 160, .45); background: #06100c; overflow: hidden; }
.engine-boot-bar i { display: block; width: 0%; height: 100%; background: linear-gradient(90deg, #42e68f, #f4bd50); transition: width .25s ease; }
.engine-boot-tip {
  margin: .75rem 0 0;
  padding: .65rem .75rem;
  border: 1px solid rgba(103,246,160,.22);
  background: rgba(66,230,143,.07);
  color: #d6ffe4;
}
.engine-boot-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .45rem; margin-top: 1rem; text-align: left; }
.engine-boot-list span { border: 1px solid rgba(255,255,255,.12); background: rgba(255,255,255,.04); padding: .55rem .65rem; color: var(--muted); font-size: .78rem; min-width: 0; overflow-wrap: anywhere; }
.engine-boot-list span::before { content: "... "; color: var(--muted); }
.engine-boot-list span[data-status="loading"] { border-color: rgba(87,165,255,.65); color: #d9ebff; }
.engine-boot-list span[data-status="loading"]::before { content: ">> "; color: var(--blue); }
.engine-boot-list span[data-status="loaded"] { border-color: rgba(103,246,160,.55); color: #d6ffe4; }
.engine-boot-list span[data-status="loaded"]::before { content: "OK "; color: #67f6a0; }
.engine-boot-list span[data-status="warning"] { border-color: rgba(244,189,80,.8); color: #ffe6a6; }
.engine-boot-list span[data-status="warning"]::before { content: "! "; color: #f4bd50; }
.engine-boot-list span[data-status="failed"] { border-color: rgba(255,93,122,.8); color: #ffc5d0; }
.engine-boot-list span[data-status="failed"]::before { content: "x "; color: #ff5d7a; }
.engine-boot-list span[data-duration]::after {
  content: attr(data-duration);
  float: right;
  color: rgba(255,255,255,.45);
  font-size: .68rem;
}
.engine-boot-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: flex-start; margin-top: 1rem; }
#engineBootOverlay:not(.failed) #engineBootRetry,
#engineBootOverlay:not(.failed) #engineBootReload,
#engineBootOverlay:not(.failed) #engineBootHome { display: none; }
.engine-boot-actions button { border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.07); color: #fff; padding: .6rem 1rem; }
.engine-boot-details {
  margin: 1rem 0 0;
  max-height: 220px;
  overflow: auto;
  padding: .75rem;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.38);
  color: #d6ffe4;
  font-size: .72rem;
}
.engine-boot-details.hidden { display: none; }

@media (max-width: 560px) {
  .engine-boot-card { padding: 1rem; }
  .engine-boot-head { grid-template-columns: 64px minmax(0, 1fr); }
  .engine-boot-head img { width: 64px; }
  .engine-boot-list { grid-template-columns: 1fr; }
}

.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    radial-gradient(circle, rgba(66,230,143,.55) 0 1px, transparent 2px),
    radial-gradient(circle, rgba(244,189,80,.5) 0 1px, transparent 2px);
  background-size: 70px 90px, 120px 110px;
  animation: drift 18s linear infinite;
  opacity: .22;
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(-120px); }
}

.panel, .feature-grid article, .game-card, .boss-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0,0,0,.32), inset 0 1px 0 rgba(255,255,255,.06);
  backdrop-filter: blur(16px);
}

.btn, .icon-btn, .tabs button, .side-nav button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.06);
  color: var(--text);
  padding: .72rem .95rem;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.btn:hover, .icon-btn:hover, .side-nav button:hover { transform: translateY(-1px); border-color: rgba(66,230,143,.55); }
.primary {
  background: linear-gradient(135deg, rgba(66,230,143,.95), rgba(244,189,80,.9));
  color: #10130d;
  font-weight: 800;
}

.world-mode .panel,
.landing .panel,
.world-mode .game-card,
.landing .game-card {
  border-radius: 0;
  border: 2px solid rgba(244,189,80,.24);
  box-shadow: 0 0 0 2px rgba(0,0,0,.45), 0 12px 0 rgba(0,0,0,.18);
  backdrop-filter: none;
}
.world-mode .btn,
.world-mode button,
.landing .btn,
.landing button {
  border-radius: 0;
}
.wide { width: 100%; }

.landing { padding: 5vh 5vw; }
.hero {
  min-height: 66vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 380px;
  gap: 2rem;
  align-items: center;
}
.hero-copy h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: .88;
  letter-spacing: 0;
  text-shadow: 0 0 28px rgba(66,230,143,.28);
}
.hero-copy h2 { margin: .6rem 0 1rem; color: var(--gold); font-size: clamp(1.4rem, 3vw, 2.4rem); }
.hero-copy p { color: var(--muted); max-width: 700px; font-size: 1.1rem; }
.brand-logo {
  width: min(640px, 92vw);
  display: block;
  margin: .3rem 0 .25rem;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.55));
}
.hero-copy .brand-logo + h1 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.eyebrow { color: var(--emerald) !important; text-transform: uppercase; font-size: .8rem !important; letter-spacing: .14em; }
.hero-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.5rem; }
.auth-panel { padding: 1rem; }
.tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: .8rem; }
.tabs .active { border-color: var(--emerald); color: var(--emerald); }
form { display: grid; gap: .8rem; }
input, select {
  width: 100%;
  color: var(--text);
  background: rgba(0,0,0,.26);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .8rem;
}
.error { color: var(--red); min-height: 1.2rem; }
.feature-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: .9rem;
}
.feature-grid article { padding: 1rem; min-height: 150px; }
.feature-grid span { font-size: 1.9rem; }
.feature-grid h3 { margin: .5rem 0; }
.feature-grid p { color: var(--muted); margin: 0; }

.beta-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid rgba(244,189,80,.65);
  background: rgba(244,189,80,.12);
  color: var(--gold);
  padding: .35rem .55rem;
  font-size: .78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.beta-landing-hero { min-height: 58vh; }
.beta-landing-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .9rem;
  margin-top: 1.2rem;
}
.beta-card {
  padding: 1rem;
  background: rgba(7, 16, 14, .88);
}
.beta-card h3, .beta-card h4 { color: var(--gold); margin: .2rem 0 .65rem; }
.beta-card p, .beta-card li { color: #c5d2c9; }
.beta-card ul { margin: .5rem 0 0; padding-left: 1.1rem; }
.hero-actions.compact { gap: .5rem; margin-top: .85rem; }
.auth-links {
  display: flex;
  justify-content: space-between;
  gap: .5rem;
  margin: 0;
}
.auth-links button,
.auth-links a,
.landing-footer button {
  border: 0;
  background: transparent;
  color: var(--emerald);
  padding: 0;
  text-decoration: none;
}
.auth-links a:hover,
.auth-reset-link:hover { color: var(--gold); }
.landing-footer {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.2rem;
  color: var(--muted);
  font-size: .9rem;
}

.auth-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
}
.auth-reset-shell {
  width: min(460px, calc(100vw - 2rem));
  position: relative;
  z-index: 1;
}
.auth-reset-card {
  padding: 1.2rem;
  display: grid;
  gap: .75rem;
}
.auth-reset-logo {
  width: 170px;
  max-width: 70%;
  filter: drop-shadow(0 12px 24px rgba(0,0,0,.45));
}
.auth-reset-card h1 {
  margin: 0;
  color: var(--gold);
  font-size: clamp(1.8rem, 7vw, 2.7rem);
  letter-spacing: 0;
}
.auth-reset-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}
.auth-reset-form {
  margin-top: .35rem;
}
.auth-reset-form small {
  color: var(--muted);
  line-height: 1.35;
}
.form-note {
  min-height: 1.25rem;
  color: var(--gold) !important;
}
.form-note[data-kind="success"] { color: var(--emerald) !important; }
.form-note[data-kind="error"] { color: var(--red) !important; }
.auth-reset-link {
  color: var(--emerald);
  text-decoration: none;
  font-weight: 700;
}
.beta-modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(0, 0, 0, .62);
}
.beta-modal.hidden { display: none; }
.beta-modal-card {
  width: min(1040px, 96vw);
  max-height: 90vh;
  overflow: auto;
  padding: 1rem;
  position: relative;
}
.beta-panel-body { margin-top: .9rem; }
.beta-hero-panel {
  border: 1px solid rgba(66,230,143,.32);
  background: rgba(66,230,143,.08);
  padding: 1rem;
  margin-bottom: .9rem;
}
.beta-hero-panel h3 { margin: .7rem 0 .35rem; color: var(--gold); }
.beta-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .9rem;
}
.beta-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .8rem;
}
.beta-status-chip {
  display: inline-block;
  border: 1px solid rgba(66,230,143,.45);
  color: var(--emerald);
  padding: .2rem .45rem;
  font-size: .74rem;
  text-transform: uppercase;
}
.beta-form { display: grid; gap: .75rem; }
.beta-form label { display: grid; gap: .35rem; color: var(--muted); }
textarea {
  width: 100%;
  min-height: 104px;
  resize: vertical;
  color: var(--text);
  background: rgba(0,0,0,.26);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .8rem;
  font: inherit;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .75rem;
}
.beta-form-status { color: var(--gold); min-height: 1.2rem; margin: 0; }

.game-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 300px;
  grid-template-rows: auto 1fr;
  gap: .9rem;
  padding: .9rem;
}
.top-hud {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.6fr repeat(5, minmax(80px, auto)) auto;
  gap: .8rem;
  align-items: center;
  padding: .85rem;
}
.hud-logo {
  width: 132px;
  max-height: 38px;
  object-fit: contain;
  display: block;
  margin: -4px 0 2px;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.45));
}
.hud-stat span { display: block; color: var(--muted); font-size: .75rem; }
.hud-stat b { color: var(--gold); }
.side-nav { padding: .7rem; display: grid; gap: .45rem; align-self: start; }
.side-nav button { text-align: left; }
.side-nav .active { border-color: var(--emerald); background: rgba(66,230,143,.13); color: var(--emerald); }
.game-main { min-width: 0; }
.content-panel { min-height: calc(100vh - 110px); padding: 1rem; }
.feed { padding: .8rem; align-self: start; max-height: calc(100vh - 110px); overflow: auto; }
.feed-head { display: flex; justify-content: space-between; color: var(--muted); margin-bottom: .8rem; }
#feedItems p { border-top: 1px solid var(--line); margin: 0; padding: .75rem 0; color: #cad8ce; }
#feedItems p.activity-loot { color: #c99cff; }
#feedItems p.activity-level, #feedItems p.activity-unlock { color: #42e68f; }
#feedItems p.activity-raid, #feedItems p.activity-boss { color: #ffb2c6; }

.section-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--muted); }
.character-grid, .card-grid, .zone-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: .9rem;
}
.game-card { padding: 1rem; position: relative; overflow: hidden; }
.game-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% 30%;
  height: 80px;
  background: radial-gradient(circle, rgba(66,230,143,.14), transparent 60%);
}
.game-card h3 { margin: 0 0 .7rem; }
.game-card p, .game-card small, li { color: var(--muted); }
.avatar {
  width: 92px;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(66,230,143,.28), rgba(164,108,255,.24));
  border: 1px solid rgba(66,230,143,.4);
  font-size: 3rem;
  margin-bottom: .8rem;
}
.stats { display: grid; grid-template-columns: 1fr auto; gap: .5rem; }
.stats dt { color: var(--muted); }
.stats dd { margin: 0; color: var(--gold); font-weight: 800; }
.bar {
  height: 10px;
  background: rgba(255,255,255,.08);
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid var(--line);
}
.bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--emerald), var(--gold));
  box-shadow: 0 0 18px rgba(66,230,143,.55);
  transition: width .35s ease;
}
.bar.big { height: 14px; margin: .7rem 0; }
.bar.boss { height: 24px; }
.bar.boss i { background: linear-gradient(90deg, var(--red), var(--violet), var(--gold)); }
.resource-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .6rem;
  margin-bottom: 1rem;
}
.resource-row span {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .75rem;
  text-transform: capitalize;
}
.resource-row b { color: var(--gold); }
.resource-row em { color: var(--emerald); font-style: normal; }
.locked { filter: grayscale(.75); }
.boss-panel { text-align: center; padding: 1.3rem; }
.boss-art { font-size: 6rem; filter: drop-shadow(0 0 24px rgba(255,92,138,.4)); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.04); } }
.rarity-common { border-color: #87909a; }
.rarity-uncommon { border-color: var(--emerald); box-shadow: 0 0 22px rgba(66,230,143,.12); }
.rarity-rare { border-color: var(--blue); box-shadow: 0 0 22px rgba(87,165,255,.14); }
.rarity-epic { border-color: var(--violet); box-shadow: 0 0 22px rgba(164,108,255,.18); }
.rarity-legendary { border-color: var(--gold); box-shadow: 0 0 24px rgba(244,189,80,.2); }
.rarity-mythic { border-color: var(--red); box-shadow: 0 0 26px rgba(255,92,138,.26); }
table { width: 100%; border-collapse: collapse; overflow: hidden; border-radius: 8px; }
td { padding: .85rem; border-bottom: 1px solid var(--line); color: var(--muted); }
tr.me td { color: var(--emerald); background: rgba(66,230,143,.08); }
.guild-actions { display: grid; grid-template-columns: 1fr auto auto; gap: .7rem; }
#toast { position: fixed; right: 1rem; bottom: 1rem; display: grid; gap: .5rem; z-index: 10; }
#toast div {
  background: var(--panel-strong);
  border: 1px solid rgba(66,230,143,.35);
  border-radius: 6px;
  padding: .8rem 1rem;
  box-shadow: 0 15px 40px rgba(0,0,0,.35);
}

@media (max-width: 1050px) {
  .feature-grid { grid-template-columns: repeat(3, 1fr); }
  .beta-landing-grid, .beta-columns { grid-template-columns: 1fr 1fr; }
  .game-shell { grid-template-columns: 170px minmax(0, 1fr); }
  .feed { grid-column: 1 / -1; max-height: 240px; }
  .top-hud { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 720px) {
  .landing { padding: 1rem; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .feature-grid { grid-template-columns: 1fr 1fr; }
  .beta-landing-grid, .beta-columns, .form-grid { grid-template-columns: 1fr; }
  .game-shell { display: block; padding: .6rem; }
  .top-hud, .side-nav, .content-panel, .feed { margin-bottom: .7rem; }
  .top-hud { grid-template-columns: 1fr 1fr; }
  .side-nav { grid-template-columns: repeat(4, 1fr); }
  .side-nav button { text-align: center; padding: .65rem .35rem; font-size: .82rem; }
  .section-head, .guild-actions { grid-template-columns: 1fr; display: grid; }
}

/* Playable 2D world shell */
.world-mode {
  display: block;
  padding: 0;
  overflow: hidden;
  background: #07110d;
}

#gameCanvas {
  position: fixed;
  inset: 0;
  z-index: 0;
}

#gameCanvas canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

#gameCanvas::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: rgba(2,7,6,.5);
  opacity: 0;
  transition: opacity .15s ease;
}
.modal-open #gameCanvas::after { opacity: 1; }
.modal-open .game-main { z-index: 200; }
.modal-open .content-panel,.modal-open .profile-panel { z-index: 201; box-shadow: 0 22px 90px rgba(0,0,0,.7); }
.modal-open #skillHotbar,
.modal-open #targetFrame,
.modal-open #buffBar,
.modal-open #bossHud,
.modal-open #interactPrompt,
.modal-open .chat-panel,
.modal-open .feed,
.modal-open #miniMap,
.modal-open #questTracker,
.modal-open #dungeonTracker,
.modal-open #hotkeyHints,
.modal-open .quick-hud,
.modal-open #mobileControls { opacity: 0 !important; visibility: hidden !important; pointer-events: none !important; }
.modal-open .top-hud { z-index: 3; opacity: .28; pointer-events: none; }
.modal-open .content-panel { overflow: hidden; }
.modal-open #panelBody { max-height: calc(100vh - var(--safe-top) - 2.5rem); overflow: auto; scrollbar-gutter: stable; }
.skill-tree-open #panelBody { max-height: none; height: 100%; overflow: hidden; }

.world-mode .particles { z-index: 1; opacity: .14; }

.world-mode .top-hud {
  position: fixed;
  z-index: 5;
  top: .75rem;
  left: .75rem;
  right: .75rem;
  grid-template-columns: minmax(170px, 1.4fr) repeat(8, minmax(64px, auto)) auto;
  background: linear-gradient(180deg, rgba(12, 17, 17, .84), rgba(18, 27, 24, .68));
}

.hud-stat.hp .bar i {
  width: 100%;
  background: linear-gradient(90deg, #ff5c8a, #f4bd50);
}

.quick-hud {
  position: fixed;
  z-index: 5;
  left: .75rem;
  bottom: .75rem;
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  max-width: min(720px, calc(100vw - 1.5rem));
  background: rgba(10, 16, 15, .7);
}

.quick-hud button {
  text-align: center;
  min-width: 54px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255,255,255,.07);
  font-weight: 900;
}

.quick-hud button.active {
  border-color: var(--emerald);
  color: var(--emerald);
  background: rgba(66,230,143,.13);
}

#settingsButton {
  position: fixed;
  right: 12.25rem;
  top: 5.4rem;
  z-index: 26000;
  min-width: 104px;
  height: 42px;
  border-color: rgba(244,189,80,.48);
  background: rgba(10,16,15,.92);
  box-shadow: 0 10px 24px rgba(0,0,0,.32);
}

.world-mode .game-main {
  position: fixed;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.world-mode .content-panel {
  position: absolute;
  top: 6.6rem;
  left: 50%;
  width: min(1040px, calc(100vw - 1.5rem));
  max-height: calc(100vh - 8rem);
  overflow: auto;
  transform: translate(-50%, 16px) scale(.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  background: linear-gradient(180deg, rgba(16, 24, 27, .94), rgba(13, 16, 23, .92));
}

.world-mode.panel-open .content-panel {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
}

.world-mode.skill-tree-open .content-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  top: max(.7rem, env(safe-area-inset-top));
  width: min(1500px, calc(100vw - 1.2rem));
  height: min(950px, calc(100vh - 1.4rem));
  max-height: min(950px, calc(100vh - 1.4rem));
  padding: .75rem;
}
.world-mode.skill-tree-open .panel-close {
  position: static;
  float: none;
  justify-self: end;
  z-index: 5;
  padding: .5rem .8rem;
}

.world-mode.profile-open .profile-panel {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
  pointer-events: auto;
  z-index: 9;
}

.panel-close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: rgba(255,255,255,.08);
  padding: .55rem .8rem;
}

.world-mode .feed {
  position: fixed;
  z-index: 5;
  right: .75rem;
  bottom: .75rem;
  width: 310px;
  max-height: 340px;
  transition: max-height .2s ease, width .2s ease;
}

.feed-toggle {
  width: 100%;
  display: none;
  border: 0;
  color: var(--text);
  background: transparent;
  font-weight: 800;
  padding: .2rem 0 .5rem;
}

.world-mode .feed.collapsed {
  max-height: 48px;
  overflow: hidden;
}

.world-mode .feed .feed-toggle { display: block; }

.chat-panel {
  position: fixed;
  left: .75rem;
  bottom: 4.55rem;
  z-index: 6;
  width: min(430px, calc(100vw - 1.5rem));
  max-height: 300px;
  padding: .65rem;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: .45rem;
  background: linear-gradient(180deg, rgba(10, 18, 18, .92), rgba(9, 12, 18, .92));
}

.chat-panel.collapsed {
  max-height: 46px;
  overflow: hidden;
}

#chatToggle {
  border: 0;
  background: transparent;
  color: var(--gold);
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  text-align: left;
}

#chatToggle small {
  color: var(--muted);
  font-size: .78rem;
  font-weight: 800;
}

#chatMessages {
  min-height: 110px;
  max-height: 190px;
  overflow: auto;
  display: grid;
  align-content: end;
  gap: .25rem;
  font-size: .88rem;
}

#chatMessages p {
  margin: 0;
  color: var(--text);
  overflow-wrap: anywhere;
}

#chatMessages p.system { color: var(--muted); }
#chatMessages p.guild-chat-line {
  color: #c7ffd9;
  background: rgba(66,230,143,.06);
  border-color: rgba(66,230,143,.18);
}
#chatMessages p.party-chat-line {
  color: #d9e7ff;
  background: rgba(131,246,255,.06);
  border-color: rgba(131,246,255,.18);
}
#chatMessages p.whisper-chat-line {
  color: #ffd6f0;
  background: rgba(255,107,184,.08);
  border-color: rgba(255,107,184,.24);
}
#chatMessages span { color: var(--muted); margin-right: .35rem; }
#chatMessages b { color: var(--emerald); margin-right: .25rem; }
#chatMessages .chat-role,
.role-pill {
  display: inline-grid;
  place-items: center;
  min-width: 34px;
  margin-right: .3rem;
  padding: .08rem .28rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 4px;
  color: #10130d;
  background: linear-gradient(135deg, #a4b0b8, #dbe4e8);
  font: 900 .62rem monospace;
  font-style: normal;
  vertical-align: middle;
}
#chatMessages .role-owner,
.role-pill.role-owner { background: linear-gradient(135deg, #ffe28a, #ff5c8a); border-color: rgba(255,226,138,.75); }
#chatMessages .role-admin,
.role-pill.role-admin { background: linear-gradient(135deg, #83f6ff, #a46cff); border-color: rgba(131,246,255,.65); }
#chatMessages .role-moderator,
.role-pill.role-moderator { background: linear-gradient(135deg, #42e68f, #f4bd50); border-color: rgba(66,230,143,.65); }
#chatMessages .role-player,
.role-pill.role-player { color: var(--muted); background: rgba(255,255,255,.06); }
.role-pill {
  min-width: auto;
  margin-left: .35rem;
  margin-right: 0;
}
#chatMessages em {
  color: var(--gold);
  font-style: normal;
  font-weight: 900;
  margin-right: .35rem;
}

#chatInput {
  width: 100%;
  border: 1px solid rgba(66,230,143,.28);
  border-radius: 6px;
  background: rgba(0,0,0,.3);
  color: var(--text);
  padding: .62rem .7rem;
}

.profile-panel.hidden {
  display: none;
}

#interactPrompt {
  position: fixed;
  left: 50%;
  bottom: 7rem;
  z-index: 7;
  transform: translateX(-50%) translateY(12px);
  opacity: 0;
  pointer-events: none;
  color: #122015;
  background: linear-gradient(135deg, #42e68f, #f4bd50);
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 999px;
  padding: .75rem 1rem;
  font-weight: 900;
  box-shadow: 0 12px 32px rgba(0,0,0,.38), 0 0 24px rgba(66,230,143,.32);
  transition: opacity .15s ease, transform .15s ease;
}

#interactPrompt.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

#questTracker {
  position: fixed;
  z-index: 5;
  left: .75rem;
  top: 6.2rem;
  width: min(360px, calc(100vw - 1.5rem));
  padding: .8rem;
  background: rgba(10, 16, 15, .72);
}

#miniMap {
  position: fixed;
  z-index: 5;
  right: .75rem;
  top: 6.2rem;
  width: 170px;
  height: 140px;
  padding: .65rem;
  background:
    radial-gradient(circle at 34% 44%, rgba(66,230,143,.25), transparent 20%),
    radial-gradient(circle at 70% 38%, rgba(131,246,255,.2), transparent 18%),
    rgba(10, 16, 15, .72);
}

#miniMap.hidden {
  display: none;
}

#miniMap strong {
  color: var(--gold);
}

#miniMap i {
  position: absolute;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 14px rgba(66,230,143,.55);
}

#miniMap i:nth-of-type(1) { left: 34px; top: 82px; }
#miniMap i:nth-of-type(2) { left: 82px; top: 54px; background: var(--violet); }
#miniMap i:nth-of-type(3) { right: 30px; top: 76px; background: var(--blue); }
#miniMap i:nth-of-type(4) { right: 52px; bottom: 22px; background: var(--red); }

#questTracker strong {
  color: var(--gold);
}

#questTracker p {
  margin: .35rem 0 0;
  color: var(--muted);
}

#dialogueBox {
  position: fixed;
  z-index: 8;
  left: 50%;
  bottom: 2rem;
  width: min(880px, calc(100vw - 1.5rem));
  transform: translateX(-50%);
  padding: 1rem 1.15rem 1.05rem;
  background:
    linear-gradient(180deg, rgba(21, 31, 26, .98), rgba(9, 14, 18, .98)),
    radial-gradient(circle at 12% 12%, rgba(66,230,143,.14), transparent 34%);
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 1rem;
  border: 1px solid rgba(244,189,80,.62);
  border-radius: 8px;
  box-shadow: 0 18px 70px rgba(0,0,0,.54), inset 0 1px 0 rgba(255,255,255,.06);
  overflow: hidden;
}

#dialogueBox::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(244,189,80,.18);
  border-radius: 6px;
  pointer-events: none;
}

#dialogueBox .panel-close {
  position: absolute;
  top: .65rem;
  right: .75rem;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 7px;
  font-size: 0;
}

#dialogueBox .panel-close::before,
#dialogueBox .panel-close::after {
  content: "";
  position: absolute;
  left: 9px;
  top: 16px;
  width: 15px;
  height: 2px;
  background: var(--text);
  border-radius: 999px;
}

#dialogueBox .panel-close::before {
  transform: rotate(45deg);
}

#dialogueBox .panel-close::after {
  transform: rotate(-45deg);
}

#dialogueBox.hidden {
  display: none;
}

#dialoguePortrait {
  width: 106px;
  height: 116px;
  align-self: start;
  border-radius: 7px;
  border: 1px solid rgba(244,189,80,.55);
  background:
    radial-gradient(circle at 50% 31%, #f0c493 0 17px, transparent 18px),
    radial-gradient(circle at 43% 28%, #2b1b13 0 26px, transparent 27px),
    linear-gradient(180deg, #42e68f 0 46%, #143f2b 47%);
  box-shadow: inset 0 -22px 30px rgba(0,0,0,.32), 0 0 24px rgba(66,230,143,.16);
}

#dialoguePortrait.portrait-mira {
  background: radial-gradient(circle at 50% 31%, #f0c493 0 17px, transparent 18px), radial-gradient(circle at 50% 25%, #633e31 0 28px, transparent 29px), linear-gradient(180deg, #9c65ff 0 46%, #263c2e 47%);
}

#dialoguePortrait.portrait-kael {
  background: radial-gradient(circle at 50% 31%, #e0ad80 0 17px, transparent 18px), radial-gradient(circle at 50% 25%, #20140c 0 27px, transparent 28px), linear-gradient(180deg, #7c4a24 0 46%, #2e1e14 47%);
}

#dialoguePortrait.portrait-borin {
  background: radial-gradient(circle at 50% 31%, #d5a06f 0 18px, transparent 19px), radial-gradient(circle at 50% 25%, #59616a 0 29px, transparent 30px), linear-gradient(180deg, #66717a 0 46%, #282e34 47%);
}

#dialoguePortrait.portrait-guild {
  background: radial-gradient(circle at 50% 31%, #f0c493 0 17px, transparent 18px), radial-gradient(circle at 50% 25%, #442c16 0 27px, transparent 28px), linear-gradient(180deg, #f4bd50 0 46%, #312615 47%);
}

#dialoguePortrait.portrait-raid {
  background: radial-gradient(circle at 50% 31%, #f0c493 0 17px, transparent 18px), radial-gradient(circle at 50% 25%, #2a1020 0 27px, transparent 28px), linear-gradient(180deg, #ff5c8a 0 46%, #30111b 47%);
}

.dialogue-copy {
  min-width: 0;
  padding-right: 2.6rem;
}

#dialogueRole {
  display: inline-flex;
  margin-bottom: .22rem;
  color: var(--emerald);
  font-size: .75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

#dialogueBox h2 {
  margin: 0 0 .35rem;
  color: var(--gold);
  font-size: clamp(1.25rem, 2vw, 1.75rem);
  line-height: 1.05;
}

#dialogueBox p {
  max-width: 62ch;
  margin: 0;
  color: var(--text);
  line-height: 1.45;
}

#dialogueQuestMeta {
  display: grid;
  gap: .55rem;
  margin-top: .8rem;
}

.dialogue-quest-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .85rem;
  align-items: center;
  padding: .7rem .8rem;
  border: 1px solid rgba(66,230,143,.22);
  border-radius: 7px;
  background: rgba(4, 10, 8, .38);
}

.dialogue-quest-kicker {
  display: block;
  margin-bottom: .15rem;
  color: var(--muted);
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.dialogue-quest-card strong {
  color: var(--text);
}

.dialogue-quest-card p {
  margin-top: .18rem;
  color: var(--muted);
  font-size: .92rem;
}

.dialogue-progress {
  min-width: 120px;
  text-align: right;
}

.dialogue-progress span,
.dialogue-reward {
  color: var(--muted);
  font-size: .82rem;
}

.dialogue-progress b {
  display: block;
  margin-top: .14rem;
  color: var(--emerald);
  font-size: 1.15rem;
}

.dialogue-reward {
  color: #f1d391;
}

#dialogueActions {
  display: flex;
  justify-content: flex-end;
  gap: .55rem;
  flex-wrap: wrap;
  margin-top: .9rem;
}

#dialogueActions .btn {
  min-width: 118px;
  justify-content: center;
}

#hotkeyHints {
  position: fixed;
  z-index: 5;
  left: 50%;
  bottom: .75rem;
  transform: translateX(-50%);
  padding: .55rem .75rem;
  color: var(--muted);
  background: rgba(10,16,15,.64);
  font-size: .85rem;
}

#mobileControls {
  position: fixed;
  z-index: 5;
  right: .75rem;
  bottom: 6.2rem;
  display: none;
  grid-template-columns: repeat(3, 48px);
  grid-template-rows: repeat(3, 48px);
  gap: .35rem;
}

#mobileControls button {
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 8px;
  color: var(--text);
  background: rgba(13,18,20,.7);
  backdrop-filter: blur(10px);
  font-weight: 900;
}

#mobileControls [data-move="up"] { grid-column: 2; grid-row: 1; }
#mobileControls [data-move="left"] { grid-column: 1; grid-row: 2; }
#mobileControls [data-move="down"] { grid-column: 2; grid-row: 3; }
#mobileControls [data-move="right"] { grid-column: 3; grid-row: 2; }
#mobileInteract { grid-column: 3; grid-row: 3; background: rgba(66,230,143,.35) !important; }

/* CSS sprites and illustrated overlay panels */
.hero-stage, .garden-scene, .battle-stage, .raid-arena, .guild-hall {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #111b25, #0c1713 60%, #132315);
  box-shadow: inset 0 -40px 80px rgba(0,0,0,.28);
  margin-bottom: 1rem;
}

.hero-stage::before, .garden-scene::before, .battle-stage::before, .raid-arena::before, .guild-hall::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 18% 24%, rgba(66,230,143,.18), transparent 18%),
    radial-gradient(circle at 80% 30%, rgba(164,108,255,.16), transparent 22%);
}

.forest-layer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 52px;
  height: 150px;
  background:
    radial-gradient(ellipse at 8% 100%, #143d25 0 28px, transparent 29px),
    radial-gradient(ellipse at 18% 100%, #1f5b34 0 40px, transparent 41px),
    radial-gradient(ellipse at 32% 100%, #153d28 0 34px, transparent 35px),
    radial-gradient(ellipse at 48% 100%, #1d6037 0 48px, transparent 49px),
    radial-gradient(ellipse at 66% 100%, #173e2a 0 38px, transparent 39px),
    radial-gradient(ellipse at 84% 100%, #215f37 0 46px, transparent 47px);
}
.forest-layer.back { opacity: .55; transform: translateY(-34px) scale(1.2); }
.forest-layer.mid { opacity: .9; }

.hero-plinth {
  position: absolute;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  display: grid;
  justify-items: center;
}

.sprite {
  position: relative;
  width: 82px;
  height: 112px;
  filter: drop-shadow(0 12px 16px rgba(0,0,0,.35));
}
.sprite::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: 0;
  width: 48px;
  height: 14px;
  border-radius: 50%;
  background: rgba(0,0,0,.34);
}
.hero-sprite i {
  position: absolute;
  left: 21px;
  top: 31px;
  width: 40px;
  height: 58px;
  border-radius: 14px 14px 8px 8px;
  background: linear-gradient(180deg, #18432d, #0f261d);
  border: 2px solid rgba(66,230,143,.45);
}
.hero-sprite b {
  position: absolute;
  left: 29px;
  top: 14px;
  width: 25px;
  height: 25px;
  border-radius: 50%;
  background: #e6c191;
}
.hero-sprite span {
  position: absolute;
  left: 14px;
  top: 5px;
  width: 54px;
  height: 42px;
  border-radius: 50% 50% 42% 42%;
  background: linear-gradient(180deg, #42e68f, #123829);
  clip-path: polygon(50% 0, 92% 55%, 68% 100%, 32% 100%, 8% 55%);
}
.hero-sprite.thornblade i { background: linear-gradient(180deg, #3f1530, #151018); border-color: rgba(255,92,138,.45); }
.hero-sprite.stonebark i { background: linear-gradient(180deg, #48515a, #223026); border-color: rgba(244,189,80,.42); }
.sprite.asset-world {
  background-image: none;
  filter: drop-shadow(0 14px 18px rgba(0,0,0,.42));
}
.sprite.asset-world i,
.sprite.asset-world b,
.sprite.asset-world span { display: block; }
.hero-sprite.asset-world {
  width: 96px;
  height: 126px;
}
.enemy-sprite.asset-world {
  width: 108px;
  height: 112px;
}
.enemy-sprite.asset-world.sprout,
.enemy-sprite.asset-world.goblin,
.enemy-sprite.asset-world.beetle,
.enemy-sprite.asset-world.wolf { background-image: none; }
.enemy-sprite.asset-world.dragon,
.enemy-sprite.asset-world.treant,
.enemy-sprite.asset-world.knight { background-image: none; }
.hero-sprite.idle { animation: spriteIdle 1.8s ease-in-out infinite; }
.hero-sprite.strike { animation: heroStrike .45s ease; }
.hero-sprite.mini { width: 42px; height: 52px; transform: scale(.55); transform-origin: center; }
@keyframes spriteIdle { 50% { transform: translateY(-5px); } }
@keyframes heroStrike { 50% { transform: translate(26px, -4px) rotate(4deg); } }

.enemy-sprite i {
  position: absolute;
  left: 16px;
  top: 34px;
  width: 52px;
  height: 48px;
  border-radius: 48% 48% 38% 38%;
  background: #5b3a84;
  border: 2px solid rgba(255,255,255,.18);
}
.enemy-sprite b, .enemy-sprite span {
  position: absolute;
  top: 25px;
  width: 18px;
  height: 32px;
  border-radius: 50% 50% 0 0;
  background: #8d65c7;
}
.enemy-sprite b { left: 18px; transform: rotate(-28deg); }
.enemy-sprite span { right: 18px; transform: rotate(28deg); }
.enemy-sprite.goblin i { background: #416b2f; }
.enemy-sprite.sprout i { background: #4cc76e; }
.enemy-sprite.beetle i { background: #4bb5d0; }
.enemy-sprite.wolf i { background: #2e3440; }
.enemy-sprite.treant i { background: #604326; }
.enemy-sprite.knight i { background: #687380; }
.enemy-sprite.dragon i { background: #8d2341; }
.enemy-sprite.hurt { animation: enemyHit .42s ease; }
@keyframes enemyHit { 35% { transform: translateX(18px); filter: brightness(1.8); } }

.nameplate {
  display: grid;
  justify-items: center;
  gap: .1rem;
  margin-top: .25rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: rgba(0,0,0,.35);
  border: 1px solid rgba(244,189,80,.3);
}
.nameplate span, .stat-runes span { color: var(--muted); font-size: .8rem; }
.stat-runes {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .6rem;
}
.stat-runes span, .power-orb {
  border: 1px solid rgba(66,230,143,.28);
  border-radius: 8px;
  background: rgba(0,0,0,.28);
  padding: .75rem;
  text-align: center;
  color: var(--gold);
  font-weight: 900;
}
.power-orb {
  display: grid;
  place-items: center;
  min-height: 120px;
  border-radius: 50%;
  font-size: 2rem;
  background: radial-gradient(circle, rgba(244,189,80,.28), rgba(66,230,143,.12), rgba(0,0,0,.18));
}
.mini-map { height: 120px; position: relative; background: rgba(0,0,0,.22); border-radius: 8px; }
.mini-map i { position: absolute; width: 34px; height: 34px; border-radius: 50%; background: var(--emerald); box-shadow: 0 0 20px rgba(66,230,143,.4); }
.mini-map i:nth-child(1) { left: 18%; top: 56%; }
.mini-map i:nth-child(2) { left: 45%; top: 25%; background: var(--violet); }
.mini-map i:nth-child(3) { right: 18%; top: 52%; background: var(--gold); }

.garden-scene { min-height: 380px; background: linear-gradient(180deg, #111927, #14261a); }
.moon {
  position: absolute;
  right: 12%;
  top: 12%;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #f4e5a3;
  box-shadow: 0 0 50px rgba(244,229,163,.35);
}
.garden-ground {
  position: absolute;
  left: 5%;
  right: 5%;
  bottom: 8%;
  height: 68%;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(48,108,54,.8), rgba(26,65,38,.62) 55%, transparent 70%);
}
.building-node {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 112px;
  height: 92px;
  transform: translate(-50%, -50%);
  border: 0;
  background: transparent;
  color: var(--text);
}
.building-node i {
  display: block;
  width: 86px;
  height: 70px;
  margin: auto;
  border-radius: 10px;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.35));
}
.building-node span {
  display: inline-block;
  margin-top: .15rem;
  border-radius: 999px;
  background: rgba(0,0,0,.55);
  padding: .25rem .5rem;
  border: 1px solid rgba(244,189,80,.35);
}
.building-node.plot i { background: repeating-linear-gradient(90deg, #623b20 0 12px, #42e68f 12px 18px); }
.building-node.mine i { background: radial-gradient(circle at 40% 30%, #83f6ff 0 12px, transparent 13px), linear-gradient(135deg, #354b62, #15202b); clip-path: polygon(18% 100%, 0 40%, 28% 10%, 52% 22%, 74% 0, 100% 46%, 80% 100%); }
.building-node.shrine i { background: linear-gradient(180deg, #73385f, #302033); clip-path: polygon(50% 0, 86% 35%, 72% 100%, 28% 100%, 14% 35%); box-shadow: 0 0 26px rgba(255,92,138,.3); }
.building-node.tree i { background: radial-gradient(circle at 50% 30%, #42e68f 0 26px, #1f6b3c 27px 46px, transparent 47px), linear-gradient(90deg, transparent 42%, #5b371d 43% 58%, transparent 59%); }
.building-node.hut i { background: linear-gradient(135deg, #5f3d25 0 50%, #2d1d16 51%), linear-gradient(#9c65ff, #9c65ff); clip-path: polygon(50% 0, 100% 38%, 86% 100%, 14% 100%, 0 38%); }
.building-node.vault i { background: linear-gradient(180deg, #78838e, #2e3942); border: 5px solid #f4bd50; }

.battle-stage { min-height: 300px; }
.battle-bg, .battle-floor {
  position: absolute;
  inset: 0;
}
.battle-bg { background: radial-gradient(circle at 50% 20%, rgba(164,108,255,.22), transparent 30%); }
.battle-floor {
  top: auto;
  height: 38%;
  background: radial-gradient(ellipse, rgba(34,86,48,.9), rgba(20,42,31,.95));
}
.combatant {
  position: absolute;
  bottom: 44px;
  display: grid;
  justify-items: center;
  gap: .3rem;
}
.combatant.left { left: 18%; }
.combatant.right { right: 18%; }
.combatant small {
  padding: .25rem .55rem;
  border-radius: 999px;
  background: rgba(0,0,0,.38);
}
.damage-pop {
  position: absolute;
  right: 28%;
  top: 30%;
  color: var(--red);
  font-size: 2rem;
  font-weight: 900;
  animation: floatDamage 1s ease forwards;
}
@keyframes floatDamage {
  to { transform: translateY(-60px); opacity: 0; }
}
.result-banner {
  position: absolute;
  left: 50%;
  top: 18%;
  transform: translateX(-50%);
  padding: .6rem 1rem;
  border-radius: 999px;
  font-weight: 900;
  background: rgba(0,0,0,.55);
  border: 1px solid var(--line);
}
.result-banner.win { color: var(--emerald); }
.result-banner.loss { color: var(--red); }

.realm-map, .loot-grid, .quest-board, .leaderboard-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .9rem;
}
.zone-card, .loot-card, .quest-scroll, .leader-row {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
  background: rgba(14,18,21,.78);
}
.zone-card::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .55;
  background: radial-gradient(circle at 50% 22%, var(--zone-a, #42e68f), transparent 30%), linear-gradient(160deg, var(--zone-b, #173a28), #0c1117);
}
.zone-card > * { position: relative; }
.zone-fields { --zone-a: #78e887; --zone-b: #1f5e35; }
.zone-thicket { --zone-a: #8ad04d; --zone-b: #24371c; }
.zone-crystal { --zone-a: #83f6ff; --zone-b: #1f3e54; }
.zone-shadow { --zone-a: #9c65ff; --zone-b: #16131f; }
.zone-ruins { --zone-a: #f4bd50; --zone-b: #3a3326; }
.zone-abyss { --zone-a: #ff5c8a; --zone-b: #25111a; }
.zone-mark {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #0b120e;
  background: rgba(244,189,80,.9);
  font-weight: 900;
}
.zone-loot { display: flex; flex-wrap: wrap; gap: .35rem; margin: .7rem 0; }
.zone-loot span { font-size: .75rem; color: var(--text); background: rgba(0,0,0,.35); border-radius: 999px; padding: .25rem .45rem; }

.raid-arena { min-height: 470px; background: linear-gradient(180deg, #140d19, #1d1218 58%, #271c1c); }
.raid-sky {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 72% 26%, rgba(255,92,138,.24), transparent 28%);
}
.dragon-sprite {
  position: absolute;
  right: 15%;
  bottom: 88px;
  width: 240px;
  height: 220px;
  filter: drop-shadow(0 20px 25px rgba(0,0,0,.5));
  animation: dragonHover 2.4s ease-in-out infinite;
}
.dragon-sprite i {
  position: absolute;
  left: 58px;
  top: 72px;
  width: 126px;
  height: 86px;
  border-radius: 50% 44% 36% 50%;
  background: linear-gradient(135deg, #8d2341, #31112b);
  border: 3px solid rgba(244,189,80,.28);
}
.dragon-sprite b, .dragon-sprite span {
  position: absolute;
  top: 28px;
  width: 100px;
  height: 95px;
  background: rgba(126,53,255,.45);
  clip-path: polygon(0 100%, 50% 0, 100% 100%);
}
.dragon-sprite b { left: 0; transform: rotate(-28deg); }
.dragon-sprite span { right: 0; transform: rotate(28deg); }
.dragon-sprite.hit { animation: enemyHit .42s ease; }
@keyframes dragonHover { 50% { transform: translateY(-12px); } }
.raid-hero { position: absolute; left: 16%; bottom: 84px; }
.raid-hp {
  position: absolute;
  left: 50%;
  top: 1rem;
  width: min(520px, 80%);
  transform: translateX(-50%);
  text-align: center;
}
.raid-attackers {
  margin-top: .65rem;
  display: grid;
  gap: .25rem;
  color: var(--muted);
  font-size: .85rem;
}
.raid-attackers p {
  margin: 0;
  color: #ffb2c6;
}
.raid-arena #attackBoss {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
}

.loot-card { display: grid; justify-items: center; text-align: center; gap: .4rem; }
.item-power {
  min-width: 92px;
  border: 1px solid rgba(244,189,80,.45);
  border-radius: 999px;
  padding: .25rem .55rem;
  color: #10130d;
  background: linear-gradient(135deg, #42e68f, #f4bd50);
  font-weight: 900;
  font-size: .82rem;
}
.item-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: rgba(0,0,0,.28);
  border: 2px solid currentColor;
}
.item-icon i { width: 44px; height: 44px; background: var(--gold); display: block; }
.item-icon.asset-icon {
  background-image: none;
  box-shadow: inset 0 0 18px rgba(0,0,0,.36), 0 10px 18px rgba(0,0,0,.24);
}
.item-icon.asset-icon i { display: block; }
.item-icon.asset-icon.blade,
.item-icon.asset-icon.shield,
.item-icon.asset-icon.gem,
.item-icon.asset-icon.bag,
.item-icon.asset-icon.potion { background-image: none; }
.item-icon.blade i { clip-path: polygon(45% 0, 62% 0, 57% 72%, 78% 72%, 78% 86%, 22% 86%, 22% 72%, 43% 72%); }
.item-icon.shield i { clip-path: polygon(50% 0, 88% 16%, 78% 74%, 50% 100%, 22% 74%, 12% 16%); }
.item-icon.gem i { clip-path: polygon(50% 0, 92% 35%, 50% 100%, 8% 35%); }
.loot-card dl {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: .25rem .55rem;
  font-size: .8rem;
}
.loot-card dt { color: var(--muted); }
.loot-card dd { margin: 0; color: var(--gold); }
.loot-actions { display: flex; gap: .45rem; flex-wrap: wrap; justify-content: center; }

.quest-scroll {
  background: linear-gradient(180deg, rgba(95,65,34,.82), rgba(39,29,22,.88));
}
.quest-seal {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold), #8d5128);
  box-shadow: 0 0 18px rgba(244,189,80,.28);
}
.quest-scroll.claimed { opacity: .65; }

.leaderboard-list { grid-template-columns: 1fr; }
.leader-row {
  min-height: 74px;
  display: grid;
  grid-template-columns: 64px 52px minmax(130px,1fr) auto auto auto auto;
  align-items: center;
  gap: .8rem;
}
.leader-row.me { border-color: var(--emerald); background: rgba(66,230,143,.1); }
.rank { color: var(--gold); font-weight: 900; }

.social-tabs { align-items: center; }
.social-list {
  display: grid;
  gap: .65rem;
}
.social-row,
.mail-row,
.notification-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .75rem;
  border: 1px solid rgba(255,255,255,.1);
  background: linear-gradient(180deg, rgba(8,20,18,.9), rgba(3,9,10,.86));
}
.social-row b,
.mail-row b,
.notification-row b { color: #f8e7b0; }
.social-row small,
.mail-row small,
.notification-row small {
  display: block;
  margin-top: .18rem;
  color: var(--muted);
}
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #65706b;
  box-shadow: 0 0 0 3px rgba(255,255,255,.04);
}
.social-row.online .status-dot {
  background: var(--emerald);
  box-shadow: 0 0 16px rgba(103,246,160,.45);
}
.social-compose {
  margin-bottom: .75rem;
}
.social-compose-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(180px, 1fr) auto;
  gap: .6rem;
}
.social-compose-grid textarea {
  grid-column: 1 / -1;
  min-height: 110px;
  resize: vertical;
}
.whisper-thread {
  display: grid;
  gap: .55rem;
  padding: .75rem;
  border: 1px solid rgba(244,189,80,.18);
  background: rgba(0,0,0,.22);
}
.whisper-thread p {
  justify-self: start;
  max-width: min(720px, 92%);
  margin: 0;
  padding: .55rem .7rem;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(5,16,16,.86);
}
.whisper-thread p.mine {
  justify-self: end;
  border-color: rgba(103,246,160,.35);
}
.whisper-thread span,
.whisper-thread small { display: block; }
.mail-row,
.notification-row { grid-template-columns: minmax(0, 1fr) auto; }
.mail-row.unread,
.notification-row.unread {
  border-color: rgba(244,189,80,.45);
  box-shadow: inset 3px 0 0 var(--gold);
}
.moderation-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: start;
  padding: .8rem;
  border: 1px solid rgba(255,122,50,.28);
  background: linear-gradient(180deg, rgba(23,14,12,.9), rgba(5,9,10,.9));
}
.moderation-row p { margin: .35rem 0 0; color: var(--muted); }
.debug-json {
  max-height: 56vh;
  overflow: auto;
  padding: .8rem;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.35);
  white-space: pre-wrap;
  color: #bdf7d1;
}
.hidden.staff-only { display: none !important; }
.profile-hero + .social-actions {
  justify-content: flex-end;
  margin: .65rem 0 0;
}

.guild-hall { min-height: 360px; display: grid; place-items: center; padding: 2rem; }
.guild-layout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  align-items: start;
}
.guild-hero, .guild-card {
  border: 1px solid rgba(244,189,80,.22);
  background: linear-gradient(180deg, rgba(13,31,24,.9), rgba(7,16,18,.94));
  box-shadow: 0 16px 36px rgba(0,0,0,.24);
  border-radius: 8px;
  padding: 1rem;
}
.guild-hero {
  display: grid;
  gap: .8rem;
  grid-row: span 2;
}
.guild-card h3 {
  margin: 0 0 .7rem;
  color: var(--gold);
}
.guild-banner {
  display: grid;
  justify-items: center;
  gap: .7rem;
}
.guild-banner i {
  width: 120px;
  height: 150px;
  background: linear-gradient(180deg, #42e68f, #265f3f);
  clip-path: polygon(0 0, 100% 0, 100% 78%, 50% 100%, 0 78%);
  border: 4px solid var(--gold);
}
.guild-banner span { font-size: 1.6rem; font-weight: 900; }
.guild-message {
  margin: 0;
  color: #d6eadc;
  line-height: 1.45;
}
.guild-treasury {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
  gap: .5rem;
}
.guild-treasury span {
  display: grid;
  gap: .15rem;
  min-height: 58px;
  align-content: center;
  padding: .55rem;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.24);
  color: var(--muted);
  font-size: .78rem;
}
.guild-treasury b {
  color: var(--gold);
  font-size: 1rem;
}
.guild-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin-top: .7rem;
}
.guild-actions input, .guild-actions select {
  flex: 1 1 130px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem .75rem;
  background: rgba(0,0,0,.28);
  color: var(--text);
}
.guild-list, .guild-activity {
  display: grid;
  gap: .55rem;
}
.guild-list article {
  display: grid;
  gap: .4rem;
  padding: .65rem;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 8px;
  background: rgba(0,0,0,.2);
}
.guild-list article p {
  margin: 0;
  color: var(--muted);
}
.guild-list small {
  color: var(--muted);
}
.member-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.guild-activity p {
  margin: 0;
  padding: .5rem .6rem;
  border-left: 2px solid rgba(66,230,143,.45);
  background: rgba(0,0,0,.18);
  color: var(--muted);
}
.guild-danger {
  border-color: rgba(255,110,110,.28);
}
.party-layout .party-same {
  border-color: rgba(66,230,143,.38);
  background: rgba(66,230,143,.08);
}
.party-layout .party-away {
  border-color: rgba(244,189,80,.28);
  background: rgba(244,189,80,.06);
}
.setting-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: .75rem 0;
  border-top: 1px solid rgba(255,255,255,.08);
  color: var(--text);
}
.setting-row:first-of-type { border-top: 0; }
.setting-row input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: var(--emerald);
}
.setting-row input[type="range"] {
  width: min(240px, 38vw);
  accent-color: var(--emerald);
}
.member-ring {
  width: min(620px, 100%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .7rem;
  margin: 1rem 0;
}
.member-token {
  display: flex;
  align-items: center;
  gap: .6rem;
  background: rgba(0,0,0,.24);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .7rem;
}
.member-token.online {
  border-color: rgba(66,230,143,.55);
  background: rgba(66,230,143,.12);
}
.member-token b {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--emerald);
  color: #0b120e;
}
.member-token small { display: block; color: var(--muted); }

@media (max-width: 900px) {
  .world-mode .top-hud {
    grid-template-columns: repeat(4, 1fr);
    font-size: .9rem;
  }
  .world-mode .content-panel {
    top: 8.2rem;
    max-height: calc(100vh - 9.2rem);
  }
  .world-mode .feed {
    right: .5rem;
    width: 260px;
  }
}

@media (max-width: 720px) {
  #mobileControls { display: grid; }
  .quick-hud {
    left: .5rem;
    right: .5rem;
    max-width: none;
    justify-content: center;
    bottom: .5rem;
  }
  .quick-hud button {
    min-width: auto;
    flex: 1 1 78px;
  }
  .world-mode .feed {
    left: .5rem;
    right: auto;
    bottom: 10.2rem;
    width: 220px;
  }
  .chat-panel {
    left: .5rem;
    right: .5rem;
    bottom: 7.2rem;
    width: auto;
  }
  #settingsButton {
    top: auto;
    right: .5rem;
    bottom: 13.2rem;
  }
  #interactPrompt { bottom: 13.6rem; max-width: calc(100vw - 1rem); text-align: center; }
  #hotkeyHints { display: none; }
  #dialogueBox {
    grid-template-columns: 76px minmax(0, 1fr);
    bottom: 5rem;
    gap: .75rem;
    padding: .85rem;
  }
  #dialoguePortrait { width: 76px; height: 84px; }
  .dialogue-copy { padding-right: 2.25rem; }
  .dialogue-quest-card { grid-template-columns: 1fr; }
  .dialogue-progress {
    min-width: 0;
    text-align: left;
  }
  #dialogueActions { justify-content: stretch; }
  #dialogueActions .btn { flex: 1 1 130px; }
  .stat-runes { grid-template-columns: repeat(2, 1fr); }
  .combatant.left { left: 8%; }
  .combatant.right { right: 8%; }
  .dragon-sprite { right: 4%; transform: scale(.8); transform-origin: bottom right; }
  .raid-hero { left: 6%; }
  .leader-row { grid-template-columns: 44px 38px 1fr; }
  .leader-row span:last-of-type, .leader-row strong { grid-column: span 1; }
}

/* Master responsive presentation pass */
.landing {
  min-height: 100vh;
  padding: clamp(1rem, 4vw, 4rem);
  overflow-y: auto;
}

.landing .hero {
  width: min(1240px, 100%);
  min-height: min(680px, 68vh);
  margin: 0 auto clamp(1.5rem, 4vw, 3.5rem);
  grid-template-columns: minmax(0, 1fr) minmax(320px, 390px);
  gap: clamp(1.5rem, 4vw, 4rem);
}

.hero-copy,
.auth-panel { min-width: 0; }

.brand-logo {
  width: min(640px, 100%);
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.auth-panel {
  width: 100%;
  max-width: 390px;
  justify-self: end;
}

.feature-grid {
  width: min(1240px, 100%);
  margin: 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
}

.feature-grid article {
  min-width: 0;
  min-height: 140px;
  overflow-wrap: anywhere;
}

.feature-grid .feature-rune {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #10130d;
  background: var(--gold);
  border: 3px solid #3b2912;
  box-shadow: inset 0 0 0 2px #ffe09a, 3px 3px 0 rgba(0,0,0,.45);
  font: 900 .72rem monospace;
}

.world-mode .top-hud {
  min-height: var(--hud-height);
  display: grid;
  grid-template-columns: minmax(190px, .85fr) minmax(390px, 1.45fr) minmax(270px, 1fr) auto;
  gap: clamp(.55rem, 1.2vw, 1.1rem);
  padding: .6rem .75rem;
  align-items: center;
  background: var(--panel-bg);
  border-color: var(--panel-border);
}

.hud-identity,
.hud-vitals,
.hud-resources,
.hud-account {
  display: flex;
  align-items: center;
  min-width: 0;
}

.hud-identity { gap: .65rem; }
.hud-logo { flex: 0 0 auto; width: clamp(88px, 8vw, 126px); margin: 0; }
.hud-player-copy { min-width: 0; display: grid; gap: .1rem; }
.hud-player-copy strong,
.hud-player-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hud-player-copy span { color: var(--muted); font-size: .78rem; }

.hud-vitals { gap: .65rem; }
.hud-vitals .hud-stat { min-width: 58px; flex: 1 1 80px; }
.hud-vitals .hp,
.hud-vitals .xp,
.hud-vitals .stamina { min-width: 82px; }
.hud-vitals .stamina b { font-size: .75rem; }
.hud-vitals .hp b { display: block; margin-top: .12rem; color: #f2ddd8; font: 800 .68rem monospace; white-space: nowrap; }
.low-health .hud-vitals .hp { animation: low-health-pulse .8s steps(2,end) infinite; }
@keyframes low-health-pulse { 50% { filter: brightness(1.55); } }
.hud-stat em { color: var(--emerald); font-style: normal; }
.hud-stat .bar { height: 8px; margin-top: .2rem; }

.hud-resources { justify-content: flex-end; gap: clamp(.6rem, 1.2vw, 1.15rem); }
.hud-resources .hud-stat { text-align: center; min-width: 46px; }
.hud-account { justify-content: flex-end; gap: .4rem; }
.hud-account .icon-btn { min-width: 76px; height: 38px; padding: .45rem .65rem; }

#settingsButton {
  position: static;
  z-index: auto;
  min-width: 76px;
  height: 38px;
  box-shadow: none;
}

#defeatOverlay { position: fixed; inset: 0; z-index: 120000; display: grid; place-items: center; padding: 1rem; background: rgba(3,4,8,.78); }
#defeatOverlay.hidden { display: none; }
.defeat-card { width: min(430px,calc(100vw - 2rem)); padding: 1.25rem; text-align: center; border-color: rgba(255,92,138,.65); }
.defeat-card small { color: #ff7898; font: 900 .72rem monospace; text-transform: uppercase; }
.defeat-card h2 { margin: .45rem 0; color: #f2ddd8; }
.defeat-card p { color: var(--muted); }

#questTracker {
  top: calc(var(--safe-top) + .35rem);
  left: var(--hud-padding);
  width: min(360px, calc(100vw - var(--hud-padding) * 2));
  background: var(--panel-bg);
}

#miniMap {
  top: var(--safe-top);
  right: var(--hud-padding);
  width: 188px;
  height: auto;
  min-height: 154px;
  padding: .55rem;
  background: var(--panel-bg);
  overflow: hidden;
}

.minimap-head,
.minimap-legend { display: flex; align-items: center; justify-content: space-between; gap: .4rem; }
.minimap-head span { color: var(--muted); font: 700 .66rem monospace; }
#miniMapCanvas {
  display: block;
  width: 100%;
  height: 104px;
  margin: .4rem 0;
  background: #07140e;
  border: 1px solid rgba(66,230,143,.22);
  image-rendering: pixelated;
}
.minimap-legend { justify-content: flex-start; font-size: .58rem; color: var(--muted); }
.minimap-legend span { display: flex; align-items: center; gap: .2rem; }
.minimap-legend span::before { content: ""; width: 6px; height: 6px; background: #f4bd50; }
.minimap-legend span:nth-child(2)::before { background: #83f6ff; }
.minimap-legend span:nth-child(3)::before { background: #ff5c8a; }

.quick-hud {
  left: 50%;
  bottom: var(--hud-padding);
  transform: translateX(-50%);
  max-width: min(520px, calc(100vw - 680px));
  flex-wrap: nowrap;
  justify-content: center;
  padding: .35rem;
  background: var(--panel-bg);
}
.quick-hud button { width: 52px; min-width: 52px; height: 40px; }
.chat-panel { left: var(--hud-padding); bottom: var(--safe-bottom); }
.world-mode .feed { right: var(--hud-padding); bottom: var(--hud-padding); background: var(--panel-bg); }
#hotkeyHints { bottom: calc(var(--safe-bottom) + .25rem); }
#interactPrompt { bottom: calc(var(--safe-bottom) + 3.1rem); }

.world-mode .content-panel {
  top: var(--safe-top);
  max-height: calc(100vh - var(--safe-top) - var(--hud-padding));
}

@media (max-width: 1180px) {
  :root { --hud-height: 118px; }
  .world-mode .top-hud {
    grid-template-columns: minmax(180px, .8fr) minmax(380px, 1.5fr) auto;
  }
  .hud-resources { grid-column: 1 / 3; justify-content: flex-start; }
  .hud-account { grid-column: 3; grid-row: 1 / 3; }
  .quick-hud { max-width: 420px; }
  .world-mode .feed { width: 260px; }
}

@media (max-width: 900px) {
  .landing .hero { grid-template-columns: 1fr; min-height: auto; }
  .auth-panel { max-width: 620px; justify-self: stretch; }
  .feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root { --hud-height: 148px; --bottom-bar-height: 96px; }
  .world-mode .top-hud { grid-template-columns: 1fr auto; align-content: center; }
  .hud-identity { grid-column: 1; }
  .hud-account { grid-column: 2; grid-row: 1; }
  .hud-vitals { grid-column: 1 / -1; }
  .hud-resources { grid-column: 1 / -1; justify-content: flex-start; }
  #questTracker { width: min(320px, calc(100vw - 220px)); }
  .quick-hud { left: var(--hud-padding); right: var(--hud-padding); max-width: none; transform: none; }
  .quick-hud button { flex: 1 1 52px; }
  #hotkeyHints { display: none; }
  .chat-panel { width: min(360px, calc(100vw - 1.5rem)); }
}

@media (max-width: 620px) {
  .landing { padding: 1rem; }
  .landing .hero { gap: 1.25rem; margin-bottom: 1.5rem; }
  .hero-copy p { font-size: 1rem; }
  .hero-actions .btn { flex: 1 1 140px; }
  .feature-grid { grid-template-columns: 1fr; }
  :root { --hud-height: 166px; --bottom-bar-height: 142px; --hud-padding: 8px; }
  .world-mode .top-hud { top: .35rem; left: .35rem; right: .35rem; padding: .5rem; }
  .hud-logo { width: 82px; }
  .hud-player-copy span { display: none; }
  .hud-account .icon-btn { min-width: 58px; padding: .35rem; font-size: .72rem; }
  .hud-vitals { gap: .35rem; }
  .hud-vitals .hud-stat { min-width: 0; }
  .hud-resources { gap: .8rem; overflow-x: auto; }
  #questTracker { top: calc(var(--safe-top) + .3rem); width: calc(100vw - 216px); font-size: .8rem; }
  #miniMap { top: var(--safe-top); width: 190px; }
  .quick-hud { bottom: .35rem; flex-wrap: wrap; }
  .quick-hud button { height: 36px; flex-basis: 24%; }
  .chat-panel { bottom: var(--safe-bottom); max-height: 220px; }
  .world-mode .feed { bottom: calc(var(--safe-bottom) + 3.2rem); width: 210px; }
  #interactPrompt { bottom: calc(var(--safe-bottom) + 3.6rem); max-width: calc(100vw - 1rem); text-align: center; }
  #mobileControls { bottom: calc(var(--safe-bottom) + .5rem); }
  #dialogueBox { bottom: var(--safe-bottom); max-height: calc(100vh - var(--safe-top) - var(--safe-bottom)); overflow-y: auto; }
}

.economy-tabs,
.economy-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin-bottom: .8rem;
}
.economy-tabs button {
  min-height: 36px;
  padding: .4rem .7rem;
  color: var(--muted);
  background: rgba(255,255,255,.04);
  border: 1px solid var(--line);
}
.economy-tabs button.active { color: var(--gold); border-color: var(--gold); }
.profession-grid,
.recipe-grid,
.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: .7rem;
  margin-bottom: 1rem;
}
.recipe-card { display: grid; align-content: start; gap: .5rem; }
.recipe-card h3,
.recipe-card p { margin: 0; }
.recipe-card small { line-height: 1.6; color: var(--muted); }
.recipe-card small span { display: inline-block; }
.recipe-card .missing { color: var(--red); }
.rarity-label { color: var(--gold); font: 800 .68rem monospace; }
.economy-toolbar input { flex: 1 1 220px; }
.economy-inventory [hidden] { display: none; }
.market-grid .game-card { display: grid; gap: .45rem; }
.market-grid small { color: var(--muted); }

.enchant-layout { display: grid; grid-template-columns: minmax(210px,280px) minmax(0,1fr); gap: .75rem; }
.enchant-items,.enchant-workbench,.market-listing-form,.trade-window { padding: .75rem; border: 1px solid rgba(244,189,80,.3); background: rgba(7,13,16,.9); }
.enchant-items { display: grid; align-content: start; gap: .35rem; max-height: 66vh; overflow: auto; }
.enchant-item-choice { display: grid; grid-template-columns: 42px minmax(0,1fr); align-items: center; gap: .5rem; min-width: 0; padding: .4rem; border: 1px solid #485357; background: rgba(255,255,255,.025); color: var(--text); text-align: left; }
.enchant-item-choice.selected { border-color: var(--gold); background: rgba(244,189,80,.09); }
.enchant-item-choice .item-icon { width: 40px; height: 40px; }
.enchant-item-choice span,.market-preview span { min-width: 0; }
.enchant-item-choice b,.enchant-item-choice small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.enchant-item-choice small { color: var(--muted); font-size: .62rem; }
.enchant-selected { display: flex; align-items: center; gap: .75rem; padding: .7rem; border: 1px solid; background: rgba(0,0,0,.24); }
.enchant-selected .item-icon { flex: 0 0 64px; width: 64px; height: 64px; }
.enchant-selected h3,.enchant-selected p { margin: 0 0 .25rem; }
.enchant-selected p,.enchant-selected small { color: var(--muted); }
.enchant-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .55rem; margin-top: .7rem; }
.enchant-action-card { display: grid; align-content: start; gap: .4rem; min-width: 0; padding: .65rem; border: 1px solid #465052; background: rgba(255,255,255,.025); }
.enchant-action-card.ready { border-color: rgba(66,230,143,.45); }
.enchant-action-card.preferred { box-shadow: inset 0 0 0 2px rgba(244,189,80,.28); }
.enchant-action-card h3,.enchant-action-card p { margin: 0; }
.enchant-action-card p,.enchant-action-card small { color: var(--muted); font-size: .68rem; }
.enchant-reason { color: #ff9db4; font-size: .68rem; }
.enchant-action-card.ready .enchant-reason { color: var(--emerald); }

.market-layout { display: grid; grid-template-columns: minmax(240px,300px) minmax(0,1fr); gap: .75rem; }
.market-listing-form { align-self: start; display: grid; gap: .6rem; }
.market-preview { display: flex; align-items: center; gap: .55rem; padding: .5rem; border: 1px solid var(--line); }
.market-preview .item-icon { flex: 0 0 50px; width: 50px; height: 50px; }
.market-preview b,.market-preview small { display: block; }
.market-preview small,.market-fee-note { color: var(--muted); font-size: .68rem; }
.market-fields { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.market-fields label,.trade-controls label { display: grid; gap: .25rem; color: var(--muted); font-size: .68rem; }
.market-card { display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: .55rem; min-width: 0; padding: .55rem; border: 1px solid; background: rgba(7,13,16,.85); }
.market-card .item-icon { width: 46px; height: 46px; }
.market-card b,.market-card small { display: block; }
.market-card p { margin: .25rem 0 0; }
.market-history { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; margin-top: .85rem; }
.status-active { color: var(--emerald); }.status-sold { color: var(--gold); }.status-cancelled,.status-expired { color: var(--muted); }

.trade-window { max-width: 900px; margin: 0 auto; }
.trade-columns { display: grid; grid-template-columns: 1fr 1fr; gap: .65rem; }
.trade-offer { min-height: 150px; padding: .65rem; border: 1px solid #495255; background: rgba(0,0,0,.22); }
.trade-offer.confirmed { border-color: var(--emerald); box-shadow: inset 0 0 18px rgba(66,230,143,.08); }
.trade-offer header { display: flex; justify-content: space-between; gap: .5rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line); }
.trade-offer header span { color: var(--muted); font-size: .68rem; }
.trade-offer.confirmed header span { color: var(--emerald); }
.trade-offer article { margin-top: .4rem; padding: .4rem; background: rgba(255,255,255,.035); }
.trade-offer small { display: block; color: var(--muted); }
.trade-controls { display: grid; grid-template-columns: repeat(4,minmax(110px,1fr)) auto; align-items: end; gap: .45rem; margin-top: .7rem; }
.trade-warning { color: #ffcc67; font-size: .7rem; }
.trade-footer { display: flex; justify-content: flex-end; gap: .5rem; }

@media (max-width: 620px) {
  .profession-grid,.recipe-grid,.market-grid { grid-template-columns: 1fr; }
  .economy-tabs button { flex: 1 1 42%; }
}

@media (max-width: 900px) {
  .enchant-layout,.market-layout,.market-history { grid-template-columns: 1fr; }
  .enchant-items { max-height: 230px; }
  .enchant-actions { grid-template-columns: 1fr; }
  .trade-controls { grid-template-columns: 1fr 1fr; }
  .trade-controls .btn { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .trade-columns,.market-fields { grid-template-columns: 1fr; }
  .market-card { grid-template-columns: 44px minmax(0,1fr); }
  .market-card .btn { grid-column: 1 / -1; }
}

@media (max-width: 430px) {
  :root { --hud-height: 190px; }
  .world-mode .top-hud { grid-template-columns: minmax(0, 1fr) auto; }
  .hud-vitals { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .hud-resources { font-size: .72rem; }
  #questTracker { width: calc(100vw - 16px); top: calc(var(--safe-top) + .3rem); }
  #miniMap { display: none; }
  .chat-panel { right: var(--hud-padding); width: auto; }
}

/* MMO character and inventory */
.mmo-inventory {
  display: grid;
  grid-template-columns: minmax(500px, 1fr) minmax(240px, 300px);
  gap: .75rem;
  color: var(--text);
}
.inventory-identity {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: center;
  gap: .75rem;
  min-height: 68px;
  padding: .55rem .75rem;
  border: 1px solid rgba(244,189,80,.38);
  background: linear-gradient(90deg, rgba(23,43,31,.92), rgba(13,19,23,.94));
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.28);
}
.inventory-identity > div { position: relative; width: 56px; height: 56px; overflow: hidden; }
.inventory-identity .hero-sprite { position: absolute; left: 50%; top: 46%; transform: translate(-50%,-50%) scale(.48); }
.inventory-identity strong { display: block; color: var(--gold); font-size: 1.05rem; }
.inventory-identity small { display: block; color: var(--muted); font-size: .72rem; }
.inventory-identity > b { color: var(--gold); font: 900 1.35rem monospace; text-align: right; }
.inventory-identity .bar { height: 5px; margin-top: .35rem; }
.paper-doll {
  display: grid;
  grid-template-columns: 74px minmax(180px,1fr) 74px;
  gap: .55rem;
  min-height: 430px;
  padding: .65rem;
  border: 1px solid rgba(244,189,80,.32);
  background: radial-gradient(circle at 50% 45%, rgba(66,230,143,.13), transparent 38%), repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 2px, transparent 2px 6px), rgba(7,13,15,.9);
}
.paper-column { display: grid; align-content: center; gap: .38rem; }
.paper-slot {
  position: relative;
  width: 68px;
  height: 58px;
  padding: 2px;
  overflow: hidden;
  border: 2px solid #596168;
  border-radius: 3px;
  background: rgba(4,8,10,.85);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.035);
}
.paper-slot:hover,.paper-slot.selected { border-color: var(--gold); filter: brightness(1.16); }
.paper-slot small { position: absolute; left: 3px; right: 3px; bottom: 2px; z-index: 2; overflow: hidden; color: #aeb8b3; font: 700 .53rem monospace; text-transform: uppercase; white-space: nowrap; }
.paper-slot > span { color: #62716a; font: 900 .8rem monospace; }
.paper-slot > b { position: absolute; right: 3px; top: 2px; z-index: 3; color: #83f6ff; font: 800 .62rem monospace; }
.paper-slot .item-icon { width: 38px; height: 38px; border: 0; padding: 2px; }
.paper-slot .item-icon i { width: 28px; height: 28px; }
.paper-hero { position: relative; display: grid; place-items: center; min-width: 0; overflow: hidden; }
.paper-hero .hero-sprite { z-index: 2; transform: scale(1.3); }
.paper-hero > strong { position: absolute; bottom: 12px; z-index: 3; color: var(--gold); font: 800 .72rem monospace; }
.paper-aura { position: absolute; width: 190px; height: 260px; border: 1px solid rgba(66,230,143,.25); border-radius: 50%; box-shadow: inset 0 0 45px rgba(66,230,143,.08), 0 0 28px rgba(66,230,143,.08); }
.character-stats,.item-inspect {
  min-width: 0;
  padding: .75rem;
  border: 1px solid rgba(244,189,80,.28);
  background: rgba(8,13,16,.92);
}
.character-stats h3,.item-inspect h3 { margin: 0 0 .55rem; color: var(--gold); font-size: .88rem; }
.character-stats > div { display: flex; justify-content: space-between; gap: .65rem; padding: .3rem .15rem; border-bottom: 1px solid rgba(255,255,255,.055); font-size: .75rem; }
.character-stats span { color: var(--muted); }
.character-stats b { color: #e8f1ec; font-family: monospace; }
.character-stats .power-total { margin-top: .45rem; padding: .55rem; border: 1px solid rgba(244,189,80,.34); color: var(--gold); }
.inventory-bag { min-width: 0; padding: .7rem; border: 1px solid rgba(66,230,143,.2); background: rgba(8,13,16,.92); }
.bag-heading { display: flex; align-items: end; justify-content: space-between; gap: .7rem; margin-bottom: .55rem; }
.bag-heading h2 { margin: 0; color: var(--gold); font-size: .95rem; }
.bag-heading small { color: var(--muted); }
.bag-meter { width: 110px; height: 5px; background: #111b17; }
.bag-meter i { display: block; height: 100%; background: var(--emerald); }
.inventory-controls { display: grid; grid-template-columns: minmax(150px,1fr) 130px 120px; gap: .4rem; margin-bottom: .5rem; }
.inventory-tabs { display: flex; gap: .3rem; overflow-x: auto; padding-bottom: .4rem; }
.inventory-tabs button { flex: 0 0 auto; min-height: 30px; padding: .3rem .5rem; border: 1px solid var(--line); background: rgba(255,255,255,.035); color: var(--muted); font-size: .66rem; }
.inventory-tabs button.active { color: var(--gold); border-color: rgba(244,189,80,.6); }
.bag-grid { display: grid; grid-template-columns: repeat(8, minmax(46px,1fr)); gap: .35rem; }
.bag-slot { position: relative; aspect-ratio: 1; min-width: 0; padding: 3px; border: 2px solid #4e565a; border-radius: 3px; background: rgba(3,7,9,.9); overflow: hidden; }
.bag-slot:hover,.bag-slot.selected { border-color: var(--gold); filter: brightness(1.15); }
.bag-slot.empty { opacity: .42; border-color: #30393b; background: repeating-linear-gradient(135deg,rgba(255,255,255,.025) 0 3px,transparent 3px 7px); }
.bag-slot.locked { filter: saturate(.55); }
.bag-slot .item-icon { width: 100%; height: 100%; border: 0; padding: 5px; }
.bag-slot .item-icon i { width: 100%; height: 100%; }
.bag-slot > b,.bag-slot > small,.bag-slot > em,.slot-lock { position: absolute; z-index: 3; padding: 1px 2px; background: rgba(0,0,0,.78); font: 800 .58rem monospace; }
.bag-slot > b { right: 2px; bottom: 2px; color: white; }
.bag-slot > small { left: 2px; bottom: 2px; color: #b9c8c0; }
.bag-slot > em { right: 2px; top: 2px; color: #83f6ff; font-style: normal; }
.slot-lock { left: 2px; top: 2px; color: #ffcc67; }
.item-inspect { align-self: stretch; overflow-wrap: anywhere; }
.inspect-name { display: flex; align-items: center; gap: .55rem; padding-bottom: .55rem; border-bottom: 1px solid var(--line); }
.inspect-name .item-icon { flex: 0 0 54px; width: 54px; height: 54px; }
.inspect-name h3 { margin: 0; }
.inspect-name small { color: var(--muted); font-size: .68rem; }
.item-inspect dl { display: grid; grid-template-columns: 1fr auto; gap: .25rem .65rem; font-size: .72rem; }
.item-inspect dt { color: var(--muted); }
.item-inspect dd { margin: 0; color: #e8f1ec; font-family: monospace; }
.item-inspect > p,.item-inspect > small { display: block; color: var(--muted); font-size: .7rem; line-height: 1.45; }
.item-lock { margin: .5rem 0; padding: .35rem; border: 1px solid rgba(244,189,80,.4); color: #ffcc67; font: 700 .67rem monospace; }
.item-compare { display: grid; gap: .2rem; margin: .55rem 0; padding: .5rem; border: 1px solid rgba(255,255,255,.08); background: rgba(0,0,0,.2); font-size: .68rem; }
.item-compare strong { color: var(--gold); }
.item-compare .positive { color: #65efa4; }
.item-compare .negative { color: #ff7898; }
.inspect-actions { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .65rem; }
.inspect-actions .btn { flex: 1 1 42%; min-height: 34px; padding: .35rem; font-size: .68rem; }
.inspect-actions .sell-item { border-color: rgba(244,189,80,.7); color: var(--gold); }
.inspect-actions .sell-item::before {
  content: "S";
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  margin-right: 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font: 800 .6rem monospace;
}
.rarity-common { border-color: #778086; }.rarity-uncommon { border-color: #42e68f; }.rarity-rare { border-color: #57a5ff; }.rarity-epic { border-color: #9c65ff; }.rarity-legendary { border-color: #f4a340; }.rarity-mythic { border-color: #ff5c8a; box-shadow: 0 0 10px rgba(255,92,138,.18); }
@media (max-width: 900px) {
  .mmo-inventory { grid-template-columns: 1fr; }
  .inventory-identity,.paper-doll,.character-stats,.inventory-bag,.item-inspect { grid-column: 1; }
  .paper-doll { min-height: 380px; }
  .character-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 0 .8rem; }
  .character-stats h3,.character-stats .power-total { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .world-mode.panel-open .content-panel { width: calc(100vw - .7rem); padding: .55rem; }
  .inventory-identity { grid-template-columns: 46px minmax(0,1fr) auto; }
  .inventory-identity > div { width: 44px; height: 48px; }
  .paper-doll { grid-template-columns: 58px minmax(110px,1fr) 58px; min-height: 350px; padding: .4rem; }
  .paper-slot { width: 54px; height: 50px; }
  .paper-hero .hero-sprite { transform: scale(.92); }
  .inventory-controls { grid-template-columns: 1fr 1fr; }
  #inventorySearch { grid-column: 1 / -1; }
  .bag-grid { grid-template-columns: repeat(5,minmax(44px,1fr)); }
}

#skillHotbar {
  position: fixed;
  z-index: 7;
  left: 50%;
  bottom: 4.25rem;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, minmax(96px, 132px));
  gap: .4rem;
  padding: .4rem;
  background: var(--panel-bg);
}
#skillHotbar button {
  position: relative;
  height: 58px;
  min-width: 0;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 0 .35rem;
  overflow: hidden;
  color: var(--text);
  background: #15251d;
  border: 2px solid rgba(66,230,143,.3);
  text-align: left;
}
#skillHotbar kbd { grid-row: 1 / 3; color: var(--gold); font: 900 1rem monospace; }
#skillHotbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 800 .72rem monospace; }
#skillHotbar small { color: var(--muted); font-size: .58rem; }
#skillHotbar i {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: white;
  background: rgba(5,8,7,.78);
  font: 900 1rem monospace;
  pointer-events: none;
}
#skillHotbar i:empty { display: none; }
#skillHotbar button.locked { filter: grayscale(1); opacity: .58; }
#skillHotbar button.low-stamina { border-color: rgba(255,92,138,.6); }
#hotkeyHints { bottom: 9.25rem; }
#interactPrompt { bottom: 11.85rem; }
.chat-panel { bottom: 9.25rem; }

#targetFrame {
  position: fixed;
  z-index: 7;
  top: var(--safe-top);
  left: 50%;
  width: min(330px, calc(100vw - 2rem));
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: .15rem .7rem;
  padding: .55rem .7rem;
  background: rgba(9,17,15,.94);
  border-color: rgba(255,92,138,.48);
}
#targetFrame.hidden { display: none; }
#targetFrame > small { color: #ff789d; font: 800 .62rem monospace; }
#targetFrame > strong { grid-column: 1; font: 900 .85rem monospace; }
#targetFrame > span { grid-column: 2; grid-row: 1 / 3; align-self: center; color: var(--muted); font-size: .68rem; }
#targetFrame .bar { grid-column: 1 / -1; height: 8px; }
#targetFrame .bar i { background: linear-gradient(90deg,#e9416d,#ff8a6a); }
#targetFrame > b { grid-column: 1 / -1; color: #f2ddd8; text-align: right; font: 700 .62rem monospace; }
#targetDebuffs { grid-column: 1 / -1; display: flex; gap: .25rem; }
#targetDebuffs button { min-width: 52px; height: 25px; padding: .15rem .3rem; display: flex; align-items: center; justify-content: center; gap: .25rem; border: 1px solid #a776ff; background: #24152f; color: #d8c5ff; font-size: .58rem; }

#buffBar {
  position: fixed;
  z-index: 7;
  left: 50%;
  bottom: 8.35rem;
  transform: translateX(-50%);
  display: flex;
  gap: .35rem;
}
#buffBar button { width: 42px; height: 42px; padding: 0; display: grid; place-items: center; border: 2px solid var(--emerald); background: #10281c; }
#buffBar button.debuff { border-color: #a776ff; background: #24152f; }
#buffBar b { font: 900 .9rem monospace; }
#buffBar span { font-size: .52rem; color: var(--muted); }
#buffBar button em,
#targetDebuffs button em { position: absolute; right: 3px; top: 1px; font: 900 .55rem monospace; color: #fff; }
#buffBar button,
#targetDebuffs button { position: relative; }
.effect-poison { border-color: #54f58a !important; background: #0d2a18 !important; color: #b8ffd1 !important; }
.effect-bleed { border-color: #ff5d7a !important; background: #2c1017 !important; color: #ffc5d0 !important; }
.effect-burn { border-color: #ff9a38 !important; background: #2c1808 !important; color: #ffe0b8 !important; }
.effect-defensive { border-color: #83d7ff !important; background: #0c1f2c !important; color: #d7f3ff !important; }
.effect-nature { border-color: #67f6a0 !important; background: #0c2718 !important; color: #d6ffe4 !important; }
.effect-shadow { border-color: #b68cff !important; background: #1a1030 !important; color: #eadfff !important; }
.effect-frost { border-color: #9ce7ff !important; background: #0b2530 !important; color: #e1f9ff !important; }

.skill-tree-shell { height: 100%; min-width: 0; display: grid; grid-template-rows: auto minmax(0,1fr) 142px; gap: .65rem; overflow: hidden; }
.skill-tree-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .15rem .35rem .65rem; border-bottom: 1px solid rgba(244,189,80,.3); }
.skill-tree-head h2 { margin: .15rem 0; color: var(--gold); }
.skill-tree-head p { margin: 0; color: var(--muted); }
.skill-tree-shell { --talent-a: var(--emerald); --talent-b: var(--gold); --talent-c: #83f6ff; }
.skill-tree-shell.theme-nightblade { --talent-a: #a46cff; --talent-b: #f4bd50; --talent-c: #ff5c8a; }
.skill-tree-shell.theme-venomfang { --talent-a: #86ef4f; --talent-b: #a46cff; --talent-c: #42e68f; }
.skill-tree-shell.theme-lifebloom-sage { --talent-a: #42e68f; --talent-b: #ffe28a; --talent-c: #9dffbd; }
.skill-tree-shell.theme-thorncaller { --talent-a: #42e68f; --talent-b: #ff5c8a; --talent-c: #83f6ff; }
.skill-tree-shell.theme-ironwarden { --talent-a: #9aa4a8; --talent-b: #c89454; --talent-c: #83f6ff; }
.skill-tree-shell.theme-dawnbreaker { --talent-a: #ffb347; --talent-b: #ffe28a; --talent-c: #ff7a32; }
.skill-tree-actions { display: flex; align-items: center; gap: .65rem; }
.talent-zoom { display: flex; align-items: center; border: 1px solid rgba(244,189,80,.32); background: rgba(5,12,11,.75); }
.talent-zoom button { min-width: 42px; height: 42px; padding: 0 .55rem; border: 0; border-right: 1px solid rgba(244,189,80,.22); background: transparent; color: var(--text); font-weight: 900; }
.talent-zoom button:last-child { border-right: 0; }
.skill-point-orb { width: 74px; aspect-ratio: 1; display: grid; place-items: center; border: 3px solid var(--gold); background: #14261c; box-shadow: 0 0 24px rgba(244,189,80,.22); color: var(--gold); font: 900 1.5rem monospace; }
.skill-point-orb span { display: block; margin-top: -1.1rem; color: var(--muted); font-size: .55rem; }
.specialization-picker { display: grid; gap: .35rem; max-height: 118px; overflow: hidden; }
.specialization-picker h3 { margin: 0; color: var(--gold); font-size: .78rem; text-transform: uppercase; }
.specialization-picker > div { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .55rem; }
.specialization-picker.compact > div { grid-template-columns: repeat(2,minmax(220px,340px)); }
.spec-card { min-height: 62px; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: .2rem .55rem; align-items: center; padding: .48rem .6rem; border: 1px solid rgba(131,246,255,.2); background: rgba(8,20,17,.72); }
.spec-card.selected { border-color: var(--gold); box-shadow: inset 4px 0 var(--gold); }
.spec-card p { grid-column: 1; margin: 0; color: var(--muted); font-size: .76rem; }
.spec-card button { grid-row: 1 / 3; grid-column: 2; padding: .5rem .75rem; }
.talent-main { min-height: 0; display: grid; grid-template-columns: 260px minmax(0,1fr) 340px; gap: .75rem; overflow: hidden; }
.talent-left-sidebar,.talent-right-panel { min-height: 0; overflow: auto; border: 1px solid rgba(244,189,80,.24); background: linear-gradient(180deg,rgba(9,18,18,.94),rgba(5,9,13,.94)); box-shadow: inset 0 0 32px rgba(0,0,0,.34); }
.talent-left-sidebar { display: grid; align-content: start; gap: .65rem; padding: .8rem; }
.class-emblem { width: 86px; height: 86px; display: grid; place-items: center; justify-self: center; border: 2px solid var(--talent-b); background: radial-gradient(circle,var(--talent-a),#070d0c 72%); box-shadow: 0 0 28px color-mix(in srgb, var(--talent-b) 35%, transparent); clip-path: polygon(50% 0, 92% 24%, 92% 76%, 50% 100%, 8% 76%, 8% 24%); }
.class-emblem span { color: var(--talent-b); font: 900 2rem monospace; text-shadow: 0 0 16px currentColor; }
.talent-left-sidebar h3,.talent-left-sidebar p { margin: 0; }
.talent-left-sidebar h3 { color: var(--gold); text-align: center; }
.talent-left-sidebar small,.talent-left-sidebar p { color: var(--muted); }
.talent-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.talent-stat-grid span { padding: .45rem; border: 1px solid rgba(131,246,255,.18); background: rgba(0,0,0,.22); color: var(--muted); text-align: center; font-size: .68rem; }
.talent-stat-grid b { display: block; color: var(--gold); font-size: 1rem; }
.spec-switcher { display: grid; gap: .45rem; }
.spec-switcher button { display: grid; gap: .15rem; padding: .55rem; text-align: left; border: 1px solid rgba(131,246,255,.2); background: rgba(7,16,15,.75); color: var(--text); }
.spec-switcher button.selected { border-color: var(--gold); box-shadow: inset 4px 0 var(--gold); }
.spec-switcher small { font-size: .62rem; }
.talent-tree-stage { min-width: 0; min-height: 0; overflow: hidden; }
.talent-canvas-scroll { min-width: 0; min-height: 0; overflow: auto; border: 1px solid rgba(244,189,80,.28); background: rgba(4,10,10,.74); scrollbar-width: thin; scrollbar-color: rgba(244,189,80,.7) rgba(9,16,15,.8); }
.talent-board-scale { position: relative; }
.talent-board { position: relative; min-width: 1220px; min-height: 780px; overflow: hidden; transform-origin: top left; background: radial-gradient(circle at 25% 18%,rgba(66,230,143,.13),transparent 28%),radial-gradient(circle at 70% 36%,rgba(164,108,255,.1),transparent 30%),linear-gradient(180deg,rgba(7,18,16,.96),rgba(9,13,20,.96)); box-shadow: inset 0 0 36px rgba(0,0,0,.5); }
.talent-tree-mist { position: absolute; inset: 0; background-image: radial-gradient(circle, rgba(131,246,255,.18) 0 1px, transparent 2px), radial-gradient(circle, rgba(244,189,80,.14) 0 1px, transparent 2px); background-size: 110px 92px, 170px 140px; opacity: .34; }
.talent-section-band { position: absolute; top: 64px; bottom: 46px; border: 1px solid rgba(244,189,80,.14); background: linear-gradient(180deg,rgba(66,230,143,.04),rgba(0,0,0,.08)); }
.talent-section-band.core { left: 42px; width: 520px; }
.talent-section-band.spec { left: 626px; width: 540px; }
.talent-section-label { position: absolute; top: 14px; z-index: 2; padding: .35rem .6rem; color: var(--gold); background: rgba(3,10,9,.86); border: 1px solid rgba(244,189,80,.35); font-size: .82rem; font-weight: 900; }
.talent-section-label.core { left: 28px; }
.talent-section-label.spec { left: 666px; }
.talent-connectors { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.talent-connectors path { fill: none; stroke-width: 7; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(0,0,0,.85)); }
.talent-connectors path.locked { stroke: rgba(78,91,87,.34); stroke-dasharray: 12 10; }
.talent-connectors path.available { stroke: var(--talent-b); filter: drop-shadow(0 0 8px color-mix(in srgb, var(--talent-b) 35%, transparent)); }
.talent-connectors path.active { stroke: var(--talent-a); filter: drop-shadow(0 0 11px color-mix(in srgb, var(--talent-a) 55%, transparent)); }
.talent-node { position: absolute; z-index: 3; width: 132px; min-height: 96px; display: grid; justify-items: center; align-content: start; gap: 5px; padding: .28rem; border: 0; background: transparent; color: #dfeee7; text-align: center; cursor: pointer; transition: filter .12s ease, transform .12s ease; }
.talent-node:hover { transform: translateY(-2px); filter: brightness(1.16); }
.talent-node span { width: 68px; height: 68px; display: grid; place-items: center; border: 2px solid #61736e; background: radial-gradient(circle at 35% 28%,#294d3b,#0c1514 70%); color: var(--gold); font: 900 1.25rem monospace; box-shadow: inset 0 0 18px rgba(255,255,255,.04), 0 10px 24px rgba(0,0,0,.38); border-radius: 50%; }
.talent-node.active_unlock span { width: 82px; height: 82px; border-color: rgba(131,246,255,.62); clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); border-radius: 0; }
.talent-node.active_upgrade span { clip-path: polygon(50% 4%, 96% 78%, 50% 100%, 4% 78%); border-radius: 0; }
.talent-node.keystone span { width: 112px; height: 112px; border-width: 3px; border-color: var(--gold); clip-path: polygon(50% 0, 90% 18%, 100% 58%, 72% 100%, 28% 100%, 0 58%, 10% 18%); border-radius: 0; box-shadow: 0 0 30px rgba(244,189,80,.42), inset 0 0 24px rgba(244,189,80,.12); }
.talent-node b { max-width: 126px; padding: .12rem .25rem; color: #edf7ed; background: rgba(4,10,10,.78); border: 1px solid rgba(255,255,255,.08); font-size: .66rem; line-height: 1.08; }
.talent-node small { color: var(--gold); font: 900 .72rem monospace; }
.talent-node.locked { opacity: .62; filter: grayscale(.9); }
.talent-node.available { box-shadow: none; }
.talent-node.available span { border-color: var(--talent-b); box-shadow: 0 0 24px color-mix(in srgb, var(--talent-b) 34%, transparent), inset 0 0 16px rgba(244,189,80,.08); }
.talent-node.ranked span { border-color: var(--talent-a); box-shadow: 0 0 24px color-mix(in srgb, var(--talent-a) 35%, transparent), inset 0 0 16px rgba(66,230,143,.08); }
.talent-node.maxed span { border-color: #ffe28a; box-shadow: 0 0 34px rgba(255,226,138,.42), inset 0 0 20px rgba(66,230,143,.12); }
.talent-node.selected span { border-color: #83f6ff; box-shadow: 0 0 0 3px rgba(131,246,255,.2), 0 0 34px rgba(131,246,255,.35); }
.talent-details { min-height: 0; max-height: 100%; display: grid; grid-template-rows: auto auto auto auto auto auto minmax(0,1fr) auto; gap: .6rem; padding: 1rem; background: transparent; overflow: auto; }
.talent-detail-orb { width: 76px; height: 76px; display: grid; place-items: center; justify-self: center; border: 2px solid var(--gold); background: radial-gradient(circle,#243a2f,#07100f 70%); box-shadow: 0 0 28px rgba(244,189,80,.22); border-radius: 50%; }
.talent-detail-orb span { color: var(--gold); font: 900 1.5rem monospace; }
.talent-status { justify-self: start; padding: .25rem .5rem; border: 1px solid rgba(244,189,80,.35); color: var(--gold); background: rgba(244,189,80,.08); font-size: .68rem; text-transform: uppercase; }
.talent-details h3 { margin: 0; color: var(--gold); }
.talent-details p { margin: 0; color: #dce9e4; }
.talent-details dl { display: grid; gap: .28rem; margin: 0; min-height: 0; }
.talent-details dt { color: var(--muted); font-size: .64rem; text-transform: uppercase; }
.talent-details dd { margin: 0 0 .25rem; font-size: .82rem; }
.talent-rank-meter { height: 8px; background: #07100d; border: 1px solid rgba(131,246,255,.2); }
.talent-rank-meter i { display: block; height: 100%; background: linear-gradient(90deg,var(--emerald),var(--gold)); }
.ability-loadout { min-height: 0; display: grid; grid-template-columns: 430px minmax(0,1fr); gap: .65rem; padding: .55rem; border: 1px solid rgba(244,189,80,.22); background: linear-gradient(180deg,rgba(5,12,12,.88),rgba(4,7,10,.9)); overflow: hidden; }
.ability-loadout > header { grid-column: 1; display: flex; justify-content: space-between; align-items: center; }
.ability-loadout h3,.ability-loadout p { margin: .1rem 0; }
.loadout-slots { grid-column: 1; display: grid; grid-template-columns: repeat(5,76px); gap: .45rem; align-self: start; }
.loadout-slot { position: relative; min-height: 76px; display: grid; grid-template-columns: 1fr; justify-items: center; align-content: center; gap: .1rem; padding: .35rem; border: 1px solid rgba(131,246,255,.22); background: radial-gradient(circle at 50% 18%,rgba(66,230,143,.12),#08110f 70%); }
.loadout-slot.filled { border-color: rgba(66,230,143,.65); box-shadow: 0 0 18px rgba(66,230,143,.12); }
.loadout-slot kbd { grid-row: 1 / 3; color: var(--gold); font: 900 1.1rem monospace; }
.loadout-slot strong { max-width: 64px; font-size: .58rem; line-height: 1.05; text-align: center; }
.loadout-slot small { color: var(--muted); font-size: .5rem; }
.unequip-ability { position: absolute; top: 3px; right: 3px; width: 20px; height: 20px; padding: 0; opacity: 0; }
.loadout-slot:hover .unequip-ability { opacity: 1; }
.ability-library { grid-column: 2; grid-row: 1 / span 2; min-height: 0; display: flex; gap: .55rem; overflow-x: auto; overflow-y: hidden; padding: .1rem .2rem .35rem; }
.ability-library > article { flex: 0 0 300px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; gap: .45rem; align-items: center; padding: .5rem; border: 1px solid rgba(131,246,255,.18); background: rgba(8,20,17,.7); }
.ability-library p { margin: .2rem 0; color: var(--muted); font-size: .7rem; }
.ability-library small { color: var(--gold); font-size: .58rem; }
.ability-library > article > div:last-child { display: grid; grid-template-columns: repeat(5,25px); gap: 2px; }
.assign-ability { width: 26px; height: 26px; padding: 0; font: 800 .7rem monospace; }
.ability-glyph { width: 38px; height: 38px; display: grid; place-items: center; border: 2px solid var(--emerald); background: radial-gradient(circle,#274e38,#101b17 70%); color: var(--gold); font: 900 1rem monospace; }
.item-class-meta { display: grid; gap: .2rem; margin: .55rem 0; padding: .5rem; border: 1px solid rgba(244,189,80,.3); background: rgba(244,189,80,.05); font-size: .7rem; }
.item-class-meta b { color: var(--gold); }
.item-class-meta span { color: #b9d8c7; }

@media (max-width: 1350px) {
  .world-mode.skill-tree-open .content-panel { width: calc(100vw - .7rem); height: calc(100vh - .7rem); max-height: calc(100vh - .7rem); padding: .55rem; }
  .skill-tree-shell { grid-template-rows: auto minmax(0,1fr) 126px; gap: .45rem; }
  .skill-tree-head { padding-bottom: .45rem; }
  .skill-tree-head h2 { font-size: 1.25rem; }
  .skill-tree-actions { gap: .4rem; }
  .talent-zoom button { min-width: 34px; height: 36px; padding: 0 .42rem; }
  .skill-point-orb { width: 58px; font-size: 1.15rem; }
  .talent-main { grid-template-columns: 220px minmax(0,1fr) 300px; gap: .55rem; }
  .talent-left-sidebar { gap: .45rem; padding: .6rem; }
  .class-emblem { width: 66px; height: 66px; }
  .class-emblem span { font-size: 1.5rem; }
  .talent-stat-grid span { padding: .32rem; }
  .spec-switcher button { padding: .42rem; }
  .talent-details { padding: .75rem; gap: .42rem; }
  .talent-detail-orb { width: 58px; height: 58px; }
  .ability-loadout { grid-template-columns: 386px minmax(0,1fr); padding: .42rem; }
  .loadout-slots { grid-template-columns: repeat(5,68px); gap: .35rem; }
  .loadout-slot { min-height: 66px; }
  .ability-library > article { flex-basis: 260px; }
}

@media (max-height: 760px) and (min-width: 900px) {
  .world-mode.skill-tree-open .content-panel { top: .25rem; height: calc(100vh - .5rem); max-height: calc(100vh - .5rem); }
  .skill-tree-shell { grid-template-rows: auto minmax(0,1fr) 112px; gap: .35rem; }
  .skill-tree-head h2 { margin: 0; }
  .skill-tree-head p { font-size: .82rem; }
  .talent-left-sidebar p { display: none; }
  .talent-stat-grid { grid-template-columns: repeat(4,1fr); }
  .talent-stat-grid span { font-size: .58rem; padding: .25rem; }
  .spec-switcher small { display: none; }
  .ability-loadout h3,.ability-loadout p { display: none; }
  .loadout-slot { min-height: 58px; }
  .ability-library > article { padding: .35rem; }
  .ability-library p { display: none; }
}

@media (max-width: 1100px) {
  #skillHotbar { grid-template-columns: repeat(5,minmax(74px,1fr)); width: min(620px,calc(100vw - 1rem)); }
  #skillHotbar small { display: none; }
  .talent-main { grid-template-columns: minmax(0,1fr); grid-template-rows: auto minmax(460px,1fr) auto; overflow: auto; }
  .talent-left-sidebar { grid-template-columns: 80px minmax(0,1fr) minmax(220px,300px); align-items: center; }
  .talent-left-sidebar .class-emblem { grid-row: 1 / 4; }
  .talent-left-sidebar .talent-stat-grid { grid-column: 2; grid-template-columns: repeat(4,1fr); }
  .talent-left-sidebar .spec-switcher { grid-column: 3; grid-row: 1 / 4; }
  .talent-right-panel { grid-column: 1; max-height: 280px; }
  .talent-canvas-scroll { min-height: 480px; }
  .talent-details { position: static; }
  .ability-loadout { grid-template-columns: 1fr; overflow: auto; }
  .ability-library { grid-column: 1; grid-row: auto; max-height: 260px; }
  .ability-library { grid-template-columns: 1fr; }
}

@media (max-width: 650px) {
  #skillHotbar { bottom: 9.2rem; grid-template-columns: repeat(5,minmax(54px,1fr)); }
  #skillHotbar button { height: 48px; grid-template-columns: 16px minmax(0,1fr); padding: .3rem; }
  #skillHotbar span { font-size: .58rem; }
  #buffBar { bottom: 12.7rem; }
  #targetFrame { top: calc(var(--safe-top) + 4px); }
  .skill-tree-head { align-items: start; flex-direction: column; }
  .skill-tree-actions { width: 100%; justify-content: space-between; }
  .skill-tree-shell { grid-template-rows: auto minmax(0,1fr) 170px; }
  .talent-main { grid-template-columns: 1fr; grid-template-rows: auto minmax(420px,1fr) auto; overflow: auto; }
  .talent-left-sidebar { max-height: 220px; }
  .talent-right-panel { grid-column: 1; max-height: 320px; }
  .specialization-picker > div,.loadout-slots { grid-template-columns: 1fr; }
  .specialization-picker { max-height: 180px; overflow: auto; }
  .talent-board { min-width: 820px; transform-origin: top left; }
  .talent-node { width: 118px; min-height: 86px; }
  .talent-node.keystone span { width: 96px; height: 96px; }
  .ability-loadout { grid-template-columns: 1fr; }
  .loadout-slots { display: flex; overflow-x: auto; }
  .loadout-slot { flex: 0 0 78px; }
  .ability-library > article { grid-template-columns: 40px minmax(0,1fr); }
  .ability-library > article > div:last-child { grid-column: 1 / -1; }
}
#dungeonTracker {
  position: fixed;
  z-index: 6;
  left: var(--hud-padding);
  top: calc(var(--safe-top) + 104px);
  width: min(390px, calc(100vw - 1.5rem));
  padding: .7rem;
  background: var(--panel-bg);
}
#dungeonTracker p { margin: .3rem 0 0; color: var(--muted); font-size: .78rem; }
.dungeon-tracker-actions { margin-top: .45rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
#dungeonPartyStatus { color: #83f6ff; font-size: .66rem; }
#dungeonAbandon { padding: .25rem .45rem; color: #ffb2c6; background: rgba(255,92,138,.08); border: 1px solid rgba(255,92,138,.3); font-size: .68rem; }
#bossHud {
  position: fixed;
  z-index: 7;
  top: calc(var(--safe-top) + .25rem);
  left: 50%;
  transform: translateX(-50%);
  width: min(520px, calc(100vw - 420px));
  padding: .55rem .75rem;
  text-align: center;
  background: var(--panel-bg);
}
#bossHud .bar { margin-top: .35rem; }
#bossWarning { display: block; min-height: 1em; margin-top: .25rem; color: #ff9a58; font: 800 .7rem monospace; }
.boss-frame {
  border-color: rgba(244,189,80,.45);
  box-shadow: 0 18px 55px rgba(0,0,0,.42), inset 0 0 28px rgba(244,189,80,.04);
}
.boss-frame-top,
.boss-meta,
.boss-cast > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
}
.boss-frame-top span {
  color: #ffb25f;
  font: 900 .62rem monospace;
  text-transform: uppercase;
}
.boss-frame-top small,
.boss-meta {
  color: var(--muted);
  font: 800 .66rem monospace;
}
.boss-frame #bossName {
  display: block;
  margin: .15rem 0;
  color: #f8e7b0;
  font-size: clamp(.92rem, 1.4vw, 1.18rem);
}
.boss-hp {
  height: 10px;
  background: rgba(64,12,22,.9);
}
.boss-hp i {
  background: linear-gradient(90deg, #ff315d, #ff9a58, #f4bd50);
  box-shadow: 0 0 16px rgba(255,92,138,.45);
}
.boss-cast {
  margin-top: .45rem;
  padding: .35rem .45rem;
  border: 1px solid rgba(244,189,80,.22);
  background: rgba(4,8,9,.64);
}
.boss-cast.nearly-ready {
  animation: bossCastPulse .22s alternate infinite;
}
.boss-cast-bar {
  height: 8px;
  margin-top: .25rem !important;
}
.boss-cast-bar i { width: 0; background: #f4bd50; }
.boss-cast.school-burn .boss-cast-bar i { background: linear-gradient(90deg,#ff315d,#ff7a32); }
.boss-cast.school-nature .boss-cast-bar i { background: linear-gradient(90deg,#24d070,#b7d95a); }
.boss-cast.school-aether .boss-cast-bar i { background: linear-gradient(90deg,#83f6ff,#b68cff); }
.boss-cast.school-shadow .boss-cast-bar i { background: linear-gradient(90deg,#7f58ff,#ff5c8a); }
.boss-cast.school-frost .boss-cast-bar i { background: linear-gradient(90deg,#8fe9ff,#57a5ff); }
.boss-effects { display: flex; justify-content: center; gap: .25rem; min-height: 16px; margin-top: .25rem; }
.boss-effects span { display: grid; place-items: center; width: 16px; height: 16px; border: 1px solid rgba(255,255,255,.16); color: #ffd45a; background: rgba(0,0,0,.4); font: 900 10px monospace; }
@keyframes bossCastPulse { from { filter: brightness(1); } to { filter: brightness(1.5); } }
#bossPhaseBanner {
  position: fixed;
  z-index: 45;
  left: 50%;
  top: 34%;
  transform: translate(-50%, -50%) scale(.94);
  min-width: min(560px, calc(100vw - 2rem));
  padding: 1rem 1.5rem;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  border: 1px solid rgba(244,189,80,.5);
  background: linear-gradient(90deg, rgba(4,8,9,.06), rgba(8,14,18,.96), rgba(4,8,9,.06));
  box-shadow: 0 0 50px rgba(244,189,80,.16);
  transition: opacity .25s ease, transform .25s ease;
}
#bossPhaseBanner.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#bossPhaseBanner small { display: block; color: #ffb25f; font: 900 .75rem monospace; text-transform: uppercase; }
#bossPhaseBanner strong { color: #f8e7b0; font-size: clamp(1.35rem, 3vw, 2.6rem); text-shadow: 0 0 18px rgba(244,189,80,.35); }
#dungeonRewards {
  position: fixed;
  z-index: 30;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 1.5rem));
  padding: 1rem;
  text-align: center;
  background: var(--panel-bg);
}
#dungeonTracker p {
  display: grid;
  gap: .28rem;
}
#dungeonTracker p span {
  display: flex;
  justify-content: space-between;
  gap: .45rem;
  padding: .2rem .3rem;
  border-left: 2px solid transparent;
}
#dungeonTracker p .done { color: #67f6a0; border-color: rgba(103,246,160,.65); }
#dungeonTracker p .active { color: #f8e7b0; border-color: rgba(244,189,80,.7); background: rgba(244,189,80,.05); }
#dungeonTracker p .locked { color: rgba(213,224,211,.45); }
#dungeonTracker p .boss-step { color: #ffb2c6; }
#dungeonTracker p .chest-step { color: #ffd45a; }
#dungeonVictory {
  position: fixed;
  z-index: 38;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: radial-gradient(circle at center, rgba(244,189,80,.12), rgba(1,5,5,.78) 62%);
  backdrop-filter: blur(2px);
}
.dungeon-victory-card {
  width: min(640px, calc(100vw - 1.5rem));
  padding: 1.2rem;
  text-align: center;
  border-color: rgba(244,189,80,.62);
  background: rgba(7,14,14,.96);
  box-shadow: 0 24px 100px rgba(0,0,0,.7), 0 0 70px rgba(244,189,80,.1);
}
.dungeon-victory-card > small { color: #ffb25f; font: 900 .75rem monospace; text-transform: uppercase; }
.dungeon-victory-card h2 { margin: .25rem 0; color: #f8e7b0; font-size: clamp(1.5rem, 4vw, 2.6rem); }
.dungeon-victory-card p { color: var(--muted); }
.victory-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
  margin: 1rem 0;
}
.victory-stats span {
  padding: .7rem;
  border: 1px solid rgba(244,189,80,.25);
  background: rgba(0,0,0,.22);
}
.victory-stats b { display: block; color: #ffd45a; font-size: 1.25rem; }
.victory-stats small { color: var(--muted); }
.victory-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; }
.reward-reveal {
  width: min(560px, calc(100vw - 1.5rem)) !important;
  border-color: rgba(244,189,80,.56);
  box-shadow: 0 24px 90px rgba(0,0,0,.68);
}
.chest-burst {
  width: 82px;
  height: 58px;
  margin: .3rem auto .85rem;
  border: 3px solid rgba(244,189,80,.7);
  background: linear-gradient(180deg, #3a1a10, #13080a);
  box-shadow: 0 0 38px rgba(244,189,80,.28);
  animation: rewardBurst 1.15s ease infinite alternate;
}
@keyframes rewardBurst { from { transform: scale(.96); filter: brightness(1); } to { transform: scale(1.04); filter: brightness(1.35); } }
.reward-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: .55rem;
}
.reward-summary span {
  padding: .65rem;
  border: 1px solid rgba(244,189,80,.22);
  background: rgba(0,0,0,.2);
}
.reward-summary b { display: block; color: #ffd45a; font-size: 1.2rem; }
.reward-summary small { color: var(--muted); }
.reward-item-card {
  display: grid;
  gap: .25rem;
  margin: .8rem 0;
  padding: .9rem;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(0,0,0,.26);
}
.reward-item-card strong { color: #f8e7b0; }
.reward-item-card.rarity-rare { border-color: #57a5ff; box-shadow: 0 0 22px rgba(87,165,255,.18); }
.reward-item-card.rarity-epic { border-color: #b68cff; box-shadow: 0 0 26px rgba(182,140,255,.24); }
.reward-item-card.rarity-legendary,.reward-item-card.rarity-mythic { border-color: #f4bd50; box-shadow: 0 0 30px rgba(244,189,80,.3); }
.reward-already { color: var(--muted); }
#confirmOverlay {
  position: fixed;
  z-index: 300;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(2, 7, 6, .72);
  backdrop-filter: blur(3px);
}
.confirm-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: .85rem 1rem;
  width: min(440px, calc(100vw - 2rem));
  padding: 1rem;
  border-color: rgba(244,189,80,.58);
  background: rgba(9,16,17,.98);
  box-shadow: 0 24px 80px rgba(0,0,0,.72);
}
.confirm-mark {
  width: 52px;
  height: 52px;
  border: 2px solid rgba(244,189,80,.62);
  border-radius: 50%;
  background: linear-gradient(135deg, #f4bd50 0 46%, #d9932d 47% 100%);
  box-shadow: inset 0 0 0 10px #10191a, 0 0 24px rgba(244,189,80,.16);
}
.confirm-copy { min-width: 0; }
.confirm-copy small { color: var(--gold); font-weight: 800; text-transform: uppercase; }
.confirm-copy h2 { margin: .15rem 0 .35rem; font-size: 1.25rem; }
.confirm-copy p { margin: 0; color: var(--muted); line-height: 1.45; }
.confirm-copy strong { display: block; margin-top: .65rem; color: var(--gold); font-size: 1.05rem; }
.confirm-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .5rem; padding-top: .25rem; }
.confirm-actions .btn { min-width: 108px; }
#dungeonInvite {
  position: fixed;
  z-index: 31;
  right: var(--hud-padding);
  top: calc(var(--safe-top) + 11rem);
  width: min(360px, calc(100vw - 1rem));
  padding: .85rem;
  background: var(--panel-bg);
}
#tradeInvite {
  position: fixed;
  z-index: 31;
  right: var(--hud-padding);
  top: calc(var(--safe-top) + 18rem);
  width: min(360px, calc(100vw - 1rem));
  padding: .85rem;
  background: var(--panel-bg);
}
#dungeonInvite p { color: var(--muted); }
.dungeon-invite-actions { display: flex; gap: .5rem; }
#dungeonDebug {
  position: fixed;
  z-index: 40;
  right: var(--hud-padding);
  bottom: var(--safe-bottom);
  width: min(440px, calc(100vw - 1rem));
  max-height: 46vh;
  overflow: auto;
  padding: .7rem;
  background: rgba(3,8,7,.96);
  font: 700 11px monospace;
}
#dungeonDebug pre { white-space: pre-wrap; color: #83f6ff; }
#dungeonRewardBody .game-card { margin: .8rem 0; display: grid; gap: .35rem; }
.reward-materials { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin: .65rem 0; }
.reward-materials span { padding: .3rem .5rem; border: 1px solid rgba(255,122,50,.4); color: #ffb05c; background: rgba(91,22,27,.35); font: 800 .72rem monospace; }
.progression-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  margin: .75rem 0 1rem;
}
.progression-tabs button {
  border: 1px solid rgba(244,189,80,.28);
  background: rgba(3,9,8,.78);
  color: var(--text);
  padding: .55rem .75rem;
  font-weight: 900;
}
.progression-tabs button.active {
  border-color: rgba(244,189,80,.82);
  color: #06120e;
  background: linear-gradient(135deg, #67f6a0, #f4bd50);
}
.progression-grid,
.collection-grid,
.title-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: .75rem;
}
.progression-card {
  display: grid;
  align-content: start;
  gap: .55rem;
  min-height: 190px;
  padding: .85rem;
  border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(8,18,18,.94), rgba(4,9,10,.9));
  box-shadow: inset 0 0 0 1px rgba(103,246,160,.03);
}
.progression-card.complete { border-color: rgba(103,246,160,.58); box-shadow: 0 0 24px rgba(103,246,160,.08); }
.progression-card.claimed,
.progression-card.locked { opacity: .68; }
.progression-card.equipped { border-color: rgba(244,189,80,.78); box-shadow: 0 0 28px rgba(244,189,80,.13); }
.progression-card header {
  display: grid;
  gap: .2rem;
}
.progression-card header span {
  color: var(--gold);
  font: 900 .68rem monospace;
  text-transform: uppercase;
}
.progression-card header b {
  color: #f8e7b0;
  font-size: 1.05rem;
}
.progression-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.4;
}
.progression-card footer {
  display: flex;
  justify-content: space-between;
  gap: .55rem;
  color: var(--muted);
  font-size: .85rem;
}
.progression-card .btn {
  align-self: end;
}
.season-hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 220px);
  gap: 1rem;
  align-items: stretch;
  padding: 1rem;
  border: 1px solid rgba(244,189,80,.36);
  background: radial-gradient(circle at 14% 20%, rgba(103,246,160,.14), transparent 34%), linear-gradient(135deg, rgba(5,13,13,.96), rgba(10,17,24,.94));
}
.season-hero-card h2 { margin: .2rem 0 .45rem; color: #f8e7b0; }
.season-hero-card p { margin: 0; color: var(--muted); line-height: 1.45; }
.season-hero-card small { color: var(--gold); font: 900 .72rem monospace; text-transform: uppercase; }
.season-hero-card aside {
  display: grid;
  align-content: center;
  gap: .25rem;
  padding: .8rem;
  border: 1px solid rgba(103,246,160,.24);
  background: rgba(0,0,0,.22);
  text-align: center;
}
.season-hero-card aside b { color: var(--gold); font-size: 1.6rem; }
.season-hero-card aside span { color: var(--muted); font-size: .78rem; text-transform: uppercase; }
.season-reward-track { display: grid; gap: .7rem; }
.season-level-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: .65rem;
  align-items: stretch;
}
.season-level-row > h3 {
  display: grid;
  place-items: center;
  margin: 0;
  color: #06120e;
  background: linear-gradient(135deg, #67f6a0, #f4bd50);
  border: 1px solid rgba(244,189,80,.65);
  font: 900 1rem monospace;
}
.season-level-row > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
.season-reward-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .35rem .65rem;
  align-content: start;
  min-height: 124px;
  padding: .75rem;
  border: 1px solid rgba(255,255,255,.14);
  background: linear-gradient(180deg, rgba(7,17,18,.95), rgba(3,8,10,.92));
}
.season-reward-card small,
.season-reward-card b { color: var(--gold); font: 900 .68rem monospace; text-transform: uppercase; }
.season-reward-card h3 { margin: 0; color: #f8e7b0; font-size: 1rem; }
.season-reward-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}
.season-reward-card .btn {
  grid-column: 2;
  grid-row: 1 / 4;
  align-self: center;
  min-width: 92px;
}
.season-reward-card.premium { border-style: dashed; opacity: .7; }
.season-reward-card.claimed { opacity: .62; }
.season-mission-group { margin-top: 1rem; }
.season-mission-group > h3 { color: var(--gold); margin: 0 0 .6rem; }
.season-mission header span { letter-spacing: 0; }
.season-badge-shelf {
  margin: 1rem 0;
}
.season-badge-shelf h3 {
  margin: 0 0 .55rem;
  color: var(--gold);
}
.season-badge-shelf > div {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: .6rem;
}
.season-badge-card {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
  padding: .65rem;
  border: 1px solid rgba(244,189,80,.38);
  background: linear-gradient(135deg, rgba(103,246,160,.1), rgba(244,189,80,.08)), rgba(3,9,9,.82);
}
.season-badge-card > span {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid var(--gold);
  color: #06120e;
  background: linear-gradient(135deg, #67f6a0, #f4bd50);
  font: 900 .82rem monospace;
}
.cosmetic-preview {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 2px solid var(--cosmetic-accent, var(--gold));
  color: #06120e;
  background:
    radial-gradient(circle at 68% 24%, rgba(255,255,255,.55), transparent 14px),
    linear-gradient(135deg, var(--cosmetic-color, #42e68f), var(--cosmetic-accent, #f4bd50));
  box-shadow: 0 0 18px color-mix(in srgb, var(--cosmetic-color, #42e68f) 45%, transparent);
  font: 900 .82rem monospace;
  text-transform: uppercase;
}
.season-badge-card b {
  display: block;
  color: #f8e7b0;
}
.season-badge-card small {
  display: block;
  color: var(--muted);
}
.profile-hero {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) minmax(120px, 180px);
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  border: 1px solid rgba(244,189,80,.32);
  background: radial-gradient(circle at 22% 30%, rgba(103,246,160,.12), transparent 34%), rgba(5,13,13,.86);
}
.profile-cosmetic-banner {
  background:
    radial-gradient(circle at 18% 22%, color-mix(in srgb, var(--cosmetic-accent, #42e68f) 22%, transparent), transparent 30%),
    linear-gradient(135deg, color-mix(in srgb, var(--cosmetic-color, #102719) 88%, #000 12%), rgba(5,13,13,.9));
  position: relative;
  overflow: hidden;
}
.profile-cosmetic-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  border-top: 2px solid color-mix(in srgb, var(--cosmetic-accent, #42e68f) 55%, transparent);
  pointer-events: none;
}
.profile-title-frame {
  display: inline-flex;
  width: fit-content;
  padding: .18rem .45rem;
  border: 1px solid var(--cosmetic-accent, var(--gold));
  background: color-mix(in srgb, var(--cosmetic-color, #102719) 24%, transparent);
}
.profile-hero h2 {
  margin: .15rem 0;
  color: #f8e7b0;
  font-size: clamp(1.35rem, 3vw, 2.4rem);
}
.profile-hero small {
  color: var(--gold);
  font-weight: 900;
}
.profile-hero p {
  margin: 0 0 .55rem;
  color: var(--muted);
}
.profile-hero aside {
  display: grid;
  grid-template-columns: 1fr;
  gap: .15rem;
  text-align: right;
}
.profile-hero aside b {
  color: var(--gold);
  font-size: 1.35rem;
}
.profile-hero aside span {
  color: var(--muted);
  font: 800 .72rem monospace;
  text-transform: uppercase;
}
.profile-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: .65rem;
  margin: .8rem 0;
}
.profile-stat-grid span {
  padding: .75rem;
  border: 1px solid rgba(255,255,255,.11);
  background: rgba(0,0,0,.22);
  color: var(--muted);
}
.profile-stat-grid b {
  display: block;
  color: #f8e7b0;
  font-size: 1.15rem;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .65rem;
}
.profile-gear {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: .6rem;
  align-items: center;
  padding: .65rem;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(3,9,9,.74);
}
.profile-gear b {
  color: #f8e7b0;
}
.profile-gear small {
  display: block;
  color: var(--muted);
}
.wardrobe-tabs {
  overflow-x: auto;
  scrollbar-width: thin;
}
.wardrobe-equipped {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .65rem;
  margin: .85rem 0;
}
.wardrobe-equipped article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: .55rem;
  align-items: center;
  padding: .6rem;
  border: 1px solid rgba(244,189,80,.26);
  background: rgba(3,9,9,.72);
}
.wardrobe-equipped .cosmetic-preview {
  width: 38px;
  height: 38px;
  font-size: .68rem;
  grid-row: span 2;
}
.wardrobe-equipped small,
.wardrobe-equipped b {
  min-width: 0;
  overflow-wrap: anywhere;
}
.wardrobe-equipped small {
  color: var(--muted);
  font: 800 .66rem monospace;
  text-transform: uppercase;
}
.wardrobe-equipped b {
  color: #f8e7b0;
}
.cosmetic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: .75rem;
}
.cosmetic-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: .75rem;
  padding: .85rem;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(3,9,9,.78);
  min-width: 0;
}
.cosmetic-card.locked {
  opacity: .55;
  filter: grayscale(.5);
}
.cosmetic-card.equipped {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 1px rgba(244,189,80,.32);
}
.cosmetic-card h3 {
  margin: .08rem 0 .2rem;
  color: #f8e7b0;
  font-size: 1rem;
}
.cosmetic-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.35;
}
.cosmetic-card small,
.cosmetic-card span {
  color: var(--gold);
  font: 900 .66rem monospace;
  text-transform: uppercase;
}
.cosmetic-card footer {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .5rem;
}
.cosmetic-card .btn {
  min-width: 0;
}
.profile-settings {
  display: grid;
  gap: .7rem;
  max-width: 520px;
}
.profile-settings label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  padding: .65rem;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(0,0,0,.2);
}
.profile-settings select {
  min-width: 190px;
}
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: .45rem;
}
.shortcut-grid article {
  display: grid;
  gap: .18rem;
  min-width: 0;
  padding: .55rem .65rem;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.2);
}
.shortcut-grid b {
  color: var(--gold);
  font: 900 .82rem monospace;
  overflow-wrap: anywhere;
}
.shortcut-grid small {
  color: var(--muted);
  overflow-wrap: anywhere;
}

#tutorialOverlay,
#tutorialCompleteOverlay {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 9000;
  width: min(520px, calc(100vw - 28px));
  transform: translate(-50%, -50%);
  padding: 1.2rem;
  border-color: rgba(244,189,80,.78);
  background: radial-gradient(circle at 18% 18%, rgba(103,246,160,.16), transparent 32%), rgba(5,12,13,.96);
  box-shadow: 0 24px 90px rgba(0,0,0,.7), 0 0 42px rgba(244,189,80,.12);
}
#tutorialOverlay small,
#tutorialCompleteOverlay small {
  color: var(--gold);
  font: 900 .7rem monospace;
  text-transform: uppercase;
}
#tutorialOverlay h2,
#tutorialCompleteOverlay h2 {
  margin: .2rem 0 .55rem;
  color: #ffe28a;
}
#tutorialOverlay p,
#tutorialCompleteOverlay p,
#tutorialCompleteOverlay li {
  color: #d4dfd6;
  line-height: 1.45;
}
.tutorial-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .65rem;
  margin-top: 1rem;
}
#tutorialTracker {
  position: fixed;
  left: var(--hud-padding);
  top: calc(var(--safe-top) + 7.35rem);
  z-index: 1800;
  width: min(360px, calc(100vw - var(--hud-padding) * 2));
  padding: .85rem;
  border-color: rgba(244,189,80,.55);
  background: rgba(5,14,14,.9);
  box-shadow: 0 10px 34px rgba(0,0,0,.4), inset 0 0 0 1px rgba(103,246,160,.06);
}
.tutorial-step-head {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: center;
}
.tutorial-step-head small,
#tutorialMarkerChip {
  color: var(--gold);
  font: 900 .68rem monospace;
  text-transform: uppercase;
}
#tutorialTracker button {
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.05);
  color: #dbe8dc;
  padding: .25rem .45rem;
}
#tutorialTracker strong {
  display: block;
  margin-top: .3rem;
  color: #ffe28a;
}
#tutorialTracker p {
  margin: .3rem 0 .45rem;
  color: #d4dfd6;
  line-height: 1.35;
}
#worldMapPanel {
  position: fixed;
  inset: calc(var(--safe-top) + .6rem) .8rem .8rem .8rem;
  z-index: 7600;
  padding: 1rem;
  background: rgba(5,12,13,.94);
  border-color: rgba(244,189,80,.55);
  box-shadow: 0 24px 80px rgba(0,0,0,.64);
  overflow: hidden;
}
#worldMapPanel header {
  display: grid;
  gap: .15rem;
  padding-right: 5rem;
}
#worldMapPanel header small {
  color: var(--gold);
  font: 900 .7rem monospace;
  text-transform: uppercase;
}
#worldMapPanel h2 {
  margin: 0;
  color: #ffe28a;
}
#worldMapPanel p {
  margin: 0;
  color: var(--muted);
}
.world-map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: .8rem;
  height: calc(100% - 76px);
  margin-top: .75rem;
}
.world-map-canvas-wrap {
  min-height: 0;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  overflow: hidden;
}
#worldMapCanvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
}
.world-map-layout aside {
  display: grid;
  align-content: start;
  gap: .65rem;
  overflow: auto;
}
.world-map-layout aside strong {
  color: #ffe28a;
}
.world-map-legend,
#worldMapLandmarks {
  display: grid;
  gap: .35rem;
}
.world-map-legend span,
.world-map-landmark {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  padding: .45rem .55rem;
  border: 1px solid rgba(255,255,255,.1);
  background: rgba(255,255,255,.035);
  color: #dce8dc;
}
.world-map-legend i {
  width: 10px;
  height: 10px;
  display: inline-block;
  margin-right: .35rem;
}
.world-map-legend .player { background: #ffe28a; }
.world-map-legend .landmark { background: #f4bd50; border-radius: 50%; }
.world-map-legend .portal { background: #a46cff; }
.world-map-legend .danger { background: #ff5c8a; }
.world-map-legend .safe { background: #42e68f; }
.world-map-landmark small {
  color: var(--muted);
}
.tutorial-highlight {
  position: relative;
  z-index: 2500 !important;
  outline: 2px solid #f4bd50 !important;
  box-shadow: 0 0 0 5px rgba(244,189,80,.16), 0 0 24px rgba(103,246,160,.26) !important;
  animation: tutorialPulse 1.1s ease-in-out infinite;
}
@keyframes tutorialPulse {
  0%,100% { filter: brightness(1); }
  50% { filter: brightness(1.25); }
}
.tutorial-hint-toast {
  border-color: rgba(103,246,160,.55) !important;
}
.hidden { display: none !important; }

#performanceOverlay {
  position: fixed;
  right: 12px;
  bottom: 12px;
  z-index: 60000;
  width: 260px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 8px;
  padding: 10px;
  border: 1px solid rgba(131,246,255,.45);
  background: rgba(3, 10, 12, .92);
  color: #d8f9ee;
  font: 700 11px ui-monospace, Consolas, monospace;
  pointer-events: none;
  box-shadow: 0 16px 36px rgba(0,0,0,.45);
}
#performanceOverlay strong {
  grid-column: 1 / -1;
  color: var(--gold);
  font-size: 12px;
}
#performanceOverlay span {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
}
#performanceOverlay b {
  color: #83f6ff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Keep modal chrome fixed and give every menu exactly one internal scroller. */
.world-mode.modal-open .content-panel {
  overflow: hidden;
}
.world-mode.modal-open .content-panel > #panelBody,
.world-mode.modal-open .content-panel > #profileBody {
  max-height: calc(100vh - var(--safe-top) - 2.5rem);
  overflow-x: hidden;
  overflow-y: auto;
}
.world-mode.skill-tree-open .content-panel > #panelBody {
  max-height: none;
  height: 100%;
  overflow: hidden;
}

@media (max-width: 900px) {
  #skillHotbar { bottom: 6.8rem; grid-template-columns: repeat(5, minmax(68px, 1fr)); width: min(620px, calc(100vw - 1rem)); }
  #interactPrompt { bottom: 12.25rem; }
  .chat-panel { bottom: 12.25rem; }
  #bossHud { width: min(430px, calc(100vw - 1rem)); top: calc(var(--safe-top) + 5.5rem); }
  #dungeonTracker { top: var(--safe-top); }
  .victory-stats,.reward-summary { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  #skillHotbar { bottom: 9.4rem; grid-template-columns: repeat(5, minmax(52px, 1fr)); width: calc(100vw - 1rem); }
  #interactPrompt { bottom: 14.2rem; }
  .chat-panel { bottom: 14.2rem; }
  #skillHotbar button { height: 52px; grid-template-columns: 18px minmax(0, 1fr); }
  #skillHotbar small { display: none; }
  #dungeonTracker { top: calc(var(--safe-top) + 80px); width: calc(100vw - 16px); }
  #bossHud { top: calc(var(--safe-top) + 2px); }
  .profile-hero { grid-template-columns: 1fr; text-align: left; }
  .profile-hero aside { text-align: left; grid-template-columns: repeat(2, 1fr); }
  .leader-row,
  .social-row,
  .mail-row,
  .notification-row { grid-template-columns: 1fr; align-items: start; }
  .social-row .status-dot { display: none; }
  .social-compose-grid { grid-template-columns: 1fr; }
  .profile-hero + .social-actions,
  .social-actions { justify-content: stretch; }
  .social-actions .btn { flex: 1 1 120px; }
  #tutorialTracker {
    top: calc(var(--safe-top) + 8rem);
    width: calc(100vw - var(--hud-padding) * 2);
  }
  .tutorial-actions {
    grid-template-columns: 1fr;
  }
  #worldMapPanel { inset: .45rem; }
  .world-map-layout { grid-template-columns: 1fr; height: calc(100% - 88px); }
  .world-map-layout aside { max-height: 190px; }
}

/* Final world HUD layout pass. Keep combat controls inside predictable bottom lanes. */
:root {
  --quick-hud-bottom: var(--hud-padding);
  --quick-hud-height: 40px;
  --skillbar-bottom: calc(var(--quick-hud-bottom) + var(--quick-hud-height) + .45rem);
  --skillbar-height: 66px;
  --hint-bottom: calc(var(--skillbar-bottom) + var(--skillbar-height) + .45rem);
  --buff-bottom: calc(var(--hint-bottom) + 2.05rem);
  --prompt-bottom: calc(var(--buff-bottom) + 2.85rem);
}
.world-mode .quick-hud {
  left: 50%;
  right: auto;
  bottom: var(--quick-hud-bottom);
  width: min(720px, calc(100vw - 700px));
  min-width: 560px;
  max-width: none;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  gap: .28rem;
  padding: .3rem;
  overflow: visible;
  background: var(--panel-bg);
}
.world-mode .quick-hud button {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 0 .18rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border-radius: 7px;
  font-size: .72rem;
}
.world-mode .quick-hud .hidden {
  display: none !important;
}
.world-mode .chat-panel {
  left: var(--hud-padding);
  bottom: calc(var(--hud-padding) + 3.6rem);
  width: min(340px, calc(100vw - 1.5rem));
  max-height: 280px;
}
.world-mode .feed {
  right: var(--hud-padding);
  bottom: var(--hud-padding);
  width: min(310px, calc(100vw - 1.5rem));
}
#skillHotbar {
  bottom: var(--skillbar-bottom);
  width: min(620px, calc(100vw - 2rem));
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
}
#skillHotbar button {
  width: 100%;
  min-width: 0;
}
#skillHotbar small,
#skillHotbar span {
  min-width: 0;
}
#hotkeyHints {
  left: 50%;
  bottom: var(--hint-bottom);
  width: min(520px, calc(100vw - 2rem));
  max-width: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  pointer-events: none;
  text-align: center;
  padding: .34rem .55rem;
  font-size: .74rem;
  background: rgba(4,10,9,.86);
}
#buffBar {
  left: 50%;
  bottom: var(--buff-bottom);
  width: min(440px, calc(100vw - 2rem));
  max-width: none;
  justify-content: center;
  flex-wrap: nowrap;
  overflow: hidden;
  pointer-events: none;
}
#buffBar button {
  flex: 0 0 42px;
  min-width: 42px;
}
#interactPrompt {
  bottom: var(--prompt-bottom);
  max-width: min(560px, calc(100vw - 2rem));
  text-align: center;
}

@media (max-width: 1260px) {
  .world-mode .quick-hud {
    width: min(620px, calc(100vw - 540px));
    min-width: 470px;
  }
  .world-mode .chat-panel {
    bottom: calc(var(--hud-padding) + 8.55rem);
    width: min(300px, calc(100vw - 1.5rem));
  }
  .world-mode .feed {
    width: 270px;
  }
  #hotkeyHints {
    display: none;
  }
}

@media (max-width: 980px) {
  .world-mode .quick-hud {
    left: var(--hud-padding);
    right: var(--hud-padding);
    width: auto;
    min-width: 0;
    transform: none;
    grid-template-columns: repeat(auto-fit, minmax(48px, 1fr));
  }
  #skillHotbar {
    bottom: calc(var(--quick-hud-bottom) + 6.35rem);
  }
  #hotkeyHints {
    display: none;
  }
  #buffBar {
    bottom: calc(var(--hud-padding) + 11.9rem);
  }
  #interactPrompt {
    bottom: calc(var(--hud-padding) + 14.65rem);
  }
  .world-mode .chat-panel {
    bottom: calc(var(--hud-padding) + 12.25rem);
    width: min(330px, calc(100vw - 1.5rem));
  }
}

@media (max-width: 620px) {
  .world-mode .quick-hud {
    grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
  }
  .world-mode .quick-hud button {
    height: 36px;
  }
  #skillHotbar {
    bottom: calc(var(--quick-hud-bottom) + 7.5rem);
    width: calc(100vw - 1rem);
  }
  #buffBar {
    bottom: calc(var(--hud-padding) + 13.1rem);
    width: calc(100vw - 1rem);
  }
  #interactPrompt {
    bottom: calc(var(--hud-padding) + 15.8rem);
  }
  .world-mode .chat-panel {
    bottom: calc(var(--hud-padding) + 16rem);
    width: calc(100vw - 1rem);
  }
}

@media (max-width: 720px) {
  .season-hero-card,
  .season-level-row,
  .season-level-row > div,
  .season-reward-card {
    grid-template-columns: 1fr;
  }
  .season-reward-card .btn {
    grid-column: auto;
    grid-row: auto;
    width: 100%;
  }
}
