/* CodyCross Respostas - Estilos globais */
:root {
  --roxo: #6C5CE7;
  --roxo-escuro: #5849c4;
  --roxo-claro: #f3f1ff;
  --verde: #00B894;
  --verde-escuro: #00997a;
  --texto: #1a1a2e;
  --texto-suave: #5a5a73;
  --borda: #e8e8ef;
  --fundo: #ffffff;
  --fundo-suave: #f9f9fc;
  --amarelo: #ffeaa7;
  --sombra: 0 1px 3px rgba(20, 20, 40, .06), 0 1px 2px rgba(20, 20, 40, .04);
  --sombra-m: 0 4px 16px rgba(20, 20, 40, .08);
  --radius: 12px;
  --radius-s: 8px;
  --max: 960px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--texto);
  background: var(--fundo);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 70px; /* espaço para banner fixo mobile */
}

a { color: var(--roxo); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-weight: 700; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(24px, 5vw, 34px); }
h2 { font-size: clamp(20px, 3.5vw, 24px); }
h3 { font-size: 17px; }
p { margin: 0 0 1em; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------- Header ---------- */
.topbar {
  background: var(--roxo);
  color: #fff;
  padding: 14px 0;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(108, 92, 231, .15);
}
.topbar .container { display: flex; align-items: center; gap: 16px; }
.logo {
  display: flex; align-items: center; gap: 10px;
  color: #fff; font-weight: 700; font-size: 18px;
  text-decoration: none;
}
.logo:hover { text-decoration: none; opacity: .9; }
.logo-mark {
  width: 32px; height: 32px;
  background: #fff; color: var(--roxo);
  border-radius: 8px; display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.nav-links { margin-left: auto; display: flex; gap: 18px; }
.nav-links a { color: #fff; font-size: 14px; opacity: .9; }
.nav-links a:hover { opacity: 1; text-decoration: none; }

@media (max-width: 600px) {
  .nav-links { display: none; }
}

/* ---------- Search ---------- */
.search-hero { padding: 28px 0 8px; }
.search-hero h1 { text-align: center; margin-bottom: 6px; }
.search-hero .sub { text-align: center; color: var(--texto-suave); margin-bottom: 20px; font-size: 15px; }

.search-box {
  position: relative;
  max-width: 640px;
  margin: 0 auto 8px;
}
.search-box input {
  width: 100%;
  padding: 16px 18px 16px 50px;
  font-size: 17px;
  font-family: inherit;
  border: 2px solid var(--borda);
  border-radius: var(--radius);
  background: #fff;
  color: var(--texto);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search-box input:focus {
  border-color: var(--roxo);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, .12);
}
.search-box::before {
  content: "";
  position: absolute;
  left: 18px; top: 50%;
  width: 20px; height: 20px;
  transform: translateY(-50%);
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235a5a73' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m21 21-4.3-4.3'/></svg>") no-repeat center/contain;
  pointer-events: none;
}
.search-hint { text-align: center; font-size: 13px; color: var(--texto-suave); margin-top: 6px; }

.search-results {
  max-width: 640px; margin: 12px auto 0;
  background: #fff; border: 1px solid var(--borda); border-radius: var(--radius);
  box-shadow: var(--sombra-m);
  max-height: 400px; overflow-y: auto;
  display: none;
}
.search-results.active { display: block; }
.search-results .item {
  display: block;
  padding: 12px 16px;
  border-bottom: 1px solid var(--borda);
  color: var(--texto);
}
.search-results .item:last-child { border-bottom: 0; }
.search-results .item:hover { background: var(--roxo-claro); text-decoration: none; }
.search-results .item .clue { font-weight: 500; }
.search-results .item .answer { color: var(--verde-escuro); font-weight: 600; font-size: 14px; margin-left: 8px; }
.search-results .empty { padding: 20px; text-align: center; color: var(--texto-suave); font-size: 14px; }

/* ---------- Ads ---------- */
.ad-slot {
  margin: 20px auto;
  border: 2px dashed #cbc9dd;
  background: #fafaff;
  color: #888;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  font-weight: 600;
  border-radius: 6px;
}
.ad-leaderboard { max-width: 728px; height: 90px; }
.ad-rect { max-width: 300px; height: 250px; margin: 24px auto; }
.ad-mobile-fixed {
  position: fixed; bottom: 0; left: 0; right: 0;
  max-width: 320px; height: 50px; margin: 0 auto;
  background: #fafaff;
  z-index: 40;
  border-radius: 0;
  border-left: 0; border-right: 0; border-bottom: 0;
}

@media (max-width: 768px) {
  .ad-leaderboard { height: 60px; }
}

/* ---------- Worlds grid ---------- */
.section-title {
  margin-top: 36px;
  margin-bottom: 16px;
  font-size: 20px;
}

.worlds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}
.world-card {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  padding: 18px 16px;
  text-decoration: none;
  color: var(--texto);
  transition: transform .15s, box-shadow .15s, border-color .15s;
  display: flex; align-items: center; gap: 12px;
  min-height: 64px;
}
.world-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sombra-m);
  border-color: var(--roxo);
  text-decoration: none;
}
.world-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: grid; place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}
.world-card .name { font-weight: 600; font-size: 15px; }
.world-card .meta { font-size: 12px; color: var(--texto-suave); margin-top: 2px; }

