/* TerraZoo — Campanha Palpite Copa do Mundo */

:root {
  --tz-green:      #1a5c2a;
  --tz-green-mid:  #2e7d3a;
  --tz-green-light:#a8d5a2;
  --tz-green-pale: #e8f5e9;
  --tz-gold:       #f5a623;
  --tz-gold-light: #fff8e1;
  --tz-white:      #ffffff;
  --tz-gray:       #f2f4f3;
  --tz-text:       #1a1a1a;
  --tz-muted:      #666666;
  --tz-danger:     #c0392b;
  --tz-radius:     14px;
  --tz-radius-sm:  8px;
  --tz-shadow:     0 2px 16px rgba(0,0,0,0.08);
  --tz-shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--tz-gray);
  color: var(--tz-text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ────────────────────────────────────────────────────── */
.tz-page {
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

/* ─── Header ────────────────────────────────────────────────────── */
.tz-header {
  text-align: center;
  padding: 36px 24px 28px;
  background: linear-gradient(160deg, #1e6b30 0%, #0f3d1a 100%);
  border-radius: var(--tz-radius);
  margin-bottom: 16px;
  box-shadow: var(--tz-shadow-lg);
  position: relative;
  overflow: hidden;
}

.tz-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 80% 20%, rgba(255,255,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}

.tz-header__eyebrow {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--tz-green-light);
  margin-bottom: 12px;
}

.tz-header__trophy {
  font-size: 52px;
  margin-bottom: 12px;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.3));
}

.tz-header__title {
  font-size: 27px;
  font-weight: 800;
  color: var(--tz-white);
  line-height: 1.2;
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.tz-header__sub {
  font-size: 14px;
  color: rgba(255,255,255,0.70);
  line-height: 1.4;
}

/* ─── Card ──────────────────────────────────────────────────────── */
.tz-card {
  background: var(--tz-white);
  border-radius: var(--tz-radius);
  padding: 22px 20px;
  margin-bottom: 14px;
  box-shadow: var(--tz-shadow);
}

.tz-card--muted {
  background: #fafafa;
  border: 1px solid #ebebeb;
  box-shadow: none;
}

.tz-card__title {
  font-size: 14px;
  font-weight: 700;
  color: var(--tz-green);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 7px;
  letter-spacing: -0.1px;
}

.tz-card__hint {
  font-size: 13px;
  color: var(--tz-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ─── Steps ─────────────────────────────────────────────────────── */
.tz-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 20px;
}

.tz-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 0 0 18px;
  position: relative;
}

.tz-step:last-child { padding-bottom: 0; }

.tz-step:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background: var(--tz-green-pale);
}

.tz-step__badge {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tz-green);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(26,92,42,0.30);
}

.tz-step__content {
  padding-top: 4px;
}

.tz-step__label {
  font-size: 13px;
  font-weight: 700;
  color: var(--tz-text);
  margin-bottom: 2px;
}

.tz-step__text {
  font-size: 13px;
  line-height: 1.5;
  color: var(--tz-muted);
}

/* ─── Prizes ────────────────────────────────────────────────────── */
.tz-prizes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tz-prize {
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: var(--tz-radius-sm);
  padding: 14px 16px;
}

.tz-prize--gold {
  background: var(--tz-gold-light);
  border: 1px solid #ffe082;
}

.tz-prize--silver {
  background: var(--tz-green-pale);
  border: 1px solid #c8e6c9;
}

.tz-prize__icon {
  font-size: 28px;
  flex-shrink: 0;
}

.tz-prize__title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--tz-muted);
  margin-bottom: 2px;
}

.tz-prize__value {
  font-size: 14px;
  font-weight: 700;
  color: var(--tz-text);
  line-height: 1.3;
}

.tz-prize__limit {
  font-size: 12px;
  font-weight: 400;
  color: var(--tz-muted);
}

/* ─── Stats ─────────────────────────────────────────────────────── */
.stats-jogo {
  font-size: 14px;
  font-weight: 700;
  color: var(--tz-green);
  background: var(--tz-green-pale);
  border-radius: var(--tz-radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
  border: 1px solid #c8e6c9;
}

.stats-header {
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--tz-muted);
}

.stats-total {
  font-weight: 600;
  color: var(--tz-text);
}

.stats-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.stats-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats-label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 150px;
}

.stats-prediction {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: 155px;
}

.stats-prediction__score {
  font-size: 14px;
  font-weight: 800;
  color: var(--tz-green);
  font-family: 'Courier New', monospace;
  letter-spacing: 1px;
  min-width: 42px;
}

.stats-prediction__sep {
  color: #ccc;
  font-size: 12px;
}

.stats-prediction__flag {
  font-size: 16px;
  line-height: 1;
}

