:root {
  color-scheme: dark;
  --bg: #0b0f17;
  --panel: #171d2a;
  --panel-strong: #1c2332;
  --metric: #111721;
  --text: #f4f6fb;
  --muted: #7f8aa0;
  --accent: #d5ad5a;
  --green: #66c08a;
  --red: #ef675a;
  --border: #263044;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.app {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 18px 14px 32px;
}

.hero {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.eyebrow {
  margin: 0 0 8px;
  color: #657086;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(24px, 7vw, 34px);
  line-height: 1;
}

.subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.tab {
  border: 0;
  color: var(--text);
  cursor: pointer;
  font-weight: 700;
}

.live-badge {
  margin-left: auto;
  color: #c4c9d4;
  font-size: 12px;
}

.live-badge::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.live-badge.paused {
  color: var(--muted);
}

.live-badge.paused::before {
  background: var(--red);
}

.summary {
  display: grid;
  grid-template-columns: minmax(0, 220px);
  gap: 10px;
  margin: 14px 0;
}

.summary article,
.prediction-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
}

.summary article {
  padding: 12px;
}

.summary span,
.label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary strong {
  display: block;
  margin-top: 6px;
  font-size: 20px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.tab {
  flex: 0 0 auto;
  padding: 8px 15px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #111722;
  color: var(--muted);
}

.tab.active {
  border-color: var(--accent);
  background: rgba(213, 173, 90, 0.10);
  color: #f0c86e;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 14px 0;
}

.referral-link,
.referral-link:visited,
.referral-link:hover,
.referral-link:active,
.profile-panel {
  color: inherit;
  text-decoration: none;
}

.referral-panel,
.profile-panel {
  position: relative;
  display: grid !important;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 58px;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  background:
    radial-gradient(circle at top left, rgba(213, 173, 90, 0.13), transparent 14rem),
    var(--panel-strong);
  color: #f0c86e;
  box-shadow: none;
  cursor: pointer;
  text-decoration: none !important;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.profile-panel {
  border-left-color: var(--green);
  font: inherit;
  text-align: left;
}

.referral-panel:hover,
.profile-panel:hover {
  border-color: rgba(240, 200, 110, 0.72);
  transform: translateY(-1px);
}

.referral-panel:active,
.profile-panel:active {
  transform: translateY(0);
}

.referral-brand,
.profile-mini-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(240, 200, 110, 0.34);
  border-radius: 12px;
  background: rgba(11, 15, 23, 0.68);
  color: #fff4cf;
  font-size: 14px;
  font-weight: 950;
  letter-spacing: 0.02em;
}

.profile-mini-avatar {
  border-color: rgba(102, 192, 138, 0.38);
  color: #bff3d0;
}

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

.referral-copy strong {
  color: #fff4cf;
  font-size: 14px;
}

.referral-copy small {
  color: var(--muted);
  font-size: 11px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.referral-arrow {
  position: absolute;
  right: 10px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 50%;
  background: rgba(213, 173, 90, 0.16);
  color: #fff4cf;
  font-size: 16px;
  font-weight: 900;
}

.referral-panel.disabled {
  border-color: var(--border);
  border-left-color: var(--border);
  background: #111722;
  color: var(--muted);
  pointer-events: none;
}

.referral-panel.disabled .referral-brand,
.referral-panel.disabled .referral-arrow {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.referral-panel.disabled .referral-copy strong,
.referral-panel.disabled .referral-copy small {
  color: var(--muted);
}

.profile-overlay {
  position: fixed;
  z-index: 20;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(5, 8, 13, 0.72);
  backdrop-filter: blur(10px);
}

.profile-overlay[hidden] {
  display: none;
}

.profile-card {
  position: relative;
  width: min(360px, 100%);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel-strong);
  text-align: center;
}

.profile-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #111722;
  color: var(--text);
  cursor: pointer;
  font-size: 20px;
}

.profile-avatar {
  width: 86px;
  height: 86px;
  margin: 4px auto 12px;
  border-radius: 50%;
  object-fit: cover;
}

.profile-avatar.fallback {
  display: grid;
  place-items: center;
  background: rgba(102, 192, 138, 0.12);
  color: #bff3d0;
  font-size: 32px;
  font-weight: 900;
}

.profile-card h2 {
  margin: 0;
  font-size: 24px;
}

.profile-card p {
  margin: 6px 0 18px;
  color: var(--muted);
}

.profile-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0;
}

