[hidden] { display: none !important; }
:root {
  --bg1: #1a1036; --bg2: #05030f;
  --panel: rgba(255, 255, 255, .06); --panel-hi: rgba(255, 255, 255, .12);
  --text: #f3eefe; --muted: #a99cc8; --accent: #7ef0c1; --gold: #ffd166; --danger: #ff6b6b;
}
body[data-stage="1"] { --bg1: #2b2b3a; --bg2: #0b0b12; }
body[data-stage="2"] { --bg1: #0f3d4a; --bg2: #041318; }
body[data-stage="3"] { --bg1: #3d1f0f; --bg2: #120804; }
body[data-stage="4"] { --bg1: #3a0f4a; --bg2: #08020e; }

* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--text);
  font-family: 'Fredoka', system-ui, sans-serif;
  background: radial-gradient(ellipse at top, var(--bg1), var(--bg2)) fixed;
  transition: background 2s;
}
/* starfield */
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .6; z-index: -1;
  background-image:
    radial-gradient(1px 1px at 10% 20%, #fff, transparent), radial-gradient(1px 1px at 70% 80%, #fff, transparent),
    radial-gradient(2px 2px at 40% 60%, #fff, transparent), radial-gradient(1px 1px at 85% 15%, #fff, transparent),
    radial-gradient(1px 1px at 25% 90%, #fff, transparent), radial-gradient(2px 2px at 60% 30%, #fff, transparent);
  background-size: 300px 300px;
}

button { font: inherit; color: inherit; cursor: pointer; border: 0; }
button:disabled { cursor: not-allowed; opacity: .45; }
h1, h2 { margin: .2em 0; font-weight: 600; }
h2 { font-size: 1.2rem; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

header { text-align: center; padding: 16px 16px 8px; }
.count { font-size: 2.4rem; font-weight: 600; }
.count span { color: var(--accent); }
.rate { color: var(--muted); }
.tuns { color: var(--gold); margin-left: .5em; }
.news { margin: 8px auto 0; max-width: 700px; font-size: .9rem; font-style: italic; color: var(--gold); min-height: 1.3em; }

main { display: grid; grid-template-columns: 1fr 1.2fr 1fr; gap: 16px; padding: 16px; max-width: 1300px; margin: 0 auto; }
@media (max-width: 900px) { main { grid-template-columns: 1fr; } }
section { background: var(--panel); border-radius: 16px; padding: 16px; }

.scene { text-align: center; }
.bear { background: none; width: 100%; max-width: 280px; padding: 0; transition: transform .1s; }
.bear:hover { transform: scale(1.04) rotate(-2deg); }
.bear svg { width: 100%; filter: drop-shadow(0 6px 18px rgba(126, 240, 193, .25)); }
.bear.squish { animation: squish .25s; }
@keyframes squish { 50% { transform: scale(1.12, .85); } }
.nap { background: #4b3a8f; padding: 10px 16px; border-radius: 12px; margin: 8px 0; }

.shop-head { display: flex; justify-content: space-between; align-items: center; }
.buy-mode button { background: var(--panel); padding: 4px 10px; border-radius: 8px; margin-left: 4px; }
.buy-mode .active { background: var(--accent); color: #111; }

.producer, .upgrade, .galaxy {
  display: flex; width: 100%; text-align: left; gap: 12px; align-items: center;
  background: var(--panel); border-radius: 12px; padding: 10px; margin-top: 8px;
}
.producer:not(:disabled):hover, .upgrade:not(:disabled):hover, .galaxy:hover { background: var(--panel-hi); }
.icon { width: 72px; height: 72px; flex: none; display: grid; place-items: center; font-size: 2rem; }
.icon img { width: 100%; height: 100%; object-fit: contain; }
.info { flex: 1; display: flex; flex-direction: column; }
small { color: var(--muted); }
.producer .cost { color: var(--accent); }
.owned { font-size: 1.6rem; font-weight: 600; min-width: 2ch; text-align: right; }

.upgrade, .galaxy { flex-direction: column; align-items: flex-start; gap: 2px; }
.upgrade .cost { color: var(--gold); }
.prestige { margin-top: 20px; border-top: 1px solid var(--panel-hi); padding-top: 12px; }
.galaxy { border: 1px solid var(--gold); }

.settings { margin-top: 20px; display: flex; gap: 8px; flex-wrap: wrap; }
.settings button { background: var(--panel); padding: 6px 10px; border-radius: 8px; font-size: .85rem; }
.settings .danger { color: var(--danger); }

.floater { position: fixed; pointer-events: none; font-weight: 600; color: var(--accent); animation: float .9s forwards; transform: translate(-50%, -50%); }
@keyframes float { to { opacity: 0; margin-top: -60px; } }

.welcome { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; }
.welcome[hidden] { display: none; }
.welcome .card { background: #241a48; padding: 24px; border-radius: 16px; max-width: 420px; text-align: center; }
.welcome button { background: var(--accent); color: #111; padding: 10px 20px; border-radius: 10px; font-weight: 600; }

.size { color: var(--gold); font-weight: 600; }
.natives { margin-top: 16px; text-align: left; border-top: 1px solid var(--panel-hi); padding-top: 8px; }
.natives ul { list-style: none; padding: 0; margin: 0; }
.natives li { padding: 4px 0; }
.natives li.won { color: var(--accent); }
#welcome-text { white-space: pre-line; text-align: left; }

.bear img { width: 100%; display: block; filter: drop-shadow(0 6px 18px rgba(126, 240, 193, .25)); }
.natives li { display: flex; align-items: center; gap: 10px; }
.natives li img, .natives li .emoji { width: 52px; height: 52px; object-fit: contain; flex: none; }
.natives li.locked img { filter: grayscale(.6) brightness(.8); }

.council-line { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.redtape { color: var(--danger); }
.approval { margin: 10px 0; padding: 10px; border-radius: 12px; background: var(--panel); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.approval button, .small-btn { background: #4b3a8f; padding: 6px 12px; border-radius: 10px; }
.natives li.locked img { filter: grayscale(1) brightness(.6); }
.natives li.locked i { color: var(--muted); }
.natives li.pending { flex-direction: column; align-items: stretch; background: var(--panel); border: 1px solid var(--gold); border-radius: 12px; padding: 8px; }
.pick { display: flex; gap: 10px; align-items: center; text-align: left; background: var(--panel); border-radius: 10px; padding: 6px; }
.pick:hover { background: var(--panel-hi); }
.pick span { display: flex; flex-direction: column; }
.scandal { margin-top: 20px; border-top: 1px solid var(--panel-hi); padding-top: 12px; }
.leak { display: block; margin-top: 8px; background: var(--gold); color: #111; font-weight: 600; padding: 8px 14px; border-radius: 10px; }
.bar { height: 12px; background: var(--panel); border-radius: 6px; overflow: hidden; margin: 8px 0 4px; }
#vote-fill { height: 100%; width: 0; background: var(--gold); transition: width .3s; }
.toasts { position: fixed; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; max-width: min(360px, calc(100vw - 32px)); z-index: 5; }
.toast { display: flex; gap: 10px; align-items: center; background: #2a1d55; border: 1px solid var(--gold); border-radius: 12px; padding: 8px 12px; animation: toastin .3s; }
.toast img, .toast .emoji { width: 44px; height: 44px; object-fit: contain; font-size: 1.8rem; flex: none; }
.toast p { margin: 0; font-size: .9rem; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } }
.welcome .card { max-height: 85vh; overflow-y: auto; }