.stats-prediction__team {
  font-size: 12px;
  font-weight: 600;
  color: var(--tz-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 72px;
}

.stats-flag { font-size: 18px; }

.stats-team {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.stats-bar-track {
  flex: 1;
  background: var(--tz-green-pale);
  border-radius: 99px;
  height: 9px;
  overflow: hidden;
}

.stats-bar-fill {
  height: 100%;
  border-radius: 99px;
  width: 0%;
}

.stats-pct {
  font-size: 12px;
  font-weight: 700;
  color: var(--tz-muted);
  min-width: 36px;
  text-align: right;
}

.stats-tip {
  background: var(--tz-gold-light);
  border-left: 3px solid var(--tz-gold);
  border-radius: var(--tz-radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #555;
}

.stats-tip-icon { margin-right: 4px; }

/* ─── Formulário de código ──────────────────────────────────────── */
.tz-input-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tz-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--tz-muted);
}

.tz-input {
  width: 100%;
  padding: 16px;
  border: 2px solid #e0e0e0;
  border-radius: var(--tz-radius-sm);
  font-size: 22px;
  font-family: 'Courier New', monospace;
  font-weight: 700;
  letter-spacing: 6px;
  text-align: center;
  text-transform: uppercase;
  color: var(--tz-green);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
}

.tz-input:focus {
  border-color: var(--tz-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,92,42,0.10);
}

.tz-input::placeholder {
  color: #ccc;
  letter-spacing: 3px;
  font-weight: 400;
  font-size: 18px;
}

/* ─── Botões ────────────────────────────────────────────────────── */
.tz-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--tz-radius-sm);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
  text-align: center;
  letter-spacing: -0.1px;
}

