.grift-page {
  color-scheme: dark;
}

.grift-body {
  margin: 0;
  min-height: 100vh;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(34, 211, 238, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(167, 139, 250, 0.1), transparent 50%),
    #050508;
  color: #e4e4e7;
}

.grift-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

@media (min-width: 768px) {
  .grift-shell { padding: 1.75rem 1.5rem 4rem; }
}

.grift-hero {
  position: relative;
  margin-bottom: 1.25rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(63, 63, 70, 0.7);
  background: linear-gradient(145deg, rgba(24, 24, 27, 0.95), rgba(9, 9, 11, 0.98));
  overflow: hidden;
}

.grift-hero__glow {
  position: absolute;
  inset: -40% -20% auto;
  height: 70%;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.18), transparent 65%);
  pointer-events: none;
}

.grift-hero__inner {
  position: relative;
  padding: 2rem 1.5rem 1.75rem;
}

@media (min-width: 768px) {
  .grift-hero__inner { padding: 2.5rem 2rem 2rem; }
}

.grift-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.grift-hero__title {
  margin: 1rem 0 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.grift-hero__acronym {
  font-size: clamp(2.5rem, 6vw, 3.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  background: linear-gradient(120deg, #f4f4f5 0%, #a5f3fc 45%, #c4b5fd 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grift-hero__subtitle {
  font-size: clamp(0.95rem, 2vw, 1.15rem);
  font-weight: 500;
  color: #a1a1aa;
}

.grift-hero__lede {
  margin: 0;
  max-width: 46rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: #a1a1aa;
}

.grift-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}

.grift-meta-pill {
  font-size: 0.8rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: rgba(39, 39, 42, 0.9);
  border: 1px solid #3f3f46;
  color: #d4d4d8;
}

.grift-disclosure {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  font-size: 0.88rem;
  line-height: 1.55;
  color: #fde68a;
  background: rgba(120, 53, 15, 0.25);
  border: 1px solid rgba(251, 191, 36, 0.35);
}

.grift-disclosure strong {
  color: #fef3c7;
}

.grift-disclosure-data {
  display: block;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(251, 191, 36, 0.2);
  font-size: 0.82rem;
  color: #fcd34d;
}

.grift-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.grift-search-wrap {
  position: relative;
  flex: 1 1 240px;
  min-width: 0;
}

.grift-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #71717a;
  pointer-events: none;
}

.grift-search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.75rem;
  border-radius: 0.85rem;
  border: 1px solid #3f3f46;
  background: rgba(24, 24, 27, 0.9);
  color: #f4f4f5;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.grift-search-input:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

.grift-search-results {
  position: absolute;
  z-index: 40;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border-radius: 0.85rem;
  border: 1px solid #3f3f46;
  background: #18181b;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  max-height: 280px;
  overflow-y: auto;
}

.grift-search-results li button {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: none;
  border-radius: 0.55rem;
  background: transparent;
  color: #e4e4e7;
  cursor: pointer;
  font-size: 0.9rem;
}

.grift-search-results li button:hover,
.grift-search-results li button:focus-visible {
  background: rgba(34, 211, 238, 0.12);
  outline: none;
}

.grift-search-results .grift-search-meta {
  display: block;
  font-size: 0.75rem;
  color: #71717a;
  margin-top: 0.15rem;
}

.grift-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  flex: 1 1 auto;
}

.grift-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.65rem 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid transparent;
  background: rgba(39, 39, 42, 0.95);
}

.grift-chip__dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.grift-chip__remove {
  border: none;
  background: transparent;
  color: #a1a1aa;
  cursor: pointer;
  padding: 0.15rem;
  line-height: 1;
  border-radius: 0.25rem;
}

.grift-chip__remove:hover { color: #f4f4f5; }

.grift-reset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid #3f3f46;
  background: transparent;
  color: #a1a1aa;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.grift-reset-btn:hover {
  color: #f4f4f5;
  border-color: #52525b;
}

.grift-dashboard {
  display: grid;
  gap: 1rem;
  margin-bottom: 2rem;
}

@media (min-width: 1024px) {
  .grift-dashboard {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

.grift-chart-panel,
.grift-leaderboard {
  border-radius: 1.15rem;
  border: 1px solid rgba(63, 63, 70, 0.75);
  background: linear-gradient(160deg, rgba(18, 18, 20, 0.98), rgba(9, 9, 11, 0.99));
  overflow: hidden;
}

.grift-chart-head,
.grift-leaderboard-head {
  padding: 1.15rem 1.25rem 0.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.grift-panel-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #f4f4f5;
}

.grift-panel-desc {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: #71717a;
}

.grift-legend-spy {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: #fbbf24;
}

.grift-legend-spy i {
  display: inline-block;
  width: 1.25rem;
  height: 0;
  border-top: 2px dashed #fbbf24;
}

.grift-chart-frame {
  position: relative;
  height: min(52vh, 420px);
  min-height: 280px;
  padding: 0.5rem 0.75rem 1rem;
}

.grift-chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #71717a;
  font-size: 0.95rem;
  pointer-events: none;
  backdrop-filter: blur(2px);
}

.grift-chart-loading[hidden] { display: none; }

.grift-leader-list {
  margin: 0;
  padding: 0.5rem 0.75rem 1rem;
  list-style: none;
}

.grift-leader-item {
  margin-bottom: 0.45rem;
}

.grift-leader-btn {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid transparent;
  background: rgba(39, 39, 42, 0.5);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.grift-leader-btn:hover,
.grift-leader-btn.is-active {
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}

.grift-leader-rank {
  font-size: 0.75rem;
  font-weight: 700;
  color: #71717a;
  min-width: 1.5rem;
}

.grift-leader-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #f4f4f5;
  line-height: 1.25;
}

.grift-leader-sub {
  font-size: 0.72rem;
  color: #71717a;
  margin-top: 0.1rem;
}

.grift-leader-excess {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4ade80;
  font-variant-numeric: tabular-nums;
}

.grift-leader-excess.is-negative { color: #fb7185; }

.grift-method {
  border-top: 1px solid rgba(63, 63, 70, 0.5);
  padding-top: 1.75rem;
}

.grift-method-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  color: #a1a1aa;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.grift-method-grid {
  display: grid;
  gap: 0.85rem;
}

@media (min-width: 768px) {
  .grift-method-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.grift-method-card {
  padding: 1.1rem 1.15rem;
  border-radius: 0.95rem;
  border: 1px solid #27272a;
  background: rgba(24, 24, 27, 0.6);
}

.grift-method-card i {
  color: #22d3ee;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.grift-method-card h3 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  color: #f4f4f5;
}

.grift-method-card p {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
  color: #71717a;
}

.grift-footer {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  font-size: 0.8rem;
  color: #52525b;
}

.grift-party-d { color: #60a5fa; }
.grift-party-r { color: #f87171; }
.grift-party-i { color: #c084fc; }