/* === Global Reset === */
html,
body {
  height: 100%;
  margin: 0;
}

.pinnacle-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.pinnacle-items li {
  list-style: none;
  margin: 0 0 8px 0;
  padding: 0;
}

.pinnacle-items li::marker {
  content: none;
}

/* --- Layout general setting --- */
:root {
  --pill-w: 48px;
  --pill-gap: 12px;
  --app-bg: #0f1115;
  --app-surface: #141720;
  --app-muted: #1b1f2a;
  --app-ring: #2b3040;
  --app-text: #e8eefb;
  --app-sub: #9fb0d8;
  --app-accent: #5aa9ff;
  --tree-gap: 4px;
  --scrollbar-size: 100px;
  --scrollbar-thumb: #BDA000;
  --scrollbar-thumb-hover: #FFD24D;
  --scrollbar-track: #1a1a1a;
  --special-top-nudge: -6px;
  --zone-thumb-h: 150px;
  --zone-card-w: 240px;
  --zone-thumb-h: 140px;
}

/* Item Rarities*/
.item-name {
  font-weight: 700;
}

.rarity-poor {
  color: #9d9d9d;
}

.rarity-common {
  color: #ffffff;
}

.rarity-uncommon {
  color: #1eff00;
}

.rarity-rare {
  color: #0070dd;
}

.rarity-epic {
  color: #a335ee;
}

/* Highlight utilities  */
.highlight-gold {
  color: #BDA000;
  font-weight: 700;
}

.highlight-green {
  color: #4caf50;
  font-weight: 700;
}

.highlight-blue {
  color: #4da6ff;
  font-weight: 700;
}

.highlight-lblue {
  color: #4da6ff;
  font-weight: 700;
}

.highlight-purple {
  color: #830cd3;
  font-weight: 700;
}

.highlight-red {
  color: #f44336;
}

p.Larger {
  font-size: 18px;
}

p.Bolder {
  font-weight: bold;
}

body {
  background-color: var(--app-bg);
  background-image:
    radial-gradient(1200px 800px at 70% -10%, rgba(255,255,255,.06), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(90,169,255,.08), transparent 60%),
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 50%);

  background-repeat: no-repeat;
  background-attachment: fixed;
}

/* Class selection screen paneling */
#class-screen {
  background: transparent;
  color: var(--app-text);
}

#class-screen h1 {
  color: var(--app-text);
  text-shadow: 0 0 12px rgba(90, 169, 255, .15);
}

#class-select button,
#back-btn,
#controls button,
#reset-btn {
  background: var(--app-muted);
  border: 1px solid var(--app-ring);
  color: var(--app-text);
  box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
}

#class-select button:hover,
#back-btn:hover,
#controls button:hover,
#reset-btn:hover {
  filter: brightness(1.08);
  border-color: var(--app-accent);
  box-shadow:
    0 0 0 2px rgba(90, 169, 255, .25),
    0 6px 20px rgba(0, 0, 0, .35);
}

/* horizontal scroll on */
#tree-container {
  overflow-x: auto;
  overscroll-behavior-x: contain;

  /* Firefox scrollbar styling */
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: auto;
}

/* WebKit (Chrome, Edge, Safari) */
#tree-container::-webkit-scrollbar {
  height: var(--scrollbar-size);
  background: var(--scrollbar-track);
}

#tree-container::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: 10px;
  border: 4px solid var(--scrollbar-track);
}

#tree-container::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}

#tree-container::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
  border-radius: 10px;
}

#tree-container::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

/* ------------------------------------------------------------------------------------------------------------------ */
/* remember not to remove this resizer block*/
/* ------------------------------------------------------------------------------------------------------------------ */
.tab-icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* --- Site navigation, subtabs, share button (used on every page) --- */

.site-nav {
  display: flex;
  gap: 2.25rem;
  align-items: flex-end;
}

/* All links share the same weight -> no width change on active */
.site-nav a {
  display: inline-flex;
  position: relative;
  padding-bottom: 8px;
  font-weight: 700;
}

.site-nav a.is-active {
  color: #d4b037;
}

.site-nav a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: #d4b037;
  border-radius: 2px;
  opacity: .9;
}

.site-nav a.is-active::after {
  display: block;
}

.subtabs-container {
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.2));
  border-bottom: 2px solid rgba(255, 200, 0, 0.3);
  padding: 0;
  margin: 0;
}

.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  max-width: 100%;
  margin: 0;
  padding: 0;
  align-items: flex-end;
}