.profile-info div,
.profile-section,
.profile-option {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #111722;
}

.profile-info div {
  padding: 10px;
  text-align: left;
}

.profile-info span,
.profile-section h3 {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
}

.profile-info strong {
  color: var(--text);
  font-size: 13px;
}

.profile-option {
  width: 100%;
  padding: 12px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
}

.profile-option.active {
  border-color: rgba(102, 192, 138, 0.42);
  color: #bff3d0;
}

.profile-section {
  margin-top: 10px;
  padding: 12px;
  text-align: left;
}

.profile-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.profile-history {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.history-item {
  display: grid;
  gap: 2px;
  padding: 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.035);
}

.history-item strong {
  color: var(--text);
}

.feed {
  display: grid;
  gap: 12px;
}

.prediction-card {
  padding: 16px 16px 18px;
  overflow: hidden;
  position: relative;
  transition: opacity 0.25s ease, filter 0.25s ease, border-color 0.25s ease;
}

.signal-card.emerald {
  border-left: 3px solid var(--accent);
  background: var(--panel-strong);
}

.signal-card.matte {
  border-left: 3px solid var(--accent);
  background: var(--panel-strong);
}

.signal-card.red {
  border-left: 3px solid var(--red);
  background: var(--panel-strong);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.game {
  margin: 0;
  font-size: 17px;
  font-weight: 900;
}

.asset-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.signal-icon {
  display: inline-grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #111722;
  font-size: 12px;
  font-weight: 900;
}

.time {
  color: var(--muted);
  font-size: 13px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-bottom: 14px;
}

.metric {
  padding: 11px;
  border-radius: 8px;
  background: var(--metric);
}

.mines-analysis {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.mines-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  padding: 10px;
  border-radius: 12px;
  background: var(--metric);
}

.mines-cell {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  background: #171d2a;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.mines-cell.safe {
  border-color: rgba(102, 192, 138, 0.52);
  background: rgba(102, 192, 138, 0.14);
  color: #bff3d0;
  box-shadow: 0 0 18px rgba(102, 192, 138, 0.12);
}

.mines-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.mines-timer-row {
  grid-template-columns: minmax(0, 1fr);
}

.value {
  display: block;
  margin-top: 5px;
  font-size: 19px;
  font-weight: 800;
}

.risk-badge {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(213, 173, 90, 0.12);
  color: #f0c86e;
  font-size: 11px;
  font-weight: 900;
}

.gateway-timer {
  position: relative;
}

.timer-value {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.04em;
  transition: color 0.3s ease;
}

.expiry-status {
  display: none;
  margin-top: 5px;
  color: #ff8a3d;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.signal-card.expiring .timer-value {
  color: var(--red);
}

.signal-card.expiring .expiry-status {
  display: inline-block;
  animation: blink 0.9s ease-in-out infinite;
}

.signal-card.closed {
  opacity: 0.46;
  filter: grayscale(0.35);
}

.signal-card.closed .closed-badge {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.closed-badge {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;
  width: max-content;
  max-width: calc(100% - 32px);
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(11, 15, 23, 0.94);
  color: var(--text);
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.94);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.signal-footer {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.risk-ring {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel-strong) 58%, transparent 60%),
    conic-gradient(var(--risk-color) var(--risk-percent), rgba(255, 255, 255, 0.08) 0);
  color: var(--risk-color);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 900;
}

.risk-ring span {
  transform: translateY(1px);
}

.verified {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.verified span {
  color: var(--green);
}

.verified strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.pause-banner {
  padding: 22px;
  border: 1px solid rgba(213, 173, 90, 0.22);
  border-radius: 14px;
  background:
    radial-gradient(circle at top left, rgba(213, 173, 90, 0.13), transparent 18rem),
    var(--panel-strong);
  text-align: left;
}

.pause-banner h2 {
  margin: 0;
  font-size: 22px;
}

.pause-banner p {
  max-width: 620px;
  margin: 10px 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.pause-banner span {
  display: inline-block;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(213, 173, 90, 0.10);
  color: #f0c86e;
  font-size: 12px;
  font-weight: 800;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }

  50% {
    opacity: 0.25;
  }
}

@media (max-width: 520px) {
  .hero {
    display: block;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .summary,
  .metrics,
  .mines-analysis {
    grid-template-columns: 1fr;
  }

  .signal-footer {
    grid-template-columns: auto 1fr;
  }

  .verified {
    grid-column: 1 / -1;
    text-align: left;
  }
}
