/* Liltwell — the well. A duotone instrument: plum shadows, apricot highlights, nothing else.
   One live figure (the level of the well) over a CSS dial of eight block stations with a bell needle; the CA in a
   dock above the thumb; the name in a slim strip. No SVG, no canvas: the dial is gradients and rotated boxes. */
:root {
  --lo: #1a0f22; --lo2: #24152f; --lo3: #33203f; --lo4: #47305a;
  --mid: #8a5f74; --hi: #ffb27a; --hi2: #f4dcc8; --hi3: #d99a6a;
  --disp: 'Electrolize', 'Figtree', sans-serif; --body: 'Figtree', system-ui, sans-serif; --mono: 'JetBrains Mono', ui-monospace, monospace;
  --dial: min(84vw, 340px); --dockh: 64px;
}
* { box-sizing: border-box; }
html { background: var(--lo); }
body { margin: 0; background: var(--lo); color: var(--hi2); font-family: var(--body); font-size: 16px; line-height: 1.45; padding: 0 0 calc(var(--dockh) + 28px); -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden; }
a { color: var(--hi); text-decoration: none; }
button { font: inherit; cursor: pointer; }
code { font-family: var(--mono); }

/* ---------- the brim: a slim strip, never a header ---------- */
.brim { height: 44px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--lo3); white-space: nowrap; overflow: hidden; }
.wellmark { display: inline-flex; align-items: center; gap: 8px; color: var(--hi2); }
.wellmark img { width: 22px; height: 22px; border-radius: 50%; filter: sepia(1) hue-rotate(-20deg) saturate(1.4); }
.wellmark b { font-family: var(--disp); font-weight: 400; letter-spacing: .12em; text-transform: uppercase; font-size: 15px; }
.wellmark i { font-style: normal; color: var(--mid); font-size: 12px; }
.brimlinks { display: inline-flex; align-items: center; gap: 14px; font-size: 13px; }
.brimlinks a { color: var(--hi3); }
#orbit a { margin-left: 10px; }
#linkUp { background: transparent; color: var(--hi); border: 1px solid var(--hi3); border-radius: 999px; padding: 4px 11px; font-size: 12px; letter-spacing: .04em; }
#linkUp.lit { background: var(--hi); color: var(--lo); border-color: var(--hi); }

