:root { --ink: #1c2330; --card: rgba(255,255,255,.94); --muted: #667085; --accent: #2f7fe0; --good: #17a34a; --bad: #e0362f; --warn: #d98a00; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #bcd3e6; color: var(--ink); font-family: 'Fredoka', system-ui, sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
.hidden { display: none !important; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: #eef1f5; border-radius: 10px; padding: 6px 10px; }
button:hover { background: #e2e7ee; }
button.on { background: var(--ink); color: #fff; }
button:disabled { opacity: .45; cursor: default; }

#top { position: fixed; top: 10px; left: 10px; right: 10px; display: flex; gap: 10px; align-items: stretch; pointer-events: none; flex-wrap: wrap; }
#top > * { pointer-events: auto; background: var(--card); border-radius: 16px; box-shadow: 0 4px 18px rgba(20,40,70,.16); backdrop-filter: blur(6px); }
.logo { font-weight: 700; font-size: 22px; padding: 10px 16px; cursor: pointer; display: flex; align-items: center; }
.logo span, h1 span { color: var(--accent); }
.stats { display: flex; padding: 4px 6px; gap: 2px; flex-wrap: wrap; }
.stat { padding: 4px 12px; text-align: center; min-width: 74px; }
.stat b { display: block; font-size: 18px; font-weight: 600; line-height: 1.2; white-space: nowrap; }
.stat small { color: var(--muted); font-size: 12px; white-space: nowrap; }
.stat.clock b { font-variant-numeric: tabular-nums; }
#wBox { cursor: pointer; }
.pr { display: flex; align-items: center; gap: 6px; justify-content: center; }
.pr button { padding: 0 8px; font-size: 16px; line-height: 22px; border-radius: 8px; }
.speed { display: flex; gap: 4px; padding: 8px; align-items: center; margin-left: auto; }
.speed button { min-width: 38px; height: 34px; }

#side { position: fixed; top: 84px; left: 10px; display: flex; flex-direction: column; gap: 6px; }
#side button { background: var(--card); box-shadow: 0 3px 12px rgba(20,40,70,.14); padding: 8px 12px; text-align: left; }
#side button.on { background: var(--ink); }
#repBtn { font-weight: 600; }

#tools { position: fixed; bottom: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; background: var(--card); padding: 8px; border-radius: 18px; box-shadow: 0 6px 24px rgba(20,40,70,.2); }
#tools button { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 76px; padding: 8px 10px; font-size: 14px; font-weight: 500; }
#tools i { display: block; width: 24px; height: 24px; }
#tools svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#sub { position: fixed; bottom: 92px; left: 50%; transform: translateX(-50%); display: flex; gap: 6px; background: var(--card); padding: 8px; border-radius: 16px; box-shadow: 0 6px 24px rgba(20,40,70,.2); max-width: calc(100vw - 20px); overflow-x: auto; }
#sub button { white-space: nowrap; text-align: left; padding: 7px 11px; font-size: 14px; line-height: 1.25; }
#sub button small { display: block; color: var(--muted); font-size: 11.5px; }
#sub button.on small { color: #c8d2e0; }
#hint { position: fixed; bottom: 158px; left: 50%; transform: translateX(-50%); background: rgba(28,35,48,.9); color: #fff; padding: 7px 14px; border-radius: 12px; font-size: 14.5px; pointer-events: none; max-width: calc(100vw - 20px); text-align: center; }
#hint:empty { display: none; }
#hint.bad { background: rgba(190,40,34,.94); }
#hint b { font-weight: 600; }

.panel { position: fixed; background: var(--card); border-radius: 16px; box-shadow: 0 6px 24px rgba(20,40,70,.2); padding: 14px 16px; font-size: 14.5px; backdrop-filter: blur(6px); }
#info { right: 10px; top: 84px; width: 280px; }
#report { left: 110px; top: 84px; width: 340px; max-height: calc(100vh - 190px); overflow-y: auto; }
#todo { right: 10px; bottom: 12px; width: 250px; font-size: 13.5px; }
#todo:empty { display: none; }
#todo div { padding: 2px 0; color: var(--muted); }
#todo div.done { color: var(--good); text-decoration: line-through; }
#todo .g { display: flex; justify-content: space-between; gap: 8px; color: var(--ink); }
#todo .g small { color: var(--muted); white-space: nowrap; }
#sub button.lock { opacity: .55; }
.lb.land { background: rgba(28,35,48,.88); color: #fff; border-color: #fff; font-weight: 500; text-align: center; transform: translate(-50%, -50%); }
.lb.land.ok { background: var(--good); }
.chart { margin: 2px 0 8px; }
.chart svg { display: block; width: 100%; height: 64px; overflow: visible; }
.chart .hd { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.chart .hd b { color: var(--ink); font-weight: 500; }
.chart rect.hit { fill: transparent; }
.chart rect.hit:hover { fill: rgba(47,127,224,.12); }
.panel h3 { margin: 0 0 6px; font-size: 18px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.panel h4 { margin: 12px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 600; }
.panel .x { background: none; padding: 0 4px; font-size: 18px; color: var(--muted); }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 1.5px 0; }
.kv span:first-child { color: var(--muted); }
.kv b { font-weight: 500; }
.kv .good { color: var(--good); } .kv .bad { color: var(--bad); }
.btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.btns button { font-size: 13.5px; }
.btns .danger { color: var(--bad); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 8px; color: #fff; font-size: 12.5px; font-weight: 500; }
.desc { color: var(--muted); font-size: 13.5px; margin: 4px 0; }
.bar { height: 7px; background: #e5e9ef; border-radius: 4px; overflow: hidden; margin: 3px 0 6px; }
.bar i { display: block; height: 100%; background: var(--accent); }
.fc { display: flex; gap: 6px; margin-top: 4px; }
.fc div { flex: 1; background: #eef1f5; border-radius: 10px; padding: 6px 4px; text-align: center; font-size: 12.5px; }
.fc b { display: block; font-size: 17px; font-weight: 500; }

#toasts { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; }
.toast { background: rgba(28,35,48,.92); color: #fff; padding: 7px 14px; border-radius: 12px; font-size: 14px; animation: tin .25s; max-width: 80vw; }
.toast.good { background: rgba(18,128,60,.94); } .toast.bad { background: rgba(190,40,34,.94); } .toast.warn { background: rgba(180,112,0,.95); }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }
#labels { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.lb { position: absolute; transform: translate(-50%, -100%); background: #fff; border: 2px solid var(--ink); border-radius: 10px; padding: 0 7px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.lb.hot { background: var(--bad); color: #fff; border-color: #fff; }
.lb.off { background: #555d6b; color: #fff; border-color: #fff; font-weight: 500; }

#menu, #help { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: linear-gradient(#9fc4e8cc, #e9f1f9cc); padding: 16px; }
#help { background: rgba(28,35,48,.45); }
.card { background: #fff; border-radius: 24px; padding: 28px 30px; max-width: 520px; width: 100%; box-shadow: 0 20px 60px rgba(20,40,70,.3); max-height: 100%; overflow-y: auto; }
.card h1 { font-size: 50px; margin: 0; letter-spacing: -1px; }
.card h2 { margin: 0 0 8px; }
.lead { color: var(--muted); font-size: 17px; margin: 6px 0 18px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.big { background: var(--accent); color: #fff; font-size: 18px; font-weight: 600; padding: 12px 22px; border-radius: 14px; }
.big:hover { background: #2569c0; }
.big.alt { background: var(--ink); }
.seed { display: flex; align-items: center; gap: 8px; margin: 14px 0 4px; color: var(--muted); font-size: 14px; }
.seed input { font: inherit; width: 96px; padding: 5px 8px; border: 1.5px solid #d5dbe4; border-radius: 9px; }
.how { padding-left: 18px; color: #3a4354; line-height: 1.5; font-size: 14.5px; }
.how li { margin: 3px 0; }
.back { color: var(--muted); font-size: 13px; text-decoration: none; }

@media (max-width: 760px) {
  .logo { font-size: 17px; padding: 6px 10px; }
  .stat { min-width: 56px; padding: 3px 6px; } .stat b { font-size: 15px; } .stat small { font-size: 10.5px; }
  .speed { margin-left: 0; padding: 4px; } .speed button { min-width: 32px; height: 30px; padding: 2px 6px; }
  #side { top: auto; bottom: 96px; flex-direction: row; flex-wrap: wrap; left: 6px; right: 6px; }
  #side button { padding: 5px 9px; font-size: 13px; }
  #tools button { min-width: 58px; padding: 6px 6px; font-size: 12.5px; }
  #sub { bottom: 140px; } #hint { bottom: 200px; font-size: 13px; }
  #info { top: auto; bottom: 150px; right: 6px; left: 6px; width: auto; max-height: 40vh; overflow-y: auto; }
  #report { left: 6px; right: 6px; width: auto; top: 120px; max-height: calc(100vh - 290px); }
  #todo { display: none; }
  .card h1 { font-size: 38px; }
}
