/* HASHFARM: arctic night console. Dark only. Desktop-first, phone works. */
:root {
  color-scheme: dark;
  --bg: #050a1c; --ink: #eaf4ff; --dim: #8aa3c8; --dim2: #5d7599;
  --cyan: #4df3ff; --mint: #4dffb8; --violet: #9b7bff; --amber: #ffb347; --red: #ff4d6d; --gold: #ffd36b;
  --panel: rgba(9, 20, 44, .86); --panel2: rgba(20, 38, 74, .72); --line: rgba(120, 200, 255, .16); --line2: rgba(120, 200, 255, .32);
  --r: 16px; --gut: 16px;
  --font: "Segoe UI Variable Display", "Segoe UI", Inter, "SF Pro Display", -apple-system, Roboto, system-ui, sans-serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.45 var(--font); }
body { min-height: 100dvh; overflow-x: hidden; }
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 0; display: block; }
body::after { content: ""; position: fixed; inset: 0; z-index: 1; pointer-events: none; transition: opacity .6s;
  background: radial-gradient(ellipse at 50% 40%, transparent 40%, rgba(0, 0, 0, .55) 100%); }
button { font: inherit; color: inherit; cursor: pointer; }
b { font-weight: 700; }
h2 { margin: 0; font-size: 12.5px; letter-spacing: .22em; text-transform: uppercase; color: var(--dim); font-weight: 700; }
h3 { margin: 0 0 2px; font-size: 16px; }
small, .dim { color: var(--dim); }
.hide { display: none !important; }
.sec-h { margin: 22px 2px 10px; }

#app { position: relative; z-index: 2; max-width: 1280px; margin: 0 auto; padding: 0 var(--gut) 96px; }

/* ---- top bar ---- */
.top { display: flex; align-items: center; gap: 16px; padding: calc(14px + env(safe-area-inset-top)) 0 10px; }
.brand { font-weight: 900; font-size: 20px; letter-spacing: .28em; display: flex; align-items: center; gap: 10px; text-shadow: 0 0 18px rgba(77, 243, 255, .55); }
.logo { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; color: #021018; font-size: 18px;
  background: linear-gradient(135deg, var(--cyan), var(--mint)); box-shadow: 0 0 20px rgba(77, 243, 255, .6); animation: logoGlow 4s ease-in-out infinite alternate; }
@keyframes logoGlow { to { box-shadow: 0 0 34px rgba(77, 255, 184, .85); } }
.top .grow { flex: 1; }
@media (max-width: 480px) { .brand { font-size: 16px; letter-spacing: .16em; } .chip { padding: 6px 10px; font-size: 12px; } }
.chip { white-space: nowrap; background: var(--panel); border: 1px solid var(--line2); border-radius: 999px; padding: 7px 14px; font-size: 13px; color: var(--cyan); letter-spacing: .04em; }