@media (max-width: 479px) { .wellmark i, #orbit { display: none; } .brimlinks { gap: 12px; } }

/* ---------- the stage ---------- */
.stage { font-size: 20px; max-width: 560px; margin: 0 auto; padding: 14px 16px 0; }
.gauge { font-size: 20px; text-align: center; }
.level { font-family: var(--disp); font-weight: 400; font-size: clamp(64px, 21vw, 92px); line-height: .95; margin: 8px 0 0; color: var(--hi); letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.level.pulse { animation: pulse .6s ease-out; }
@keyframes pulse { from { transform: scale(1.04); filter: brightness(1.4); } to { transform: none; filter: none; } }
.levelcap { margin: 4px 0 14px; font-size: 13px; color: var(--mid); letter-spacing: .02em; }
.levelcap b { color: var(--hi2); font-weight: 600; }

/* the dial */
.dial { --size: var(--dial); position: relative; width: var(--size); height: var(--size); margin: 0 auto; border-radius: 50%;
  background:
    radial-gradient(circle, var(--lo2) 0 41%, transparent 41.5%),
    repeating-conic-gradient(from -11.25deg, var(--lo4) 0deg 0.6deg, transparent 0.6deg 45deg),
    repeating-conic-gradient(from -2.8125deg, var(--lo3) 0deg 0.4deg, transparent 0.4deg 5.625deg),
    radial-gradient(circle, var(--lo2) 0 62%, var(--lo3) 62.5%, var(--lo2) 63%);
  box-shadow: inset 0 0 0 1px var(--lo4), 0 0 0 1px var(--lo3), 0 24px 60px -30px #000; }
.dial::after { content: ""; position: absolute; inset: 24%; border-radius: 50%; border: 1px solid var(--lo4); pointer-events: none; }
.station { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px 0 0 -29px; border-radius: 50%; border: 1px solid var(--lo4); background: var(--lo);
  color: var(--hi2); display: grid; place-content: center; gap: 0; line-height: 1; padding: 0; transition: transform .25s, background .2s, color .2s;
  --r: calc(var(--size) / 2 - 36px); transform: rotate(var(--a)) translateY(calc(-1 * var(--r))) rotate(calc(-1 * var(--a))); }
.station .n { font-family: var(--disp); font-size: 20px; }
.station .c { font-size: 10px; color: var(--mid); letter-spacing: .06em; margin-top: 3px; }
.station.picked { background: var(--hi); color: var(--lo); border-color: var(--hi); box-shadow: 0 0 0 4px var(--lo), 0 0 0 5px var(--hi3); }
.station.picked .c { color: var(--lo); }
.station.mine { border-color: var(--hi3); box-shadow: inset 0 0 0 2px var(--hi3); }
.station.up { background: var(--hi); color: var(--lo); border-color: var(--hi); }
.station.up .c { color: var(--lo); }
.station:disabled { cursor: default; opacity: .75; }
.needle { position: absolute; left: calc(50% - 2px); top: calc(50% - var(--size) * .38); width: 4px; height: calc(var(--size) * .38); transform-origin: 50% 100%; transform: rotate(var(--deg, 0deg)); transition: transform .9s linear;
  background: linear-gradient(to top, transparent 0 40%, var(--hi) 40% 92%, transparent 92%); border-radius: 2px; pointer-events: none; }
.arc { position: absolute; inset: 27%; border-radius: 50%; background: conic-gradient(var(--hi) 0 var(--pct, 0%), var(--lo3) var(--pct, 0%) 100%);
  -webkit-mask: radial-gradient(circle, transparent 0 78%, #000 79%); mask: radial-gradient(circle, transparent 0 78%, #000 79%); pointer-events: none; }
.core { position: absolute; inset: 31%; border-radius: 50%; background: var(--lo); display: grid; place-content: center; text-align: center; gap: 2px; line-height: 1.1; }
.core .k { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--mid); }
.core .t { font-family: var(--disp); font-size: 26px; color: var(--hi2); font-variant-numeric: tabular-nums; }
.core .s { font-size: 11px; color: var(--hi3); }

/* the action */
.pailrow { margin: 16px 0 0; display: grid; gap: 6px; justify-items: center; }
.dropbtn { width: 100%; max-width: 360px; padding: 15px 18px; border: 0; border-radius: 14px; background: var(--hi); color: var(--lo); font-weight: 700; font-size: 17px; letter-spacing: .01em; transition: filter .15s, transform .1s; }
.dropbtn:hover { filter: brightness(1.06); }
.dropbtn:active { transform: translateY(1px); }
.dropbtn:disabled { background: var(--lo3); color: var(--mid); cursor: default; }
.pailnote { font-size: 12px; color: var(--mid); }
.pailnote b { color: var(--hi3); font-weight: 600; }

/* the spec, folded */
.spec { margin: 20px auto 0; max-width: 420px; text-align: left; border: 1px solid var(--lo3); border-radius: 12px; padding: 0 14px; font-size: 14px; }
.spec summary { cursor: pointer; padding: 11px 0; color: var(--hi3); letter-spacing: .06em; text-transform: uppercase; font-size: 12px; }
.spec dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; margin: 0 0 14px; }
.spec dt { color: var(--mid); }
.spec dd { margin: 0; color: var(--hi2); }

/* ---------- the bells column ---------- */
.bells { margin: 26px 0 0; font-size: 14px; display: grid; gap: 14px; }
.bellhead { font-family: var(--disp); font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: var(--mid); margin: 0; }
.primer { border: 1px solid var(--lo3); border-radius: 12px; padding: 12px 14px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px 14px; background: var(--lo2); }
.primer div { display: grid; gap: 2px; }
.primer .k { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--mid); }
.primer .v { font-family: var(--disp); font-size: 18px; color: var(--hi); }
.bell { display: grid; grid-template-columns: 62px 1fr; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--lo3); }
.bell:first-of-type { border-top: 0; }
.mini { width: 62px; height: 62px; border-radius: 50%; position: relative; background: conic-gradient(from -22.5deg, var(--s1) 0 45deg, var(--s2) 45deg 90deg, var(--s3) 90deg 135deg, var(--s4) 135deg 180deg, var(--s5) 180deg 225deg, var(--s6) 225deg 270deg, var(--s7) 270deg 315deg, var(--s8) 315deg 360deg); box-shadow: inset 0 0 0 1px var(--lo4); }
.mini::after { content: attr(data-p); position: absolute; inset: 30%; border-radius: 50%; background: var(--lo); color: var(--hi2); font-family: var(--disp); font-size: 12px; display: grid; place-content: center; }
.bell .who { color: var(--hi2); font-weight: 600; }
.bell .what { color: var(--mid); font-size: 13px; }
.bell .what b { color: var(--hi); font-weight: 600; }
.tape { display: grid; gap: 0; }
.tick { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 7px 0; border-top: 1px solid var(--lo3); font-size: 13px; }
.tick:first-child { border-top: 0; }
.tick .blk { font-family: var(--disp); color: var(--hi); }
.tick .ago { color: var(--mid); }
.hush { color: var(--mid); font-size: 13px; padding: 6px 0; }

/* ---------- other views ---------- */
.plate { text-align: left; }
.plate h2 { font-family: var(--disp); font-weight: 400; font-size: 30px; margin: 10px 0 4px; color: var(--hi); letter-spacing: .02em; }
.plate p, .plate li { font-size: 15px; color: var(--hi2); }
.plate .lede { color: var(--mid); margin: 0 0 16px; }
.plate h3 { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--mid); margin: 20px 0 6px; }
.plate code { font-size: 13px; word-break: break-all; color: var(--hi3); }
.pailcard { border: 1px solid var(--lo3); border-radius: 12px; padding: 12px 14px; margin: 10px 0; background: var(--lo2); font-size: 14px; }
.pailcard .row { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.pailcard .row span:first-child { color: var(--mid); }
.blocks { display: inline-flex; gap: 4px; }
.blocks i { font-style: normal; font-family: var(--disp); width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--lo4); display: grid; place-content: center; font-size: 12px; }
.blocks i.up { background: var(--hi); color: var(--lo); border-color: var(--hi); }
.blocks i.down { color: var(--mid); }
.haulbtn { margin-top: 8px; width: 100%; padding: 11px; border: 0; border-radius: 10px; background: var(--hi); color: var(--lo); font-weight: 700; }

