:root {
  --bg: #0a0a0a;
  --panel: #141414;
  --line: #2a2a2a;
  --yellow: #ffd400;
  --yellow2: #ffe566;
  --text: #f7f7f2;
  --muted: #a8a89a;
  --radius: 16px;
  --dock: 72px;
  font-family: "Avenir Next", "Segoe UI", "Trebuchet MS", sans-serif;
}
* { box-sizing: border-box; }
html, body {
  margin: 0; min-height: 100%;
  background:
    radial-gradient(110% 70% at 0% -5%, #3a3200 0%, transparent 55%),
    radial-gradient(90% 60% at 100% 0%, #222 0%, transparent 45%),
    var(--bg);
  color: var(--text);
}
body { padding-bottom: calc(var(--dock) + env(safe-area-inset-bottom)); }
.hidden { display: none !important; }
#hub { max-width: 520px; margin: 0 auto; padding: 12px 14px 24px; }
.bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 14px;
}
.brand, .bar h2 {
  font-size: 1.08rem; letter-spacing: 0.05em; margin: 0;
  background: linear-gradient(90deg, var(--yellow), #fff, var(--yellow2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  font-weight: 800;
}
.ico {
  width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); color: var(--text); display: grid; place-items: center;
  cursor: pointer;
}
.ico img, .mini { width: 22px; height: 22px; object-fit: contain; }
.mini { width: 28px; height: 28px; }
.hero { text-align: center; padding: 8px 4px 18px; }
.logo {
  width: 108px; height: 108px; object-fit: contain;
  filter: drop-shadow(0 8px 24px rgba(255,212,0,.35));
}
.hero h1 { margin: 10px 0 6px; font-size: 1.55rem; }
.tag { color: var(--muted); font-size: .92rem; line-height: 1.45; margin: 0; }
.tag.pad { padding: 0 4px 12px; }
.pad-top { margin-top: 12px; }
.kpi {
  display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin-bottom: 14px;
}
.kpi .card, .list .card, .card.soft, .panel {
  background: linear-gradient(160deg, #1a1a14, #10100c);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.kpi strong { display: block; font-size: 1.25rem; color: var(--yellow); }
.kpi span { color: var(--muted); font-size: .72rem; }
.stack { display: grid; gap: 10px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; border: 0; border-radius: 14px; padding: 14px 16px;
  font-weight: 700; font-size: .98rem; cursor: pointer;
}
.btn img { width: 26px; height: 26px; object-fit: contain; }
.btn.gold {
  background: linear-gradient(135deg, #ffe566, #ffd400 55%, #e6c200);
  color: #1a1400; box-shadow: 0 8px 22px rgba(255,212,0,.35);
}
.btn.ghost {
  background: var(--panel); color: var(--text); border: 1px solid var(--line);
}
.btn.danger { color: #ffb4bc; border: 1px solid #5a2230; background: #1a1012; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  border-radius: 999px; padding: 8px 12px; font-size: .82rem; cursor: pointer;
}
.chip.on { color: #1a1400; background: var(--yellow); border-color: var(--yellow); font-weight: 700; }
.list { display: grid; gap: 10px; }
.list .card h4 { margin: 0 0 4px; font-size: 1rem; }
.list .card .meta { color: var(--muted); font-size: .78rem; margin-bottom: 6px; }
.list .card p { margin: 0; font-size: .88rem; line-height: 1.4; color: #ddd; }
.badge {
  display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .04em;
  padding: 3px 8px; border-radius: 999px; margin-right: 6px;
  background: #2a2508; color: var(--yellow); border: 1px solid #4a4000;
}
.badge.open { background: #1a2a10; color: #b8e986; border-color: #3a5020; }
.badge.done { background: #1a1a1a; color: #aaa; border-color: #333; }
.card.row {
  display: flex; align-items: center; justify-content: space-between; cursor: pointer;
}
.card.soft h3 { margin: 0 0 8px; color: var(--yellow); font-size: 1rem; }
.card.soft p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.panel { margin-top: 12px; }
.pairs-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px;
}
.pair-card {
  min-height: 72px; border-radius: 12px; border: 1px solid var(--line);
  background: #12120e; color: var(--text); padding: 10px; cursor: pointer;
  font-size: .85rem; line-height: 1.3;
}
.pair-card.on { border-color: var(--yellow); box-shadow: 0 0 0 1px var(--yellow); }
.pair-card.matched { opacity: .45; pointer-events: none; border-color: #4a4000; }
.puzzle {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; max-width: 260px; margin: 10px auto;
}
.puzzle button {
  aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px;
  background: #1a1a12; color: var(--yellow); font-size: 1.2rem; font-weight: 800; cursor: pointer;
}
.puzzle button.empty { background: transparent; border-style: dashed; color: transparent; }
.dock {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 4px; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(10,10,10,.94); border-top: 1px solid var(--line); backdrop-filter: blur(10px);
}
.dock button {
  border: 0; background: transparent; color: var(--muted); display: grid; place-items: center;
  gap: 2px; font-size: .68rem; padding: 6px 2px; cursor: pointer;
}
.dock button img { width: 22px; height: 22px; object-fit: contain; opacity: .7; }
.dock button.on { color: var(--yellow); }
.dock button.on img { opacity: 1; filter: drop-shadow(0 0 6px rgba(255,212,0,.5)); }
.dlg {
  position: fixed; inset: 0; background: rgba(0,0,0,.72);
  display: grid; place-items: end center; z-index: 40; padding: 12px;
}
.dlg-card {
  width: min(520px, 100%); background: #141410; border: 1px solid var(--line);
  border-radius: 18px 18px 12px 12px; padding: 16px; margin-bottom: env(safe-area-inset-bottom);
  max-height: 88vh; overflow: auto;
}
.dlg-card h3 { margin: 0 0 12px; color: var(--yellow); }
.dlg-card label {
  display: grid; gap: 6px; margin-bottom: 10px; font-size: .82rem; color: var(--muted);
}
.dlg-card input, .dlg-card textarea, .dlg-card select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  background: #0e0e0c; color: var(--text); padding: 10px 12px; font: inherit;
}
.dlg-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
@media (min-width: 640px) {
  .dlg { place-items: center; }
  .dlg-card { border-radius: 18px; }
}
