/* ============================================================= base */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overscroll-behavior: none; }
body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #0d1420;
  color: #e8e2d0;
  overflow-x: hidden;
}
.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }

/* ============================================================= landing */
#landing { min-height: 100vh; background: radial-gradient(ellipse at 50% -20%, #1d3049 0%, #0d1420 55%, #090d16 100%); position: relative; }
.stars { position: fixed; inset: 0; pointer-events: none; opacity: .6; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 60% 10%, #ffe9b0 50%, transparent 50%),
    radial-gradient(2px 2px at 80% 40%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 35% 70%, #cfe4ff 50%, transparent 50%),
    radial-gradient(1.5px 1.5px at 90% 80%, #fff 50%, transparent 50%),
    radial-gradient(1px 1px at 10% 85%, #ffe9b0 50%, transparent 50%);
  animation: twinkle 5s ease-in-out infinite alternate; }
@keyframes twinkle { from { opacity: .35; } to { opacity: .75; } }

.site-nav { display: flex; justify-content: space-between; align-items: center; padding: 18px 5vw; position: relative; z-index: 2; }
.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: 1px; }
.logo span { color: #ffb347; }
.logo.big { font-size: 2.2rem; text-align: center; margin-bottom: 18px; }
.nav-links { display: flex; gap: 26px; align-items: center; }
.nav-links a { color: #cfd8e3; text-decoration: none; font-weight: 600; transition: color .2s; }
.nav-links a:hover { color: #ffb347; }

.hero { text-align: center; padding: 9vh 5vw 60px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(3rem, 10vw, 6.5rem); font-weight: 900; letter-spacing: 6px;
  text-shadow: 0 0 60px rgba(255, 140, 40, .35), 0 4px 0 rgba(0,0,0,.55); }
/* gradient word: a text-shadow would show through clipped text and darken
   it, so the glow and depth come from a drop-shadow filter instead */
.hero .ember { background: linear-gradient(180deg, #ffe08a, #ff9b2e); -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: none; filter: drop-shadow(0 4px 0 rgba(0,0,0,.45)) drop-shadow(0 0 26px rgba(255,160,50,.4)); }
.tagline { font-size: clamp(1rem, 2.4vw, 1.3rem); color: #b9c4d0; margin: 18px 0 30px; line-height: 1.6; }
.btn-play { background: linear-gradient(180deg, #ffb347, #e07b12); border: 2px solid #ffd98a; color: #241300;
  font-size: 1.25rem; font-weight: 800; padding: 15px 44px; border-radius: 12px;
  box-shadow: 0 6px 24px rgba(255, 150, 40, .4), inset 0 2px 0 rgba(255,255,255,.4);
  transition: transform .15s, box-shadow .15s; }
.btn-play:hover { transform: translateY(-2px) scale(1.02); box-shadow: 0 10px 32px rgba(255, 150, 40, .55); }
/* the small Play button is one design everywhere — as a <button> or an <a>,
   in any nav — dark text on the amber gradient, brighter (never blank) on hover */
.btn-play-sm, .nav-links a.btn-play-sm, .top-links a.btn-play-sm {
  background: linear-gradient(180deg, #ffb347, #e07b12) !important;
  border: 1px solid #ffd98a; color: #241300 !important;
  font-weight: 700; padding: 8px 18px; border-radius: 9px; cursor: pointer; text-decoration: none; }
.btn-play-sm:hover { filter: brightness(1.08); color: #241300 !important; }
.btn-play-sm { background: linear-gradient(180deg, #ffb347, #e07b12); border: 1px solid #ffd98a; color: #241300;
  font-weight: 700; padding: 9px 20px; border-radius: 9px; }
.hero-sub { margin-top: 14px; color: #8fa0b3; font-size: .95rem; }
.guide-link { color: #ffcf87; text-decoration: underline; }
.guide-link:hover { color: #ffd98a; }

.hero-cards { display: flex; gap: 16px; justify-content: center; margin-top: 48px; flex-wrap: wrap; }
.stat-card { background: rgba(255,255,255,.05); border: 1px solid rgba(255,179,71,.25); border-radius: 14px;
  padding: 18px 28px; min-width: 130px; backdrop-filter: blur(4px); }
.stat-card b { display: block; font-size: 2rem; color: #ffb347; }
.stat-card span { color: #a9b6c4; font-size: .9rem; }

.section { padding: 70px 6vw; position: relative; z-index: 1; max-width: 1200px; margin: 0 auto; }
.section.alt { background: rgba(255,255,255,.025); border-block: 1px solid rgba(255,179,71,.12); max-width: none; }
.section.alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; }
.section h2 { font-size: clamp(1.6rem, 4vw, 2.4rem); text-align: center; margin-bottom: 40px; color: #ffd98a; }

.feature-grid, .world-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.feature, .place { background: rgba(20, 30, 46, .8); border: 1px solid rgba(255,179,71,.18); border-radius: 16px;
  padding: 26px; transition: transform .2s, border-color .2s; }
.feature:hover, .place:hover { transform: translateY(-4px); border-color: rgba(255,179,71,.5); }
.f-icon { font-size: 2.4rem; margin-bottom: 12px; }
.feature h3, .place h3 { color: #ffcf87; margin-bottom: 8px; }
.feature p, .place p { color: #a9b6c4; line-height: 1.55; }

.skill-badges { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.skill-badges span { background: rgba(255,179,71,.1); border: 1px solid rgba(255,179,71,.3); border-radius: 999px;
  padding: 9px 18px; font-weight: 600; }
.cta-block { text-align: center; margin-top: 70px; }
.site-footer { text-align: center; padding: 34px; color: #66788c; font-size: .9rem; border-top: 1px solid rgba(255,255,255,.06); position: relative; z-index: 1; }
.site-footer a { color: #8fa0b3; }
.site-nav .logo { text-decoration: none; color: inherit; }

/* ---- mobile navigation: hamburger that folds into an X ---- */
.nav-burger { display: none; background: none; border: none; padding: 10px; margin-left: auto;
  width: 44px; height: 44px; position: relative; z-index: 40; }
.nav-burger span { display: block; width: 24px; height: 2.6px; background: #e8e2d0; border-radius: 2px;
  margin: 5px auto; transition: transform .25s, opacity .2s; }
.nav-burger.open span:nth-child(1) { transform: translateY(7.6px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7.6px) rotate(-45deg); }

/* ---- small screens: the whole site folds down gracefully ---- */
@media (max-width: 760px) {
  .site-nav { flex-wrap: wrap; padding: 12px 4vw; row-gap: 0; }
  .nav-burger { display: block; }
  .site-nav .nav-links { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch;
    gap: 2px; padding: 10px 0 4px; border-top: 1px solid rgba(255,255,255,.08); margin-top: 10px; margin-left: 0; }
  .site-nav.open .nav-links { display: flex; }
  .site-nav .nav-links a { padding: 11px 8px; font-size: 1rem; border-radius: 8px; }
  .site-nav .nav-links a:hover { background: rgba(255,255,255,.06); }
  .site-nav .nav-links .btn-play-sm, .site-nav .nav-links button.btn-play-sm { text-align: center; margin-top: 6px; }
  .hero { padding: 5vh 4vw 40px; }
  .hero h1 { letter-spacing: 3px; }
  .hero-cards { gap: 10px; }
  .stat-card { padding: 12px 14px; flex: 1 1 40%; }
  .section { padding: 46px 5vw; }
  .shot-grid { grid-template-columns: 1fr; }
  .hero-shot figcaption, .shot figcaption { font-size: .82rem; }
  .charselect-card, .auth-card { padding: 22px; }
  .char-card { flex-wrap: wrap; }
  .acct-grid { grid-template-columns: 1fr; }
}

/* ============================================================= screenshots */
.section-sub { text-align: center; max-width: 760px; margin: -20px auto 36px; color: #a9b6c4; line-height: 1.6; }
.hero-shot { max-width: 900px; margin: 44px auto 0; position: relative; }
.hero-shot img, .shot img { width: 100%; display: block; border-radius: 14px; border: 1px solid rgba(255,179,71,.35);
  box-shadow: 0 18px 60px rgba(0,0,0,.55); }
.hero-shot figcaption, .shot figcaption { margin-top: 10px; color: #8fa0b3; font-size: .88rem; text-align: left; }
.shot-tag { display: inline-block; background: rgba(255,179,71,.16); border: 1px solid rgba(255,179,71,.45);
  color: #ffcf87; font-size: .72rem; font-weight: 700; letter-spacing: .5px; text-transform: uppercase;
  border-radius: 999px; padding: 2px 10px; margin-right: 8px; vertical-align: 1px; }
.shot-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 22px; }
.shot { margin: 0; transition: transform .2s; }
.shot:hover { transform: translateY(-3px); }

/* ============================================================= character select */
#charselect { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #1d3049 0%, #0d1420 60%, #090d16 100%); padding: 20px; }
.charselect-card { background: rgba(16, 24, 38, .95); border: 1px solid rgba(255,179,71,.3); border-radius: 20px;
  padding: 32px; width: 100%; max-width: 520px; }
.char-sub { color: #8fa0b3; text-align: center; margin: -8px 0 18px; font-size: .92rem; }
.char-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.char-loading { color: #8fa0b3; text-align: center; padding: 18px 0; }
.char-card { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,179,71,.2); border-radius: 14px; padding: 14px 16px; }
.char-card:hover { border-color: rgba(255,179,71,.5); }
.char-info b { display: block; font-size: 1.08rem; color: #ffe0a3; }
.char-info span { color: #8fa0b3; font-size: .84rem; }
.char-btns { display: flex; align-items: center; gap: 8px; }
.char-mini { background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.15); color: #cfd8e3;
  border-radius: 8px; padding: 7px 10px; font-size: .9rem; }
.char-mini:hover { background: rgba(255,255,255,.14); }
.char-mini.danger:hover { background: rgba(229,57,53,.25); border-color: rgba(229,57,53,.6); }
.char-create { display: flex; gap: 10px; margin-bottom: 16px; }
.char-create input { flex: 1; padding: 12px 14px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06); color: #fff; font-size: 1rem; }
.char-create input:focus { outline: none; border-color: #ffb347; }
.char-create .btn-play { font-size: 1rem; padding: 10px 18px; }
.char-actions { display: flex; flex-direction: column; gap: 6px; }

/* ============================================================= auth */
#auth { min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, #1d3049 0%, #0d1420 60%); padding: 20px; }
.auth-card { background: rgba(16, 24, 38, .95); border: 1px solid rgba(255,179,71,.3); border-radius: 20px;
  padding: 36px; width: 100%; max-width: 420px; box-shadow: 0 20px 80px rgba(0,0,0,.6); }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; padding: 11px; background: rgba(255,255,255,.05); color: #a9b6c4;
  border: 1px solid rgba(255,255,255,.1); border-radius: 10px; font-weight: 700; }
.auth-tabs button.active { background: rgba(255,179,71,.16); color: #ffcf87; border-color: rgba(255,179,71,.45); }
#auth-form { display: flex; flex-direction: column; gap: 12px; }
#auth-form input { padding: 13px 15px; border-radius: 10px; border: 1px solid rgba(255,255,255,.15);
  background: rgba(255,255,255,.06); color: #fff; font-size: 1rem; }
#auth-form input:focus { outline: none; border-color: #ffb347; }
.auth-error { background: rgba(229,57,53,.15); border: 1px solid rgba(229,57,53,.5); color: #ff8a80;
  padding: 10px 14px; border-radius: 8px; font-size: .92rem; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #66788c; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.1); }
.btn-guest { width: 100%; padding: 13px; background: rgba(120, 144, 156, .18); color: #cfd8e3;
  border: 1px solid rgba(255,255,255,.16); border-radius: 10px; font-weight: 700; font-size: 1rem; }
.btn-guest:hover { background: rgba(120, 144, 156, .3); }
.btn-back { width: 100%; margin-top: 12px; padding: 10px; background: none; border: none; color: #8fa0b3; }
.server-status { text-align: center; margin-top: 14px; font-size: .85rem; color: #66788c; }
.server-status.online { color: #81c784; }
.server-status.offline { color: #ffb74d; }

/* ============================================================= game shell */
#game-wrap { position: fixed; inset: 0; }
#game-container, #game-canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; }
#hud { position: absolute; inset: 0; pointer-events: none; z-index: 5; overflow: hidden; }
#hud > * { pointer-events: auto; }
#hud .plate-layer { pointer-events: none; }

#loading { position: absolute; inset: 0; background: #0d1420; z-index: 50; display: flex; align-items: center; justify-content: center; }
.load-inner { text-align: center; width: min(400px, 80vw); }
.load-bar { height: 14px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,179,71,.4); border-radius: 999px; overflow: hidden; margin: 18px 0 12px; }
#load-fill { height: 100%; width: 0%; background: linear-gradient(90deg, #ffb347, #ff7a1a); transition: width .3s; }
#load-text { color: #8fa0b3; }

/* ============================================================= HUD: top-left */
.hud-topleft { position: absolute; top: 12px; left: 12px; display: flex; align-items: center; gap: 10px; }
.hp-orb { width: 62px; height: 62px; border-radius: 50%; background: #16202e; border: 3px solid #caa356;
  position: relative; overflow: hidden; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.hp-fill { position: absolute; bottom: 0; left: 0; right: 0; height: 100%; background: #43a047; transition: height .3s, background .3s; }
.hp-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-weight: 900; font-size: 1.25rem; color: #fff; text-shadow: 0 1px 3px #000; }
.info-line { background: rgba(10, 16, 26, .8); border: 1px solid rgba(255,179,71,.3); padding: 7px 13px;
  border-radius: 999px; font-weight: 700; font-size: .9rem; }

/* ============================================================= HUD: minimap */
.minimap-wrap { position: absolute; top: 12px; right: 12px; width: 150px; height: 150px; }
.minimap { width: 150px; height: 150px; border-radius: 50%; box-shadow: 0 6px 20px rgba(0,0,0,.6); cursor: crosshair; }
.mm-btn { position: absolute; width: 38px; height: 38px; border-radius: 50%; border: 2px solid #caa356;
  background: #16202e; font-size: 1.05rem; display: flex; align-items: center; justify-content: center; color: #fff; }
.mm-btn.compass { top: -6px; left: -6px; }
.mm-btn.mapbtn { bottom: -6px; left: -6px; }
.mm-btn.runbtn { bottom: -6px; right: -6px; opacity: 0.75; }
.mm-btn.runbtn.on { opacity: 1; background: #caa356; box-shadow: 0 0 10px rgba(255, 213, 79, 0.8); }

/* ============================================================= HUD: messages */
.msg-log { position: absolute; left: 12px; bottom: 12px; width: min(420px, 60vw); display: flex; flex-direction: column; gap: 3px; }
.msg { background: rgba(8, 13, 22, .78); border-left: 3px solid #607d8b; padding: 5px 10px; border-radius: 0 8px 8px 0;
  font-size: .86rem; line-height: 1.35; transition: opacity .8s; }
.msg.fade { opacity: 0; }
.msg-warn { border-color: #ef5350; color: #ffab91; }
.msg-quest { border-color: #ffd54f; color: #ffe082; }
.msg-combat { border-color: #ef9a9a; }
.msg-magic { border-color: #b388ff; color: #d1c4e9; }
.msg-skill { border-color: #81c784; color: #c8e6c9; }
.msg-system { border-color: #4fc3f7; color: #b3e5fc; }

/* ============================================================= HUD: xp + toasts */
.xp-drops { position: absolute; top: 176px; right: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.xp-drop { background: rgba(20, 30, 46, .9); border: 1px solid rgba(129,199,132,.5); color: #c8e6c9;
  padding: 4px 11px; border-radius: 999px; font-size: .82rem; font-weight: 700; animation: xpfloat 1.8s forwards; }
@keyframes xpfloat { 0% { transform: translateY(8px); opacity: 0; } 15% { opacity: 1; } 80% { opacity: 1; } 100% { transform: translateY(-22px); opacity: 0; } }

.toasts { position: absolute; top: 84px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 30; }
.toast { background: linear-gradient(180deg, rgba(30, 42, 60, .97), rgba(16, 24, 38, .97)); border: 1px solid #ffd54f;
  color: #ffe082; padding: 12px 26px; border-radius: 12px; font-weight: 800; box-shadow: 0 8px 30px rgba(0,0,0,.6);
  animation: toastIn .3s ease-out; transition: opacity .6s; }
.toast.fade { opacity: 0; }
@keyframes toastIn { from { transform: translateY(-16px); opacity: 0; } }

.boss-banner { position: absolute; top: 26vh; left: 50%; transform: translateX(-50%); font-size: clamp(1.4rem, 4vw, 2.4rem);
  font-weight: 900; color: #ffd54f; text-shadow: 0 0 30px rgba(255, 120, 40, .8), 0 3px 0 #000; letter-spacing: 2px;
  animation: bossIn .6s ease-out; pointer-events: none; }
@keyframes bossIn { from { transform: translateX(-50%) scale(1.6); opacity: 0; } }

/* ============================================================= HUD: plates & splats */
.plate-layer { position: absolute; inset: 0; z-index: 4; }
.plate { position: absolute; transform: translate(-50%, -100%); text-align: center; pointer-events: none; }
.plate-name { font-size: .78rem; font-weight: 800; text-shadow: 0 1px 3px #000, 0 0 6px rgba(0,0,0,.8); white-space: nowrap; }
.plate-name.npc { color: #ffe94a; }
.plate-hp { width: 56px; height: 6px; background: #b71c1c; border: 1px solid #000; margin: 2px auto 0; border-radius: 3px; overflow: hidden; }
.plate-hp div { height: 100%; background: #43a047; }
.splat { position: absolute; transform: translate(-50%, -50%); width: 30px; height: 30px; border-radius: 50%;
  background: #c62828; color: #fff; font-weight: 900; display: flex; align-items: center; justify-content: center;
  font-size: .95rem; text-shadow: 0 1px 2px #000; animation: splatPop .9s forwards; pointer-events: none; z-index: 6; }
.splat.zero { background: #1565c0; }
@keyframes splatPop { 0% { transform: translate(-50%, -50%) scale(.4); } 20% { transform: translate(-50%, -50%) scale(1.15); } 100% { transform: translate(-50%, -90%) scale(1); opacity: 0; } }

/* ============================================================= HUD: side panel */
.side-panel { position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; max-width: 340px; }
.tab-bar { display: flex; gap: 5px; background: rgba(10, 16, 26, .85); padding: 7px; border-radius: 14px; border: 1px solid rgba(255,179,71,.3); }
.tab-btn { width: 42px; height: 42px; border-radius: 10px; border: 1px solid transparent; background: rgba(255,255,255,.06);
  font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.tab-btn.active { background: rgba(255,179,71,.22); border-color: rgba(255,179,71,.6); }
.tab-content { background: rgba(12, 18, 30, .93); border: 1px solid rgba(255,179,71,.35); border-radius: 16px;
  padding: 14px; width: 330px; max-height: min(430px, 55vh); overflow-y: auto; box-shadow: 0 10px 40px rgba(0,0,0,.55); }
.tab-title { font-weight: 800; color: #ffcf87; margin-bottom: 10px; font-size: 1rem; }

/* combat tab */
.combat-weapon { font-size: .9rem; margin-bottom: 10px; color: #cfd8e3; }
.style-row { display: flex; gap: 6px; margin-bottom: 10px; }
.style-btn { flex: 1; padding: 8px 4px; border-radius: 10px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.12); color: #cfd8e3; display: flex; flex-direction: column; gap: 2px; }
.style-btn small { color: #8fa0b3; font-size: .68rem; }
.style-btn.active { background: rgba(239,83,80,.18); border-color: rgba(239,83,80,.6); color: #ffcdd2; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: .92rem; margin-bottom: 10px; }
.autocast-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: .88rem;
  background: rgba(124,77,255,.12); border: 1px solid rgba(124,77,255,.4); padding: 7px 10px; border-radius: 10px; margin-bottom: 10px; }
.bonus-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; font-size: .84rem; color: #a9b6c4;
  background: rgba(255,255,255,.04); padding: 10px; border-radius: 10px; }

/* skills tab */
.skill-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.skill-cell { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
  padding: 8px 6px 6px; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; cursor: help; }
.skill-icon { font-size: 1.15rem; }
.skill-lvl { font-weight: 800; color: #ffe082; margin-left: auto; }
.skill-prog { width: 100%; height: 4px; background: rgba(0,0,0,.5); border-radius: 2px; overflow: hidden; }
.skill-prog div { height: 100%; background: #81c784; }

/* inventory */
.inv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.inv-cell { aspect-ratio: 1; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1);
  border-radius: 9px; position: relative; display: flex; align-items: center; justify-content: center; cursor: pointer; user-select: none; -webkit-user-select: none; }
.inv-cell:hover { border-color: rgba(255,179,71,.5); }
.inv-cell.using { border-color: #4fc3f7; box-shadow: 0 0 8px rgba(79,195,247,.7); background: rgba(79,195,247,.14); }
.inv-cell { touch-action: none; }  /* lets touch drags rearrange instead of scrolling */
.inv-cell.drag-src { opacity: .35; }
.inv-ghost { position: fixed; width: 48px; height: 48px; z-index: 300; pointer-events: none;
  opacity: .9; background: rgba(20,30,46,.9); border-color: #ffb347; box-shadow: 0 6px 18px rgba(0,0,0,.5); }
.inv-icon { font-size: 1.5rem; }
.inv-qty { position: absolute; top: 2px; right: 4px; font-size: .68rem; font-weight: 800; color: #ffe082; text-shadow: 0 1px 2px #000; }

/* equipment */
.equip-grid { display: flex; flex-direction: column; gap: 7px; margin-bottom: 12px; }
.equip-cell { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.1); border-radius: 10px;
  padding: 9px 12px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; }
.equip-cell:hover { border-color: rgba(255,179,71,.5); }
.equip-label { color: #8fa0b3; font-size: .82rem; font-weight: 700; }
.equip-item { font-size: .9rem; }
.equip-item.empty { color: #55677a; }

/* quests */
.quest-list { display: flex; flex-direction: column; gap: 6px; }
.quest-row { text-align: left; padding: 10px 13px; border-radius: 10px; background: rgba(255,255,255,.05);
  border: 1px solid rgba(255,255,255,.1); color: #ef9a9a; font-weight: 700; font-size: .92rem; }
.quest-row.active { color: #ffe082; }
.quest-row.done { color: #a5d6a7; text-decoration: line-through; }
.quest-row:hover { border-color: rgba(255,179,71,.5); }
.quest-meta { color: #8fa0b3; font-size: .8rem; margin-bottom: 10px; }
.quest-stage-text { line-height: 1.55; font-size: .92rem; margin-bottom: 12px; }
.quest-rewards { font-size: .86rem; color: #a5d6a7; background: rgba(129,199,132,.08); border: 1px solid rgba(129,199,132,.25);
  padding: 9px 11px; border-radius: 10px; margin-bottom: 12px; }

/* spellbook */
.book-toggle { display: flex; gap: 6px; margin-bottom: 10px; }
.book-btn { flex: 1; padding: 8px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
  color: #cfd8e3; font-weight: 700; font-size: .85rem; }
.book-btn.active { background: rgba(124,77,255,.2); border-color: rgba(124,77,255,.6); color: #d1c4e9; }
.book-btn.locked { opacity: .55; }
.spell-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.spell-cell { aspect-ratio: 1; border-radius: 9px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
  position: relative; display: flex; align-items: center; justify-content: center; }
.spell-cell .spell-icon { font-size: 1.3rem; }
.spell-cell .spell-lvl { position: absolute; bottom: 1px; right: 4px; font-size: .62rem; color: #8fa0b3; font-weight: 700; }
.spell-cell.locked { opacity: .32; filter: grayscale(1); }
.spell-cell.norunes { opacity: .6; }
.spell-cell.active { border-color: #b388ff; background: rgba(124,77,255,.3); box-shadow: 0 0 10px rgba(124,77,255,.5); }

/* settings */
.set-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-size: .92rem; }
.set-row select { background: #1a2534; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 8px; padding: 6px 10px; }
.help-text { font-size: .8rem; color: #8fa0b3; line-height: 1.6; background: rgba(255,255,255,.04);
  padding: 10px 12px; border-radius: 10px; margin: 12px 0; }
.btn-wide { display: block; width: 100%; padding: 11px; margin-top: 8px; border-radius: 10px; font-weight: 800;
  background: rgba(255,179,71,.16); border: 1px solid rgba(255,179,71,.45); color: #ffcf87; }
.btn-wide.danger { background: rgba(229,57,53,.13); border-color: rgba(229,57,53,.45); color: #ef9a9a; }
.btn-sm { padding: 5px 12px; border-radius: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18);
  color: #e8e2d0; font-weight: 700; font-size: .8rem; }
.btn-sm:hover { border-color: rgba(255,179,71,.5); }

/* ============================================================= dialog */
.dialog-box { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%);
  width: min(560px, 92vw); background: rgba(12, 18, 30, .96); border: 2px solid #caa356; border-radius: 16px;
  padding: 16px 18px; box-shadow: 0 14px 50px rgba(0,0,0,.7); z-index: 20; }
.dialog-name { font-weight: 900; color: #ffcf87; margin-bottom: 6px; }
.dialog-text { line-height: 1.55; margin-bottom: 12px; font-size: .98rem; }
.dialog-options { display: flex; flex-direction: column; gap: 6px; }
.dialog-opt { text-align: left; padding: 9px 13px; border-radius: 10px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14); color: #cfe0f0; font-size: .92rem; }
.dialog-opt:hover { border-color: #caa356; background: rgba(255,179,71,.12); }
.dialog-continue { text-align: center; color: #8fa0b3; }

/* ============================================================= shop / menus / map */
.panel-head { display: flex; justify-content: space-between; align-items: center; font-weight: 800;
  color: #ffcf87; font-size: 1.05rem; margin-bottom: 12px; }
.panel-close { background: rgba(229,57,53,.16); border: 1px solid rgba(229,57,53,.5); color: #ef9a9a;
  width: 32px; height: 32px; border-radius: 9px; font-weight: 800; }

.shop-panel { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(620px, 94vw); max-height: 82vh; overflow-y: auto; background: rgba(12, 18, 30, .97);
  border: 2px solid #caa356; border-radius: 18px; padding: 16px; z-index: 25; box-shadow: 0 20px 70px rgba(0,0,0,.8); }
.shop-coins { font-weight: 800; color: #ffe082; margin-bottom: 12px; }
.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 9px; margin-bottom: 14px; }
.shop-item { background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 12px;
  padding: 10px 8px; text-align: center; font-size: .8rem; }
.shop-item.sellable { cursor: pointer; }
.shop-item.sellable:hover { border-color: rgba(129,199,132,.6); }
.shop-item-icon { font-size: 1.6rem; }
.shop-item-name { font-weight: 700; margin: 4px 0 2px; }
.shop-item-price { color: #ffe082; font-weight: 700; }
.shop-item-qty { color: #8fa0b3; font-size: .72rem; }
.shop-item-req { color: #ef9a9a; font-size: .7rem; margin-top: 2px; }
.shop-btn-row { display: flex; gap: 5px; justify-content: center; margin-top: 7px; }
.shop-sell-head { font-weight: 700; color: #a5d6a7; margin: 6px 0 8px; font-size: .9rem; }

.action-menu { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(460px, 92vw); max-height: 74vh; overflow-y: auto; background: rgba(12, 18, 30, .97);
  border: 2px solid #caa356; border-radius: 16px; padding: 14px; z-index: 25; box-shadow: 0 16px 60px rgba(0,0,0,.8); }
.action-row { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 11px 13px;
  margin-bottom: 6px; border-radius: 10px; background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.13);
  color: #e8e2d0; font-size: .9rem; }
.action-row:hover { border-color: rgba(255,179,71,.55); }
.action-icon { font-size: 1.3rem; }

.ctx-menu { position: fixed; z-index: 40; background: rgba(14, 20, 32, .98); border: 1px solid #caa356;
  border-radius: 10px; overflow: hidden; min-width: 150px; box-shadow: 0 10px 34px rgba(0,0,0,.7); }
.ctx-item { display: block; width: 100%; text-align: left; padding: 10px 15px; background: none; border: none;
  color: #e8e2d0; font-size: .9rem; }
.ctx-item:hover { background: rgba(255,179,71,.16); }
.ctx-item.ctx-cancel { color: #8fa0b3; border-top: 1px solid rgba(255,255,255,.1); }

/* skill info window */
.skillinfo-xp { font-size: .88rem; color: #cfd8e3; margin-bottom: 10px; }
.skill-prog.big { height: 8px; margin-top: 6px; border-radius: 4px; background: rgba(0,0,0,.5); overflow: hidden; }
.skill-prog.big div { height: 100%; background: #81c784; }
.unlock-list { display: flex; flex-direction: column; gap: 4px; }
.unlock-row { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px;
  background: rgba(255,255,255,.04); font-size: .86rem; color: #8fa0b3; }
.unlock-row.done { color: #c8e6c9; background: rgba(129,199,132,.08); }
.unlock-lvl { font-weight: 800; min-width: 26px; text-align: right; color: #ffe082; }
.unlock-row:not(.done) .unlock-lvl { color: #8fa0b3; }
.unlock-check { margin-left: auto; }

/* world map zoom */
.map-zoom-row { display: flex; gap: 8px; margin-top: 10px; }
.map-zoom-btn { font-size: 1rem; padding: 8px 18px; }
.worldmap-canvas { touch-action: none; }

.map-overlay { position: absolute; inset: 0; background: rgba(6, 10, 17, .93); z-index: 28;
  display: flex; flex-direction: column; align-items: center; padding: 14px; }
.map-overlay .panel-head { width: min(700px, 96vw); }
.worldmap-canvas { border: 2px solid #caa356; border-radius: 14px; cursor: crosshair; max-width: 96vw; }

/* ============================================================= mobile */
@media (max-width: 760px), (max-height: 560px) {
  .minimap-wrap, .minimap { width: 112px; height: 112px; }
  .mm-btn { width: 34px; height: 34px; }
  .hp-orb { width: 52px; height: 52px; }
  .hp-text { font-size: 1.05rem; }
  .side-panel { right: 8px; bottom: 8px; left: 8px; align-items: stretch; max-width: none; }
  .tab-bar { justify-content: space-around; }
  .tab-btn { width: 40px; height: 40px; }
  .tab-content { width: auto; max-height: 46vh; }
  .msg-log { bottom: 66px; width: 62vw; }
  .msg { font-size: .76rem; }
  .xp-drops { top: 132px; right: 10px; }
  .dialog-box { bottom: 70px; }
}
@media (max-width: 420px) {
  .inv-grid { grid-template-columns: repeat(7, 1fr); }
  .skill-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ============================================================= svg icons */
.gi { width: 1.5em; height: 1.5em; vertical-align: -0.35em; display: inline-block; }
.inv-icon .gi, .inv-icon svg { width: 30px; height: 30px; vertical-align: middle; }
.skill-icon .gi { width: 22px; height: 22px; }
.spell-icon .gi { width: 26px; height: 26px; }
.shop-item-icon .gi { width: 34px; height: 34px; }
.action-icon .gi { width: 26px; height: 26px; }
.tab-btn .gi { width: 22px; height: 22px; vertical-align: middle; }
.mm-btn .gi { width: 22px; height: 22px; vertical-align: middle; }
.ctx-item .gi { width: 18px; height: 18px; vertical-align: -0.28em; margin-right: 4px; }
.xp-drop .gi { width: 15px; height: 15px; vertical-align: -0.2em; }
.head-ic .gi { width: 20px; height: 20px; vertical-align: -0.25em; }
.equip-item.eq-ic .gi { width: 20px; height: 20px; vertical-align: -0.3em; }
.dev-stat-ic .gi { width: 20px; height: 20px; }
.toast .gi { width: 18px; height: 18px; vertical-align: -0.22em; }

/* ============================================================= transition */
.transition-overlay { position: absolute; inset: 0; background: #05080e; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .38s ease; }
/* must out-rank the #hud > * pointer-events rule */
#hud > .transition-overlay { pointer-events: none; }
#hud > .transition-overlay.show { pointer-events: auto; }
.transition-overlay.show { opacity: 1; }
.transition-inner { text-align: center; }
.transition-spinner { width: 44px; height: 44px; margin: 0 auto 16px; border-radius: 50%;
  border: 4px solid rgba(255,179,71,.2); border-top-color: #ffb347; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.transition-label { color: #ffcf87; font-weight: 700; letter-spacing: .5px; }

/* ============================================================= bank */
.bank-panel { max-width: 560px; }
.bank-qty-row { display: flex; align-items: center; gap: 7px; margin-bottom: 12px; flex-wrap: wrap; }
.bank-qty-label { color: #8fa0b3; font-size: .88rem; }
.btn-sm.active-qty { background: rgba(255,179,71,.25); border-color: rgba(255,179,71,.7); color: #ffcf87; }
.btn-sm.dep-all { margin-left: auto; }
.bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(52px, 1fr)); gap: 6px; margin-bottom: 14px; }
.bank-cell { aspect-ratio: 1; }
.bank-empty { grid-column: 1 / -1; color: #66788c; font-size: .88rem; padding: 12px; text-align: center; }

/* ============================================================= dev menu */
.dev-btn { background: rgba(124,77,255,.14); border-color: rgba(124,77,255,.45); color: #d1c4e9; }
.dev-warning { line-height: 1.6; font-size: .92rem; color: #ffcdd2; background: rgba(229,57,53,.1);
  border: 1px solid rgba(229,57,53,.4); border-radius: 10px; padding: 14px; margin-bottom: 12px; }
.danger-btn { background: rgba(229,57,53,.16); border-color: rgba(229,57,53,.5); color: #ef9a9a; }
.dev-search { width: 100%; padding: 9px 12px; margin-bottom: 10px; border-radius: 9px;
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.06); color: #fff; font-size: .92rem; }
.dev-search:focus { outline: none; border-color: #ffb347; }
.dev-item-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; max-height: 42vh; overflow-y: auto; }
.dev-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 4px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; color: #cfd8e3; }
.dev-item:hover { border-color: rgba(124,77,255,.6); }
.dev-item-name { font-size: .68rem; text-align: center; line-height: 1.2; }
.dev-stat-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; max-height: 46vh; overflow-y: auto; }
.dev-stat-row { display: flex; align-items: center; gap: 9px; background: rgba(255,255,255,.04);
  padding: 7px 10px; border-radius: 9px; }
.dev-stat-name { flex: 1; font-size: .9rem; }
.dev-stat-name.done-q { color: #a5d6a7; }
.dev-stat-input { width: 58px; padding: 5px 8px; border-radius: 7px; border: 1px solid rgba(255,255,255,.2);
  background: rgba(255,255,255,.07); color: #fff; }

/* ============================================================= site svg icons */
.logo .gi { width: 1.25em; height: 1.25em; vertical-align: -0.25em; }
.f-icon .gi { width: 44px; height: 44px; }
.place h3 .gi { width: 21px; height: 21px; vertical-align: -0.28em; }
.skill-badges .gi { width: 18px; height: 18px; vertical-align: -0.3em; margin-right: 2px; }
.btn-play .gi, .btn-guest .gi { width: 20px; height: 20px; vertical-align: -0.28em; margin-right: 4px; }
.gi-inline { width: 17px; height: 17px; vertical-align: -0.25em; }

/* ============================================================= quest tracker */
.quest-tracker { position: absolute; top: 84px; left: 12px; display: flex; gap: 10px; align-items: center;
  background: rgba(10, 16, 26, .88); border: 1px solid rgba(255,213,79,.45); border-radius: 12px;
  padding: 8px 12px; max-width: 270px; cursor: pointer; box-shadow: 0 4px 18px rgba(0,0,0,.45); }
.qt-arrow { font-size: 1.4rem; color: #ffd54f; transition: transform .15s linear; text-shadow: 0 0 8px rgba(255,213,79,.6); }
.qt-name { font-weight: 800; color: #ffd54f; font-size: .82rem; }
.qt-hint { font-size: .76rem; color: #cfd8e3; line-height: 1.3; }
.qt-dist { font-size: .7rem; color: #8fa0b3; margin-top: 2px; }
.quest-row.tracked { border-color: rgba(255,213,79,.6); color: #ffd54f; }
.quest-btn-row { justify-content: flex-start; }
@media (max-width: 760px), (max-height: 560px) {
  .quest-tracker { top: 70px; max-width: 210px; padding: 6px 9px; }
  .qt-hint { display: none; }
}

/* subtle vignette over the 3D view */
#game-container::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 2;
  background: radial-gradient(ellipse at 50% 42%, transparent 58%, rgba(5, 10, 18, .38) 100%); }

/* minigame status pill */
.minigame-hud { position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: rgba(10, 16, 26, .9); border: 1px solid rgba(255,213,79,.55); color: #ffd54f;
  font-weight: 800; padding: 8px 18px; border-radius: 999px; font-size: .92rem; z-index: 20;
  box-shadow: 0 4px 16px rgba(0,0,0,.5); }

/* ============================================================= lightbox */
.shot-zoomable { cursor: zoom-in; }
.lightbox { position: fixed; inset: 0; z-index: 500; background: rgba(5, 8, 14, .9);
  display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 14px;
  padding: 4vh 4vw; cursor: zoom-out; animation: lb-in .18s ease-out; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lightbox img { max-width: 100%; max-height: 82vh; border-radius: 12px;
  border: 1px solid rgba(255,179,71,.4); box-shadow: 0 24px 80px rgba(0,0,0,.7); }
.lightbox figcaption { color: #cfd8e3; font-size: .95rem; text-align: center; max-width: 800px; }
.lightbox-close { position: absolute; top: 16px; right: 18px; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.2); color: #e8e2d0; width: 42px; height: 42px; border-radius: 50%;
  font-size: 1.2rem; }
