/* Custom variables and theme */
:root {
  --bg: #030308;
  --text: #e2e8f0;
  --text-primary: #f8fafc;
  --muted: #94a3b8;
  --accent-base: #a855f7;
  --accent-gradient: linear-gradient(135deg, #c084fc, #60a5fa);
  --accent-hover: linear-gradient(135deg, #d8b4fe, #93c5fd);
  --link: #38bdf8;
  --card-bg: rgba(20, 20, 30, 0.4);
  --card-border: rgba(255, 255, 255, 0.08);
  --code-bg: rgba(0, 0, 0, 0.3);
  --success: #22c55e;
  --warning: #f59e0b;
  --glass-blur: blur(20px);
}

/* Base styles */
* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  font-size: 16px;
  position: relative;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
.badge {
  font-family: 'Outfit', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
}

/* Background Animated Orbs */
.bg-orbs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
  background: radial-gradient(circle at 50% 10%, rgba(20, 10, 40, 0.8), var(--bg) 60%);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
  width: 40vw;
  height: 40vw;
  background: #a855f7;
  top: -10vw;
  left: -10vw;
  animation-duration: 25s;
}

.orb-2 {
  width: 50vw;
  height: 50vw;
  background: #3b82f6;
  bottom: -20vw;
  right: -10vw;
  animation-duration: 22s;
  animation-direction: alternate-reverse;
}

.orb-3 {
  width: 30vw;
  height: 30vw;
  background: #ec4899;
  top: 40%;
  left: 60%;
  animation-duration: 28s;
  opacity: 0.3;
}

@keyframes float {
  0% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(5%, 10%) scale(1.05);
  }

  66% {
    transform: translate(-5%, -5%) scale(0.95);
  }

  100% {
    transform: translate(10%, -10%) scale(1);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(15px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Layout */
.container {
  max-width: 1200px;
  padding: 0 24px;
  margin: 0 auto;
}

/* Hero */
.hero {
  padding: 80px 0 64px;
  text-align: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

main.container {
  display: flex;
  flex-direction: column;
  gap: 32px;
  padding-top: 32px;
  padding-bottom: 48px;
}

.hero .badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: fadeIn 0.6s ease-out;
}

.hero h1 {
  margin: 0 0 16px;
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeIn 0.8s ease-out;
}

.lead {
  color: var(--muted);
  margin: 0 auto 32px;
  max-width: 720px;
  font-size: 18px;
  animation: fadeIn 1s ease-out;
}

.cta {
  display: inline-flex;
  gap: 16px;
  animation: fadeIn 1.2s ease-out;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.btn.primary {
  background: var(--accent-gradient);
  border: none;
  color: #fff;
  box-shadow: 0 4px 15px rgba(168, 85, 247, 0.4);
}

.btn.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.6);
  transform: translateY(-2px);
}

/* Cards */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin: 24px 0;
}

main.container>section {
  flex: 0 0 auto;
}

#try-it .grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  #try-it .grid {
    grid-template-columns: 1fr;
  }
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 32px;
  margin: 16px 0;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  background: rgba(25, 25, 35, 0.5);
}

.card h2 {
  margin: 0 0 20px;
  font-size: 32px;
  letter-spacing: -0.01em;
}

.card h3 {
  margin: 0 0 16px;
  font-size: 22px;
  color: var(--text-primary);
  font-weight: 500;
}

.card.subtle {
  background: rgba(10, 10, 15, 0.4);
  border-radius: 16px;
  padding: 24px;
  box-shadow: none;
}

.card.subtle:hover {
  transform: none;
  background: rgba(15, 15, 20, 0.5);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.card table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
  font-size: 14px;
}

.card th,
.card td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  text-align: left;
}

.card tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.02);
}

/* Inputs */
.try-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 12px 0 24px;
}