/* ---- tabs: bottom bar on phones, pill row in the header on desktop ---- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: grid; grid-template-columns: repeat(6, 1fr);
  background: rgba(5, 10, 28, .88); border-top: 1px solid var(--line2); padding-bottom: env(safe-area-inset-bottom); }
.tabs button { background: transparent; border: 0; padding: 8px 2px 7px; font-size: 11.5px; color: var(--dim); display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 56px; position: relative; transition: color .2s; }
.tabs button i { font-style: normal; font-size: 19px; line-height: 1; }
.tabs button.on { color: var(--cyan); text-shadow: 0 0 12px rgba(77, 243, 255, .7); }
.tabs .dot { position: absolute; top: 6px; left: 54%; width: 9px; height: 9px; border-radius: 50%; background: var(--red); box-shadow: 0 0 10px var(--red); animation: blink 1s steps(2) infinite; }
@media (min-width: 1024px) {
  .tabs { position: static; display: flex; gap: 6px; background: none; border: 0; backdrop-filter: none; padding: 0; margin-left: 12px; }
  .tabs button { flex-direction: row; gap: 8px; min-height: 0; padding: 9px 18px; border-radius: 999px; font-size: 14px; border: 1px solid transparent; letter-spacing: .04em; }
  .tabs button i { font-size: 15px; }
  .tabs button:hover { color: var(--ink); background: rgba(120, 200, 255, .08); }
  .tabs button.on { background: rgba(77, 243, 255, .12); border-color: rgba(77, 243, 255, .5); }
  .tabs .dot { top: 4px; left: auto; right: 8px; }
  .top { padding-bottom: 14px; }
}

/* ---- resource cards ---- */
.res { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 12px; }
.stat { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px 12px; overflow: hidden; min-width: 0; }
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 2px; background: linear-gradient(90deg, transparent, var(--c, var(--cyan)), transparent); opacity: .9; }
.stat .lbl { display: block; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--dim); }
.stat b { display: block; font-size: clamp(24px, 2.6vw, 40px); line-height: 1.1; font-variant-numeric: tabular-nums; font-weight: 800; text-shadow: 0 0 22px color-mix(in srgb, var(--c, var(--cyan)) 55%, transparent); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat small { font-size: 12px; }
.stat.credits { --c: var(--gold); }
.stat.credits b { color: var(--gold); font-size: clamp(28px, 3.2vw, 48px); }
.stat.score { --c: var(--cyan); } .stat.hash { --c: var(--mint); } .stat.net { --c: var(--violet); }
body.fx-boom .stat.credits { animation: boomGlow 1.4s ease-in-out infinite alternate; }
@keyframes boomGlow { to { box-shadow: 0 0 36px rgba(255, 211, 107, .55), inset 0 0 22px rgba(255, 211, 107, .15); border-color: rgba(255, 211, 107, .7); } }
@media (max-width: 700px) { .res { grid-template-columns: 1fr 1fr; gap: 8px; } .stat { padding: 9px 12px; } }

/* ---- event banners ---- */
#banners { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
#banners:empty { display: none; }
.banner { position: relative; overflow: hidden; border-radius: 14px; padding: 11px 16px 11px 56px; border: 1px solid var(--line2); background: var(--panel); animation: slideIn .4s ease-out; font-size: 14px; }
.banner b { display: block; letter-spacing: .06em; text-transform: uppercase; font-size: 12.5px; }
.banner .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 26px; line-height: 1; filter: drop-shadow(0 0 8px currentColor); }
.banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .13) 50%, transparent 70%); transform: translateX(-100%); animation: sweep 3.6s ease-in-out infinite; pointer-events: none; }
@keyframes sweep { 60%, 100% { transform: translateX(100%); } }
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } }
.banner.bad { border-color: rgba(255, 77, 109, .6); background: linear-gradient(90deg, rgba(255, 77, 109, .2), var(--panel)); color: #ffd3da; }
.banner.warn { border-color: rgba(255, 179, 71, .55); background: linear-gradient(90deg, rgba(255, 179, 71, .17), var(--panel)); color: #ffe9c7; }
.banner.good { border-color: rgba(77, 255, 184, .5); background: linear-gradient(90deg, rgba(77, 255, 184, .15), var(--panel)); color: #cffff0; }
.banner.info { border-color: rgba(77, 243, 255, .4); background: linear-gradient(90deg, rgba(77, 243, 255, .1), var(--panel)); color: #d7fbff; }
.banner.k-blackout { animation: slideIn .4s ease-out, flicker 2.4s steps(1) infinite; }
.banner.k-blackout .ic { animation: flicker 1.3s steps(1) infinite; }
@keyframes flicker { 0%, 100% { opacity: 1; } 8% { opacity: .35; } 10% { opacity: 1; } 42% { opacity: .5; } 44% { opacity: 1; } 70% { opacity: .2; } 72% { opacity: 1; } }
.banner.k-halving { border-color: rgba(255, 211, 107, .8); background: linear-gradient(90deg, rgba(255, 211, 107, .26), var(--panel)); color: var(--gold); }
.banner.k-halving .ic { animation: snip 1.2s ease-in-out infinite; transform-origin: 50% 50%; }
@keyframes snip { 0%, 100% { transform: translateY(-50%) rotate(-18deg); } 50% { transform: translateY(-50%) rotate(14deg) scale(1.12); } }
.banner.k-boom .ic { animation: rise 1.1s ease-in-out infinite; }
@keyframes rise { 0%, 100% { transform: translateY(-40%); } 50% { transform: translateY(-70%); } }
.banner.k-thaw { border-color: rgba(255, 140, 66, .6); background: linear-gradient(90deg, rgba(255, 140, 66, .22), var(--panel)); color: #ffe0cc; }
.banner.k-storm { border-color: rgba(160, 210, 255, .7); background: linear-gradient(90deg, rgba(160, 210, 255, .2), var(--panel)); color: #e6f4ff; }
.banner.k-storm .ic, .banner.k-thaw .ic { animation: sway 2.2s ease-in-out infinite; }
@keyframes sway { 50% { transform: translateY(-50%) translateX(4px); } }

/* ---- panels ---- */
.panel { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.panel + .panel { margin-top: 14px; }
.panel-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.panel-h h2 small { letter-spacing: .08em; color: var(--cyan); margin-left: 6px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-top: 12px; }
.card.row { display: flex; align-items: center; gap: 14px; }
.grow { flex: 1; min-width: 0; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 14px; }
.kv span:nth-child(odd) { color: var(--dim); }
.kv span:nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

/* farm layout */
.farm { display: grid; gap: 14px; margin-top: 14px; grid-template-columns: 1fr; }
.farm .panel + .panel { margin-top: 0; }
.farm .main-col, .farm .side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 1024px) { .farm { grid-template-columns: minmax(0, 1.65fr) minmax(340px, 1fr); align-items: start; } }

/* ---- climate ---- */
.temp-big { display: flex; align-items: baseline; gap: 6px; }
.temp-big b { font-size: 54px; line-height: 1; font-weight: 800; font-variant-numeric: tabular-nums; color: hsl(var(--hh, 190) 100% 62%); text-shadow: 0 0 26px hsl(var(--hh, 190) 100% 55% / .65); transition: color .8s; }
.temp-big span { font-size: 22px; color: var(--dim); }
.temp-big .state { margin-left: auto; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line2); color: hsl(var(--hh, 190) 100% 70%); }
.bar { position: relative; height: 12px; border-radius: 8px; background: rgba(0, 0, 0, .4); border: 1px solid var(--line); overflow: hidden; margin: 10px 0 4px; }
.bar i { position: absolute; top: 0; bottom: 0; left: 0; border-radius: 8px; transition: width .6s; }
.bar.temp { background: linear-gradient(90deg, #2a6bff 0%, #2a6bff 12.5%, #26d89a 12.5%, #26d89a 50%, #ffc857 50%, #ffc857 68.75%, #ff8a3d 68.75%, #ff8a3d 87.5%, #ff3d57 87.5%); }
.bar.temp .mark { position: absolute; top: -3px; bottom: -3px; width: 4px; margin-left: -2px; background: #fff; border-radius: 2px; box-shadow: 0 0 10px #fff; transition: left .6s; }
.bar.pw i { background: linear-gradient(90deg, var(--cyan), var(--mint)); box-shadow: 0 0 12px var(--cyan); }
.bar.pw.over i { background: linear-gradient(90deg, var(--amber), var(--red)); }
.scale { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--dim2); letter-spacing: .08em; text-transform: uppercase; }
.gauge { margin-top: 14px; }
.gauge .row { display: flex; justify-content: space-between; align-items: baseline; }
.gauge .row b { font-size: 20px; font-variant-numeric: tabular-nums; }

/* ---- hangar ---- */
.hangar-panel { --hh: 190; --ha: .08; overflow: hidden; transition: box-shadow .8s, border-color .8s;
  background: linear-gradient(180deg, hsl(var(--hh) 100% 50% / var(--ha)), transparent 55%), var(--panel);
  border-color: hsl(var(--hh) 100% 60% / .35); box-shadow: 0 0 40px hsl(var(--hh) 100% 55% / .14), inset 0 0 60px hsl(var(--hh) 100% 55% / .06); }
.hangar-panel::before { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0; will-change: opacity; box-shadow: 0 0 60px hsl(var(--hh) 100% 55% / .55), inset 0 0 80px hsl(var(--hh) 100% 55% / .25); transition: opacity .6s; }
.hangar-panel.hot::before { animation: heatglow 1.4s ease-in-out infinite; }
@keyframes heatglow { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.hangar { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 9px; margin-top: 6px; }
@media (max-width: 700px) { .hangar { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; } }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--dim); margin-top: 12px; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.hangar-panel::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; background: rgba(0, 0, 0, .72); transition: opacity .5s; border-radius: inherit; }
.hangar-panel.blackout::after { opacity: 1; animation: flicker 3s steps(1) infinite; }
.hangar-panel.blackout { border-color: rgba(255, 77, 109, .75); box-shadow: inset 0 0 70px rgba(255, 77, 109, .35); }
.blackout-tag { position: absolute; z-index: 3; left: 50%; top: 46%; transform: translate(-50%, -50%); font-weight: 900; letter-spacing: .4em; font-size: 22px; color: #ff9aa9; text-shadow: 0 0 24px var(--red); opacity: 0; pointer-events: none; text-align: center; }
.blackout-tag small { display: block; letter-spacing: .2em; font-size: 11px; color: #ffd3da; margin-top: 6px; }
.hangar-panel.blackout .blackout-tag { opacity: 1; animation: flicker 2.2s steps(1) infinite; }

/* rigs: CSS only, transform/opacity animations */
.rig { --blade: rgba(255, 255, 255, .75); --led: var(--mint); position: relative; aspect-ratio: 1; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .14); background: var(--rig-bg, #1b2a49); padding: 0; color: #fff; font-size: 11px; font-weight: 800; letter-spacing: .06em; box-shadow: 0 5px 12px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .15); transition: transform .15s, filter .4s, opacity .4s; }
.rig::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: repeating-linear-gradient(0deg, transparent 0 5px, rgba(0, 0, 0, .3) 5px 6px); opacity: .55; }
.rig .fan { position: absolute; left: 50%; top: 38%; width: 48%; aspect-ratio: 1; margin: -24% 0 0 -24%; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .22);
  background: conic-gradient(var(--blade) 0 16%, transparent 16% 33%, var(--blade) 33% 50%, transparent 50% 66%, var(--blade) 66% 83%, transparent 83%);
  animation: spin var(--fan, 1.2s) steps(9) infinite; }
/* Fans turn in 9 steps per revolution: the 3-blade fan looks continuous, and each fan repaints ~8 times a second instead of every frame. */
/* fan hub: a static dot over the spinning blades (no mask: masks force a repaint of every fan on every frame) */
.rig .fan::after { content: ""; position: absolute; inset: 34%; border-radius: 50%; background: rgba(10, 20, 40, .85); box-shadow: 0 0 0 2px rgba(255, 255, 255, .25); }
@keyframes spin { to { transform: rotate(360deg); } }
.rig .led { position: absolute; top: 6px; right: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--led); box-shadow: 0 0 8px var(--led); animation: blink 1.5s steps(2) infinite; }
@keyframes blink { 50% { opacity: .25; } }
.rig .tag { position: absolute; left: 0; right: 0; bottom: 3px; text-align: center; text-shadow: 0 1px 2px #000; }
.rig.s9 { --rig-bg: linear-gradient(160deg, #9a6431, #5a361a); --blade: #ffd1a3; }
.rig.t17 { --rig-bg: linear-gradient(160deg, #6b7c97, #38465f); --blade: #dfe9ff; }
.rig.pp { --rig-bg: linear-gradient(160deg, #3f98e0, #1f4f8a); --blade: #d4f0ff; }
.rig.xl { --rig-bg: linear-gradient(160deg, #78ecff, #1b8db5); --blade: #ffffff; box-shadow: 0 0 16px rgba(77, 243, 255, .5), inset 0 1px 0 rgba(255, 255, 255, .35); }
.rig.xl::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(circle at 22% 95%, rgba(255, 255, 255, .85) 0 2px, transparent 3px), radial-gradient(circle at 62% 98%, rgba(255, 255, 255, .7) 0 1.5px, transparent 2.5px), radial-gradient(circle at 84% 92%, rgba(255, 255, 255, .8) 0 2px, transparent 3px); animation: bubbles 2.6s linear infinite; }
@keyframes bubbles { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-70%); opacity: 0; } }
.rig.idle { filter: saturate(.45) brightness(.7); } .rig.idle .fan { animation-play-state: paused; } .rig.idle .led { --led: var(--amber); animation-duration: 3s; }
.rig.empty { background: rgba(120, 200, 255, .04); border: 1px dashed var(--line2); box-shadow: none; }
.rig.empty::before, .rig.empty .fan, .rig.empty .led, .rig.empty .tag { display: none; }
.rig.broken { cursor: pointer; border-color: rgba(255, 77, 109, .85); box-shadow: 0 0 14px rgba(255, 77, 109, .45), inset 0 1px 0 rgba(255, 255, 255, .15); }
.rig.broken .fan { animation-play-state: paused; opacity: .4; } .rig.broken .led { --led: var(--red); animation-duration: .35s; }
.rig .spark, .rig .smoke { display: none; }
.rig.broken .spark { display: block; position: absolute; left: 30%; top: 38%; width: 5px; height: 5px; border-radius: 50%; background: #fff6c2; box-shadow: 0 0 8px 2px #ffd94a, 18px 6px 0 -1px #ffd94a, -6px 14px 0 -1px #fff; animation: spark .55s steps(3) infinite; will-change: transform, opacity; }
@keyframes spark { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: 1; } 100% { opacity: 0; transform: translate(6px, -8px) scale(1.4); } }
.rig.broken .smoke { display: block; position: absolute; left: 36%; top: 6%; width: 36%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, rgba(200, 200, 210, .75), transparent 70%); animation: smoke 2s ease-out infinite; will-change: transform, opacity; }
@keyframes smoke { from { transform: translateY(40%) scale(.5); opacity: .9; } to { transform: translateY(-120%) scale(1.8); opacity: 0; } }
@keyframes shake { 25% { transform: translateX(-.6px); } 75% { transform: translateX(.6px); } }
.rig:not(.empty):not(.broken):hover { transform: translateY(-2px); }

/* ---- buttons ---- */
.btn { background: linear-gradient(135deg, var(--cyan), #36c9ff); color: #031722; border: 0; border-radius: 11px; padding: 10px 16px; font-weight: 800; letter-spacing: .02em; min-height: 42px; box-shadow: 0 0 22px rgba(77, 243, 255, .3); transition: transform .12s, box-shadow .2s, filter .2s; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 0 32px rgba(77, 243, 255, .6); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn.sec { background: var(--panel2); color: var(--ink); border: 1px solid var(--line2); box-shadow: none; }
.btn.bad { background: var(--red); color: #fff; box-shadow: 0 0 22px rgba(255, 77, 109, .4); }
.btn:disabled { opacity: .38; cursor: not-allowed; box-shadow: none; }
.btn.sm { padding: 7px 12px; min-height: 36px; font-size: 13px; }
/* affordable only with a credit pack: looks dimmed, but opens the "Not enough credits" window */
.btn.short { opacity: .55; box-shadow: none; } .btn.short:hover, .btn.short:focus-visible { opacity: .85; }
#modal .sheet.topup { width: min(500px, 100%); } #modal .sheet.topup.still { animation: none; }
#modal .topup .tu-pack { text-align: left; margin: 4px 0 12px; }
#modal .topup .tu-pack h3 { font-size: 16px; margin: 0 0 4px; }
#modal .topup .tu-small { font-size: 12.5px; margin: 0 0 12px; }
#modal .topup .tu-msg { color: var(--gold); font-size: 13.5px; margin: 0 0 12px; }
#modal .topup .tu-btns { justify-content: center; margin-bottom: 10px; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; background: rgba(0, 0, 0, .3); border: 1px solid var(--line); border-radius: 13px; padding: 4px; }
.seg button { background: transparent; border: 0; border-radius: 10px; padding: 10px 2px; font-size: 13px; font-weight: 700; color: var(--dim); min-height: 46px; transition: background .2s, color .2s, box-shadow .2s; }
.seg button small { display: block; font-size: 11px; font-weight: 500; color: inherit; opacity: .8; }
.seg button.on { background: linear-gradient(135deg, var(--cyan), #36c9ff); color: #031722; box-shadow: 0 0 20px rgba(77, 243, 255, .45); }
.seg button.on[data-mode="turbo"] { background: linear-gradient(135deg, var(--amber), #ff8a3d); box-shadow: 0 0 20px rgba(255, 179, 71, .5); }
.seg button.on[data-mode="max"] { background: linear-gradient(135deg, #ff6a5c, var(--red)); color: #fff; box-shadow: 0 0 22px rgba(255, 77, 109, .6); }

/* ---- shop ---- */
.shop-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.shop-grid .card { margin: 0; }
.rig-card { display: grid; grid-template-columns: 76px 1fr; gap: 14px; }
.rig-card .rig { width: 76px; align-self: start; }
.shop-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tag { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line2); color: var(--dim); letter-spacing: .06em; white-space: nowrap; }
.tag.dirty { color: #ffb878; border-color: #9a6431; } .tag.stable { color: var(--cyan); border-color: rgba(77, 243, 255, .5); }
.stats3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; font-size: 13px; margin: 8px 0; font-weight: 700; }
.stats3 div { background: rgba(0, 0, 0, .3); border-radius: 9px; padding: 5px 7px; }
.stats3 span { display: block; color: var(--dim); font-size: 11px; font-weight: 500; }
.price { font-weight: 800; color: var(--gold); text-shadow: 0 0 14px rgba(255, 211, 107, .4); white-space: nowrap; }
.need { color: var(--amber); font-size: 12.5px; margin-top: 6px; }

/* ---- feed ---- */
.feed { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.feed li { background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-left: 4px solid var(--line2); border-radius: 11px; padding: 9px 12px; font-size: 14px; animation: slideIn .3s ease-out; }
.feed li.bad { border-left-color: var(--red); } .feed li.warn { border-left-color: var(--amber); } .feed li.good { border-left-color: var(--mint); }
.feed .when { color: var(--dim); font-size: 12px; margin-left: 6px; }
.two { display: grid; gap: 14px; } @media (min-width: 1024px) { .two { grid-template-columns: 1fr 1.4fr; align-items: start; } }

/* ---- table, cosmetics ---- */
table.lb { width: 100%; border-collapse: collapse; font-size: 15px; }
table.lb td, table.lb th { padding: 9px 8px; border-bottom: 1px solid var(--line); text-align: left; }
table.lb th { color: var(--dim); font-weight: 600; font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; }
table.lb td.n, table.lb th.n { text-align: right; font-variant-numeric: tabular-nums; }
table.lb tr.me td { background: rgba(77, 243, 255, .12); font-weight: 800; color: var(--cyan); }
table.lb tr.ghost td:nth-child(2) { color: var(--dim); }
.cos { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.cos > div { background: var(--panel2); border: 1px solid var(--line2); border-radius: 13px; padding: 11px 14px; font-size: 13px; }
.cos > div:not(.off) { border-color: rgba(255, 211, 107, .6); box-shadow: 0 0 22px rgba(255, 211, 107, .18); }
.cos > div.off { opacity: .42; }
.cos b { display: block; margin-bottom: 2px; }
input[type=text] { background: rgba(0, 0, 0, .35); color: var(--ink); border: 1px solid var(--line2); border-radius: 11px; padding: 11px 13px; font: inherit; font-size: 16px; width: 100%; }
input[type=text]:focus { outline: 2px solid var(--cyan); outline-offset: 1px; }
.spark { width: 100%; height: 84px; display: block; }
ul.rules { padding-left: 18px; margin: 8px 0; } ul.rules li { margin: 6px 0; }
.p { margin: 6px 0; }

/* ---- toasts, coins, modal ---- */
#toasts { position: fixed; left: 0; right: 0; top: calc(10px + env(safe-area-inset-top)); display: flex; flex-direction: column; align-items: center; gap: 8px; z-index: 80; pointer-events: none; } /* above #modal (70): payment errors from the top-up window stay visible */
.toast { background: rgba(10, 22, 48, .94); border: 1px solid var(--line2); padding: 9px 16px; border-radius: 13px; font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .5); animation: slideIn .25s; max-width: 92vw; }
.toast.bad { border-color: var(--red); } .toast.good { border-color: var(--mint); }
#coins { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }
.pop { position: absolute; font-weight: 800; font-size: 17px; color: var(--gold); text-shadow: 0 0 12px rgba(255, 211, 107, .8), 0 2px 4px #000; animation: popUp 1.8s ease-out forwards; white-space: nowrap; }
.pop.big { font-size: 24px; color: var(--mint); text-shadow: 0 0 16px rgba(77, 255, 184, .8), 0 2px 4px #000; }
@keyframes popUp { from { transform: translate(-50%, 0) scale(.7); opacity: 0; } 15% { opacity: 1; transform: translate(-50%, -8px) scale(1.1); } to { transform: translate(-50%, -64px) scale(1); opacity: 0; } }
.coin { position: absolute; width: 14px; height: 14px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff3b8, var(--gold) 55%, #c98a10); box-shadow: 0 0 10px rgba(255, 211, 107, .8); animation: coinUp 1.5s cubic-bezier(.2, .8, .3, 1) forwards; }
@keyframes coinUp { from { transform: translate(0, 0) scale(.5); opacity: 0; } 15% { opacity: 1; } to { transform: translate(var(--dx, 0), -120px) scale(1); opacity: 0; } }
#flash { position: fixed; inset: 0; z-index: 50; pointer-events: none; opacity: 0; background: radial-gradient(circle, rgba(255, 211, 107, .55), transparent 70%); }
#flash.go { animation: flash 1.4s ease-out; }
@keyframes flash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.over-note { text-align: center; color: var(--dim); font-size: 13px; margin: 14px 0; }

/* ---- page-level event moods ---- */
body.fx-blackout::after { opacity: 1; background: radial-gradient(ellipse at 50% 40%, rgba(0, 0, 0, .25) 20%, rgba(0, 0, 0, .8) 100%); }
body.fx-thaw .panel, body.fx-thaw .stat { border-color: rgba(255, 140, 66, .35); }
body.fx-storm .panel, body.fx-storm .stat { border-color: rgba(190, 225, 255, .35); }

/* ---- tab transition ---- */
#view.enter { animation: viewIn .38s cubic-bezier(.2, .8, .3, 1); }
@keyframes viewIn { from { opacity: 0; transform: translateY(10px); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* cosmetic: Golden Lights */
body.cos-gold .rig.on .led { --led: var(--gold); }

/* ---- goals and achievements ---- */
.goals { border-color: rgba(255, 211, 107, .35); background: linear-gradient(180deg, rgba(255, 211, 107, .08), transparent 60%), var(--panel); }
.goal { margin-top: 12px; }
.goal-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.goal-h b { font-size: 14px; } .goal-h small { text-align: right; }
.gbar { height: 7px; border-radius: 6px; background: rgba(0, 0, 0, .4); overflow: hidden; margin-top: 6px; }
.gbar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--amber)); box-shadow: 0 0 10px rgba(255, 211, 107, .6); transition: width .8s; }
.ach { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.ach > div { background: var(--panel2); border: 1px solid var(--line); border-radius: 13px; padding: 11px 14px; font-size: 13px; opacity: .7; }
.ach > div.done { opacity: 1; border-color: rgba(255, 211, 107, .65); box-shadow: 0 0 20px rgba(255, 211, 107, .18); }
.ach b { display: block; } .ach > div.done b { color: var(--gold); }
.toast.achv { border-color: var(--gold); color: var(--gold); font-weight: 800; box-shadow: 0 0 30px rgba(255, 211, 107, .45); }

/* ---- intro ---- */
#modal { position: fixed; inset: 0; z-index: 70; display: grid; place-items: center; background: rgba(2, 6, 18, .72); backdrop-filter: blur(6px); padding: 16px; }
#modal[hidden] { display: none; }
#modal .sheet { width: min(460px, 100%); background: linear-gradient(180deg, rgba(20, 38, 74, .96), rgba(9, 20, 44, .98)); border: 1px solid var(--line2); border-radius: 22px; padding: 26px 24px 20px; box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 60px rgba(77, 243, 255, .15); animation: viewIn .35s cubic-bezier(.2, .8, .3, 1); text-align: center; }
#modal h3 { font-size: 22px; margin: 6px 0 8px; }
#modal p { color: #c8d9f2; margin: 0 0 18px; line-height: 1.55; }
.tour-ic { font-size: 40px; line-height: 1; filter: drop-shadow(0 0 16px rgba(77, 243, 255, .8)); }
.dots { display: flex; justify-content: center; gap: 7px; margin-bottom: 18px; }
.dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--line2); transition: background .2s, transform .2s; }
.dots i.on { background: var(--cyan); transform: scale(1.3); box-shadow: 0 0 10px var(--cyan); }

/* Big farms: only every third fan and every other XL bubble column animate, so weak devices stay smooth. */
.hangar.dense .rig .fan { animation: none; }
.hangar.dense .rig.on:nth-child(3n+1) .fan { animation: spin var(--fan, 1.2s) steps(9) infinite; }
.hangar.dense .rig.xl::after { animation: none; opacity: .6; }
.hangar.dense .rig.xl.on:nth-child(2n)::after { animation: bubbles 2.6s linear infinite; }

/* ---- daily challenge ---- */
.daily { border-color: rgba(77, 243, 255, .35); background: linear-gradient(180deg, rgba(77, 243, 255, .08), transparent 60%), var(--panel); }
.stars { display: flex; gap: 3px; font-style: normal; }
.stars i { font-style: normal; font-size: 15px; width: 16px; text-align: center; color: var(--dim2); }
.stars i.done { color: var(--gold); text-shadow: 0 0 10px rgba(255, 211, 107, .8); }
.stars i.today { color: var(--cyan); animation: blink 1.6s steps(2) infinite; }
.stars i.missed { color: rgba(255, 77, 109, .6); }
.two > .panel + .panel, .two > div > .panel:first-child { margin-top: 0; }

/* ---- today's briefing ---- */
.briefing ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.briefing li { display: grid; grid-template-columns: 64px 28px 1fr; grid-template-rows: auto auto; align-items: center; column-gap: 8px; background: rgba(0, 0, 0, .28); border: 1px solid var(--line); border-radius: 12px; padding: 9px 12px; }
.briefing li .when { grid-row: 1 / span 2; font-variant-numeric: tabular-nums; color: var(--cyan); font-weight: 700; font-size: 13px; }
.briefing li .ic { grid-row: 1 / span 2; font-size: 20px; }
.briefing li small { grid-column: 3; color: var(--dim); }
.briefing li.past { opacity: .45; }
.briefing li.now { border-color: rgba(255, 179, 71, .7); box-shadow: 0 0 18px rgba(255, 179, 71, .25); }
.briefing .live { color: var(--amber); animation: blink 1.2s steps(2) infinite; }
.next-ev { margin-top: 10px; font-size: 13px; color: #c8d9f2; }

/* ---- context tips ---- */
#coach { position: fixed; z-index: 55; right: 20px; bottom: 20px; width: min(380px, calc(100vw - 32px)); display: flex; gap: 12px; padding: 14px 16px; border-radius: 16px;
  background: linear-gradient(180deg, rgba(20, 38, 74, .97), rgba(9, 20, 44, .98)); border: 1px solid rgba(77, 243, 255, .5); box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 30px rgba(77, 243, 255, .2);
  transform: translateY(20px); opacity: 0; pointer-events: none; transition: transform .35s cubic-bezier(.2, .8, .3, 1), opacity .3s; }
#coach.show { transform: none; opacity: 1; pointer-events: auto; }
#coach .coach-ic { font-size: 28px; line-height: 1; filter: drop-shadow(0 0 10px rgba(77, 243, 255, .7)); }
#coach p { margin: 4px 0 10px; color: #c8d9f2; font-size: 14px; }
@media (max-width: 1023px) { #coach { right: 16px; bottom: calc(70px + env(safe-area-inset-bottom)); } }
.hint { position: relative; animation: hintPulse 1s ease-in-out 4 !important; box-shadow: 0 0 0 3px var(--gold), 0 0 28px rgba(255, 211, 107, .8) !important; }
@keyframes hintPulse { 50% { box-shadow: 0 0 0 6px rgba(255, 211, 107, .35), 0 0 36px rgba(255, 211, 107, .9); } }

/* ---- a freshly bought rig drops in ---- */
.rig.new { animation: rigIn .7s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes rigIn { from { transform: translateY(-30px) scale(.4); opacity: 0; filter: brightness(2.5); } 60% { filter: brightness(1.6); } }

/* ---- v2: AX rig, Lab, own power, HFARM store ---- */
.rig.ax { --rig-bg: linear-gradient(160deg, #c9a6ff, #5b3bd1); --blade: #ffffff; box-shadow: 0 0 18px rgba(155, 123, 255, .65), inset 0 1px 0 rgba(255, 255, 255, .4); }
.lab-kh .row { align-items: center; gap: 14px; }
.kh-big { text-align: right; } .kh-big b { display: block; font-size: 30px; color: var(--violet); text-shadow: 0 0 16px rgba(155, 123, 255, .6); line-height: 1.1; } .kh-big small { color: var(--dim); font-size: 12px; white-space: nowrap; }
.pips { display: flex; gap: 4px; margin: 6px 0; } .pips i { width: 18px; height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .1); border: 1px solid var(--line); }
.pips i.on { background: var(--violet); border-color: var(--violet); box-shadow: 0 0 8px rgba(155, 123, 255, .7); }
.card.region.here { border-color: rgba(77, 243, 255, .55); box-shadow: 0 0 18px rgba(77, 243, 255, .15); }
.contract-on { border-color: rgba(77, 255, 184, .4); margin-bottom: 12px; }
.tag.paid, .card.paid { border-color: rgba(255, 211, 107, .45); } .tag.paid { color: var(--gold); vertical-align: middle; margin-left: 6px; }
.card.paid { background: linear-gradient(180deg, rgba(255, 211, 107, .07), transparent 70%), var(--panel); }
.paid-mark { color: var(--gold); text-shadow: 0 0 8px rgba(255, 211, 107, .7); font-size: 12px; }
@media (max-width: 400px) { .tabs button { font-size: 10.5px; } .kh-big b { font-size: 24px; } }

/* season pool and board switch */
.pool { margin-top: 10px; padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(255, 211, 107, .4); background: linear-gradient(180deg, rgba(255, 211, 107, .08), transparent); display: grid; gap: 2px; }
.pool span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); } .pool b { font-size: 24px; color: var(--gold); } .pool small { color: var(--dim); font-size: 12.5px; }
.board-seg { max-width: 320px; }

/* burn bar (HFARM burned by the game this season) */
#burnbar { margin: 10px 0 0; }
.burn { padding: 10px 14px; border-radius: 12px; border: 1px solid rgba(255, 140, 60, .45); background: linear-gradient(90deg, rgba(255, 120, 40, .12), rgba(255, 211, 107, .05)), var(--panel); }
.burn-h { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; } .burn-h b { font-size: 15px; } .burn-h a { color: var(--dim); font-size: 12px; }
.burn-bar { margin: 8px 0 4px; } .burn-bar i { background: linear-gradient(90deg, #ff7a2f, #ffd36b); box-shadow: 0 0 12px rgba(255, 122, 47, .7); }
.burn small { color: var(--dim); font-size: 12px; }
.burn .pool-line b { color: var(--gold); }
.linkbtn { background: none; border: 0; padding: 0 2px; color: var(--cyan, #4df3ff); font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
#modal .sheet.pool-sheet { width: min(640px, 100%); max-height: calc(100vh - 32px); overflow-y: auto; text-align: left; }
#modal .pool-sheet h3, #modal .pool-sheet .tour-ic { text-align: center; }
.pool-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 14px; }
.pool-col h4 { margin: 0 0 2px; font-size: 15px; } .pool-col small { display: block; font-size: 12px; margin-bottom: 6px; }
.pool-t { width: 100%; border-collapse: collapse; font-size: 13px; } .pool-t th { color: var(--dim); font-weight: 600; text-align: left; padding: 3px 4px; } .pool-t td { padding: 3px 4px; border-top: 1px solid rgba(120, 200, 255, .12); } .pool-t .n { text-align: right; }
.pool-rules { margin: 0 0 14px; padding-left: 18px; color: #c8d9f2; font-size: 13px; line-height: 1.5; }
@media (max-width: 560px) { .pool-cols { grid-template-columns: 1fr; } }

/* invite friends */
.invite-row { display: flex; gap: 8px; margin-top: 8px; } .invite-row input { flex: 1; min-width: 0; font-size: 13px; }
.ref-mark { font-size: 12px; margin-left: 4px; white-space: nowrap; }

/* the fix next to a rig warning */
.need-fix { margin-top: 6px; }

/* XL/AX idle for lack of a tank place */
.rig.idle.notank { outline: 1px dashed rgba(255, 179, 71, .6); outline-offset: -3px; }
