:root {
  --bg: #1d2233; --card: #262c42; --line: #3a4262; --text: #eef0f7; --muted: #a3a9c2;
  --accent: #9fd3c7; --gold: #f2d49b; --bad: #f29b9b; --chosen: #4a6b8f;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
#app { max-width: 560px; margin: 0 auto; padding: 12px 16px 80px; }
h1 { font-size: 22px; margin: 8px 0 12px; color: var(--gold); font-weight: 600; }
h2 { font-size: 17px; margin: 18px 0 8px; color: var(--accent); font-weight: 600; }
.center { text-align: center; padding: 40px 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin: 10px 0; }
button { font: inherit; color: var(--text); background: #33405f; border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; width: 100%; text-align: left; margin: 6px 0; cursor: pointer; }
button:active { transform: scale(.99); }
button.primary { background: var(--accent); color: #12202a; font-weight: 600; text-align: center; }
button.chosen { background: var(--chosen); border-color: var(--accent); }
button.nothing { color: var(--muted); }
button.inline { width: auto; display: inline-block; margin: 4px 4px 4px 0; padding: 8px 12px; text-align: center; }
button:disabled { opacity: .45; }
input, textarea, select { font: inherit; color: var(--text); background: #1a1f2e; border: 1px solid var(--line); border-radius: 10px; padding: 10px; width: 100%; margin: 6px 0; }
textarea { min-height: 80px; resize: vertical; }
.scene img, img.scene { width: 100%; border-radius: 12px; display: block; aspect-ratio: 9 / 16; object-fit: cover; background: #111; }
.scene .text { white-space: pre-wrap; margin: 10px 2px; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; position: sticky; top: 0; background: var(--bg); padding: 8px 0; z-index: 5; }
.timer { font-variant-numeric: tabular-nums; color: var(--gold); font-weight: 600; }
.timer.low { color: var(--bad); }
.thinking { text-align: center; padding: 60px 10px; color: var(--muted); }
.thinking .dots::after { content: '…'; animation: d 1.4s infinite; }
@keyframes d { 0% { content: '.'; } 33% { content: '..'; } 66% { content: '...'; } }
.chips span { display: inline-block; background: #33405f; border-radius: 999px; padding: 3px 10px; margin: 3px 4px 3px 0; font-size: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.row > * { flex: 1; }
.chat { max-height: 280px; overflow-y: auto; }
.chat p { margin: 6px 0; }
.chat .klodik { color: var(--gold); }
.chat .lete { color: var(--bad); font-style: italic; }
.star { font-size: 15px; }
.star b { color: var(--gold); }
.star .done { color: var(--muted); text-decoration: line-through; }
.star .next { background: var(--gold); color: #222; border-radius: 6px; padding: 0 6px; }
.feed img { width: 100%; border-radius: 10px; }
.map td { padding: 4px 6px; vertical-align: top; border-bottom: 1px solid var(--line); font-size: 14px; }
.map { width: 100%; border-collapse: collapse; }
.sprite { height: 72px; vertical-align: bottom; }
#toasts { position: fixed; left: 0; right: 0; bottom: 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; z-index: 20; }
#toasts div { background: #0e1220ee; border: 1px solid var(--gold); color: var(--gold); padding: 10px 14px; border-radius: 12px; max-width: 520px; margin: 0 16px; animation: fade 7s forwards; }
@keyframes fade { 0%, 85% { opacity: 1; } 100% { opacity: 0; } }
details summary { cursor: pointer; color: var(--accent); margin: 8px 0; }
.err { color: var(--bad); }
.code { font-size: 28px; letter-spacing: 6px; }
