/* ============================================================
   GeoJogos — base.css
   CSS compartilhado por todos os jogos.
   Gerado a partir do GeoSilhueta (referência visual do projeto).
   ============================================================ */

/* ── VARIÁVEL DO BANNER ───────────────────────────────────── */
:root {
  --banner-space: 16px; /* atualizado dinamicamente pelo Kotlin após banner carregar */ /* espaço reservado para o banner AdMob */
}

/* Quando premium está ativo, remove o espaço do banner */
body.premium {
  --banner-space: 16px;
}

/* ── VARIÁVEIS DE TEMA — ESCURO (padrão) ────────────────── */
:root {
  --bg: #0f1923;
  --surface: #1a2535;
  --surface2: #243044;
  --accent: #00e5a0;
  --accent2: #ff6b35;
  --text: #e8f0fe;
  --text-dim: #7a8fa6;
  --correct: #00e5a0;
  --warm: #ffd166;
  --cold: #4a9eff;
  --wrong: #3a4a5c;
  --border: #2d3f55;
  --accent-subtle: rgba(0,229,160,0.08);
  --accent-glow:   rgba(0,229,160,0.2);
  --accent-ring:   rgba(0,229,160,0.3);
  --pill-green-bg: rgba(0,229,160,0.15);
  --pill-yellow-bg: rgba(255,209,102,0.15);
  --pill-blue-bg:  rgba(74,158,255,0.15);
  --grid-line:     rgba(0,229,160,0.03);
  --overlay-bg:    rgba(0,0,0,0.7);
  --shadow-drop:   rgba(0,0,0,0.4);
  --counter-bg:    rgba(0,229,160,0.1);
  --counter-border: rgba(0,229,160,0.25);
}

/* ── VARIÁVEIS DE TEMA — CLARO ───────────────────────────── */
:root[data-theme="light"] {
  --bg: #f0f4f8;
  --surface: #ffffff;
  --surface2: #e4eaf2;
  --accent: #00a371;
  --accent2: #e05520;
  --text: #0f1923;
  --text-dim: #5a7080;
  --correct: #00a371;
  --warm: #d4900a;
  --cold: #2978d8;
  --wrong: #c8d6e0;
  --border: #c8d6e0;
  --accent-subtle: rgba(0,163,113,0.06);
  --accent-glow:   rgba(0,163,113,0.15);
  --accent-ring:   rgba(0,163,113,0.25);
  --pill-green-bg: rgba(0,163,113,0.12);
  --pill-yellow-bg: rgba(180,120,10,0.12);
  --pill-blue-bg:  rgba(41,120,216,0.12);
  --grid-line:     rgba(0,163,113,0.04);
  --overlay-bg:    rgba(0,0,0,0.5);
  --shadow-drop:   rgba(0,0,0,0.15);
  --counter-bg:    rgba(0,163,113,0.08);
  --counter-border: rgba(0,163,113,0.2);
}

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

/* ── BODY ────────────────────────────────────────────────── */
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  overflow-x: hidden;
}

/* Background grid */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: 0;
}

/* ── APP CONTAINER ───────────────────────────────────────── */
.app {
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  padding: 0 16px var(--banner-space); /* banner-space reserva espaço para o AdMob */
}

/* ── HEADER ──────────────────────────────────────────────── */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.logo {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.6rem;
  letter-spacing: -1px;
  color: var(--accent);
}
.logo span { color: var(--text); }

.header-btns { display: flex; gap: 8px; }

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-dim);
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.2s;
}
.icon-btn:hover { background: var(--surface2); color: var(--text); }

/* ── SILHOUETTE ──────────────────────────────────────────── */
.silhouette-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
  min-height: 200px;
}
.silhouette-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, var(--surface) 100%);
  pointer-events: none;
}
#country-svg {
  width: 100%;
  max-height: 200px;
  filter: drop-shadow(0 0 20px var(--accent-glow));
}
#country-svg path { fill: var(--accent); opacity: 0.9; }

.day-badge {
  position: absolute;
  top: 12px; right: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-family: 'Nunito Sans', sans-serif;
  font-size: 0.65rem;
  color: var(--text-dim);
  z-index: 2;
}

/* ── ROUND INDICATOR ─────────────────────────────────────── */
.round-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 14px;
}
.round-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-dim);
  transition: all 0.3s;
  font-family: 'Nunito Sans', sans-serif;
}
.round-dot.active { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 10px var(--accent-ring); }
.round-dot.won    { background: var(--correct); border-color: var(--correct); color: var(--bg); }
.round-dot.lost   { background: var(--accent2); border-color: var(--accent2); color: var(--bg); }
.round-line {
  flex: 1; height: 2px;
  background: var(--border);
  border-radius: 1px;
  max-width: 40px;
}

