#ui-root { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; background: #f8fafc; color: #1e293b; }
#ui-root.hidden { display: none; }
.hub-top { height: 54px; background: #fde047; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; box-shadow: 0 2px 6px rgba(0,0,0,0.08); flex-shrink: 0; }
.hub-nav-back { background: #fff; border: none; border-radius: 12px; padding: 7px 14px; font-weight: 700; color: #334155; cursor: pointer; }
.hub-wallet { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.coin-badge { background: #1e293b; color: #fff; padding: 5px 12px; border-radius: 20px; font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 6px; }
.coin-plus { background: #4ade80; color: #064e3b; border: none; border-radius: 50%; width: 22px; height: 22px; font-weight: 800; cursor: pointer; }
.hub-body { flex: 1; display: flex; overflow: hidden; }
.side-rail { width: 112px; padding: 14px 10px; display: flex; flex-direction: column; gap: 10px; background: #f1f5f9; border-right: 1px solid #e2e8f0; flex-shrink: 0; overflow-y: auto; }
.rail-btn { background: #fef08a; border: 2px solid #facc15; border-radius: 14px; padding: 12px 6px; font-size: 12px; font-weight: 700; color: #422006; cursor: pointer; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rail-btn.active { background: #facc15; }
.shop-menu { width: 170px; padding: 14px; background: #f1f5f9; border-right: 1px solid #e2e8f0; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.menu-link { background: none; border: none; text-align: left; padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 700; color: #475569; cursor: pointer; }
.menu-link.active { background: #fde047; color: #1e293b; }
.hub-main { flex: 1; overflow-y: auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 20px; }
.sec-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sec-title { font-size: 18px; font-weight: 800; color: #65a30d; }
.sec-all { background: none; border: none; color: #65a30d; font-weight: 800; font-size: 14px; cursor: pointer; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 14px; }
.hub-card { display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; position: relative; }
.card-box { width: 100%; aspect-ratio: 4/3; border-radius: 14px; border: 3px solid #fde047; background: #84cc16; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; box-shadow: 0 3px 8px rgba(0,0,0,0.06); }
.card-box.folder { background: #fef08a; color: #713f12; font-weight: 800; font-size: 14px; text-align: center; padding: 8px; }
.card-box img { width: 100%; height: 100%; object-fit: cover; }
.card-label { font-size: 13px; font-weight: 700; color: #334155; text-align: center; }
.badge-count { position: absolute; top: 6px; right: 8px; background: rgba(0,0,0,0.55); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 10px; }
.flag-new { position: absolute; top: 0; right: 10px; background: #f43f5e; color: #fff; font-size: 11px; padding: 3px 6px 6px; border-radius: 0 0 6px 6px; font-weight: 800; }
.lock-tag { position: absolute; bottom: 6px; background: rgba(15,23,42,0.85); color: #fde047; padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: 700; }
.star-btn { position: absolute; top: 6px; right: 6px; background: rgba(0,0,0,0.45); color: #fff; border: none; border-radius: 50%; width: 28px; height: 28px; font-size: 15px; cursor: pointer; }
.star-btn.fav { color: #facc15; }
.puz-bar { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 60%; height: 8px; background: rgba(0,0,0,0.45); border-radius: 6px; overflow: hidden; }
.puz-bar > i { display: block; height: 100%; background: #38bdf8; }
.done-piece { position: absolute; bottom: 6px; right: 8px; background: #422006; color: #fde047; font-size: 11px; font-weight: 800; padding: 3px 8px; border-radius: 8px; }
.sub-tabs { display: flex; justify-content: center; gap: 16px; flex-wrap: wrap; }
.sub-tab { background: none; border: none; font-size: 16px; font-weight: 800; color: #64748b; cursor: pointer; padding-bottom: 4px; }
.sub-tab.active { color: #65a30d; border-bottom: 3px solid #65a30d; }
@media (max-width: 640px) {
  .hub-body { flex-direction: column; }
  .side-rail { width: 100%; flex-direction: row; justify-content: space-around; border-right: none; border-bottom: 1px solid #e2e8f0; padding: 8px; }
  .rail-btn { flex: 1; padding: 8px 4px; }
  .shop-menu { width: 100%; flex-direction: row; overflow-x: auto; border-right: none; border-bottom: 1px solid #e2e8f0; }
}
.setup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.75); display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50; }
.setup-overlay.hidden { display: none; }
.setup-card { background: #fff; color: #1e293b; border-radius: 18px; padding: 20px; width: min(340px, 100%); display: flex; flex-direction: column; gap: 12px; }
.setup-card img { width: 100%; max-height: 150px; object-fit: cover; border-radius: 12px; }
.grid-pills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.pill-btn { padding: 8px 4px; border-radius: 10px; border: 2px solid #e2e8f0; background: #f8fafc; color: #334155; font-size: 12px; font-weight: 700; cursor: pointer; }
.pill-btn.active { background: #fde047; border-color: #eab308; }

.card-box.free-sample { border-color: #4ade80; box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.35); }
.free-pill { position: absolute; top: 0; left: 50%; transform: translateX(-50%); background: #22c55e; color: #fff; font-size: 10px; font-weight: 800; padding: 2px 10px 3px; border-radius: 0 0 8px 8px; letter-spacing: 0.4px; text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
.lock-center { position: absolute; inset: 0; background: rgba(15, 23, 42, 0.35); display: flex; align-items: center; justify-content: center; font-size: 22px; }

.dlg-btn { padding: 11px 16px; border: none; border-radius: 12px; font-size: 14px; font-weight: 800; cursor: pointer; }
.dlg-btn.c-gold { background: #fde047; color: #422006; }
.dlg-btn.c-green { background: #4ade80; color: #064e3b; }
.dlg-btn.c-blue { background: #4a90e2; color: #fff; }

.badge-new { position: absolute; top: 6px; left: 6px; background: linear-gradient(135deg, #f97316, #ef4444); color: #fff; font-size: 9px; font-weight: 800; padding: 3px 7px; border-radius: 7px; letter-spacing: 0.4px; text-transform: uppercase; box-shadow: 0 2px 4px rgba(0,0,0,0.25); }
.flag-deferred { position: absolute; top: 0; right: 10px; background: #e11d48; color: #fff; font-size: 11px; padding: 3px 6px 6px; border-radius: 0 0 6px 6px; font-weight: 800; box-shadow: 0 2px 4px rgba(0,0,0,0.2); }