.tz-btn:hover:not(:disabled) { opacity: 0.92; box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.tz-btn:active:not(:disabled) { transform: scale(0.98); }
.tz-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.tz-btn__arrow {
  font-size: 16px;
  transition: transform 0.2s;
}
.tz-btn:hover:not(:disabled) .tz-btn__arrow { transform: translateX(3px); }

.tz-btn--primary {
  background: var(--tz-green);
  color: var(--tz-white);
  box-shadow: 0 2px 8px rgba(26,92,42,0.25);
}

.tz-btn--gold {
  background: var(--tz-gold);
  color: var(--tz-text);
  box-shadow: 0 2px 8px rgba(245,166,35,0.30);
}

/* ─── Mensagens de erro ─────────────────────────────────────────── */
.tz-error {
  display: none;
  color: var(--tz-danger);
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  background: #fdecea;
  border-radius: var(--tz-radius-sm);
  border-left: 3px solid var(--tz-danger);
}

/* ─── Regulamento ───────────────────────────────────────────────── */
.tz-rules__toggle {
  font-size: 13px;
  font-weight: 600;
  color: var(--tz-green);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  user-select: none;
  padding: 2px 0;
}

.tz-rules__toggle::-webkit-details-marker { display: none; }

.tz-rules__toggle::before {
  content: '▶';
  font-size: 8px;
  transition: transform 0.2s;
  display: inline-block;
  opacity: 0.7;
}

details[open] .tz-rules__toggle::before {
  transform: rotate(90deg);
}

.tz-rules__body {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid #ebebeb;
  padding-top: 16px;
}

.tz-rules__body h3 {
  font-size: 12px;
  font-weight: 700;
  color: var(--tz-green);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 10px;
  margin-bottom: 3px;
}

.tz-rules__body h3:first-child { margin-top: 0; }

.tz-rules__body p,
.tz-rules__body li {
  font-size: 13px;
  line-height: 1.65;
  color: #555;
}

.tz-rules__body ul {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tz-rules__body a {
  color: var(--tz-green);
  text-decoration: underline;
}

/* ─── Código display (tela palpite) ────────────────────────────── */
.tz-code-display {
  text-align: center;
  padding: 14px 16px;
  background: var(--tz-green-pale);
  border-radius: var(--tz-radius-sm);
  margin-bottom: 20px;
  border: 1px solid #c8e6c9;
}

.tz-code-display__label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 700;
  color: var(--tz-muted);
  margin-bottom: 4px;
}

.tz-code-display__code {
  font-size: 26px;
  font-weight: 800;
  font-family: 'Courier New', monospace;
  letter-spacing: 5px;
  color: var(--tz-green);
}

/* ─── Input datalist (jogo e campeão) ──────────────────────────── */
.tz-input-text {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid #e0e0e0;
  border-radius: var(--tz-radius-sm);
  font-size: 14px;
  color: var(--tz-text);
  outline: none;
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}

.tz-input-text:focus {
  border-color: var(--tz-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,92,42,0.10);
}

.tz-input-text::placeholder { color: #bbb; }

/* ─── Select / inputs do formulário de palpite ──────────────────── */
.tz-select {
  width: 100%;
  padding: 13px 14px;
  border: 2px solid #e0e0e0;
  border-radius: var(--tz-radius-sm);
  font-size: 14px;
  color: var(--tz-text);
  outline: none;
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.tz-select:focus {
  border-color: var(--tz-green);
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(26,92,42,0.10);
}

.tz-placar {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
}

.tz-placar__input {
  width: 80px;
  padding: 14px;
  border: 2px solid #e0e0e0;
  border-radius: var(--tz-radius-sm);
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  background: #fafafa;
  color: var(--tz-green);
  -moz-appearance: textfield;
}

.tz-placar__input::-webkit-outer-spin-button,
.tz-placar__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.tz-placar__input:focus {
  border-color: var(--tz-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,92,42,0.10);
}

.tz-placar__sep { font-size: 26px; font-weight: 800; color: #ccc; }

/* ─── Tela de sucesso ───────────────────────────────────────────── */
.tz-success {
  text-align: center;
  padding: 28px 8px;
}

.tz-success__icon {
  font-size: 72px;
  margin-bottom: 16px;
  display: block;
  animation: tz-pop 0.4s ease;
}

@keyframes tz-pop {
  0%   { transform: scale(0.6); opacity: 0; }
  70%  { transform: scale(1.1); }
  100% { transform: scale(1);   opacity: 1; }
}

.tz-success__title {
  font-size: 26px;
  font-weight: 800;
  color: var(--tz-green);
  margin-bottom: 8px;
  letter-spacing: -0.3px;
}

.tz-success__sub {
  font-size: 15px;
  color: var(--tz-muted);
  line-height: 1.6;
  margin-bottom: 24px;
}

.tz-success__palpite {
  background: var(--tz-green-pale);
  border-radius: var(--tz-radius-sm);
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--tz-green);
  margin-bottom: 24px;
  border: 1px solid #c8e6c9;
}

/* ─── Footer ────────────────────────────────────────────────────── */
.tz-footer {
  text-align: center;
  margin-top: 8px;
  padding: 0 16px 8px;
}

.tz-footer p {
  font-size: 11px;
  color: #aaa;
  letter-spacing: 0.3px;
}

/* ─── Utilitários ───────────────────────────────────────────────── */
.hidden { display: none !important; }

.tz-form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.tz-divider {
  height: 1px;
  background: #e0e0e0;
  margin: 20px 0;
}

/* Mantido para compatibilidade com palpite.html */
.tz-prize__row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.4;
  margin-bottom: 8px;
}
.tz-prize__row:last-child { margin-bottom: 0; }
.tz-prize__text--highlight { color: var(--tz-green); font-weight: 700; }

/* ─── Autocomplete customizado ──────────────────────────────────── */
.tz-ac {
  position: relative;
}

.tz-ac__input {
  width: 100%;
  padding: 13px 44px 13px 14px;
  border: 2px solid #e0e0e0;
  border-radius: var(--tz-radius-sm);
  font-size: 14px;
  color: var(--tz-text);
  outline: none;
  background: #fafafa;
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
  cursor: pointer;
}

.tz-ac__input:focus {
  border-color: var(--tz-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,92,42,0.10);
  cursor: text;
}

.tz-ac__input::placeholder { color: #bbb; }

.tz-ac__chevron {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #aaa;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.22s ease, color 0.15s;
  border-radius: 4px;
  line-height: 0;
}

.tz-ac__chevron:hover { color: var(--tz-green); }

.tz-ac__chevron.is-open {
  transform: translateY(-50%) rotate(180deg);
  color: var(--tz-green);
}

.tz-ac__list {
  display: none;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  background: #fff;
  border-radius: var(--tz-radius-sm);
  box-shadow: 0 8px 28px rgba(0,0,0,0.13), 0 2px 8px rgba(0,0,0,0.06);
  border: 1px solid #e4e4e4;
  max-height: 228px;
  overflow-y: auto;
  z-index: 100;
  list-style: none;
  padding: 4px 0;
  scroll-behavior: smooth;
}

.tz-ac__list.is-open { display: block; animation: tz-ac-open 0.15s ease; }

@keyframes tz-ac-open {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.tz-ac__item {
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
  color: var(--tz-text);
  transition: background 0.1s;
  display: flex;
  align-items: center;
  gap: 9px;
  user-select: none;
}

.tz-ac__item:hover,
.tz-ac__item.is-active {
  background: var(--tz-green-pale);
  color: var(--tz-green);
  font-weight: 600;
}

.tz-ac__item-icon {
  font-size: 17px;
  flex-shrink: 0;
  line-height: 1;
  width: 22px;
  text-align: center;
}

.tz-ac__item-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tz-ac__empty {
  padding: 14px;
  font-size: 13px;
  color: var(--tz-muted);
  text-align: center;
}

.tz-ac__list::-webkit-scrollbar { width: 4px; }
.tz-ac__list::-webkit-scrollbar-track { background: transparent; }
.tz-ac__list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 99px; }

/* ─── Tela bloqueada ────────────────────────────────────────────── */
.tz-success__title--danger { color: var(--tz-danger) !important; }