.subtab {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.2rem;
  border: 2px solid rgba(255, 200, 0, 0.2);
  border-bottom: none;
  border-radius: 0.5rem 0.5rem 0 0;
  background: linear-gradient(to bottom, rgba(30, 30, 30, 0.8), rgba(20, 20, 20, 0.9));
  color: rgba(200, 200, 200, 0.9);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  white-space: nowrap;
  position: relative;
  margin-right: -1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.subtab:hover {
  background: linear-gradient(to bottom, rgba(40, 40, 40, 0.9), rgba(30, 30, 30, 0.95));
  color: rgba(255, 255, 255, 0.95);
  border-color: rgba(255, 200, 0, 0.4);
  z-index: 1;
}

.subtab.is-active {
  background: linear-gradient(to bottom, rgba(60, 50, 20, 0.9), rgba(40, 35, 15, 0.95));
  border-color: rgba(255, 200, 0, 0.6);
  color: #ffd700;
  font-weight: 600;
  z-index: 2;
  box-shadow:
    inset 0 1px 0 rgba(255, 200, 0, 0.3),
    0 0 10px rgba(255, 200, 0, 0.2);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
}

.subtab img {
  border-radius: 0.25rem;
  flex-shrink: 0;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  filter: brightness(0.9);
}

.subtab:hover img {
  opacity: 0.95;
  filter: brightness(1);
}

.subtab.is-active img {
  opacity: 1;
  filter: brightness(1.1);
}

/* Responsive adjustments */
@media (max-width: 1400px) {
  .subtab {
    padding: 0.5rem 1rem;
    font-size: 13px;
  }

  .subtab img {
    width: 18px;
    height: 18px;
  }
}

@media (max-width: 1200px) {
  .subtab {
    padding: 0.5rem 0.8rem;
    font-size: 12px;
    gap: 0.4rem;
  }

  .subtab img {
    width: 16px;
    height: 16px;
  }
}

@media (max-width: 768px) {
  .subtabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .subtab {
    padding: 0.45rem 0.7rem;
    font-size: 11px;
  }
}

.share-btn {
  padding: 8px 16px;
  background: #4da6ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
}

.share-btn:hover {
  background: #3d85cc;
}

/* --- Shell layout  ------------------------------------------------------ */
.site-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(189, 160, 0, .25);
  background: rgba(15, 18, 22, .75);
}

.nav-logo {
  font-weight: 800;
  color: #BDA000;
  text-decoration: none;
}

.nav-links a {
  color: #cfd7df;
  text-decoration: none;
  margin-left: 16px;
}

.nav-links a:hover {
  color: #fff;
}

.app-root {
  padding: 16px;
}

/*  gold-bordered panel card */
.panel-like {
  position: relative;
  padding: 16px;
  border: 1px solid rgba(189, 160, 0, .45);
  border-radius: 12px;
  background: rgba(15, 18, 22, .65);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, .4) inset,
    0 6px 22px rgba(0, 0, 0, .45),
    0 0 18px rgba(189, 160, 0, .18);
}

.panel-like h2 {
  color: #BDA000;
  margin: 0 0 8px;
}

/* Shared card shell used by system, class screens, etc. */
.class-select-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 1rem;
}

.class-select-card {
  border: 2px solid gold;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 800px;
  text-align: center;
  background-color: rgba(0, 0, 0, 0.6);
  color: #ddd;
}

/* Generic page shell  */
.view-shell {
  display: grid;
  gap: 1rem;
  padding: 1rem;
}

.page-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: .5rem 0 1rem;
  border-bottom: 1px solid var(--app-ring);
}

.page-title {
  margin: 0;
  font-size: clamp(1.25rem, 1vw + 1rem, 1.75rem);
}

.page-subtitle {
  margin: .25rem 0 0;
  opacity: .8;
}

/* Generic input */
.input {
  width: 100%;
  padding: .5rem .75rem;
  border: 1px solid var(--app-ring);
  border-radius: .5rem;
  background: var(--app-muted);
  color: inherit;
}

/* Empty state */
.empty-state {
  text-align: center;
  opacity: .8;
  padding: 2rem 1rem;
}

/* Chips */
.chips {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: .25rem 0 .5rem;
}

.chip {
  border: 1px solid var(--app-ring);
  padding: .125rem .5rem;
  border-radius: 999px;
  font-size: .8rem;
  opacity: .9;
}

.lead { opacity: .9; }

/* ============================================================
   NAV BAR 
   ============================================================ */
/* --- Shell layout ------------------------------------------------------------------ */
.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 72px;                          /* taller than before */
  min-height: 72px;
  border-bottom: 1px solid rgba(189, 160, 0, .30);
  background: rgba(10, 12, 17, .92);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 16px rgba(0, 0, 0, .45);
}

