/* Joltway — the line. One neon line of twelve segments on an electric-indigo field; the stand form first, the CA on a side rail. */
:root {
  --field: #4A41A6; --deep: #241D5C; --dusk: #2F2775; --haze: #6B62C4; --mist: #B8B0F0;
  --ink: #F4F1FF; --tube: #4DF3FF; --strike: #FF4FD8; --amber: #FFC53D;
  --glow: 0 0 6px rgba(77,243,255,.9), 0 0 16px rgba(77,243,255,.55), 0 0 34px rgba(77,243,255,.25);
  --glow-hot: 0 0 6px rgba(255,79,216,.95), 0 0 18px rgba(255,79,216,.6), 0 0 40px rgba(255,79,216,.3);
  --sans: 'Albert Sans', system-ui, sans-serif; --neon: 'Tilt Neon', 'Albert Sans', sans-serif; --mono: 'Red Hat Mono', ui-monospace, monospace;
}
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.field {
  margin: 0; min-height: 100vh; background-color: var(--field); color: var(--ink);
  font: 400 15px/1.5 var(--sans); overflow-x: hidden; position: relative;
}
body.field::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 70% 40% at 30% 0%, rgba(77,243,255,.16), transparent 70%),
              radial-gradient(ellipse 60% 50% at 100% 100%, rgba(36,29,92,.9), transparent 70%),
              repeating-linear-gradient(0deg, rgba(255,255,255,.025) 0 1px, transparent 1px 4px);
}
a { color: var(--tube); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
code { font-family: var(--mono); }
.quiet { margin: 0; color: var(--mist); font-size: 14px; }

/* ---- the sign (main) ---- */
.sign { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 18px 74px 56px 16px; }
.sign-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.sign-mark { width: 36px; height: 36px; border-radius: 50%; box-shadow: 0 0 12px rgba(77,243,255,.5); }
.sign-word { margin: 0; font: 400 30px/1 var(--neon); letter-spacing: .06em; text-transform: uppercase; color: #fff; text-shadow: var(--glow); }
.sign-state { color: var(--mist); font-size: 13px; letter-spacing: .04em; flex: 1 1 auto; min-width: 120px; }
.plug { margin-left: auto; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(77,243,255,.6); background: rgba(36,29,92,.55); color: var(--tube); font-weight: 600; font-size: 13px; letter-spacing: .04em; }
.plug.lit { border-color: var(--tube); box-shadow: var(--glow); color: #fff; }

/* ---- the line ---- */
.stand { margin: 0; }
.volt-line { display: flex; flex-direction: column; gap: 6px; padding: 12px 10px; border-radius: 18px; background: rgba(36,29,92,.45); border: 1px solid rgba(255,255,255,.08); }
.volt-line.flick { animation: lineFlick .9s steps(3) 1; }
@keyframes lineFlick { 0% { filter: brightness(1.8); } 40% { filter: brightness(.6); } 100% { filter: brightness(1); } }
.seg {
  display: grid; grid-template-columns: 28px 1fr 84px; align-items: center; gap: 10px; height: 36px; padding: 0 8px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; text-align: left; transition: background .15s, border-color .15s;
}
.seg:hover { background: rgba(255,255,255,.05); }
.seg.lit { border-color: rgba(77,243,255,.7); background: rgba(77,243,255,.08); }
.seg-n { font: 400 18px/1 var(--neon); color: var(--mist); text-align: center; }
.seg.lit .seg-n, .seg.mine-on .seg-n { color: #fff; text-shadow: var(--glow); }
.seg-tube { position: relative; height: 10px; border-radius: 999px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); overflow: hidden; }
.seg-fill { position: absolute; inset: 0 auto 0 0; width: 0; min-width: 0; border-radius: 999px; background: linear-gradient(90deg, rgba(77,243,255,.55), var(--tube)); box-shadow: var(--glow); transition: width .5s ease; }
.seg.lit-up .seg-fill { min-width: 10px; }
.seg-amt { font-family: var(--mono); font-size: 12px; color: var(--mist); text-align: right; white-space: nowrap; }
.seg.lit-up .seg-amt { color: var(--ink); }
.seg.hit .seg-tube { border-color: rgba(255,79,216,.8); box-shadow: var(--glow-hot); animation: hitFlick 1.4s steps(2) infinite; }
.seg.hit .seg-fill { background: linear-gradient(90deg, rgba(255,79,216,.6), var(--strike)); box-shadow: var(--glow-hot); }
.seg.hit .seg-n { color: #fff; text-shadow: var(--glow-hot); }
.seg.hit .seg-n::after { content: '⚡'; font-size: 12px; margin-left: 2px; }
@keyframes hitFlick { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.seg.mine-on .seg-tube::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 6px; background: var(--amber); }

/* ---- the stand row ---- */
.stand-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; align-items: center; }
.stand-pick { grid-column: 1 / -1; font-size: 14px; color: var(--mist); }
.stand-pick b { font: 400 18px/1 var(--neon); color: #fff; text-shadow: var(--glow); }
.stand-amt { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; padding: 0 12px; height: 46px; border-radius: 12px; background: rgba(36,29,92,.6); border: 1px solid rgba(255,255,255,.14); }
.stand-amt input { flex: 1 1 auto; min-width: 0; background: transparent; border: 0; outline: 0; font-family: var(--mono); font-size: 17px; color: var(--ink); }
.stand-amt input::placeholder { color: var(--haze); }
.stand-unit { font-size: 12px; color: var(--mist); letter-spacing: .04em; }
.stand-quick { display: flex; gap: 6px; }
.stand-quick button { flex: 1 1 0; padding: 8px 0; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(36,29,92,.45); color: var(--mist); font-size: 12px; }
.stand-quick button.lit { border-color: var(--tube); color: var(--tube); }
.stand-go { height: 46px; border-radius: 12px; border: 1px solid var(--tube); background: rgba(77,243,255,.12); color: #fff; font: 400 20px/1 var(--neon); letter-spacing: .08em; text-transform: uppercase; text-shadow: var(--glow); box-shadow: inset 0 0 18px rgba(77,243,255,.18); }
.stand-go:disabled { opacity: .45; cursor: default; text-shadow: none; box-shadow: none; }
.stand-fine { margin: 10px 0 0; font-size: 13px; color: var(--mist); }
.stand-fine b { color: var(--ink); font-weight: 600; }

/* ---- meters ---- */
.volt-meters { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 18px; }
.meter { padding: 10px 12px; border-radius: 12px; background: rgba(36,29,92,.45); border: 1px solid rgba(255,255,255,.08); }
.meter-k { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--mist); }
.meter-v { display: block; margin-top: 2px; font-family: var(--mono); font-size: 18px; font-weight: 500; color: var(--ink); }
.meter-odds { grid-column: 1 / -1; }
.meter-odds .meter-v { color: var(--amber); }

/* ---- your stands ---- */
.mine { margin-top: 22px; }
.mine-k, .wire-k { margin: 0 0 8px; font: 400 15px/1 var(--neon); letter-spacing: .08em; text-transform: uppercase; color: var(--tube); text-shadow: 0 0 8px rgba(77,243,255,.5); }
.mine-rows { display: flex; flex-direction: column; gap: 8px; }
.mine-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: rgba(36,29,92,.45); border: 1px solid rgba(255,255,255,.08); font-size: 14px; }
.mine-row .segs { font-family: var(--mono); font-size: 13px; color: var(--ink); }
.mine-row .due { color: var(--amber); font-family: var(--mono); font-size: 13px; }
.mine-row .gone { color: var(--strike); font-family: var(--mono); font-size: 13px; }
.earth-go { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--amber); background: rgba(255,197,61,.12); color: #fff; font-weight: 600; font-size: 13px; }
.earth-go:disabled { opacity: .5; cursor: default; }

/* ---- how ---- */
.how { margin-top: 22px; border-radius: 14px; background: rgba(36,29,92,.45); border: 1px solid rgba(255,255,255,.08); }
.how summary { padding: 12px 14px; cursor: pointer; font: 400 16px/1 var(--neon); letter-spacing: .06em; text-transform: uppercase; color: var(--tube); list-style: none; }
.how summary::-webkit-details-marker { display: none; }
.how summary::before { content: '+ '; color: var(--mist); }
.how[open] summary::before { content: '– '; }
.how-body { padding: 0 14px 14px; }
.how-body h3 { margin: 12px 0 4px; font: 600 13px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--mist); }
.how-body p { margin: 0; font-size: 14px; }
.how-ref { margin-top: 12px !important; font-size: 12px !important; color: var(--mist); word-break: break-all; }

/* ---- the wire ---- */
.wire, .struck-list { margin-top: 22px; }
.wire-rows, .struck-rows { display: flex; flex-direction: column; gap: 4px; }
.wire-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px dashed rgba(255,255,255,.1); font-size: 13px; }
.wire-who { font-family: var(--mono); color: var(--mist); font-size: 12px; }
.wire-what b { color: var(--ink); font-weight: 600; }
.wire-what.strike { color: var(--strike); }
.wire-what.strike b { color: #fff; text-shadow: var(--glow-hot); }
.wire-when { color: var(--haze); font-size: 12px; }
.struck-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: rgba(36,29,92,.35); font-size: 13px; }
.struck-row .n { font: 400 16px/1 var(--neon); color: var(--mist); }
.struck-row .hitseg { color: var(--strike); font-weight: 600; }
.struck-row .paid { font-family: var(--mono); font-size: 12px; color: var(--amber); }

/* ---- the rail: the CA, on the side ---- */
.rail {
  position: fixed; right: 10px; top: 50%; transform: translateY(-50%); z-index: 30; width: 46px;
  display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 0;
  border-radius: 24px; background: rgba(20,14,60,.78); border: 1px solid rgba(77,243,255,.6);
  box-shadow: 0 0 14px rgba(77,243,255,.35), inset 0 0 10px rgba(77,243,255,.12); backdrop-filter: blur(6px);
}
.rail-k { writing-mode: vertical-rl; font-size: 11px; font-weight: 700; letter-spacing: .25em; color: var(--tube); text-shadow: 0 0 8px rgba(77,243,255,.7); }
.rail-addr { writing-mode: vertical-rl; font-family: var(--mono); font-size: 10.5px; line-height: 1; letter-spacing: .02em; color: var(--ink); user-select: all; -webkit-user-select: all; max-width: 14px; }
.rail-copy { writing-mode: vertical-rl; padding: 10px 6px; border-radius: 999px; border: 1px solid var(--tube); background: rgba(77,243,255,.14); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.rail-copy.done { background: var(--tube); color: var(--deep); }
.rail-gm { writing-mode: vertical-rl; font-size: 10px; letter-spacing: .12em; color: var(--mist); }

/* ---- drawer (wallet chooser) ---- */
.drawer { display: none; position: fixed; inset: 0; z-index: 50; background: rgba(20,14,60,.7); align-items: flex-end; justify-content: center; }
.drawer.is-open { display: flex; }
.drawer-box { width: 100%; max-width: 480px; background: var(--dusk); border: 1px solid rgba(77,243,255,.4); border-radius: 18px 18px 0 0; padding: 14px 16px 24px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; font: 400 16px/1 var(--neon); letter-spacing: .06em; text-transform: uppercase; color: var(--tube); }
.drawer-x { background: transparent; border: 0; color: var(--mist); font-size: 22px; }
.drawer-list { display: flex; flex-direction: column; gap: 8px; }
.drawer-list button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: rgba(36,29,92,.6); color: var(--ink); }
.drawer-list img { width: 24px; height: 24px; border-radius: 6px; }

/* ---- footer ---- */
.fine-print { position: relative; z-index: 1; max-width: 640px; margin: 0 auto; padding: 14px 74px 40px 16px; display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--mist); }
.fine-print code { color: var(--ink); word-break: break-all; }
.fine-line { color: var(--haze); }

