:root {
  --ink: #09090d;
  --panel: #111116;
  --panel-2: #181820;
  --line: rgba(255,255,255,.08);
  --muted: #85858f;
  --lime: #b9fb2c;
  --purple: #bd54ff;
  --purple-soft: #6d2ea6;
}

html { background: var(--ink); }
body {
  color: #f7f7fa;
  background:
    radial-gradient(900px 420px at 50% 22%, rgba(128, 51, 172, .13), transparent 68%),
    radial-gradient(500px 400px at 83% 70%, rgba(185, 251, 44, .055), transparent 72%),
    var(--ink);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  min-height: 68px;
  margin: 0;
  padding: 8px max(18px, calc((100% - 1440px) / 2));
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: rgba(15, 15, 20, .93);
  box-shadow: 0 8px 30px rgba(0,0,0,.2);
  backdrop-filter: blur(18px);
}

.brand-banner-link {
  display: grid;
  width: 205px;
  height: 52px;
  overflow: hidden;
  border: 1px solid rgba(196, 88, 255, .2);
  border-radius: 12px;
  background: #1a1820;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 22px rgba(0,0,0,.2);
  place-items: center;
}
.brand-banner-link img {
  width: 100%;
  height: auto;
  max-width: none;
  transform: translateY(-42px);
  transition: transform .2s ease;
}
.brand-banner-link:hover img { transform: translateY(-42px) scale(1.04); }
.brand-banner-link:focus-visible { outline: 2px solid var(--lime); outline-offset: 3px; }

.header-actions { gap: 9px; }
.user-pill, .balance-pill {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #1a1a21;
}
.balance-pill { color: var(--lime); }
.star-icon { color: var(--lime); }
.ghost-button { border-radius: 10px; }

.upgrader-shell {
  width: min(1440px, calc(100% - 28px));
  margin: 22px auto 48px;
  gap: 16px;
}
.arena {
  min-height: 430px;
  grid-template-columns: minmax(260px, 1fr) minmax(330px, .9fr) minmax(260px, 1fr);
  gap: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.018), transparent 25%),
    #0e0e13;
  box-shadow: 0 26px 60px rgba(0,0,0,.27);
}
.arena:after {
  position: absolute;
  inset: 14px;
  z-index: 0;
  border: 1px solid rgba(255,255,255,.035);
  border-radius: 14px;
  content: "";
  pointer-events: none;
}
.selected-panel, .wheel-panel, .panel {
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(255,255,255,.035), rgba(255,255,255,.012));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.selected-panel { padding: 18px; border-radius: 15px; }
.wheel-panel {
  min-height: 360px;
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 43%, rgba(185, 251, 44, .11), transparent 29%),
    radial-gradient(circle at 50% 48%, rgba(182, 79, 255, .14), transparent 58%),
    #121217;
}
.panel-label { color: #a9a9b4; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; }
.slot-value { color: var(--lime); }
.selection-copy { color: var(--muted); }
.gift-card {
  border: 1px solid rgba(255,255,255,.06);
  border-radius: 12px;
  background: #101015;
}
.gift-card:before {
  position: absolute;
  inset: 0;
  z-index: 6;
  border: 1px solid rgba(185,251,44,.12);
  border-radius: inherit;
  content: "";
  pointer-events: none;
}
.wheel-wrap { width: min(100%, 260px); padding: 15px; }
.wheel {
  background: conic-gradient(from 0deg, var(--purple) 0deg var(--chance-deg, 0deg), #24242b var(--chance-deg, 0deg) 1turn);
  box-shadow: 0 0 0 1px rgba(255,255,255,.08), 0 0 0 9px #15151a, 0 20px 35px rgba(0,0,0,.48), 0 0 35px rgba(185,251,44,.08);
}
.wheel:after { background: #131319; }
.wheel-center { background: #18181e; }
.wheel-center span { color: var(--lime); font-size: 25px; letter-spacing: -.06em; }
.wheel-center small { color: #9f9fa9; }
.wheel-pointer span { border-top-color: var(--lime); }
.wheel-pointer:before { border-color: var(--lime); background: #15151a; }
.empty-gift-art {
  width: min(68%, 156px);
  height: 92px;
  object-fit: contain;
  opacity: .76;
  filter: drop-shadow(0 12px 14px rgba(0, 0, 0, .34));
}
.input-gift-art { transform: translateY(3px) scale(1.04); }
.target-gift-art { transform: translateY(3px) scale(1.14); }
.empty-gift-state { gap: 7px; padding: 14px; }
.empty-gift-state .empty-ring { display: none; }
.upgrade-button {
  width: min(100%, 260px);
  min-height: 52px;
  border-color: rgba(185,251,44,.45);
  border-radius: 11px;
  background: linear-gradient(180deg, #d2ff42, #a8e71f);
  color: #14180b;
  font-size: 13px;
  letter-spacing: .02em;
  box-shadow: 0 10px 24px rgba(185,251,44,.16), inset 0 1px 0 rgba(255,255,255,.5);
}
.upgrade-button:hover:not(:disabled) { border-color: #edffac; background: #dcff69; }
.result-banner, .fairness-box { border: 1px solid rgba(255,255,255,.05); background: #101015; }

.content-grid { grid-template-columns: minmax(360px, .72fr) minmax(0, 1.28fr); gap: 16px; }
.panel { padding: 18px; border-radius: 16px; background: #111116; }
.panel-head { padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.panel-head h2 { font-size: 18px; }
.future-strip, .stars-input-card { border-color: var(--line); border-radius: 10px; background: #19191f; }
.stars-input-card { background: linear-gradient(135deg, rgba(185,251,44,.09), rgba(185,251,44,.02)); }
.stars-input-card label { color: var(--lime); }
.stars-input-card button { border-color: transparent; background: var(--lime); color: #15180b; }
.filters { gap: 8px; }
.filters input, .filters select, .stars-input-card input {
  border-color: var(--line);
  border-radius: 9px;
  background: #18181e;
}
.market-grid { gap: 9px; }
.market-card {
  border-color: var(--line);
  border-radius: 12px;
  background: #18181e;
}
.market-card:hover:not(:disabled) { border-color: rgba(185,251,44,.36); background: #202027; }
.market-card.selected { border-color: var(--lime); background: linear-gradient(150deg, rgba(185,251,44,.14), #1c1d20); box-shadow: 0 0 0 1px rgba(185,251,44,.12); }
.market-card .price-chip { background: #2b2b34; color: var(--lime); }
.target-item .price-chip { background: rgba(185,251,44,.1); }
.scope-badge { background: rgba(12,12,16,.82); }
.card-buy-action { border-color: rgba(185,251,44,.2); background: rgba(185,251,44,.12); color: var(--lime); }

@media (max-width: 900px) {
  .app-header { padding-inline: 14px; }
  .brand-banner-link { width: 160px; height: 46px; }
  .arena { grid-template-columns: 1fr; padding: 14px; gap: 14px; }
  .wheel-panel { order: -1; min-height: 300px; }
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .app-header { min-height: 60px; }
  .brand-banner-link { width: 140px; height: 42px; }
  .user-pill { display: none; }
  .upgrader-shell { width: min(100% - 16px, 1440px); margin-top: 10px; }
  .arena { border-radius: 15px; }
  .wheel-panel { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .filters { grid-template-columns: 1fr 1fr; }
}