/* ── BOTÕES ──────────────────────────────────────────────── */
.next-btn {
  background: var(--surface2);
  border: 1.5px solid var(--accent);
  border-radius: 12px;
  color: var(--accent);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 28px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  margin-top: 8px;
}
.next-btn:hover { background: var(--accent); color: var(--bg); }

.share-btn {
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: var(--bg);
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  padding: 12px 28px;
  cursor: pointer;
  width: 100%;
  transition: opacity 0.2s;
}
.share-btn:hover { opacity: 0.85; }

.start-btn {
  width: 100%; padding: 15px;
  font-family: 'Nunito', sans-serif; font-size: 1.05rem; font-weight: 800;
  border: none; border-radius: 16px; cursor: pointer;
  background: linear-gradient(90deg, var(--accent), #00b8ff);
  color: #042a1a;
  box-shadow: 0 6px 22px var(--accent-ring);
  transition: opacity 0.2s, transform 0.1s;
}
.start-btn:hover  { opacity: 0.9; }
.start-btn:active { transform: scale(0.98); }

/* ── GUESSES ─────────────────────────────────────────────── */
.guesses { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.guess-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.guess-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.guess-dist { font-family: 'Nunito Sans', sans-serif; font-size: 0.7rem; color: var(--text-dim); white-space: nowrap; }
.guess-arrow { font-size: 1.2rem; width: 28px; text-align: center; }
.guess-bars { display: flex; gap: 2px; }
.bar { width: 10px; height: 10px; border-radius: 2px; background: var(--wrong); }
.bar.green  { background: var(--correct); }
.bar.yellow { background: var(--warm); }
.empty-row { background: var(--surface); border: 1px dashed var(--border); border-radius: 12px; height: 46px; opacity: 0.4; }

/* ── INPUT ───────────────────────────────────────────────── */
.input-section { position: relative; margin-bottom: 12px; }
.search-input {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: 'Nunito', sans-serif;
  font-size: 1rem;
  padding: 14px 50px 14px 16px;
  outline: none;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--text-dim); }
.submit-btn {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  background: var(--accent);
  border: none;
  border-radius: 10px;
  color: var(--bg);
  font-weight: 700;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: opacity 0.2s;
}
.submit-btn:hover    { opacity: 0.85; }
.submit-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.autocomplete {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 0 8px 32px var(--shadow-drop);
}
.autocomplete-item {
  padding: 11px 16px;
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover, .autocomplete-item.active { background: var(--surface); color: var(--accent); }

/* ── PROGRESS BAR ────────────────────────────────────────── */
.progress-bar { height: 3px; background: var(--surface2); border-radius: 2px; margin-bottom: 16px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--cold)); border-radius: 2px; transition: width 0.5s ease; }

