/* ArenaChain — mobile-first, no horizontal overflow at 380px. */
:root {
  --bg: #0a0c14;
  --bg-2: #10131f;
  --panel: #151928;
  --panel-2: #1c2133;
  --line: #262d42;
  --ink: #eef1f9;
  --muted: #98a1bd;
  --brand: #7c5cff;      /* arena violet */
  --brand-2: #22d3ee;    /* cyan surge */
  --gold: #ffcf5c;       /* winner gold */
  --ok: #35c98b;
  --warn: #ffbf47;
  --err: #ff5c6c;
  --radius: 14px;
  --maxw: 1000px;
}
* { box-sizing: border-box; }
/* Ensure the `hidden` attribute always wins over element display rules
   (e.g. the wallet pill's inline-flex would otherwise show while hidden). */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  background:
    radial-gradient(1100px 520px at 82% -10%, rgba(124,92,255,.16), transparent 60%),
    radial-gradient(900px 500px at -10% 8%, rgba(34,211,238,.10), transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
a { color: var(--brand-2); }
img, svg { max-width: 100%; }

/* ── Nav ─────────────────────────────────────────────────── */
.ac-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 0; flex-wrap: wrap; }
.ac-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; letter-spacing: .3px; }
.ac-logo .spark { color: var(--brand-2); }
.ac-net-badge {
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: var(--brand-2); border: 1px solid var(--line);
  background: var(--panel); padding: 3px 9px; border-radius: 999px; white-space: nowrap;
}

/* ── Hero ────────────────────────────────────────────────── */
.ac-hero { padding: 28px 0 10px; }
.ac-hero h1 { font-size: clamp(28px, 8vw, 52px); line-height: 1.05; margin: 8px 0 12px; letter-spacing: -0.5px; }
.ac-hero h1 .grad {
  background: linear-gradient(92deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.ac-hero .sub { color: var(--muted); font-size: clamp(15px, 4vw, 19px); max-width: 52ch; }
.ac-kicker {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--brand-2);
  border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 5px 12px;
}
.ac-hero-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.ac-steps { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 22px 0 4px; }
.ac-step { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.ac-step b { color: var(--ink); }
.ac-step span { color: var(--muted); font-size: 14px; }
.ac-step .n {
  display: inline-flex; width: 24px; height: 24px; border-radius: 999px; margin-right: 8px;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 800;
  color: #0a0c14; background: linear-gradient(92deg, var(--brand), var(--brand-2));
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  appearance: none; border: 1px solid var(--line); background: var(--panel-2); color: var(--ink);
  font-weight: 700; font-size: 15px; padding: 12px 16px; border-radius: 12px; cursor: pointer;
  transition: transform .06s ease, border-color .15s ease, opacity .15s ease; max-width: 100%;
}
.btn:hover { border-color: var(--brand); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { border: none; color: #0a0c14; background: linear-gradient(92deg, var(--brand), var(--brand-2)); }
.btn.wide { width: 100%; }

/* ── Layout / cards ──────────────────────────────────────── */
.ac-main { margin: 26px 0 40px; }
.ac-layout { display: grid; grid-template-columns: 1fr; gap: 18px; align-items: start; }
.ac-card {
  background: linear-gradient(180deg, var(--panel), var(--bg-2));
  border: 1px solid var(--line); border-radius: 18px; padding: 18px;
}
.ac-card-title { margin: 0 0 4px; font-size: 20px; }

/* ── Organizer form ──────────────────────────────────────── */
.ac-field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; flex: 1 1 0; min-width: 0; }
.ac-field label { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .7px; }
.ac-field input {
  width: 100%; max-width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 10px 12px; font-size: 15px; font-family: inherit;
}
.ac-field input:focus { outline: none; border-color: var(--brand); }
.ac-field-row { display: flex; gap: 10px; }

.ac-preview { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 6px; }
.ac-preview-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.ac-preview-head .ac-muted { font-weight: 500; font-size: 12px; }
.ac-pay-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; padding: 4px 0; }
.ac-pay-line .who { color: var(--muted); }
.ac-pay-line .tag { font-size: 10px; color: var(--brand-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; margin-left: 6px; }
.ac-pay-line.total { font-weight: 800; font-size: 15px; border-bottom: 1px solid var(--line); padding-bottom: 8px; margin-bottom: 4px; }
.ac-pay-line.rake .who { color: var(--gold); }
.ac-form-err { color: var(--err); font-size: 13px; margin-top: 8px; }

/* ── Tournament header / facts ───────────────────────────── */
.ac-tourney-head { display: flex; align-items: center; gap: 14px; }
.ac-tourney-art {
  width: 60px; height: 60px; min-width: 60px; border-radius: 14px; font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 25%, #241a3a, #0f0c1a); border: 1px solid var(--line);
}
.ac-tourney-head h2 { margin: 0; font-size: 22px; }
.ac-tourney-meta { display: flex; align-items: center; gap: 10px; margin-top: 3px; font-size: 13px; flex-wrap: wrap; }
.ac-status-pill { font-size: 11px; font-weight: 800; letter-spacing: .6px; color: #0a0c14; background: var(--ok); border-radius: 999px; padding: 2px 9px; }

.ac-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 16px 0; }
.ac-fact { background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.ac-fact .k { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
.ac-fact .v { font-size: 15px; font-weight: 700; margin-top: 2px; word-break: break-word; }

.ac-hr { height: 1px; background: var(--line); border: 0; margin: 16px 0; }
.ac-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ac-row .lbl { color: var(--muted); font-size: 14px; }

/* wallet pill */
.ac-wallet-pill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; font-size: 13px; max-width: 100%; }
.ac-wallet-pill .dot { width: 8px; height: 8px; border-radius: 999px; background: var(--ok); }
.ac-wallet-pill .ac-addr { font-weight: 700; }
.ac-wallet-pill .ac-bal { color: var(--muted); }

/* status */
.ac-status { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 14px; border: 1px solid var(--line); }
.ac-status[data-kind="ok"]    { border-color: rgba(53,201,139,.5); background: rgba(53,201,139,.08); color: #b8f0d6; }
.ac-status[data-kind="warn"]  { border-color: rgba(255,191,71,.5); background: rgba(255,191,71,.08); color: #ffe4a6; }
.ac-status[data-kind="error"] { border-color: rgba(255,92,108,.5); background: rgba(255,92,108,.08); color: #ffc2c9; }
.ac-status[data-kind="info"]  { border-color: rgba(124,92,255,.45); background: rgba(124,92,255,.08); color: #d9cfff; }

/* receipt + settle */
.ac-receipt, .ac-settle { margin-top: 14px; background: var(--bg-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.ac-receipt h3, .ac-settle h3 { margin: 0 0 8px; font-size: 15px; }
.ac-receipt dl { margin: 0; display: grid; gap: 6px; }
.ac-receipt dl > div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.ac-receipt dt { color: var(--muted); }
.ac-receipt dd { margin: 0; text-align: right; word-break: break-all; }

/* leaderboard */
.ac-board-wrap { margin-top: 16px; }
.ac-board-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.ac-board-head .ac-muted { font-weight: 500; font-size: 12px; }
.ac-board-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.ac-board { width: 100%; border-collapse: collapse; font-size: 14px; }
.ac-board th, .ac-board td { text-align: left; padding: 9px 12px; white-space: nowrap; }
.ac-board thead th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .6px; border-bottom: 1px solid var(--line); }
.ac-board tbody tr { border-bottom: 1px solid var(--line); }
.ac-board tbody tr:last-child { border-bottom: 0; }
.ac-board tbody tr:nth-child(1) td:first-child { color: var(--gold); font-weight: 800; }
.ac-board tr.is-you { background: rgba(124,92,255,.10); }
.ac-you { font-size: 10px; font-weight: 800; color: #0a0c14; background: var(--brand-2); border-radius: 5px; padding: 1px 5px; margin-left: 6px; }
.ac-flag { color: var(--warn); font-size: 12px; }
.ac-muted { color: var(--muted); }

/* footer */
.ac-foot { border-top: 1px solid var(--line); padding: 22px 0 40px; color: var(--muted); font-size: 13px; }
.ac-foot .safe { color: var(--warn); }
.ac-foot code { background: var(--panel-2); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; font-size: 12px; }

/* ── Tablet / desktop ────────────────────────────────────── */
@media (min-width: 640px) { .ac-steps { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .ac-layout { grid-template-columns: 1fr 1fr; gap: 24px; } }
