:root {
  --bg: #0d0b1e;
  --panel: #1a1636;
  --panel-2: #241e4a;
  --text: #f3f0ff;
  --muted: #9b94c9;
  --accent: #ffd23f;
  --accent-2: #ff4f81;
  --ok: #3ddc84;
  --bad: #ff5a5a;
  --radius: 14px;
}

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

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

.pixel { font-family: "Press Start 2P", monospace; letter-spacing: 1px; }

a { color: inherit; text-decoration: none; }

.container { width: min(960px, 100% - 32px); margin: 0 auto; }

header.site {
  padding: 20px 0;
  border-bottom: 2px solid var(--panel-2);
}
header.site .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo { font-size: 20px; color: var(--accent); }
.logo span { color: var(--accent-2); }
.back { color: var(--muted); font-size: 14px; }
.back:hover { color: var(--text); }

.hero { text-align: center; padding: 56px 0 32px; }
.hero h1 { font-size: clamp(24px, 6vw, 40px); color: var(--accent); margin-bottom: 16px; }
.hero p { color: var(--muted); max-width: 520px; margin: 0 auto; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  padding: 24px 0 64px;
}

.card {
  background: var(--panel);
  border: 2px solid var(--panel-2);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.15s, border-color 0.15s;
  display: block;
}
a.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card .emoji { font-size: 40px; margin-bottom: 12px; }
.card h2 { font-size: 13px; margin-bottom: 10px; color: var(--accent); }
.card p { color: var(--muted); font-size: 14px; }
.card.soon { opacity: 0.45; }
.tag {
  display: inline-block;
  margin-top: 12px;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 99px;
  background: var(--panel-2);
  color: var(--muted);
}

/* Pagina do jogo */
.game-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  padding: 32px 0 64px;
}
@media (max-width: 820px) {
  .game-layout { grid-template-columns: 1fr; }
}

.game-title { font-size: clamp(16px, 4vw, 22px); color: var(--accent); margin-bottom: 8px; }
.game-sub { color: var(--muted); margin-bottom: 20px; font-size: 14px; }

#arena {
  width: 100%;
  min-height: 320px;
  border-radius: var(--radius);
  border: 3px solid var(--panel-2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  transition: background 0.1s;
}
#arena.idle { background: var(--panel); }
#arena.waiting { background: #7a1f3d; }
#arena.go { background: #1a8f4c; }
#arena.result { background: var(--panel); }
#arena.fail { background: #5b2b0f; }
#arena .big { font-size: clamp(18px, 5vw, 28px); margin-bottom: 12px; }
#arena .small { color: #e5e0ff; font-size: 14px; opacity: 0.85; }

.rounds { display: flex; gap: 8px; margin-top: 14px; justify-content: center; }
.rounds .dot {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--panel-2);
}
.rounds .dot.done { background: var(--accent); }

.submit-box {
  margin-top: 20px;
  background: var(--panel);
  border: 2px solid var(--panel-2);
  border-radius: var(--radius);
  padding: 20px;
}
.submit-box[hidden] { display: none; }
.submit-box h3 { font-size: 12px; color: var(--accent); margin-bottom: 12px; }
.submit-box form { display: flex; gap: 10px; flex-wrap: wrap; }
.submit-box input {
  flex: 1;
  min-width: 160px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 2px solid var(--panel-2);
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
}
.submit-box input:focus { outline: none; border-color: var(--accent); }
button.btn {
  padding: 12px 22px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: #1c1500;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}
button.btn:disabled { opacity: 0.5; cursor: not-allowed; }
button.btn.ghost { background: var(--panel-2); color: var(--text); }
.mute-btn { margin-bottom: 16px; padding: 8px 14px; font-size: 13px; }
.msg { margin-top: 10px; font-size: 14px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--bad); }

.ranking {
  background: var(--panel);
  border: 2px solid var(--panel-2);
  border-radius: var(--radius);
  padding: 20px;
  align-self: start;
}
.ranking h2 { font-size: 12px; color: var(--accent); margin-bottom: 16px; }
.ranking ol { list-style: none; }
.ranking li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--panel-2);
  font-size: 14px;
}
.ranking li:last-child { border-bottom: none; }
.ranking .pos { width: 28px; color: var(--muted); font-weight: 700; }
.ranking li:nth-child(1) .pos { color: #ffd23f; }
.ranking li:nth-child(2) .pos { color: #cfd6e4; }
.ranking li:nth-child(3) .pos { color: #e0955a; }
.ranking .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ranking .val { font-weight: 700; color: var(--accent); }
.ranking .empty { color: var(--muted); font-size: 14px; padding: 8px 0; }

footer.site {
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  padding: 24px 0 40px;
  border-top: 2px solid var(--panel-2);
}

/* Celular / app instalado */
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
header.site { padding-top: env(safe-area-inset-top); }
footer.site { padding-bottom: calc(env(safe-area-inset-bottom) + 8px); }
button, .btn, .lv, .card { touch-action: manipulation; }
.btn, .lv { min-height: 44px; }

.section-title { font-size: 14px; color: var(--accent); margin: 36px 0 16px; }

/* Destaque: jogos do dia */
.destaque .section-title { margin-top: 8px; }
.dia-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.dia-card { position: relative; display: block; padding: 24px 22px; border-radius: var(--radius); border: 2px solid var(--accent); background: linear-gradient(135deg, var(--panel) 0%, #2a2150 100%); text-decoration: none; color: inherit; transition: transform .15s, box-shadow .15s; }
.dia-card:hover { transform: translateY(-4px); box-shadow: 0 8px 28px rgba(255, 213, 79, .18); }
.dia-card.comex { border-color: #6fd6ff; }
.dia-card .emoji { font-size: 44px; margin-bottom: 10px; }
.dia-card h2 { font-size: 15px; color: var(--accent); margin-bottom: 8px; }
.dia-card p { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.dia-badge { position: absolute; top: 12px; right: 12px; font-size: 8px; background: var(--accent); color: #1b1530; padding: 5px 7px; border-radius: 6px; }
.dia-seq { display: block; min-height: 18px; color: #ffb98a; font-size: 13px; margin-bottom: 8px; }
.dia-tag { display: inline-block; font-size: 11px; color: #1b1530; background: var(--accent); padding: 9px 12px; border-radius: 10px; }
.dia-card.feito { opacity: .85; }
.dia-card.feito .dia-tag { background: #3fae5a; color: #fff; }
