/* =========================
   THEME VARIABLES
========================= */

:root {

  --ui-bg-main: rgba(10, 8, 5, 0.65);
  --ui-bg-panel: rgba(20, 18, 10, 0.92);
  --ui-bg-soft: rgba(255,255,255,0.04);

  --ui-border: rgba(255,255,255,0.08);
  --ui-border-strong: rgba(120,115,90,0.45);

  --ui-accent: #6ab04c;
  --ui-accent-soft: #badc58;

  --ui-text: #e8f5e9;
  --ui-text-muted: rgba(255,255,255,0.6);

  --ui-shadow:
    0 10px 30px rgba(0,0,0,0.65),
    inset 0 0 20px rgba(255,255,255,0.03);

}

* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.15) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.24);
}

.compact-number,
.value-tier-base {
  color: #f3efe5;
  font-variant-numeric: tabular-nums;
}

.value-tier-1k {
  color: #9fd26d;
}

.value-tier-10k {
  color: #74b9ff;
}

.value-tier-100k {
  color: #f0c866;
}

.value-tier-million {
  color: #c68cff;
}

.location-view-main::-webkit-scrollbar,
.smithing-tabs::-webkit-scrollbar,
.smithing-content::-webkit-scrollbar,
.bank-slots::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.location-view-main::-webkit-scrollbar-thumb,
.smithing-tabs::-webkit-scrollbar-thumb,
.smithing-content::-webkit-scrollbar-thumb,
.bank-slots::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
}


/* =========================
   GLOBAL
========================= */

html, body {

  margin: 0;
  padding: 0;

  height: 100%;

  overflow: hidden;

  color: var(--ui-text);

  font-family: system-ui, sans-serif;

  background: none;

}

body.game-cursor-active,
body.game-cursor-active * {
  cursor: url("/assets/ui/cursor.png") 2 2, auto !important;
}


/* =========================
   BACKGROUND SYSTEM
========================= */

body::before {

  content: "";

  position: fixed;

  inset: 0;

  z-index: -2;

  background-image: var(--background-image);

  background-size: cover;

  background-position: center;

  background-repeat: no-repeat;

  background-color: #000;

  transition: background-image 0.6s ease, filter 0.6s ease;

  filter: brightness(var(--bg-brightness,1));

}




/* =========================
   APP GRID
========================= */

#app {

  display:grid;

  grid-template-columns:228px 1fr;

  grid-template-rows:48px 1fr;

  height:100vh;

  transition:opacity 0.6s ease;


}


/* =========================
   TOP BAR
========================= */

#topBar {

  grid-column:1 / span 2;

  display:flex;

  align-items:center;

  gap:24px;

  padding:0 16px;

  background:rgba(0,0,0,0.55);

  backdrop-filter:blur(6px);


#currentSeason {

  display:inline-flex;

  align-items:center;

  gap:6px;

  padding:6px 10px;

  border-radius:999px;

  background:rgba(255,255,255,0.06);

  border:1px solid rgba(255,255,255,0.08);

  color:rgba(255,255,255,0.82);

  font-size:13px;

  white-space:nowrap;

}

  border-bottom:1px solid var(--ui-border);

}

.topbar-coins {
  display: flex;
  align-items: center;
}

.topbar-coins-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topbar-coin-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.topbar-coin-value {
  font-weight: 600;
  line-height: 1;
}

.topbar-coin-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  display: block;
}

.quest-log {
  padding: 10px;
}

.quest-entry {
  margin-bottom: 8px;
}

.quest-entry.completed {
  opacity: 0.6;
}

/* =========================
   SIDEBAR
========================= */

#sidebar {

  display:flex;

  flex-direction:column;

  padding:12px;

  background:rgba(20,18,10,0.75);

  backdrop-filter:blur(4px);

}


/* =========================
   SIDEBAR SKILLS
========================= */

#skillList {

  list-style:none;

  padding:0;

  margin:0;

}

#skillList li {

  display:flex;

  justify-content:space-between;

  align-items:center;

  padding:8px;

  border-radius:6px;

  cursor:pointer;

  transition:background 0.15s ease;

}

#skillList li:hover {

  background:rgba(255,255,255,0.05);

}

#skillList li[aria-disabled="true"]:hover {

  background:rgba(255,255,255,0.04);

}


/* =========================
   MAIN AREA
========================= */

#main {

  position:relative;

  display:grid;

  grid-template-rows:1fr 60px;

  overflow:hidden;

  background:var(--ui-bg-main);

  backdrop-filter:blur(2px);

}


/* =========================
   SKILL VIEW
========================= */

#skillView {

  padding:16px;

  overflow-y:auto;

}


/* =========================
   BOTTOM BAR
========================= */

#bottomBar {

  display:flex;

  align-items:center;

  gap:16px;

  padding:0 16px;

  background:rgba(0,0,0,0.35);

  border-top:1px solid var(--ui-border);

}

@media (max-width: 768px) {
  html,
  body {
    height: 100%;
    overflow: hidden;
  }

  body {
    background: radial-gradient(circle at top, rgba(92, 76, 42, 0.18), transparent 42%);
  }

  #app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr auto;
    height: 100dvh;
    min-height: 100dvh;
  }

  #topBar {
    grid-column: 1;
    grid-row: 1;
    gap: 10px;
    padding: max(10px, env(safe-area-inset-top)) 12px 10px;
    flex-wrap: wrap;
    align-items: stretch;
    background: rgba(7, 7, 6, 0.78);
    backdrop-filter: blur(14px);
  }

  #sidebar {
    grid-row: 2;
    padding: 8px 12px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    background: rgba(18, 16, 11, 0.92);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    -webkit-overflow-scrolling: touch;
  }

  #skillList {
    display: flex;
    gap: 8px;
    min-width: max-content;
  }

  #skillList li {
    min-width: 132px;
    padding: 10px 12px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.05);
  }

  #main {
    grid-row: 3;
    grid-template-rows: 1fr;
    min-height: 0;
    background: linear-gradient(180deg, rgba(17, 14, 9, 0.92), rgba(8, 7, 5, 0.9));
  }

  #skillView {
    padding: 10px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  #bottomBar {
    grid-row: 4;
    gap: 10px;
    padding: 10px 12px max(10px, env(safe-area-inset-bottom));
    background: rgba(11, 10, 8, 0.92);
    backdrop-filter: blur(16px);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
  }
}

@media (max-width: 768px) {
  .mobile-sidebar-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 88px;
    margin-left: auto;
  }

  #sidebar {
    position: fixed;
    left: 10px;
    right: 10px;
    top: calc(64px + env(safe-area-inset-top));
    z-index: 70;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 24px 46px rgba(0,0,0,0.34);
    transform: translateY(calc(-100% - 18px));
    opacity: 0;
    pointer-events: none;
    transition: transform 0.24s ease, opacity 0.24s ease;
  }

  #sidebar::after {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
  }

  #app.mobile-sidebar-open #sidebar {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  #app.mobile-sidebar-open #main,
  #app.mobile-sidebar-open #bottomBar {
    filter: blur(1.5px);
  }
}



#playerHealth {
  display: inline-flex;
  align-items: center;
}

.topbar-health-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 136px;
}

.topbar-health-copy {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}

.topbar-health-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.72;
}

.topbar-health-value {
  font-size: 14px;
}

.topbar-health-bar {
  width: 82px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.topbar-health-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #cf544a 0%, #f18f64 100%);
}

.runtime-notice-stack {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 1200;
  display: grid;
  gap: 10px;
  width: min(760px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
}

.runtime-notice-stack.is-hidden {
  display: none;
}

.runtime-notice {
  pointer-events: auto;
  display: grid;
  gap: 6px;
  padding: 14px 18px;
  border-radius: 16px;
  border: 2px solid rgba(255,255,255,0.14);
  box-shadow: 0 18px 40px rgba(0,0,0,0.34);
}

.runtime-notice-maintenance {
  background: linear-gradient(180deg, rgba(255, 220, 86, 0.98), rgba(255, 192, 54, 0.98));
  border-color: rgba(255, 245, 184, 0.84);
  color: #2f2000;
}

.runtime-notice-maintenance.is-active {
  background: linear-gradient(180deg, rgba(255, 214, 61, 1), rgba(255, 170, 33, 1));
  box-shadow: 0 18px 44px rgba(170, 114, 0, 0.3);
}

.runtime-notice-update {
  background: linear-gradient(180deg, rgba(42, 35, 25, 0.96), rgba(22, 18, 13, 0.98));
  border-color: rgba(214, 188, 116, 0.28);
  color: #f5ebd5;
}

.runtime-notice-connection {
  background: linear-gradient(180deg, rgba(29, 35, 42, 0.97), rgba(15, 20, 25, 0.98));
  border-color: rgba(134, 180, 214, 0.36);
  color: #edf6ff;
  box-shadow:
    0 18px 40px rgba(0,0,0,0.34),
    0 0 28px rgba(96, 152, 194, 0.12);
}

.runtime-notice-kicker {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.runtime-notice-title {
  font-size: clamp(1rem, 1.5vw, 1.22rem);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.runtime-notice-copy {
  font-size: 0.95rem;
  line-height: 1.35;
}

.runtime-notice-action {
  justify-self: start;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(214, 188, 116, 0.28);
  background: rgba(214, 188, 116, 0.16);
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.bottom-bar-shell {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

.bottom-bar-info-strip {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.bottom-info-module {
  min-height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(214, 187, 106, 0.16);
  background:
    linear-gradient(135deg, rgba(214, 187, 106, 0.12), rgba(120, 160, 96, 0.06)),
    rgba(24, 20, 15, 0.82);
  color: #f6edd8;
  font: inherit;
  text-align: left;
  box-shadow: 0 10px 22px rgba(0,0,0,0.18);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.bottom-bar-shell.is-refreshing-hover .bottom-info-module,
.bottom-bar-shell.is-refreshing-hover .bottom-bar-chat-toggle {
  transition: none;
}

.bottom-info-module:hover,
.bottom-info-module.is-active {
  border-color: rgba(214, 187, 106, 0.28);
  background:
    linear-gradient(135deg, rgba(214, 187, 106, 0.18), rgba(120, 160, 96, 0.1)),
    rgba(30, 25, 17, 0.9);
}

.bottom-info-xp {
  width: min(280px, 34vw);
  display: grid;
  align-content: center;
  gap: 7px;
  padding: 8px 12px;
}

.bottom-info-session,
.bottom-info-last-loot {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
}

.bottom-info-last-loot {
  max-width: min(280px, 28vw);
}

.bottom-info-icon {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.26));
}

.bottom-info-icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(214, 187, 106, 0.16);
  color: #f1d58e;
  font-weight: 800;
}

.bottom-info-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.bottom-info-kicker {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(241, 213, 142, 0.72);
}

.bottom-info-title {
  display: block;
  min-width: 0;
  color: #f6edd8;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bottom-info-count {
  min-width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(168, 194, 126, 0.18);
  color: #d8ebb0;
  font-size: 11px;
  font-weight: 800;
}

.bottom-info-xp-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(0,0,0,0.42);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.46);
}

.bottom-info-xp-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #8bbf53, #d7ef8f);
  box-shadow: 0 0 14px rgba(176, 224, 105, 0.26);
  transition: width 420ms ease;
}

.bottom-info-panel {
  position: absolute;
  left: 0;
  bottom: calc(100% + 10px);
  width: min(360px, calc(100vw - 32px));
  max-height: min(420px, 62vh);
  display: grid;
  gap: 10px;
  padding: 12px;
  overflow-y: auto;
  border-radius: 14px;
  border: 1px solid rgba(214, 187, 106, 0.18);
  background: linear-gradient(180deg, rgba(28, 24, 17, 0.98), rgba(16, 14, 11, 0.98));
  box-shadow: 0 18px 40px rgba(0,0,0,0.32);
  z-index: 30;
}

.bottom-info-panel-head,
.bottom-info-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.bottom-info-panel-head {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  color: rgba(241, 213, 142, 0.82);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bottom-info-panel-head strong {
  max-width: 190px;
  color: #f6edd8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bottom-info-stat-row {
  min-height: 30px;
  padding: 7px 9px;
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  font-size: 12px;
}

.bottom-info-stat-row span {
  color: rgba(244, 234, 211, 0.66);
}

.bottom-info-stat-row strong {
  color: #f6edd8;
}

.bottom-info-loot-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bottom-info-loot-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
}

.bottom-info-loot-list img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.bottom-info-loot-list strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.bottom-info-loot-list span {
  color: rgba(244, 234, 211, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.bottom-info-empty {
  margin: 0;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.035);
  color: rgba(244, 234, 211, 0.68);
  font-size: 12px;
}

.bottom-bar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.bottom-bar-chat-toggle,
.bottom-bar-secondary-btn {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.05);
  color: #f4ead3;
  cursor: pointer;
}

.bottom-bar-chat-toggle.active {
  background: rgba(168, 194, 126, 0.16);
  border-color: rgba(168, 194, 126, 0.28);
  color: #d8ebb0;
}

.bottom-bar-chat-toggle.has-unread {
  border-color: rgba(177, 216, 107, 0.44);
  color: #e4f3bd;
  box-shadow: 0 0 0 1px rgba(177, 216, 107, 0.12), 0 0 18px rgba(177, 216, 107, 0.18);
  animation: chatUnreadGlow 1.9s ease-in-out infinite;
}

.bottom-bar-chat-toggle.active.has-unread {
  box-shadow: 0 0 0 1px rgba(177, 216, 107, 0.16), 0 0 20px rgba(177, 216, 107, 0.22);
}

@keyframes chatUnreadGlow {
  0%, 100% {
    box-shadow: 0 0 0 1px rgba(177, 216, 107, 0.1), 0 0 10px rgba(177, 216, 107, 0.12);
  }

  50% {
    box-shadow: 0 0 0 1px rgba(177, 216, 107, 0.18), 0 0 22px rgba(177, 216, 107, 0.26);
  }
}

.bottom-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 10px);
  width: min(420px, calc(100vw - 32px));
  min-height: 420px;
  max-height: 70vh;
  display: none;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  resize: vertical;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  background: linear-gradient(180deg, rgba(28, 24, 17, 0.98), rgba(16, 14, 11, 0.98));
  box-shadow: 0 18px 40px rgba(0,0,0,0.32);
  z-index: 30;
}

