:root {
  --bg: #16292e;
  --card: #1f383e;
  --field: #1a3136;
  --line: #34575f;
  --text: #f1efe8;
  --muted: #a6bdbb;
  --accent: #e9b949;
  --good: #6cc592;
  --bad: #e07a6a;
  --blue: #7fbfd4;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.45;
}

button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button:disabled { cursor: default; }
.hidden { display: none !important; }

/* telas */
.screen {
  display: none; max-width: 560px; margin: 0 auto;
  padding: calc(24px + env(safe-area-inset-top)) calc(16px + env(safe-area-inset-right))
    calc(40px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left));
}
.screen.active { display: block; animation: fadeIn .2s ease; }
#screen-start, #screen-end { padding-top: calc(48px + env(safe-area-inset-top)); }

h1 { font-size: 2rem; margin-bottom: 8px; }
.tagline { color: var(--muted); margin-bottom: 20px; }

.rules { list-style: none; display: grid; gap: 8px; margin-bottom: 20px; }
.rules li { background: var(--card); border-radius: 8px; padding: 10px 12px; font-size: .95rem; }
.rules b { color: var(--accent); }
.record { color: var(--muted); font-size: .9rem; margin-bottom: 12px; min-height: 1.2em; }

.btn-big {
  display: block; width: 100%;
  padding: 14px; border-radius: 8px;
  font-size: 1.05rem; font-weight: 600;
  background: var(--accent); color: #2b2210;
}
.btn-big:hover { filter: brightness(1.05); }
.btn-big:disabled { opacity: .5; }
.btn-secondary { margin-top: 8px; background: var(--field); color: var(--text); border: 2px solid var(--line); }
.install-hint { margin-top: 12px; color: var(--muted); font-size: .85rem; text-align: center; }

/* painel de cima */
.hud {
  background: var(--card); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 12px; display: grid; gap: 8px;
}
.hud-row { display: flex; justify-content: space-between; align-items: center; }
.pop { display: flex; align-items: baseline; gap: 8px; }
.pop-icon { font-size: 1.3rem; }
.pop-count { font-size: 1.8rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pop-delta { font-weight: 600; }
.pop-delta.win { color: var(--good); }
.pop-delta.lose { color: var(--bad); }
.hud-right { display: flex; align-items: center; gap: 10px; }
.round-label { color: var(--muted); font-size: .9rem; }
.btn-icon { font-size: 1.1rem; padding: 4px; }

.band-row, .combo-row { display: flex; align-items: center; gap: 10px; font-size: .85rem; }
.band-name { font-weight: 600; color: var(--blue); min-width: 80px; }
.bar { flex: 1; height: 6px; background: var(--field); border-radius: 3px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: var(--good); }
.band-next { color: var(--muted); white-space: nowrap; }

.combo-label { color: var(--muted); min-width: 80px; }
.combo-pips { display: flex; gap: 4px; }
.pip { width: 16px; height: 6px; border-radius: 3px; background: var(--field); }
.pip.on { background: var(--good); }
.combo-mult { font-weight: 600; color: var(--good); }
.buffs { margin-left: auto; display: flex; gap: 6px; }
.buff { background: var(--field); border-radius: 4px; padding: 1px 6px; font-size: .8rem; }

/* pergunta */
.card { background: var(--card); border-radius: 8px; padding: 16px; }
.category { font-size: .8rem; color: var(--blue); margin-bottom: 6px; }
.scenario { font-size: 1.05rem; margin-bottom: 14px; }

.options { display: grid; gap: 8px; }
.option {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  padding: 12px; border-radius: 8px; border: 2px solid var(--line); background: var(--field);
}
.option:not(:disabled):hover { border-color: var(--blue); }
.option.picked { border-color: var(--accent); }
.option.best { border-color: var(--good); }
.option:disabled:not(.picked):not(.best) { opacity: .5; }
.opt-letter { flex: none; font-weight: 700; color: var(--muted); }
.option .tag { display: block; margin-top: 4px; font-size: .8rem; font-weight: 600; color: var(--good); }

.suspense { margin-top: 14px; text-align: center; color: var(--muted); }

/* resultado */
.result { margin-top: 14px; }
.result-banner { font-size: 1.3rem; font-weight: 700; margin-bottom: 8px; }
.result-banner.win { color: var(--good); }
.result-banner.lose { color: var(--bad); }
.result-odds { font-size: .95rem; margin-bottom: 6px; }
.result-note { font-size: .9rem; color: var(--muted); font-style: italic; margin-bottom: 10px; }
.feedback { display: grid; gap: 6px; margin-bottom: 14px; }
.bubble { border-left: 3px solid var(--blue); padding: 6px 10px; font-size: .92rem; }

/* fim */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 20px; }
.stat { background: var(--card); border-radius: 8px; padding: 12px; }
.stat b { display: block; font-size: 1.4rem; color: var(--accent); }
.stat span { font-size: .8rem; color: var(--muted); }

/* avaliação */
.rating { background: var(--card); border-radius: 8px; padding: 14px; margin-bottom: 16px; display: grid; gap: 10px; }
.rating-q { font-weight: 600; }
.stars { display: flex; gap: 4px; }
.star { font-size: 2rem; line-height: 1; padding: 2px 4px; color: var(--line); }
.star.on { color: var(--accent); }
.rating textarea {
  width: 100%; resize: vertical; padding: 10px; border-radius: 8px;
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--field); border: 2px solid var(--line);
}
.rating textarea:focus { outline: none; border-color: var(--blue); }
.rating .btn-secondary { margin-top: 0; }
.rating-thanks { color: var(--good); text-align: center; margin-bottom: 16px; }

/* avisos (ovo e subida de faixa) */
.modal { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, .6); display: grid; place-items: center; padding: 16px; }
.modal-box { width: 100%; max-width: 380px; background: var(--card); border-radius: 8px; padding: 20px; text-align: center; display: grid; gap: 10px; }
.modal-box p { color: var(--muted); }
.egg { font-size: 48px; }
.prize-text { color: var(--text) !important; font-weight: 600; }
.level-label { font-weight: 600; color: var(--good); }
.level h2 { font-size: 1.8rem; text-transform: capitalize; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* teclado */
kbd {
  font: inherit; font-size: .75em; font-weight: 600;
  padding: 1px 5px; border-radius: 4px;
  border: 1px solid currentColor; opacity: .7;
}
.btn-big kbd { margin-left: 6px; }
button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