/* ---- zap (toast) ---- */
.zap { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 60; padding: 10px 16px; border-radius: 999px; background: var(--deep); border: 1px solid var(--tube); color: #fff; font-size: 13px; box-shadow: var(--glow); white-space: nowrap; max-width: 92vw; overflow: hidden; text-overflow: ellipsis; }

/* ---- 700px+: the line runs horizontal, a wider measure ---- */
@media (min-width: 700px) {
  .sign { max-width: 900px; padding: 26px 90px 64px 28px; }
  .sign-word { font-size: 40px; }
  .volt-line { flex-direction: row; gap: 6px; height: 190px; padding: 14px 12px; }
  .seg { grid-template-columns: 1fr; grid-template-rows: auto 1fr auto; height: auto; padding: 4px 2px; gap: 6px; flex: 1 1 0; min-width: 0; justify-items: center; }
  .seg-n { font-size: 20px; }
  .seg-tube { width: 12px; height: 100%; }
  .seg-fill { inset: auto 0 0 0; width: 100%; height: 0; min-width: 0; transition: height .5s ease; background: linear-gradient(0deg, rgba(77,243,255,.55), var(--tube)); }
  .seg.lit-up .seg-fill { min-height: 10px; }
  .seg.hit .seg-fill { background: linear-gradient(0deg, rgba(255,79,216,.6), var(--strike)); }
  .seg.mine-on .seg-tube::after { right: 0; left: 0; top: auto; bottom: -3px; width: auto; height: 6px; border-radius: 3px; }
  .seg-amt { font-size: 11px; text-align: center; }
  .stand-row { grid-template-columns: auto 1fr auto auto; }
  .stand-pick, .stand-amt { grid-column: auto; }
  .stand-amt { min-width: 220px; }
  .stand-quick button { padding: 8px 12px; flex: 0 0 auto; }
  .stand-go { padding: 0 26px; }
  .volt-meters { grid-template-columns: repeat(5, 1fr); }
  .meter-odds { grid-column: auto; }
  .fine-print { max-width: 900px; padding: 14px 90px 40px 28px; flex-direction: row; flex-wrap: wrap; gap: 6px 18px; }
}

/* ---- 1000px+: the page recomposes — the rail becomes a left panel, the wire moves beside the line ---- */
@media (min-width: 1000px) {
  .sign { max-width: 1120px; margin: 0 auto 0 236px; padding: 34px 40px 72px 0; display: grid; grid-template-columns: minmax(0, 1fr) 340px; column-gap: 36px; grid-template-areas: "head head" "stand wire" "meters wire" "mine wire" "how struck"; align-content: start; }
  .sign-head { grid-area: head; }
  .stand { grid-area: stand; }
  .volt-meters { grid-area: meters; }
  .mine { grid-area: mine; }
  .how { grid-area: how; }
  .wire { grid-area: wire; margin-top: 0; }
  .struck-list { grid-area: struck; }
  .sign-word { font-size: 52px; }
  .volt-line { height: 260px; gap: 8px; }
  .seg-n { font-size: 24px; }
  .seg-tube { width: 16px; }
  .fine-print { max-width: 1120px; margin: 0 auto 0 236px; padding: 14px 40px 40px 0; }
  .rail { right: auto; left: 20px; width: 196px; padding: 16px 16px; gap: 10px; align-items: flex-start; border-radius: 18px; }
  .rail-k, .rail-addr, .rail-copy, .rail-gm { writing-mode: horizontal-tb; }
  .rail-addr { max-width: none; width: 100%; font-size: 12px; line-height: 1.35; word-break: break-all; }
  .rail-copy { padding: 8px 16px; }
}
@media (min-width: 1400px) {
  .sign { margin-left: auto; margin-right: auto; padding-left: 250px; max-width: 1400px; }
  .fine-print { margin-left: auto; margin-right: auto; padding-left: 250px; max-width: 1400px; }
}
