/* I token di colore, tipo e raggio stanno in /css/tokens.css */

.mc-body {
  margin: 0;
  color: var(--text);
  background: var(--navy-deep);
}

.mc-main {
  padding: 1.25rem 0 3rem;
}

.mc-main p {
  margin: 0;
}

.mc-subnav {
  position: sticky;
  top: calc(var(--header-h) + 8px);
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 1.5rem;
  padding: 0.45rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(6, 16, 31, 0.92);
  backdrop-filter: blur(16px);
}

.mc-subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.mc-subnav a:hover,
.mc-subnav a[aria-current="page"] {
  color: var(--accent);
  background: rgba(0, 245, 212, 0.08);
}

.wallet-top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: stretch;
  margin-bottom: 2rem;
}

.wallet-open {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  margin: 0;
}

.wallet-open .btn-primary {
  width: 100%;
}

.wallet-pin:not(.hidden) {
  display: grid;
  gap: 0.75rem;
}

.wallet-pin p {
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.saved-users {
  margin-top: 0.35rem;
}

.saved-users-label {
  margin: 0 0 0.45rem;
  color: var(--text-muted);
  font-size: var(--font-size-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.saved-users ul {
  display: grid;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.saved-users li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.saved-users .saved-open {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
}

.saved-users .saved-forget {
  min-height: 44px;
  min-width: 44px;
  padding: 0 0.7rem;
}

@media (min-width: 768px) {
  .wallet-top {
    grid-template-columns: 1fr 1fr;
  }
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -3rem;
  z-index: 80;
  padding: 0.6rem 1rem;
  background: var(--neon);
  color: var(--navy);
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

.brand-hex {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  background: #0a192f;
  border: 2px solid var(--neon);
  box-shadow: 0 0 16px rgba(0, 245, 212, 0.25);
}

.brand-hex .bot-avatar {
  width: 28px;
  height: 28px;
}

.mc-icon {
  width: 1.15rem;
  height: 1.15rem;
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -0.2em;
}

.mc-icon-sm {
  width: 1rem;
  height: 1rem;
}

.mc-icon-inline {
  width: 0.95rem;
  height: 0.95rem;
}

.nav-link,
.btn-primary,
.btn-ghost,
.section-title,
.stat-label,
.amount-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.section-title {
  margin: 0 0 0.4rem;
  font-family: Outfit, sans-serif;
  font-size: 1.5rem;
  color: #fff;
}

.icon-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: var(--neon);
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.22);
}

.icon-badge .mc-icon {
  width: 1.4rem;
  height: 1.4rem;
}

.bot-wrap {
  display: inline-flex;
  line-height: 0;
}

.bot-avatar {
  display: block;
  border-radius: 16px;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.user-mask {
  font-family: "IBM Plex Mono", monospace;
}

.input-with-icon {
  position: relative;
}

.input-with-icon .mc-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--neon);
  pointer-events: none;
}

.input-with-icon .mc-input {
  padding-left: 2.6rem;
}

#leaderboard[data-page="1"] tr[data-page="2"],
#leaderboard[data-page="2"] tr[data-page="1"],
#leaderboard[data-page="2"] .podium {
  display: none;
}

.leaderboard-pager {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.leaderboard-pager button {
  min-width: 4.5rem;
  padding: 0.45rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-strong);
  cursor: pointer;
}

.leaderboard-pager button.is-active {
  background: var(--primary, #008080);
  border-color: var(--primary, #008080);
  color: #fff;
}

.podium {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

@media (min-width: 768px) {
  .podium {
    grid-template-columns: 1fr 1.15fr 1fr;
    align-items: end;
  }
  .podium-1 { order: 2; padding-top: 0.4rem; padding-bottom: 1.6rem; }
  .podium-2 { order: 1; }
  .podium-3 { order: 3; }
}

.podium-card {
  text-align: center;
  padding: 1.1rem 0.8rem 1.2rem;
  background: rgba(10, 25, 47, 0.9);
  border: 1px solid rgba(148, 210, 189, 0.16);
  border-radius: 16px;
}

.podium-1 {
  border-color: rgba(0, 245, 212, 0.45);
  box-shadow: 0 0 28px rgba(0, 245, 212, 0.12);
}

.podium-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  margin: 0 0 0.7rem;
  color: var(--neon);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.podium-card .bot-wrap {
  justify-content: center;
  margin-bottom: 0.6rem;
}

.rank {
  display: inline-grid;
  place-items: center;
  min-width: 1.8rem;
  height: 1.8rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 210, 189, 0.25);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.82rem;
}

.rank-1 { background: rgba(0, 245, 212, 0.18); color: var(--neon); border-color: var(--neon); }
.rank-2 { background: rgba(148, 210, 189, 0.12); color: #d7fff3; }
.rank-3 { background: rgba(0, 128, 128, 0.2); color: var(--mint); }

.you-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(0, 245, 212, 0.14);
  color: var(--neon);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mc-table tr.is-you td {
  background: rgba(0, 245, 212, 0.06);
}

.nav-link {
  color: var(--text);
  text-decoration: none;
  min-height: 44px;
  padding: 0 0.8rem;
  border-radius: var(--radius);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--accent);
  background: rgba(0, 245, 212, 0.08);
}

.site-header {
  z-index: 40;
}

body.nav-open .nav {
  z-index: 39;
}

.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--neon);
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.glass-card,
.stat-card,
.ticker-card,
.prize-card,
.voucher-ticket {
  background: rgba(10, 25, 47, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.glass-card,
.ticker-card {
  padding: 1.4rem;
}

.stat-card {
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(0, 245, 212, 0.16), transparent 70%);
}

.stat-card--spent::after {
  background: radial-gradient(circle, rgba(0, 128, 128, 0.22), transparent 70%);
}

.stat-label {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(148, 210, 189, 0.75);
}

.stat-value {
  margin: 0.4rem 0 0;
  font-family: Outfit, sans-serif;
  font-size: 3rem;
  line-height: 1;
  color: #fff;
}

.stat-meta {
  margin: 0.5rem 0 0;
  color: var(--neon);
  font-family: "IBM Plex Mono", monospace;
}

.mc-input,
.mc-field textarea {
  width: 100%;
  border: 1px solid rgba(148, 210, 189, 0.22);
  background: rgba(6, 16, 31, 0.7);
  color: #e8f4f1;
  border-radius: 8px;
  padding: 0.85rem 1rem;
  font: inherit;
}

.mc-input:focus {
  outline: 2px solid var(--neon);
  outline-offset: 2px;
}

.mc-field span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.92rem;
}

.mc-field small {
  display: block;
  margin-top: 0.35rem;
  color: var(--text-muted);
  font-size: var(--font-size-sm);
}

.btn-primary,
.btn-ghost,
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  text-decoration: none;
  transition: background var(--duration) ease, border-color var(--duration) ease, color var(--duration) ease, transform var(--duration) ease;
}

.btn-primary {
  background: var(--primary);
  color: var(--text-strong);
  box-shadow: var(--shadow-primary);
  padding: 0.7rem 1.2rem;
  min-height: 48px;
}

.btn-ghost,
.chip {
  background: transparent;
  color: var(--text-strong);
  border-color: var(--sage);
  padding: 0.7rem 1.1rem;
}

.chip {
  min-height: 44px;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-sm);
  color: var(--sage);
}