/* ── RESULT CARD ─────────────────────────────────────────── */
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  margin-bottom: 16px;
  display: none;
}
.result-card.show { display: block; animation: fadeIn 0.5s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
.result-emoji { font-size: 3rem; margin-bottom: 8px; }
.result-title { font-size: 1.4rem; font-weight: 800; margin-bottom: 4px; }
.result-sub   { color: var(--text-dim); font-size: 0.85rem; margin-bottom: 16px; }
.result-country { font-size: 1.1rem; font-weight: 700; color: var(--accent); margin-bottom: 16px; }

.counter-pill {
  display: inline-block;
  background: var(--counter-bg);
  border: 1px solid var(--counter-border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 16px;
  animation: fadeIn 0.5s ease;
}

/* ── HINTS ───────────────────────────────────────────────── */
.hint-wrap { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.hint-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  font-family: 'Nunito', sans-serif;
  font-size: 0.82rem; font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.hint-btn:hover:not(:disabled) { background: var(--surface2); border-color: var(--accent); }
.hint-btn .hint-icon { font-size: 1.1rem; transition: filter 0.3s, opacity 0.3s; }
.hint-btn.used { cursor: default; border-color: var(--border); color: var(--text-dim); }
.hint-btn.used .hint-icon { filter: grayscale(1); opacity: 0.45; }
.hint-btn:disabled { cursor: not-allowed; opacity: 0.4; }
.hint-text { flex: 1; font-family: 'Nunito', sans-serif; font-size: 0.8rem; color: var(--text-dim); font-style: italic; text-align: right; }
.hint-text.revealed { color: var(--accent); font-style: normal; font-weight: 700; }

/* ── PILLS ───────────────────────────────────────────────── */
.pill { padding: 4px 10px; border-radius: 8px; font-size: 0.75rem; font-weight: 600; }
.pill.green  { background: var(--pill-green-bg); color: var(--correct); border: 1px solid var(--correct); }
.pill.yellow { background: var(--pill-yellow-bg); color: var(--warm);   border: 1px solid var(--warm); }
.pill.blue   { background: var(--pill-blue-bg);  color: var(--cold);    border: 1px solid var(--cold); }
.rule-pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 0.76rem; font-weight: 800; margin: 0 1px; }
.rule-pill.green  { background: var(--pill-green-bg); color: var(--correct); border: 1px solid var(--accent-ring); }
.rule-pill.yellow { background: var(--pill-yellow-bg); color: var(--warm); border: 1px solid rgba(0,0,0,0.15); }
.rule-pill.blue   { background: var(--pill-blue-bg);  color: var(--cold);  border: 1px solid rgba(0,0,0,0.15); }

/* ── MODAL ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: var(--overlay-bg);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px 40px;
  width: 100%; max-width: 480px;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-title  { font-size: 1.2rem; font-weight: 800; }
.close-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 1rem;
}

/* ── STATS ───────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 20px; }
.stat-box { background: var(--surface2); border-radius: 12px; padding: 12px 8px; text-align: center; }
.stat-num { font-family: 'Nunito Sans', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--accent); display: block; }
.stat-label { font-size: 0.65rem; color: var(--text-dim); margin-top: 2px; line-height: 1.2; }
.dist-chart { margin-top: 8px; }
.dist-chart-title { font-size: 0.8rem; color: var(--text-dim); margin-bottom: 10px; }
.dist-row { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.dist-label { font-family: 'Nunito Sans', sans-serif; font-size: 0.75rem; width: 16px; text-align: right; color: var(--text-dim); }
.dist-bar-wrap { flex: 1; background: var(--surface2); border-radius: 4px; height: 20px; overflow: hidden; }
.dist-bar-fill { height: 100%; background: var(--accent); border-radius: 4px; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; min-width: 20px; transition: width 0.6s ease; }
.dist-bar-fill span { font-family: 'Nunito Sans', sans-serif; font-size: 0.65rem; color: var(--bg); font-weight: 700; }

/* ── HOWTO ───────────────────────────────────────────────── */
.howto-list { list-style: none; }
.howto-list li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 0.9rem; color: var(--text-dim); line-height: 1.5; }
.howto-list li strong { color: var(--text); }
.howto-example { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

/* ── FOOTER ──────────────────────────────────────────────── */
.footer { margin-top: auto; padding-top: 24px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.coffee-btn {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; color: var(--text-dim);
  font-family: 'Nunito', sans-serif; font-size: 0.82rem;
  padding: 10px 18px; text-decoration: none; transition: all 0.2s;
}
.coffee-btn:hover { border-color: var(--accent); color: var(--text); }
.footer-credit { font-size: 0.68rem; color: var(--text-dim); opacity: 0.6; text-align: center; line-height: 1.5; }

/* ── WELCOME SCREEN ──────────────────────────────────────── */
#welcome-screen { display: none; flex-direction: column; gap: 16px; animation: fadeInDown 0.4s ease; }
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.welcome-hero { text-align: center; padding: 22px 0 6px; }
.welcome-hero .big-emoji { font-size: 3.6rem; line-height: 1; margin-bottom: 10px; }
.welcome-title { font-size: 1.55rem; font-weight: 900; letter-spacing: -0.5px; margin-bottom: 4px; }
.welcome-sub { font-size: 0.87rem; color: var(--text-dim); line-height: 1.55; }
.rules-card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 18px 20px; }
.rule-row { display: flex; align-items: flex-start; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.rule-row:first-child { padding-top: 0; }
.rule-row:last-child  { border-bottom: none; padding-bottom: 0; }
.rule-icon { font-size: 1.35rem; width: 26px; flex-shrink: 0; text-align: center; margin-top: 1px; }
.rule-text { font-size: 0.87rem; color: var(--text-dim); line-height: 1.5; }
.rule-text strong { color: var(--text); }
.no-show-wrap { display: flex; align-items: center; justify-content: center; gap: 8px; cursor: pointer; padding: 2px 0; }
.no-show-wrap input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.no-show-label { font-family: 'Nunito Sans', sans-serif; font-size: 0.78rem; color: var(--text-dim); cursor: pointer; user-select: none; }

/* ── TOAST ───────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 32px;
  left: 50%; transform: translateX(-50%);
  background: var(--accent); color: var(--bg);
  font-weight: 700; padding: 12px 24px;
  border-radius: 12px; font-size: 0.9rem;
  z-index: 999; opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none; white-space: nowrap;
}
.toast.show { opacity: 1; }

/* ── LOADING / SPINNER ───────────────────────────────────── */
.loading { display: flex; align-items: center; justify-content: center; height: 200px; color: var(--text-dim); flex-direction: column; gap: 12px; }
.spinner { width: 32px; height: 32px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SCROLLBAR ───────────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: var(--surface); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }