@font-face {
  font-family: "League Spartan";
  src: url("/fonts/league-spartan.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --ink: #fafafa;
  --muted: #a1a1aa;
  --surface: #18181b;
  --surface-raised: #27272a;
  --line: #3f3f46;
  --acid: #1fd978;
  --acid-dark: #052e16;
  --orange: #86efac;
  --danger: #f87171;
  --shadow: 0 24px 80px rgb(0 0 0 / 38%);
  --display: "League Spartan", "Arial Black", ui-sans-serif, system-ui, sans-serif;
  font-family: var(--display);
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgb(255 255 255 / 2%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(255 255 255 / 2%) 1px, transparent 1px),
    #0f0f12;
  background-size: 34px 34px;
}

button, input, textarea { font: inherit; }

button {
  min-height: 46px;
  padding: 0 1.15rem;
  border: 1px solid var(--acid);
  border-radius: 4px;
  color: #052e16;
  background: var(--acid);
  font-weight: 800;
  cursor: pointer;
  transition: transform 130ms ease, filter 130ms ease;
}

button:hover { filter: brightness(1.08); transform: translateY(-1px); }
button:active { transform: translateY(0); }
button:disabled { cursor: wait; opacity: .6; transform: none; }

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgb(31 217 120 / 32%);
  outline-offset: 2px;
}

.shell { width: min(1240px, calc(100% - 32px)); margin: 0 auto; padding-bottom: 4rem; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 92px;
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; gap: .8rem; align-items: center; color: inherit; text-decoration: none; }
.brand-logo { display: block; width: clamp(180px, 20vw, 240px); height: auto; }
.brand small { display: block; margin-top: .15rem; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; }

.connection { display: flex; align-items: center; gap: .55rem; color: var(--muted); font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; }
.connection span { width: 9px; height: 9px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 14px var(--danger); }
.connection[data-state="live"] span { background: var(--acid); box-shadow: 0 0 14px var(--acid); }

.login-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, .8fr);
  gap: 4rem;
  align-items: end;
  max-width: 980px;
  margin: 18vh auto 0;
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border: 1px solid var(--line);
  border-top: 4px solid var(--acid);
  background: rgb(24 24 27 / 92%);
  box-shadow: var(--shadow);
}

h1, h2, p { margin-top: 0; }
h1 { max-width: 560px; margin-bottom: 1rem; font-size: clamp(2.7rem, 7vw, 5.8rem); line-height: .86; letter-spacing: -.065em; }
h2 { margin-bottom: 0; font-size: 1.45rem; letter-spacing: -.03em; }
.login-panel p:not(.eyebrow) { max-width: 550px; color: var(--muted); font-size: 1rem; line-height: 1.65; }
.eyebrow { margin-bottom: .8rem; color: var(--acid); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; font-weight: 800; text-transform: uppercase; letter-spacing: .16em; }

.login-form label, .field label { display: block; margin-bottom: .55rem; font-size: .88rem; font-weight: 750; }
.input-action { display: flex; gap: .65rem; }

input[type="text"], input[type="password"], input[type="number"], textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: .75rem .85rem;
  color: var(--ink);
  background: #0f0f12;
}
textarea { resize: vertical; line-height: 1.4; }
input:hover, textarea:hover { border-color: #52525b; }

.dashboard { padding-top: 2rem; }
.status-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.status-strip article { min-height: 132px; padding: 1.25rem; border-right: 1px solid var(--line); }
.status-strip article:last-child { border-right: 0; }
.status-strip span, .status-strip small { display: block; color: var(--muted); }
.status-strip span { margin-bottom: 1.15rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; }
.status-strip strong { display: block; margin-bottom: .35rem; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.5rem; }
.status-strip small { font-size: .76rem; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .75fr); gap: 1rem; margin-top: 1rem; }
.panel { border: 1px solid var(--line); background: var(--surface); }
.settings-panel { padding: clamp(1.25rem, 3vw, 2rem); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 2rem; }
.panel-heading .eyebrow { margin-bottom: .35rem; }
.button-secondary { border-color: var(--line); color: var(--ink); background: transparent; }
.button-secondary:hover { border-color: var(--acid); }
.button-danger { border-color: #7f1d1d; color: #fff7f7; background: linear-gradient(180deg, #dc4444, #991b1b); box-shadow: inset 0 2px 0 rgb(255 255 255 / 15%), 0 5px 0 #450a0a, 0 12px 24px rgb(0 0 0 / 24%); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 1.1rem; }
.field small { display: block; margin-top: .5rem; color: var(--muted); font-size: .78rem; line-height: 1.4; }
.wallet-block { margin-top: 1.5rem; padding: 1.1rem; border: 1px solid var(--line); background: #141416; }
.wallet-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.wallet-heading span, .wallet-heading strong { display: block; }
.wallet-heading > div > span { margin-bottom: .35rem; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; }
.wallet-heading strong { max-width: 560px; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; }
.badge { padding: .35rem .55rem; border: 1px solid var(--orange); border-radius: 999px; color: var(--orange); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.badge.ready { border-color: var(--acid); color: var(--acid); }

.check-row { display: flex; align-items: center; gap: .65rem; margin-top: .9rem; color: var(--muted); font-size: .84rem; cursor: pointer; }
input[type="checkbox"] { width: 19px; height: 19px; accent-color: var(--acid); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; padding: 1.1rem; border: 1px solid var(--line); cursor: pointer; }
.switch-row span, .switch-row b, .switch-row small { display: block; }
.switch-row b { margin-bottom: .3rem; }
.switch-row small { color: var(--muted); line-height: 1.45; }
.switch-row input { width: 42px; height: 23px; flex: 0 0 auto; }

.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 70px; padding-top: 1.4rem; }
.form-message { min-height: 1.25rem; margin: .65rem 0 0; color: var(--acid); font-size: .84rem; line-height: 1.45; }
.form-message.error, .error { color: var(--danger); }

.side-stack { display: grid; align-content: start; gap: 1rem; }
.engine-panel, .pool-panel, .actions-panel { padding: 1.35rem; }
.engine-panel h2 { margin-bottom: 1rem; }
.engine-readout { display: flex; align-items: center; gap: .85rem; margin-bottom: 1rem; padding: .9rem; border: 2px solid var(--line); border-radius: 14px; background: #0f0f12; }
.engine-readout i { width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%; background: var(--danger); box-shadow: 0 0 14px var(--danger); }
.engine-readout span, .engine-readout strong { display: block; }
.engine-readout span { margin-bottom: .2rem; color: var(--muted); font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; }
.engine-readout strong { font-size: 1.2rem; font-weight: 900; text-transform: uppercase; }
.engine-readout[data-running="true"] i { background: var(--acid); box-shadow: 0 0 18px var(--acid); }
.engine-readout[data-running="true"] strong { color: var(--acid); }
.reset-zone { margin-top: 1.4rem; padding-top: 1.2rem; border-top: 2px solid #3f2727; }
.reset-zone strong { color: #fecaca; font-size: .88rem; font-weight: 900; text-transform: uppercase; letter-spacing: .06em; }
.reset-zone p { margin: .55rem 0 1rem; color: var(--muted); font-size: .82rem; line-height: 1.45; }
.pool-panel h2, .actions-panel h2 { margin-bottom: 1.15rem; }
.mono-address { min-height: 4.4rem; padding: .8rem; border: 1px solid var(--line); color: var(--muted); background: #0f0f12; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .76rem; line-height: 1.5; overflow-wrap: anywhere; }
.pool-number { padding: 1.2rem 0; border-bottom: 1px solid var(--line); }
.pool-number span, .pool-number strong { display: block; }
.pool-number span { margin-bottom: .45rem; color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; }
.pool-number strong { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.6rem; }
.muted, .actions-panel > p:not(.eyebrow) { color: var(--muted); font-size: .88rem; line-height: 1.55; }
.wide { width: 100%; }
.failed-payment { margin-top: 1rem; padding-top: 1rem; border-top: 1px solid var(--danger); }
.failed-payment strong { color: var(--danger); }
.failed-payment p { margin: .5rem 0 1rem; color: var(--muted); font-size: .8rem; line-height: 1.45; overflow-wrap: anywhere; }

/* Logo-led visual system */
body {
  font-weight: 560;
  background:
    radial-gradient(circle at 82% 8%, rgb(31 217 120 / 18%), transparent 31rem),
    linear-gradient(rgb(134 239 172 / 3%) 2px, transparent 2px),
    linear-gradient(90deg, rgb(134 239 172 / 3%) 2px, transparent 2px),
    #07120f;
  background-size: auto, 38px 38px, 38px 38px, auto;
}

.topbar { min-height: 104px; border-bottom: 0; }
.brand-logo { width: clamp(230px, 24vw, 330px); filter: drop-shadow(0 10px 24px rgb(0 0 0 / 32%)); }
.brand small { color: #9fc7b5; font-weight: 850; letter-spacing: .16em; }

.connection {
  padding: .7rem .9rem;
  border: 2px solid #183c33;
  border-radius: 14px;
  color: #b9d5c7;
  background: #0b201a;
  font-weight: 850;
}

button {
  min-height: 50px;
  border: 2px solid #102a25;
  border-radius: 14px;
  color: #09251c;
  background: linear-gradient(180deg, #63f0aa, #1fd978 72%);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 30%), 0 5px 0 #0a3125, 0 12px 24px rgb(0 0 0 / 24%);
  font-weight: 900;
  letter-spacing: .055em;
  text-transform: uppercase;
}

button:hover { filter: brightness(1.06); transform: translateY(-2px); }
button:active { box-shadow: inset 0 2px 0 rgb(255 255 255 / 24%), 0 2px 0 #0a3125; transform: translateY(2px); }

.button-secondary {
  border-color: #1c4d3e;
  color: #dffff0;
  background: linear-gradient(180deg, #173b31, #0b211b);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 6%), 0 5px 0 #04110d, 0 12px 24px rgb(0 0 0 / 20%);
}

.button-secondary:hover { border-color: #35e58b; }

.login-panel,
.status-strip,
.panel {
  border: 2px solid #174638;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 7%), transparent 16%),
    linear-gradient(145deg, #0c251e, #0b1714);
  box-shadow: inset 0 2px 0 rgb(255 255 255 / 7%), inset 0 -6px 0 rgb(0 0 0 / 16%), 0 18px 0 rgb(3 17 13 / 28%), 0 38px 80px rgb(0 0 0 / 28%);
}

.login-panel { position: relative; overflow: hidden; border-top: 2px solid #174638; border-radius: 30px; }
.login-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 7px;
  background: linear-gradient(180deg, #86efac, #1fd978 60%, #0b6e45);
}

h1 {
  color: #f8fff9;
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 0 6px 0 #123d31, 0 14px 34px rgb(0 0 0 / 28%);
}

h2 { color: #f7fff9; font-size: 1.65rem; font-weight: 900; text-transform: uppercase; }
.eyebrow { color: #44e993; font-family: var(--display); font-weight: 900; }
.login-form label, .field label { color: #e8f4ee; font-weight: 800; }

input[type="text"], input[type="password"], input[type="number"], textarea {
  min-height: 52px;
  border: 2px solid #1a4a3b;
  border-radius: 14px;
  color: #f5fff8;
  background: #06130f;
  box-shadow: inset 0 3px 8px rgb(0 0 0 / 26%);
  font-weight: 650;
}

input:hover, textarea:hover { border-color: #2b795e; }

.status-strip { overflow: hidden; border-radius: 24px; }
.status-strip article { min-height: 145px; border-right: 2px solid #174638; }
.status-strip span { color: #9fc7b5; font-weight: 850; }
.status-strip strong { color: #f8fff9; font-family: var(--display); font-size: 1.7rem; font-weight: 900; }
.status-strip small { color: #82a994; font-weight: 600; }

.workspace { gap: 1.25rem; margin-top: 1.25rem; }
.panel { border-radius: 24px; }
.settings-panel { overflow: hidden; }
.panel-heading { padding-bottom: 1.35rem; border-bottom: 2px solid #174638; }

.wallet-block,
.switch-row,
.mono-address {
  border: 2px solid #174638;
  border-radius: 18px;
  background: #071712;
}

.wallet-block { box-shadow: inset 0 2px 0 rgb(255 255 255 / 4%); }
.wallet-heading > div > span, .pool-number span { color: #9fc7b5; font-weight: 850; }
.wallet-heading strong, .mono-address { color: #b9d9c9; }

.badge {
  border: 2px solid #86efac;
  border-radius: 12px;
  color: #09251c;
  background: #86efac;
  font-weight: 900;
}

.badge.ready { color: #09251c; background: #1fd978; }
.switch-row b { color: #f6fff9; font-weight: 850; }
.check-row { font-weight: 650; }
.engine-panel, .pool-panel, .actions-panel { padding: 1.5rem; }
.engine-readout { border-color: #174638; background: #071712; box-shadow: inset 0 2px 0 rgb(255 255 255 / 4%); }
.pool-number { border-bottom: 2px solid #174638; }
.pool-number strong { color: #4bea97; font-family: var(--display); font-size: 1.9rem; font-weight: 900; }
.form-message { font-weight: 700; }

@media (max-width: 900px) {
  .login-panel { grid-template-columns: 1fr; gap: 2rem; margin-top: 8vh; }
  .status-strip { grid-template-columns: 1fr 1fr; }
  .status-strip article:nth-child(2) { border-right: 0; }
  .status-strip article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .workspace { grid-template-columns: 1fr; }
  .side-stack { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 20px, 1240px); }
  .topbar { min-height: 76px; }
  .brand-logo { width: 180px; }
  .brand small { display: none; }
  .connection { padding: .55rem .65rem; }
  .login-panel { padding: 1.25rem; }
  h1 { font-size: 3rem; }
  .input-action, .field-grid, .side-stack { display: grid; grid-template-columns: 1fr; }
  .status-strip { grid-template-columns: 1fr; }
  .status-strip article { min-height: 112px; border-right: 0; border-bottom: 1px solid var(--line); }
  .status-strip article:last-child { border-bottom: 0; }
  .panel-heading, .form-footer { align-items: stretch; flex-direction: column; }
  .panel-heading button, .form-footer button { width: 100%; }
  .wallet-heading { display: block; }
  .badge { display: inline-block; margin-top: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