.btn-primary:hover {
  background: var(--primary-hover);
  color: var(--text-strong);
}

.btn-ghost:hover,
.chip:hover,
.chip.is-active {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary:disabled,
.btn-ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mc-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.95rem;
}

.mc-table th,
.mc-table td {
  text-align: left;
  padding: 0.7rem 0.5rem;
  border-bottom: 1px solid rgba(148, 210, 189, 0.12);
  vertical-align: top;
}

.mc-table th {
  color: rgba(148, 210, 189, 0.65);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.note,
.mc-alert,
.mc-ok {
  padding: 0.9rem 1rem;
  border-radius: var(--radius);
}

.note {
  color: var(--text-muted);
  border: 1px dashed var(--line);
  background: transparent;
}

.mc-alert {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
}

.mc-ok {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  color: var(--success-text);
}

.prize-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 360px);
  gap: 1.25rem;
  justify-content: start;
}

@media (max-width: 400px) {
  .prize-grid {
    grid-template-columns: minmax(0, 360px);
  }

  .prize-visual,
  .prize-visual img,
  .prize-fallback {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
  }
}

.prize-visual {
  width: 360px;
  height: 360px;
  max-width: 100%;
  background:
    linear-gradient(160deg, rgba(0, 245, 212, 0.16), rgba(0, 80, 80, 0.2)),
    #0a192f;
  overflow: hidden;
}

.prize-visual img {
  display: block;
  width: 360px;
  height: 360px;
  max-width: 100%;
  object-fit: cover;
}

.prize-fallback {
  width: 360px;
  height: 360px;
  max-width: 100%;
  display: grid;
  place-items: center;
  gap: 0.35rem;
  font-family: Outfit, sans-serif;
  font-size: 1.6rem;
  color: var(--neon);
}

.prize-fallback .mc-icon {
  width: 2rem;
  height: 2rem;
}

.voucher-ticket {
  padding: 1.25rem;
  border-style: dashed;
  border-color: var(--neon);
}

.qr-preview {
  display: block;
  width: min(240px, 100%);
  margin: 1rem 0;
  padding: 0.6rem;
  background: #fff;
  border-radius: 12px;
}

.flag-row {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  color: var(--sage);
}

.flag-row input {
  margin-top: 0.25rem;
  accent-color: var(--neon);
}

.cron-box {
  overflow-x: auto;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  border: 1px dashed rgba(148, 210, 189, 0.25);
  background: rgba(6, 16, 31, 0.7);
  color: var(--neon);
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
}

.captcha-svg {
  display: block;
  border: 1px solid rgba(0, 245, 212, 0.25);
  border-radius: 8px;
}

.voucher-code {
  font-family: "IBM Plex Mono", monospace;
  font-size: 1.35rem;
  color: var(--neon);
  letter-spacing: 0.08em;
}

.status {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
}

.status-active { background: rgba(0, 245, 212, 0.14); color: var(--neon); }
.status-redeemed { background: rgba(82, 183, 136, 0.16); color: var(--mint); }
.status-cancelled { background: rgba(255, 255, 255, 0.06); color: #9bb0b8; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}