.input {
  flex: 1 1 280px;
  background: rgba(0, 0, 0, 0.4);
  color: var(--text-primary);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 16px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.input::placeholder {
  color: var(--muted);
}

.input.textarea {
  width: 100%;
  min-height: 180px;
  font-family: 'Courier New', Courier, monospace;
  resize: vertical;
  line-height: 1.5;
  font-size: 14px;
}

.input:focus {
  outline: none;
  background: rgba(0, 0, 0, 0.6);
  border-color: rgba(168, 85, 247, 0.6);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn-row.right {
  justify-content: flex-end;
  margin-top: 16px;
}

/* Data Display */
code {
  background: rgba(255, 255, 255, 0.06);
  padding: 4px 8px;
  border-radius: 6px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.9em;
  color: #fff;
}

.code-block {
  background: var(--code-bg);
  color: #e2e8f0;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 20px;
  overflow: auto;
  max-height: 480px;
  box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.5);
  font-family: 'Courier New', Courier, monospace;
  font-size: 14px;
  line-height: 1.5;
}

#try-it .code-block {
  white-space: pre-wrap;
  word-break: break-word;
}

/* Endpoints list */
.endpoints {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.endpoint {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  transition: all 0.3s ease;
}

.endpoint:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(168, 85, 247, 0.5);
  transform: translateX(4px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.endpoint .method {
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

.endpoint .method.get {
  color: #4ade80;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.2);
}

.endpoint .path {
  font-size: 15px;
  color: var(--text-primary);
  font-family: 'Courier New', Courier, monospace;
}

.endpoint .desc {
  color: var(--muted);
  margin-left: auto;
  text-align: right;
  font-size: 14px;
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: #7dd3fc;
  text-decoration: underline;
}

/* Details / Summary */
details summary {
  cursor: pointer;
  font-weight: 600;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  transition: all 0.2s;
  margin-bottom: 12px;
}

details summary:hover {
  background: rgba(255, 255, 255, 0.06);
}

details[open] summary {
  border-bottom-color: transparent;
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}

details>div.grid {
  padding: 16px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-top: none;
  border-radius: 0 0 8px 8px;
  margin-top: 0;
}

label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

select,
input[type="number"] {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  padding: 8px 12px;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
}

select:focus,
input[type="number"]:focus {
  outline: none;
  border-color: rgba(168, 85, 247, 0.5);
}

/* Footer */
.footer {
  color: var(--muted);
  text-align: center;
  padding: 48px 0;
  font-size: 14px;
}

/* Existing Layout requirements for Player Viewer & other components */
.pv-frame {
  width: 100%;
  min-height: 640px;
  border: 1px solid var(--card-border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
}

/* Item grid */
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 64px);
  gap: 10px;
}

.item-card {
  position: relative;
  overflow: visible;
}

.item-card .item-icon {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  image-rendering: pixelated;
  background-color: rgba(0, 0, 0, 0.3);
  transition: transform 0.2s;
}

.item-card:hover .item-icon {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.3);
}

.item-card .item-icon.empty {
  background: rgba(255, 255, 255, 0.02);
  border-style: dashed;
}

.item-card .badge {
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 8px;
  font-weight: bold;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.item-card .badge.count {
  bottom: 4px;
  right: 4px;
}

.item-card .badge.slot {
  top: 4px;
  left: 4px;
  color: #cbd5e1;
}

.has-tooltip {
  position: relative;
}

.has-tooltip .tooltip {
  display: none;
}

.item-card .tooltip {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 9999;
  min-width: 240px;
  max-width: 420px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  background: rgba(15, 15, 20, 0.95);
  color: var(--text);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.item-card.pinned .tooltip {
  display: block;
}

.item-card.tooltip-left .tooltip {
  left: auto;
  right: calc(100% + 12px);
}

.item-card .pet-item {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid var(--card-border);
  background: rgba(0, 0, 0, 0.5);
  image-rendering: pixelated;
}

.item-tooltip {
  position: fixed;
  display: none;
  z-index: 99999;
  min-width: 260px;
  max-width: 420px;
  background: rgba(10, 10, 15, 0.95);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.has-tooltip.pinned .tooltip {
  display: block;
}

.tooltip-title {
  font-weight: 700;
  font-family: 'Outfit', sans-serif;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--text-primary);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
}

.tooltip-lore {
  color: #e2e8f0;
  margin: 0;
  font-size: 14px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.tooltip-lore-line {
  white-space: pre-wrap;
}

/* Selector bar */
.selector-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  position: relative;
  z-index: 50;
  pointer-events: auto;
}

.slot-tab {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
}

.slot-tab:hover {
  background: rgba(255, 255, 255, 0.1);
}

.slot-tab.active {
  outline: 2px solid var(--accent-base);
  outline-offset: 2px;
  background: rgba(168, 85, 247, 0.2);
}

.slot-icon {
  width: 20px;
  height: 20px;
  image-rendering: pixelated;
}

/* Top tabs */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 16px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 12px;
  position: relative;
  z-index: 40;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.tab:hover {
  background: rgba(255, 255, 255, 0.08);
}

.tab.active {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(168, 85, 247, 0.4);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.15);
}

.tab-icon {
  width: 18px;
  height: 18px;
  image-rendering: pixelated;
  border-radius: 4px;
}

.panel-inner {
  margin-top: 8px;
}

/* Item overlay */
.item-overlay {
  position: fixed;
  right: 24px;
  top: 24px;
  width: 420px;
  max-height: calc(100vh - 48px);
  z-index: 90;
  background: rgba(20, 20, 30, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

.item-overlay .io-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.item-overlay .io-icon {
  width: 32px;
  height: 32px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.item-overlay .io-title {
  flex: 1;
  font-family: 'Outfit', sans-serif;
}

.item-overlay .io-close {
  border: 0;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.item-overlay .io-close:hover {
  background: rgba(255, 0, 0, 0.5);
}

.item-overlay .io-body {
  padding: 16px;
  max-height: calc(100vh - 48px - 60px);
  overflow: auto;
}

/* Grids */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 16px;
}

.skill-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  font-size: 15px;
  transition: transform 0.2s, background 0.2s;
}

.skill-item:hover {
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
}

.skill-name {
  font-weight: 600;
  color: var(--text-primary);
}

.skill-level {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--accent-base);
}

.gear-grid,
.wardrobe-grid,
.pets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
  gap: 16px;
}

.gear-item,
.wardrobe-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.top-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

@media (max-width: 768px) {
  .top-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 48px;
  }
}

/* Networth Dashboard */
.nw-dashboard {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.8s ease-out;
}

.nw-header {
  text-align: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: 20px;
}

.nw-total-label {
  color: var(--muted);
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 8px;
}

.nw-total-value {
  font-family: 'Outfit', sans-serif;
  font-size: 48px;
  font-weight: 800;
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 10px 20px rgba(245, 158, 11, 0.2);
}

.nw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.nw-cat-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  transition: all 0.3s ease;
}

.nw-cat-card:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.nw-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.nw-cat-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text-primary);
}

.nw-cat-value {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  color: var(--accent-base);
}

.nw-top-items {
  margin-top: 24px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 16px;
  border: 1px solid var(--card-border);
}

.nw-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nw-item-row:last-child {
  border-bottom: none;
}

.nw-item-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
}

.nw-item-price {
  font-family: 'Courier New', monospace;
  font-size: 13px;
  color: #fbbf24;
}

/* SkyHelper Section */
.sky-commands {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.sky-btn {
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  color: #d8b4fe;
  padding: 10px;
  border-radius: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.sky-btn:hover {
  background: rgba(168, 85, 247, 0.2);
  border-color: rgba(168, 85, 247, 0.4);
  transform: scale(1.02);
  color: #fff;
}

.sky-result {
  margin-top: 16px;
  animation: fadeIn 0.4s ease-out;
}