/* ---------- the sump (footer) ---------- */
.sump { max-width: 560px; margin: 34px auto 0; padding: 16px 16px 0; border-top: 1px solid var(--lo3); font-size: 12px; color: var(--mid); display: grid; gap: 6px; }
.sumprow { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.sump .sk { letter-spacing: .12em; text-transform: uppercase; font-size: 10px; }
.sump code { font-size: 11px; word-break: break-all; color: var(--hi3); }
.sumplinks a { margin-right: 12px; }
.sumpline { margin-top: 6px; font-family: var(--disp); letter-spacing: .1em; text-transform: uppercase; font-size: 11px; }

/* ---------- the dock: the CA, pinned above the thumb at every width ---------- */
.welldock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; min-height: var(--dockh); background: var(--lo2); border-top: 1px solid var(--lo4); padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 8px; align-items: center; box-shadow: 0 -12px 30px -18px #000; }
.welldock .dk { font-family: var(--disp); font-size: 11px; letter-spacing: .16em; color: var(--mid); }
.welldock code { font-size: 11.5px; line-height: 1.3; word-break: break-all; color: var(--hi2); user-select: all; }
.welldock code.dim { color: var(--mid); }
#caCopy { background: var(--hi); color: var(--lo); border: 0; border-radius: 8px; padding: 8px 12px; font-size: 12px; font-weight: 700; }
#caCopy.done { background: var(--hi2); }
#caCopy:disabled { background: var(--lo3); color: var(--mid); }
#gmgnLink { font-size: 11px; color: var(--hi3); border: 1px solid var(--lo4); border-radius: 8px; padding: 7px 9px; }

/* ---------- the sluice (sheet) ---------- */
#sluiceWrap { position: fixed; inset: 0; z-index: 30; background: rgba(12, 6, 16, .72); display: flex; align-items: flex-end; justify-content: center; }
#sluiceWrap[hidden] { display: none; }
.sluice { width: 100%; max-width: 480px; background: var(--lo2); border: 1px solid var(--lo4); border-radius: 18px 18px 0 0; padding: 14px 16px calc(18px + env(safe-area-inset-bottom)); font-size: 14px; }
.sluicehead { display: flex; justify-content: space-between; align-items: center; font-family: var(--disp); letter-spacing: .1em; text-transform: uppercase; font-size: 13px; color: var(--hi3); margin-bottom: 10px; }
.sluicehead button { background: transparent; border: 0; color: var(--hi2); font-size: 22px; line-height: 1; }
.sluice .fine { color: var(--hi2); margin: 0 0 10px; }
.sluice .fine b { color: var(--hi); }
.sluice .warnline { color: var(--hi); border: 1px solid var(--hi3); border-radius: 8px; padding: 8px 10px; margin: 8px 0; }
.sluice .go { width: 100%; padding: 13px; border: 0; border-radius: 12px; background: var(--hi); color: var(--lo); font-weight: 700; font-size: 16px; }
.sluice .go:disabled { background: var(--lo3); color: var(--mid); }
.wl { display: grid; gap: 8px; }
.wl button { display: flex; align-items: center; gap: 10px; background: var(--lo); border: 1px solid var(--lo4); color: var(--hi2); border-radius: 10px; padding: 10px; }
.wl img { width: 22px; height: 22px; border-radius: 6px; }
.ripple { position: fixed; left: 50%; bottom: calc(var(--dockh) + 18px); transform: translateX(-50%); z-index: 40; background: var(--hi); color: var(--lo); padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px -10px #000; }

/* ---------- wider ---------- */
@media (min-width: 720px) {
  :root { --dial: 420px; }
  .stage { max-width: 720px; padding-top: 22px; }
  .level { font-size: 124px; }
  .levelcap { font-size: 14px; }
  .station { width: 66px; height: 66px; margin: -33px 0 0 -33px; --r: calc(var(--size) / 2 - 40px); }
  .station .n { font-size: 23px; }
  .core .t { font-size: 32px; }
  .sump { max-width: 720px; }
  .welldock { padding-left: 24px; padding-right: 24px; }
  .welldock code { font-size: 13px; }
}
@media (min-width: 1000px) {
  :root { --dial: 460px; }
  .brim { padding: 0 32px; }
  .stage { max-width: 1160px; padding: 28px 32px 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; align-items: start; }
  .gauge { padding-top: 6px; }
  .level { font-size: 150px; }
  .pailrow { margin-top: 20px; }
  .bells { margin: 0; position: sticky; top: 16px; font-size: 14px; }
  .sump { max-width: 1160px; padding-left: 32px; padding-right: 32px; grid-template-columns: 1fr 1fr; }
  .sump .sumpline { grid-column: 1 / -1; }
  .plate { grid-column: 1 / -1; max-width: 720px; }
  .welldock { grid-template-columns: auto auto auto auto; justify-content: center; gap: 14px; }
}