/* ---------- Breadcrumbs ---------- */
.breadcrumbs {
  font-size: 13px;
  color: var(--texto-suave);
  padding: 14px 0 0;
  display: flex; flex-wrap: wrap; gap: 6px;
}
.breadcrumbs a { color: var(--texto-suave); }
.breadcrumbs a:hover { color: var(--roxo); }
.breadcrumbs .sep { opacity: .5; }
.breadcrumbs .current { color: var(--texto); font-weight: 500; }

/* ---------- Answer page ---------- */
.answer-hero {
  margin: 20px 0 24px;
  background: linear-gradient(135deg, var(--verde) 0%, #00d4a8 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: 0 6px 20px rgba(0, 184, 148, .25);
  text-align: center;
}
.answer-hero .label {
  font-size: 12px; text-transform: uppercase; letter-spacing: .15em;
  opacity: .85; font-weight: 600;
}
.answer-hero .clue {
  font-size: clamp(16px, 3vw, 19px);
  margin: 10px 0 14px;
  opacity: .95;
  font-weight: 400;
}
.answer-hero .answer {
  font-size: clamp(30px, 7vw, 48px);
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.answer-hero .meta {
  margin-top: 12px;
  font-size: 13px;
  opacity: .9;
}
.answer-hero .meta a { color: #fff; text-decoration: underline; }

/* ---------- Clue lists ---------- */
.phase-block { margin-top: 28px; }
.phase-header {
  background: var(--roxo-claro);
  color: var(--roxo);
  padding: 10px 14px;
  border-radius: var(--radius-s);
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px;
}
.phase-header .num {
  background: var(--roxo); color: #fff;
  width: 24px; height: 24px; border-radius: 6px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
}

.clue-list {
  list-style: none;
  margin: 0; padding: 0;
  border: 1px solid var(--borda);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.clue-list li {
  border-bottom: 1px solid var(--borda);
}
.clue-list li:last-child { border-bottom: 0; }
.clue-list a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px;
  color: var(--texto);
  gap: 12px;
  min-height: 48px;
}
.clue-list a:hover { background: var(--fundo-suave); text-decoration: none; }
.clue-list .clue-text { flex: 1; font-size: 15px; }
.clue-list .clue-answer {
  color: var(--verde-escuro);
  font-weight: 700;
  letter-spacing: .05em;
  font-size: 13px;
  background: #e8fff7;
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}
.clue-list .arrow {
  color: var(--texto-suave);
  font-size: 18px;
  flex-shrink: 0;
}

/* ---------- Pagination / nav ---------- */
.group-nav {
  display: flex; justify-content: space-between; gap: 10px;
  margin: 28px 0;
}
.group-nav a {
  flex: 1;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--radius-s);
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
}
.group-nav a:hover { border-color: var(--roxo); text-decoration: none; }
.group-nav a.disabled { opacity: .4; pointer-events: none; }
.group-nav .dir { color: var(--texto-suave); font-size: 12px; display: block; }

/* ---------- Footer ---------- */
footer {
  background: #1a1a2e;
  color: #c9c9d6;
  padding: 40px 0 24px;
  margin-top: 60px;
  font-size: 14px;
}
footer h3 {
  color: #fff;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 10px;
}
footer a { color: #c9c9d6; }
footer a:hover { color: #fff; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
}
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid ul li { margin-bottom: 6px; }
.footer-disclaimer {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid #2a2a45;
  font-size: 12px;
  color: #8888a0;
  text-align: center;
}
@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ---------- Groups grid (world page) ---------- */
.groups-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
  margin-top: 16px;
}
.group-chip {
  background: #fff;
  border: 1px solid var(--borda);
  border-radius: var(--radius-s);
  padding: 14px 8px;
  text-align: center;
  color: var(--texto);
  font-weight: 600;
  font-size: 13px;
  min-height: 48px;
  display: flex; align-items: center; justify-content: center;
}
.group-chip:hover { border-color: var(--roxo); background: var(--roxo-claro); text-decoration: none; }

/* ---------- Info sections ---------- */
.info-card {
  background: var(--fundo-suave);
  border-left: 3px solid var(--roxo);
  padding: 14px 16px;
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  margin: 20px 0;
  font-size: 14px;
  color: var(--texto-suave);
}
.info-card strong { color: var(--texto); }

/* Small utils */
.muted { color: var(--texto-suave); }
.center { text-align: center; }
.mt-8 { margin-top: 8px; }
.mt-24 { margin-top: 24px; }