/* --- Logo ------------------------------------------------------------------------------ */
.nav-logo {
  text-decoration: none;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
}

.nav-logo-img {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 8px;
  border: 2px solid #f2c94c;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6) inset,
    0 0 10px rgba(242, 201, 76, 0.6),
    0 0 20px rgba(242, 201, 76, 0.2);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.nav-logo:hover .nav-logo-img {
  border-color: #ffd24d;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.6) inset,
    0 0 14px rgba(255, 210, 77, 0.8),
    0 0 28px rgba(255, 210, 77, 0.35);
}

/* --- Links row ------------------------- */
.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  justify-content: center;     /* horizontally center all links */
}

/* --- Plain nav links ------------------------------------------- */
.nav-links > a {
  display: inline-flex;
  align-items: center;
  position: relative;
  padding: 6px 14px;
  color: #c8d4e8;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 6px;
  border: 1px solid transparent;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.nav-links > a:hover {
  color: #fff;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(189, 160, 0, .25);
}
.nav-links > a.is-active {
  color: #d4b037;
  border-color: rgba(212, 176, 55, .35);
  background: rgba(212, 176, 55, .08);
}
/* gold underline on active */
.nav-links > a.is-active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #d4b037;
  border-radius: 2px;
}

/* --- Wrapper for items with flyout --------------------------------------- */
.nav-item-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/*  share base styles */
.nav-item-wrapper > a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  padding: 6px 14px;
  color: #c8d4e8;
  text-decoration: none;
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.nav-item-wrapper > a:hover,
.nav-item-wrapper:hover > a {
  color: #fff;
  background: rgba(255, 255, 255, .06);
  border-color: rgba(189, 160, 0, .25);
}
.nav-item-wrapper > a.is-active {
  color: #d4b037;
  border-color: rgba(212, 176, 55, .35);
  background: rgba(212, 176, 55, .08);
}
.nav-item-wrapper > a.is-active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 10%;
  right: 10%;
  height: 2px;
  background: #d4b037;
  border-radius: 2px;
}

/* V arrow */
.nav-chevron {
  font-size: 10px;
  opacity: .65;
  transition: transform .2s ease;
  pointer-events: none;
  line-height: 1;
}
.nav-item-wrapper:hover .nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

/* --- Flyout dropdown ------------------------------------------------------------- */
.nav-flyout {
  position: absolute;
  top: 100%;                            
  left: 50%;
  transform: translateX(-50%);
  min-width: 210px;
  list-style: none;
  margin: 0;
  padding: 10px 0 6px;
  background: rgba(13, 16, 22, .97);
  border: 1px solid rgba(189, 160, 0, .40);
  border-radius: 8px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, .65),
    0 0 0 1px rgba(189, 160, 0, .10) inset;
  backdrop-filter: blur(12px);

  /* hidden by default */
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-4px);
  transition: opacity .15s ease, transform .15s ease;
  z-index: 2000;
}

/* show on hover */
.nav-item-wrapper:hover .nav-flyout {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* just the  tip 0w0 */
.nav-flyout::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 6px;
  background: rgba(189, 160, 0, .55);
  clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

/* Flyout list items */
.nav-flyout li {
  margin: 0;
  padding: 0;
}

/* Section category headers inside flyout */
.flyout-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #BDA000;
  pointer-events: none;
  user-select: none;
  margin-top: 4px;
}

/* Gold rule */
.flyout-section-label:not(:first-child) {
  border-top: 1px solid rgba(189, 160, 0, .30);
  margin-top: 6px;
  padding-top: 12px;
}
/* Extending line to the right */
.flyout-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, rgba(189, 160, 0, .40), transparent);
}

/* Flyout buttons — flex row: image + label */
.flyout-item-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 6px 14px;
  min-height: 48px;              
  text-align: left;
  background: transparent;
  border: none;
  color: #c8d4e8;
  font-size: 17px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s ease, color .12s ease;
  white-space: nowrap;
}
.flyout-item-btn:hover {
  background: rgba(189, 160, 0, .12);
  color: #f0d060;
}
.flyout-item-btn:hover .flyout-item-img {
  filter: brightness(1.15);
}
.flyout-item-btn:active {
  background: rgba(189, 160, 0, .20);
}

/* Icon inside flyout rows */
.flyout-item-img {
  width: 32px;
  height: 32px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(189, 160, 0, .20);
  transition: filter .12s ease;
}

/* flyout */
.nav-flyout {
  min-width: 240px;
}

/* Nav button image  */
.nav-btn-img {
  width: 32px;
  height: 32px;
  object-fit: contain;
  flex-shrink: 0;
}
.nav-btn-label {
  line-height: 1.2;
}