.bottom-chat-panel.is-open {
  display: flex;
}

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

.bottom-chat-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bottom-chat-subtitle {
  margin-top: 4px;
  opacity: 0.72;
  font-size: 12px;
}

.bottom-chat-scope-switch {
  display: inline-flex;
  gap: 6px;
}

.bottom-chat-scope-btn {
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: inherit;
  cursor: pointer;
}

.bottom-chat-scope-btn.active {
  background: rgba(214, 187, 106, 0.16);
  border-color: rgba(214, 187, 106, 0.24);
  color: #f1d58e;
}

.bottom-chat-scope-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.bottom-chat-body {
  flex: 1;
  min-height: 260px;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-right: 4px;
}

.bottom-chat-message {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.05);
  flex: 0 0 auto;
}

.bottom-chat-message.is-system {
  background: rgba(214, 187, 106, 0.08);
  border-color: rgba(214, 187, 106, 0.12);
}

.bottom-chat-message-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.bottom-chat-message-author {
  font-weight: 700;
}

.bottom-chat-message-time {
  opacity: 0.68;
}

.bottom-chat-message-text {
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.bottom-chat-empty {
  padding: 12px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  opacity: 0.75;
}

.bottom-chat-footer {
  display: grid;
  gap: 8px;
}

.bottom-chat-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bottom-chat-input {
  flex: 1;
  min-width: 0;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.04);
  color: inherit;
}

.bottom-chat-send-btn {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 12px;
  border: 1px solid rgba(168, 194, 126, 0.24);
  background: rgba(168, 194, 126, 0.16);
  color: #d8ebb0;
  cursor: pointer;
}

.bottom-chat-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
}

.bottom-chat-counter {
  opacity: 0.68;
}

.bottom-chat-error {
  color: #f2a38f;
}

@media (max-width: 768px) {
  .runtime-notice-stack {
    top: 8px;
    width: calc(100vw - 16px);
  }

  .runtime-notice {
    padding: 12px 14px;
    border-radius: 14px;
  }

  .runtime-notice-copy {
    font-size: 0.88rem;
  }

  .bottom-bar-shell {
    justify-content: stretch;
    gap: 8px;
  }

  .bottom-bar-info-strip {
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .bottom-bar-info-strip::-webkit-scrollbar {
    display: none;
  }

  .bottom-info-xp {
    width: 180px;
    flex: 0 0 180px;
  }

  .bottom-info-session,
  .bottom-info-last-loot {
    flex: 0 0 auto;
  }

  .bottom-info-last-loot {
    max-width: 210px;
  }

  .bottom-bar-actions {
    width: auto;
    justify-content: flex-end;
  }

  .bottom-chat-panel {
    right: 0;
    left: 0;
    width: auto;
    bottom: calc(100% + 8px);
  }

  .bottom-info-panel {
    right: 0;
    left: 0;
    width: auto;
    bottom: calc(100% + 8px);
  }

  .bottom-chat-header {
    flex-direction: column;
  }
}


