:root {
  --bg: #070b14;
  --line: #1c2a44;
  --text: #d8e6ff;
  --muted: #7f93b8;
  --cyan: #2ee6ff;
  --violet: #9b5cff;
  --gold: #ffcc33;
  --green: #3dff9a;
  --red: #ff4d6d;
  --mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
  --display: 'Orbitron', 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  color: var(--text);
  font-family: Inter, 'Segoe UI', system-ui, sans-serif;
  background:
    radial-gradient(ellipse at 15% 0%, #12203d 0%, transparent 55%),
    radial-gradient(ellipse at 100% 100%, #241040 0%, transparent 50%),
    var(--bg);
  overflow: hidden;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #1f3050; border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

#bg { position: fixed; inset: 0; z-index: 0; opacity: .16; pointer-events: none; }

/* ---------- Topbar ---------- */
.topbar {
  position: relative; z-index: 5; height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #0b1222ee, #080d18cc);
  backdrop-filter: blur(6px);
}
.brand { font-family: var(--display); font-size: 22px; letter-spacing: 1px; display: flex; align-items: center; gap: 10px; }
.brand b { color: var(--cyan); text-shadow: 0 0 12px var(--cyan); }
.logo {
  width: 32px; height: 32px; display: grid; place-items: center;
  border: 2px solid var(--cyan); border-radius: 8px; color: var(--cyan); font-weight: 900;
  box-shadow: 0 0 12px #2ee6ff66 inset, 0 0 12px #2ee6ff55;
  animation: logoPulse 3s ease-in-out infinite;
}
@keyframes logoPulse { 50% { box-shadow: 0 0 18px #2ee6ffaa inset, 0 0 24px #2ee6ff88; } }
nav { display: flex; gap: 6px; }
nav em { font-style: normal; font-family: var(--mono); color: var(--gold); font-size: 12px; }

nav button, .btn {
  font: 600 13px Inter, sans-serif; color: var(--text);
  background: #111b30; border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; cursor: pointer; transition: .15s;
}
nav button:hover, .btn:hover { border-color: var(--cyan); box-shadow: 0 0 10px #2ee6ff44; color: #fff; }
.btn.primary { background: linear-gradient(135deg, #1a6b8a, #5a2fa8); border-color: transparent; color: #fff; }
.btn.danger { border-color: #5a2030; color: #ffb3c0; }
.btn.danger:hover { border-color: var(--red); box-shadow: 0 0 10px #ff4d6d55; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

/* ---------- Layout ---------- */
.layout {
  position: relative; z-index: 1; display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(300px, 1.25fr) minmax(320px, 400px);
  height: calc(100vh - 56px);
}
.col { overflow-y: auto; overflow-x: hidden; min-width: 0; }
.left {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px; border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #0a1222aa, #0a0f1c55);
}
.mid { border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.right { padding: 12px; background: #080d18aa; }

/* ---------- Bank ---------- */
.bank { text-align: center; min-height: 150px; }
.farm-name { font: 600 11px var(--mono); color: var(--muted); letter-spacing: 3px; text-transform: uppercase; }
.hash-count {
  font: 900 clamp(28px, 3.2vw, 44px) var(--display); color: #fff; margin-top: 6px;
  text-shadow: 0 0 18px #2ee6ff88; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.hash-count.unit-up { animation: unitUp 1s ease-out; }
@keyframes unitUp {
  0% { transform: scale(1); }
  30% { transform: scale(1.25); color: var(--gold); text-shadow: 0 0 30px var(--gold); }
  100% { transform: scale(1); }
}
.unit-name { font: 700 11px var(--mono); color: var(--violet); letter-spacing: 3px; text-transform: uppercase; min-height: 16px; }
.hash-rate { font: 700 16px var(--mono); color: var(--cyan); margin-top: 4px; }
.buffs { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; min-height: 28px; }
.buff {
  font: 700 12px var(--mono); padding: 5px 10px; border-radius: 999px; color: #fff;
  background: linear-gradient(90deg, #ff8a00, #ff2e6e); box-shadow: 0 0 14px #ff5a3c88;
  animation: buffPulse .8s ease-in-out infinite alternate;
}
.buff.click { background: linear-gradient(90deg, #7a3cff, #2ee6ff); box-shadow: 0 0 14px #7a3cff88; }
@keyframes buffPulse { to { transform: scale(1.06); } }

/* ---------- CPU ---------- */
.cpu-wrap {
  --hue: 190; --spin: 20s; --heat: 0;
  position: relative; width: min(300px, 70vw); aspect-ratio: 1; margin: 14px 0 18px;
  display: grid; place-items: center;
}
.ring { position: absolute; border-radius: 50%; pointer-events: none; }
.r1 { inset: 0; border: 2px dashed hsl(var(--hue) 100% 60% / .35); animation: spin var(--spin) linear infinite; }
.r2 { inset: 7%; border: 3px dotted hsl(var(--hue) 100% 60% / .3); animation: spin calc(var(--spin) * 1.6) linear infinite reverse; }
.r3 { inset: -6%; border: 1px solid hsl(var(--hue) 100% 60% / .15); box-shadow: 0 0 60px hsl(var(--hue) 100% 60% / .18) inset, 0 0 40px hsl(var(--hue) 100% 60% / .08); }
@keyframes spin { to { transform: rotate(360deg); } }

.cpu {
  position: relative; width: 76%; aspect-ratio: 1; padding: 0; border: 0; background: none;
  cursor: pointer; outline: none; touch-action: manipulation;
  filter: drop-shadow(0 0 calc(14px + var(--heat) * 22px) hsl(var(--hue) 100% 55% / .7));
}
.cpu svg { width: 100%; height: 100%; display: block; animation: breathe 3.2s ease-in-out infinite; overflow: visible; }
.cpu:hover svg { animation-duration: 1.6s; }
.cpu:focus-visible { outline: 2px dashed var(--cyan); outline-offset: 8px; border-radius: 16px; }
@keyframes breathe { 50% { transform: scale(1.035); } }
.cpu-wrap.hot .cpu svg { animation: shake .12s linear infinite; }
@keyframes shake {
  25% { transform: translate(1.5px, -1px); }
  50% { transform: translate(-1.5px, 1px); }
  75% { transform: translate(1px, 1.5px); }
}
.cpu-body { stroke: hsl(var(--hue) 100% 60%); stroke-width: 2; }
.die { fill: #0a1120; stroke: hsl(var(--hue) 100% 65%); stroke-width: 1.5; }
.die-grid { stroke: hsl(var(--hue) 100% 60% / .16); stroke-width: .6; }
.trace { fill: none; stroke: hsl(var(--hue) 100% 60%); stroke-width: 1.6; stroke-dasharray: 3 5; animation: flow .9s linear infinite; opacity: .75; }
@keyframes flow { to { stroke-dashoffset: -16; } }
.die-text { font: 900 50px var(--display); fill: hsl(var(--hue) 100% 70%); filter: drop-shadow(0 0 5px hsl(var(--hue) 100% 60%)); }
.cpu-label { font: 700 8px var(--mono); fill: #7f93b8; letter-spacing: 2px; }
.pins rect { fill: #c9a24a; }
.led { fill: hsl(var(--hue) 100% 60%); animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }

.ripple {
  position: absolute; width: 60%; aspect-ratio: 1; border-radius: 18%;
  border: 2px solid hsl(var(--hue) 100% 65%); pointer-events: none;
  animation: ripple .5s ease-out forwards;
}
@keyframes ripple { from { transform: scale(.9); opacity: .9; } to { transform: scale(1.5); opacity: 0; } }

.heat { width: min(260px, 70vw); }
.heat-label { display: flex; justify-content: space-between; font: 600 11px var(--mono); color: var(--muted); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 1px; }
.heat-bar { height: 8px; border-radius: 99px; background: #111a2e; overflow: hidden; border: 1px solid var(--line); }
#heatFill { height: 100%; width: 0; background: linear-gradient(90deg, #2ee6ff, #ffcc33, #ff3b3b); background-size: 258px 100%; transition: width .15s; }
.click-power { margin-top: 12px; font: 600 13px var(--mono); color: var(--muted); }
.click-power span { color: #fff; }

/* ---------- FX ---------- */
#fx-layer, #golden-layer { position: fixed; inset: 0; pointer-events: none; }
#fx-layer { z-index: 60; }
#golden-layer { z-index: 40; }
.float {
  position: absolute; font: 800 18px var(--display); color: #fff; white-space: nowrap;
  text-shadow: 0 0 8px var(--cyan), 0 0 2px #000;
  animation: floatUp 1s ease-out forwards;
}
.float.big { color: var(--gold); font-size: 26px; text-shadow: 0 0 14px var(--gold), 0 0 2px #000; animation-duration: 1.8s; }
.float.storm { color: #d6b8ff; text-shadow: 0 0 10px var(--violet); }
@keyframes floatUp {
  0% { opacity: 0; transform: translate(-50%, -30%) scale(.7); }
  15% { opacity: 1; transform: translate(-50%, -70%) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -260%) scale(1); }
}
.bit { position: absolute; font: 700 14px var(--mono); color: var(--cyan); text-shadow: 0 0 6px var(--cyan); }

/* ---------- Golden Block ---------- */
.golden {
  position: absolute; width: 84px; height: 84px; pointer-events: auto; cursor: pointer;
  filter: drop-shadow(0 0 18px #ffcc33) drop-shadow(0 0 4px #fff);
  animation: goldIn .6s ease-out, goldFloat 3s ease-in-out .6s infinite;
}
.golden svg { width: 100%; height: 100%; animation: flip 2.4s ease-in-out infinite; }
.golden.out { animation: goldOut .6s forwards; pointer-events: none; }
.golden::before {
  content: ''; position: absolute; inset: -30%; border-radius: 50%;
  background: radial-gradient(circle, #ffcc3355, transparent 65%); animation: buffPulse 1s ease-in-out infinite alternate;
}
@keyframes goldIn { from { transform: scale(0) rotate(-180deg); opacity: 0; } }
@keyframes goldFloat { 50% { transform: translateY(-12px) rotate(6deg); } }
@keyframes goldOut { to { transform: scale(0); opacity: 0; } }
@keyframes flip { 50% { transform: rotateY(180deg); } }

/* ---------- Ticker ---------- */
.ticker { height: 40px; flex-shrink: 0; display: flex; align-items: center; border-bottom: 1px solid var(--line); background: #0a1020cc; }
.ticker-label { font: 900 11px var(--display); color: #000; background: var(--gold); padding: 4px 8px; margin: 0 10px; border-radius: 4px; letter-spacing: 2px; flex-shrink: 0; }
.ticker-track { flex: 1; overflow: hidden; white-space: nowrap; }
.ticker-inner { display: inline-block; padding-left: 100%; font-size: 14px; color: #c7d6f5; animation: ticker 20s linear infinite; }
@keyframes ticker { to { transform: translateX(-100%); } }

/* ---------- Farm ---------- */
.farm { flex: 1; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.farm-empty { margin: auto; color: var(--muted); text-align: center; max-width: 300px; font-size: 14px; line-height: 1.6; }
.farm-empty .big { font-size: 48px; margin-bottom: 8px; animation: goldFloat 3s ease-in-out infinite; }
.farm-row {
  --hue: 200; position: relative; display: flex; align-items: center; gap: 10px;
  min-height: 64px; padding: 8px 12px; border-radius: 12px; overflow: hidden;
  border: 1px solid hsl(var(--hue) 60% 40% / .45);
  background: linear-gradient(90deg, hsl(var(--hue) 60% 14% / .9), hsl(var(--hue) 50% 8% / .6));
  animation: rowIn .5s ease-out;
}
.farm-row::after {
  content: ''; position: absolute; top: 0; bottom: 0; width: 90px; left: -100px; pointer-events: none;
  background: linear-gradient(90deg, transparent, hsl(var(--hue) 100% 70% / .14), transparent);
  animation: scan var(--scan, 4s) linear infinite; animation-delay: var(--d, 0s);
}
@keyframes scan { to { left: 110%; } }
@keyframes rowIn { from { opacity: 0; transform: translateX(-20px); } }
.farm-label { width: 128px; flex-shrink: 0; font: 700 12px Inter, sans-serif; line-height: 1.3; }
.farm-label .fi { font-size: 22px; display: block; }
.farm-label b { color: hsl(var(--hue) 100% 75%); font-family: var(--mono); }
.farm-icons { flex: 1; display: flex; flex-wrap: wrap; gap: 2px; align-content: center; min-width: 0; }
.fic { font-size: 20px; display: inline-block; animation: bob 2.4s ease-in-out infinite; filter: drop-shadow(0 0 4px hsl(var(--hue) 100% 60% / .6)); }
.fic.new { animation: pop .45s ease-out, bob 2.4s ease-in-out .45s infinite; }
.fic.more { font: 700 12px var(--mono); color: hsl(var(--hue) 100% 75%); align-self: center; animation: none; padding-left: 4px; }
@keyframes bob { 50% { transform: translateY(-3px); } }
@keyframes pop { from { transform: scale(0) rotate(-40deg); } 70% { transform: scale(1.3); } to { transform: scale(1); } }
.farm-rate { font: 700 12px var(--mono); color: hsl(var(--hue) 100% 75%); white-space: nowrap; text-align: right; min-width: 92px; }

/* ---------- Store ---------- */
h2 { font: 700 13px var(--display); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 6px 4px 10px; }
h2 small { font-family: var(--mono); color: var(--cyan); letter-spacing: 0; }
.upgrades { display: flex; flex-wrap: wrap; gap: 6px; min-height: 64px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #0b1222aa; }
.upg {
  position: relative; width: 48px; height: 48px; font-size: 24px; border-radius: 10px;
  border: 1px solid #2a3b5e; background: linear-gradient(135deg, #16223b, #0d1426);
  cursor: pointer; display: grid; place-items: center; padding: 0;
  filter: grayscale(.75) brightness(.65); transition: transform .15s, box-shadow .15s, filter .15s;
  animation: pop .35s ease-out;
}
.upg.ok { filter: none; border-color: var(--cyan); box-shadow: 0 0 10px #2ee6ff55; }
.upg.ok.k-click, .upg.ok.k-pct { border-color: var(--violet); box-shadow: 0 0 10px #9b5cff66; }
.upg.ok.k-global { border-color: var(--green); box-shadow: 0 0 10px #3dff9a55; }
.upg.ok.k-gold, .upg.ok.k-goldDur { border-color: var(--gold); box-shadow: 0 0 10px #ffcc3366; }
.upg.ok:hover { transform: translateY(-2px) scale(1.07); }
.upg i { position: absolute; right: 3px; bottom: 1px; font: 800 9px var(--mono); font-style: normal; color: var(--gold); }
.upg-empty { color: var(--muted); font-size: 12px; padding: 8px; align-self: center; }

.store-head { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.buy-mode { display: flex; gap: 3px; }
.buy-mode button { font: 700 11px var(--mono); padding: 5px 8px; background: #101a2e; color: var(--muted); border: 1px solid var(--line); border-radius: 6px; cursor: pointer; }
.buy-mode button.active { color: #001018; background: var(--cyan); border-color: var(--cyan); }
.store { display: flex; flex-direction: column; gap: 6px; padding-bottom: 20px; }
.bld {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px;
  padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(90deg, #111b30, #0c1324); cursor: pointer;
  transition: transform .15s, border-color .15s, box-shadow .15s, opacity .2s; opacity: .55;
  text-align: left; color: inherit; width: 100%;
}
.bld.ok { opacity: 1; border-color: #2b4a6e; }
.bld.ok:hover { border-color: var(--cyan); transform: translateX(-3px); box-shadow: 0 0 14px #2ee6ff33; }
.bld-icon { font-size: 30px; text-align: center; }
.bld-name { font: 700 15px Inter, sans-serif; }
.bld-cost { font: 700 13px var(--mono); color: var(--red); }
.bld-cost small { color: var(--muted); font-weight: 400; }
.bld.ok .bld-cost { color: var(--green); }
.bld-owned { font: 900 26px var(--display); color: #ffffff2a; }
.bld.ok .bld-owned { color: #ffffff55; }
.bld.mystery { cursor: default; opacity: .35; }
.bld.mystery .bld-icon { filter: brightness(0) drop-shadow(0 0 2px var(--cyan)); }
.bld.hidden-b { display: none; }
.flash { animation: flash .4s ease-out; }
@keyframes flash { from { box-shadow: 0 0 0 2px var(--green), 0 0 30px #3dff9a88; } }
.deny { animation: deny .3s; }
@keyframes deny { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }

/* ---------- Tooltip ---------- */
.tooltip {
  position: fixed; z-index: 200; width: 330px; max-width: calc(100vw - 16px); padding: 12px;
  border-radius: 12px; background: #0b1222f4; border: 1px solid #2b4a6e;
  box-shadow: 0 10px 40px #000a, 0 0 20px #2ee6ff22; pointer-events: none; font-size: 13px; line-height: 1.45;
}
.hidden { display: none !important; }
.tt-head { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.tt-icon { font-size: 28px; }
.tt-name { font-weight: 800; font-size: 15px; }
.tt-sub { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.tt-cost { margin-left: auto; font: 700 13px var(--mono); text-align: right; white-space: nowrap; }
.tt-cost.ok { color: var(--green); }
.tt-cost.no { color: var(--red); }
.tt-desc b { color: var(--cyan); }
.tt-flavor { margin-top: 8px; color: var(--muted); font-style: italic; font-size: 12px; }
.tt-stats { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 12px; color: #b8c8e8; }
.tt-stats b { color: #fff; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 150; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  display: flex; gap: 12px; align-items: center; min-width: 260px; max-width: min(420px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: 12px; background: #0d1628f5; border: 1px solid var(--gold);
  box-shadow: 0 0 22px #ffcc3344; animation: toastIn .4s ease-out;
}
.toast.out { animation: toastOut .4s forwards; }
.toast .ti { font-size: 26px; }
.toast b { display: block; color: var(--gold); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; }
.toast span { font-size: 14px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px) scale(.9); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(10px); } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 100; background: #02050cbb; backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; animation: fadeIn .2s; }
.modal-box {
  position: relative; width: min(720px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 24px;
  border-radius: 16px; background: linear-gradient(160deg, #0f1930, #0a1020); border: 1px solid #2b4a6e;
  box-shadow: 0 0 50px #2ee6ff22; animation: modalIn .25s ease-out; user-select: text;
}
.modal-close { position: absolute; top: 12px; right: 12px; width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: #111b30; color: var(--text); cursor: pointer; }
.modal-close:hover { border-color: var(--red); }
.modal h3 { font: 800 20px var(--display); margin: 0 0 14px; color: var(--cyan); }
.modal h4 { font: 700 13px var(--display); color: var(--muted); letter-spacing: 1px; margin: 20px 0 8px; text-transform: uppercase; }
.modal p { color: #b8c8e8; line-height: 1.6; font-size: 14px; }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.stats-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.stats-table td { padding: 7px 4px; border-bottom: 1px solid var(--line); }
.stats-table td:last-child { text-align: right; font-family: var(--mono); color: #fff; }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; }
.ach { aspect-ratio: 1; display: grid; place-items: center; font-size: 22px; border-radius: 10px; background: #0f1a2e; border: 1px solid var(--line); filter: grayscale(1) brightness(.35); }
.ach.got { filter: none; border-color: var(--gold); box-shadow: 0 0 10px #ffcc3333; }
.opt-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
textarea { width: 100%; min-height: 90px; background: #070c18; color: var(--text); border: 1px solid var(--line); border-radius: 8px; font: 12px var(--mono); padding: 8px; resize: vertical; }
.fork-box { text-align: center; padding: 16px; border: 1px solid #3a2a66; border-radius: 12px; background: #120c26aa; margin: 12px 0; }
.fork-big { font: 900 44px var(--display); color: var(--violet); text-shadow: 0 0 20px var(--violet); }
.fork-sub { color: var(--muted); font-size: 13px; }
.progress { height: 10px; border-radius: 99px; background: #111a2e; overflow: hidden; margin-top: 10px; border: 1px solid var(--line); }
.progress div { height: 100%; background: linear-gradient(90deg, var(--violet), var(--cyan)); }

/* ---------- Buffs: Sale ---------- */
.buff.cost { background: linear-gradient(90deg, #13a36b, #3dff9a); color: #00140b; box-shadow: 0 0 14px #3dff9a88; }

/* ---------- Tagesbonus ---------- */
.daily {
  margin-top: 18px; width: min(280px, 80vw); display: flex; flex-direction: column; align-items: center; gap: 2px;
  font: 600 13px Inter, sans-serif; color: var(--muted); padding: 10px 14px; cursor: pointer;
  border-radius: 12px; border: 1px dashed #2b4a6e; background: #0b1222aa; transition: .2s;
}
.daily small { font: 600 11px var(--mono); color: var(--muted); }
.daily.ready {
  color: #1a1000; border: 1px solid var(--gold); background: linear-gradient(135deg, #ffcc33, #ff9a3c);
  box-shadow: 0 0 22px #ffcc3366; animation: dailyPulse 1.6s ease-in-out infinite;
}
.daily.ready small { color: #4a3000; }
.daily.ready:hover { transform: translateY(-2px) scale(1.02); }
@keyframes dailyPulse { 50% { box-shadow: 0 0 34px #ffcc33aa; } }

/* ---------- Fähigkeiten ---------- */
.skills-head { margin: 18px 0 8px; font: 700 11px var(--display); letter-spacing: 2px; text-transform: uppercase; color: var(--muted); }
.skills { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(300px, 86vw); }
.skill {
  --p: 0%; position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; cursor: pointer; padding: 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text);
  border: 1px solid #2b4a6e; background: linear-gradient(160deg, #15213a, #0b1222); transition: transform .15s, box-shadow .15s;
}
.skill::before {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background: conic-gradient(#000a var(--p), transparent 0);
}
.skill .sk-icon { font-size: 24px; position: relative; }
.skill .sk-name { font: 700 9px Inter, sans-serif; text-align: center; line-height: 1.1; position: relative; }
.skill .sk-cd { font: 700 10px var(--mono); position: relative; color: var(--muted); }
.skill.ready { border-color: var(--cyan); box-shadow: 0 0 14px #2ee6ff44; }
.skill.ready .sk-cd { color: var(--green); }
.skill.ready:hover { transform: translateY(-3px); box-shadow: 0 0 22px #2ee6ff77; }
.skill.cooling { cursor: default; }
.skill.cooling .sk-icon { filter: grayscale(.6); }
.skill.locked { cursor: default; opacity: .45; }
.skill.locked .sk-icon { filter: grayscale(1) brightness(.6); }

/* ---------- Tabs & Panels (Mitte) ---------- */
.mid-tabs { display: flex; gap: 4px; padding: 8px 10px 0; border-bottom: 1px solid var(--line); flex-shrink: 0; overflow-x: auto; }
.mid-tabs button {
  font: 700 12px Inter, sans-serif; padding: 9px 10px; border: 1px solid transparent; border-bottom: 0; white-space: nowrap;
  border-radius: 10px 10px 0 0; background: none; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 6px;
}
.mid-tabs button:hover { color: #fff; }
.mid-tabs button.active { color: var(--cyan); background: #0d1628; border-color: var(--line); }
.mid-tabs em {
  font: 700 10px var(--mono); font-style: normal; min-width: 18px; padding: 1px 5px; border-radius: 99px; text-align: center;
  background: #1c2a44; color: var(--text);
}
.mid-tabs em:empty { display: none; }
#contractBadge { background: var(--gold); color: #1a1000; animation: buffPulse .8s ease-in-out infinite alternate; }
#marketBadge.low { background: var(--green); color: #00140b; }
#marketBadge.high { background: var(--red); color: #fff; }
.panel { flex: 1; padding: 12px; }
.panel-intro { font-size: 13px; color: var(--muted); margin-bottom: 12px; line-height: 1.5; }
.locked-panel { margin: 40px auto; max-width: 300px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.6; }
.locked-panel .big { font-size: 44px; }
.locked-panel b { display: block; color: var(--text); font-size: 16px; margin-bottom: 4px; }

/* ---------- Aufträge ---------- */
.contract {
  display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; margin-bottom: 10px;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: linear-gradient(90deg, #111b30, #0c1324); animation: rowIn .4s ease-out;
}
.contract.d2 { border-color: #3a2a66; }
.contract.d3 { border-color: #6a4a12; }
.contract.done { border-color: var(--gold); box-shadow: 0 0 18px #ffcc3333; }
.contract.waiting { opacity: .6; grid-template-columns: 44px 1fr; }
.ct-icon { font-size: 28px; text-align: center; }
.ct-title { font: 700 14px Inter, sans-serif; }
.ct-stars { color: var(--gold); font-size: 11px; letter-spacing: 1px; margin-left: 4px; }
.ct-stars i { font-style: normal; color: #2b3a58; }
.ct-bar { height: 8px; border-radius: 99px; background: #0a1120; border: 1px solid var(--line); overflow: hidden; margin: 8px 0 6px; }
.ct-bar div { height: 100%; width: 0; background: linear-gradient(90deg, var(--violet), var(--cyan)); transition: width .25s; }
.contract.done .ct-bar div { background: linear-gradient(90deg, #ffcc33, #3dff9a); }
.ct-sub { font: 600 12px var(--mono); color: var(--muted); }
.ct-sub b { color: var(--gold); }
.ct-actions { display: flex; gap: 6px; align-items: center; }
.ct-actions .btn:disabled { opacity: .3; }
.btn.small { padding: 6px 9px; }

/* ---------- Börse ---------- */
.mk-top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.mk-label { font: 700 10px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.mk-price { font: 900 34px var(--display); color: #fff; text-shadow: 0 0 16px #2ee6ff66; }
.mk-change { font: 700 13px var(--mono); }
.up { color: var(--green) !important; }
.down { color: var(--red) !important; }
.mk-next { text-align: right; font: 700 16px var(--mono); color: var(--cyan); }
.mk-chart { margin: 10px 0 14px; height: 140px; border: 1px solid var(--line); border-radius: 12px; background: #070c18; overflow: hidden; }
.chart { width: 100%; height: 100%; display: block; }
.chart .line { fill: none; stroke: var(--cyan); stroke-width: 2.2; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 4px #2ee6ff); }
.chart .baseline { stroke: #7f93b8; stroke-dasharray: 4 4; stroke-width: 1; vector-effect: non-scaling-stroke; opacity: .6; }
.chart .dot { fill: #fff; stroke: var(--cyan); stroke-width: 2; vector-effect: non-scaling-stroke; animation: blink 1s steps(2) infinite; }
.mk-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.mk-grid > div { padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: #0b1222aa; }
.mk-grid b { display: block; margin-top: 4px; font: 700 15px var(--mono); color: #fff; }
.mk-actions { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.mk-actions .mk-label { width: 80px; }
.mk-actions .btn:disabled { opacity: .3; cursor: not-allowed; }
.mk-actions .btn.sell { background: linear-gradient(135deg, #a8324a, #6a2fa8); }
.mk-fee { font-size: 11px; color: var(--muted); margin-top: 6px; }

/* ---------- Ereignisse ---------- */
.buff.debuff { background: linear-gradient(90deg, #5a1626, #a8324a); box-shadow: 0 0 14px #ff4d6d66; animation: none; }
.event-alert {
  position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 45; max-width: calc(100vw - 32px);
  font: 700 14px Inter, sans-serif; color: #fff; padding: 10px 18px; border-radius: 999px; cursor: pointer;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  border: 1px solid #ff9a3c; background: linear-gradient(90deg, #4a1d6e, #8a2a4a);
  box-shadow: 0 0 24px #ff9a3c66; animation: eventIn .5s ease-out, eventPulse 1.4s ease-in-out .5s infinite;
}
.event-alert:hover { filter: brightness(1.2); }
@keyframes eventIn { from { opacity: 0; transform: translate(-50%, -30px); } }
@keyframes eventPulse { 50% { box-shadow: 0 0 40px #ff9a3caa; } }
.event-head { display: flex; gap: 14px; align-items: center; margin-bottom: 4px; }
.event-head h3 { margin: 0 0 4px; }
.event-icon { font-size: 48px; animation: goldFloat 3s ease-in-out infinite; }
.modal p.event-text { font-size: 16px; font-style: italic; color: #d8e6ff; border-left: 3px solid var(--violet); padding-left: 12px; }
.event-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.event-choice { display: flex; flex-direction: column; gap: 4px; padding: 14px; font-size: 15px; text-align: center; }
.event-choice small { font: 600 11px var(--mono); color: var(--muted); }
.event-choice:hover { transform: translateY(-2px); }
.event-result { font-size: 17px; line-height: 1.5; color: #fff; }
.event-result.pending { color: var(--muted); animation: blink 1s steps(2) infinite; }

/* ---------- Fork-Labor ---------- */
.perk-grid { display: flex; flex-direction: column; gap: 8px; }
.perk {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line); background: #0b1222aa; opacity: .6;
}
.perk.can { opacity: 1; border-color: #3a2a66; }
.perk.owned { opacity: 1; border-color: var(--violet); box-shadow: 0 0 14px #9b5cff33; }
.perk-icon { font-size: 28px; text-align: center; }
.perk-body b { display: block; font-size: 14px; }
.perk-body span { font-size: 12px; color: var(--muted); }
.perk-body span b { display: inline; color: var(--cyan); font-size: 12px; }
.perk .btn { min-width: 84px; }

/* ---------- Skins ---------- */
.skin-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; }
.skin {
  --sh: 190; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; cursor: pointer;
  border-radius: 12px; border: 1px solid var(--line); background: #0b1222aa; color: var(--text);
}
.skin small { font-size: 11px; color: var(--muted); text-align: center; }
.skin-chip {
  width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; font: 900 22px var(--display);
  color: hsl(var(--sh) 100% 70%); border: 2px solid hsl(var(--sh) 100% 60%); background: #0a1120;
  box-shadow: 0 0 14px hsl(var(--sh) 100% 55% / .5);
}
.skin.rainbow .skin-chip { animation: rainbow 4s linear infinite; }
@keyframes rainbow { to { filter: hue-rotate(360deg); } }
.skin.active { border-color: var(--cyan); box-shadow: 0 0 12px #2ee6ff44; }
.skin.locked { cursor: not-allowed; opacity: .45; }
.skin.locked .skin-chip { filter: grayscale(1); }

/* ---------- Verkaufen ---------- */
.buy-mode .sell-toggle { font-size: 13px; padding: 3px 8px; }
.buy-mode .sell-toggle.active { background: var(--gold); border-color: var(--gold); color: #1a1000; }
.store.selling .bld { border-style: dashed; }
.store.selling .bld.ok .bld-cost { color: var(--gold); }
.store.selling .bld.ok:hover { border-color: var(--gold); box-shadow: 0 0 14px #ffcc3333; }

/* ---------- Forschung ---------- */
.rs-grid { display: flex; flex-direction: column; gap: 8px; }
.rs {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px;
  border-radius: 12px; border: 1px solid var(--line); background: linear-gradient(90deg, #111b30, #0c1324);
}
.rs-icon { font-size: 26px; text-align: center; }
.rs-body b { display: block; font-size: 14px; }
.rs-body span { font-size: 12px; color: #b8c8e8; }
.rs-body span b { display: inline; color: var(--cyan); font-size: 12px; }
.rs-body small { display: block; margin-top: 4px; font: 600 11px var(--mono); color: var(--muted); }
.rs.locked { opacity: .45; }
.rs.done { opacity: .7; border-color: #1f5a3c; }
.rs.done b { color: var(--green); }
.rs.ready { border-color: #2b4a6e; }
.rs.active { border-color: var(--violet); box-shadow: 0 0 16px #9b5cff33; }
.rs.active .rs-icon { animation: spin 4s linear infinite; }
.rs .btn:disabled { opacity: .35; cursor: not-allowed; }

/* ---------- Artefakte ---------- */
.crate-box {
  display: grid; grid-template-columns: 60px 1fr auto; gap: 14px; align-items: center; padding: 14px; margin-bottom: 14px;
  border-radius: 14px; border: 1px solid #6a4a12; background: linear-gradient(135deg, #2a1d08, #0c1324);
}
.crate-icon { font-size: 44px; text-align: center; filter: grayscale(.8) brightness(.6); }
.crate-icon.has { filter: none; animation: crateWiggle 2s ease-in-out infinite; }
@keyframes crateWiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-8deg); } 90% { transform: rotate(8deg); } 95% { transform: rotate(-4deg); } }
.crate-info b { display: block; font-size: 17px; color: var(--gold); }
.crate-info span { font-size: 12px; color: var(--muted); }
.crate-box .btn:disabled { opacity: .35; cursor: not-allowed; }
.art-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.art {
  --rc: #7f93b8; aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border-radius: 12px; border: 1px solid var(--rc); background: radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--rc) 22%, transparent), #0b1222 70%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--rc) 30%, transparent);
}
.art.common { --rc: #9fb3d1; }
.art.rare { --rc: #2ee6ff; }
.art.epic { --rc: #b06bff; }
.art.legendary { --rc: #ffb020; animation: legendGlow 2s ease-in-out infinite; }
@keyframes legendGlow { 50% { box-shadow: 0 0 24px #ffb02088; } }
.art.missing { opacity: .35; box-shadow: none; background: #0b1222; animation: none; }
.art-icon { font-size: 26px; }
.art-lvl { font-size: 9px; color: var(--rc); letter-spacing: 1px; }
.art-lvl i { font-style: normal; color: #1f2c47; }
.art-bonus { margin: 0; padding-left: 18px; font-size: 12px; color: #b8c8e8; line-height: 1.8; }
.ct-sub b.ct-crate { color: #ffb020; }

.crate-open { text-align: center; position: relative; min-height: 220px; }
.crate-anim { font-size: 90px; display: inline-block; }
.crate-anim.shaking { animation: crateShake .25s linear infinite; }
@keyframes crateShake { 25% { transform: rotate(-10deg) scale(1.05); } 75% { transform: rotate(10deg) scale(1.05); } }
.crate-anim.opening { animation: crateBurst .6s ease-in forwards; position: absolute; left: 50%; top: 0; margin-left: -50px; }
@keyframes crateBurst { 60% { transform: scale(1.4) rotate(-6deg); opacity: 1; } 100% { transform: scale(2.2); opacity: 0; } }
.crate-reveal { --rc: #9fb3d1; opacity: 0; animation: reveal .6s ease-out .55s forwards; }
.crate-reveal.rare { --rc: #2ee6ff; }
.crate-reveal.epic { --rc: #b06bff; }
.crate-reveal.legendary { --rc: #ffb020; }
@keyframes reveal { from { opacity: 0; transform: scale(.5); } to { opacity: 1; transform: scale(1); } }
.art-big { font-size: 80px; filter: drop-shadow(0 0 24px var(--rc)); animation: goldFloat 3s ease-in-out 1.2s infinite; }
.rar-label { font: 900 12px var(--display); letter-spacing: 3px; text-transform: uppercase; color: var(--rc); text-shadow: 0 0 10px var(--rc); }
.crate-reveal h3 { margin: 6px 0 4px; color: #fff; }

/* ---------- Account & Rangliste ---------- */
nav button.account { display: flex; align-items: center; gap: 6px; border-color: #2b4a6e; }
nav button.account b { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--cyan); }
.sync-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; background: var(--muted); }
.sync-dot.ok { background: var(--green); box-shadow: 0 0 8px var(--green); }
.sync-dot.busy { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.sync-dot.error { background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1s steps(2) infinite; }
.sync-dot.guest { background: #5a6b8c; }

.tabs { display: flex; gap: 4px; margin: 16px 0 12px; border-bottom: 1px solid var(--line); }
.tab { font: 700 14px Inter, sans-serif; padding: 10px 16px; background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); cursor: pointer; }
.tab.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.auth-form { display: flex; flex-direction: column; gap: 12px; max-width: 380px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font: 600 12px Inter, sans-serif; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.auth-form input {
  font: 500 15px Inter, sans-serif; color: var(--text); background: #070c18; border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 12px; outline: none; text-transform: none; letter-spacing: 0;
}
.auth-form input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px #2ee6ff22; }
.auth-form .btn { align-self: flex-start; padding: 10px 18px; font-size: 14px; }
.form-error { color: var(--red); font-size: 13px; min-height: 18px; }
.modal p.hint { font-size: 12px; color: var(--muted); }
.modal a { color: var(--cyan); }
.btn.ghost { background: none; color: var(--muted); }
.opt-row.center { justify-content: center; margin-top: 16px; }

.lb-wrap { overflow-x: auto; }
.lb { width: 100%; border-collapse: collapse; font-size: 14px; }
.lb th { text-align: left; font: 700 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: 1px; padding: 8px 6px; border-bottom: 1px solid #2b4a6e; }
.lb td { padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.lb td:nth-child(n+3) { font-family: var(--mono); text-align: right; }
.lb th:nth-child(n+3) { text-align: right; }
.lb td.rank { font: 800 15px var(--display); color: var(--muted); width: 40px; }
.lb tr:nth-child(-n+3) td:nth-child(2) { font-weight: 800; color: var(--gold); }
.lb tr.me td { background: #2ee6ff14; color: #fff; }
.lb tr.me td:nth-child(2) { color: var(--cyan); }
.lb tr.sep td { border-top: 2px dashed #2b4a6e; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  body { overflow: auto; }
  .layout { display: flex; flex-direction: column; height: auto; }
  .col { overflow: visible; border-right: 0 !important; }
  .left { order: 1; padding: 16px; }
  .right { order: 2; }
  .mid { order: 3; min-height: 300px; border-top: 1px solid var(--line); }
  nav button span, nav button.account b { display: none; }
  nav { gap: 4px; }
  nav button { padding: 6px 8px; }
  .topbar { padding: 0 10px; }
  .brand { font-size: 17px; gap: 8px; }
  .logo { width: 28px; height: 28px; }
  .farm-label { width: 96px; }
  .farm-rate { min-width: 70px; }
}
@media (prefers-reduced-motion: reduce) {
  .ring, .trace, .cpu svg, .fic, .farm-row::after { animation: none !important; }
}
