/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: #060a14;
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { display: block; max-width: 100%; }
a   { color: inherit; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); line-height: 1.2; }

/* ============================================================
   APP SHELL — mobile-only viewport
   ============================================================ */
.app-shell {
  width: 100%;
  max-width: var(--mobile-max);
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Sombra lateral em desktop */
@media (min-width: 431px) {
  .app-shell {
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.8);
  }
}

/* ============================================================
   CONTENT AREA
   ============================================================ */
.content-area {
  flex: 1;
  padding: var(--space-md);
  padding-bottom: calc(var(--bottom-nav-h) + var(--space-lg));
  overflow-y: auto;
}

.content-area--no-nav {
  padding-bottom: var(--space-lg);
}

/* ============================================================
   AUTH PAGES
   ============================================================ */
.auth-page {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding: var(--space-2xl) var(--space-lg) var(--space-lg);
  min-height: 100vh;
}

.auth-page__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  padding-top: var(--space-xl);
}

.auth-page__logo {
  width: 72px;
  height: 72px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-sm);
}

.auth-page__logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.auth-page__title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  color: var(--text);
  text-align: center;
}

.auth-page__subtitle {
  font-size: var(--text-sm);
  color: var(--muted2);
  text-align: center;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

/* ============================================================
   HOME / BOLÕES LIST
   ============================================================ */
.home-header {
  padding: var(--space-lg) var(--space-md) var(--space-md);
}

.home-header__greeting {
  font-size: var(--text-sm);
  color: var(--muted2);
}

.home-header__name {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  color: var(--text);
}

.bolao-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: border-color var(--transition), transform var(--transition);
  cursor: pointer;
}
.bolao-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.bolao-card:active { transform: translateY(0); }

.bolao-card__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-sm);
}
.bolao-card__thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  object-fit: cover;
  background: var(--surface2);
  flex-shrink: 0;
}
.bolao-card__info { flex: 1; min-width: 0; }
.bolao-card__name {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bolao-card__desc {
  font-size: var(--text-sm);
  color: var(--muted2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bolao-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-xs);
}

.bolao-card__pending {
  font-size: var(--text-sm);
  color: var(--accent);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   JOGO CARD (palpites)
   ============================================================ */
.jogo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition);
}
.jogo-card--salvo   { border-color: var(--green); }
.jogo-card--bloqueado { opacity: 0.7; }

.jogo-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}

.jogo-card__body {
  display: flex;
  align-items: center;
  padding: var(--space-md);
  gap: var(--space-sm);
}

.jogo-card__time {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
}
.jogo-card__escudo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.jogo-card__time-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  text-align: center;
}

.jogo-card__vs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  flex-shrink: 0;
}

.jogo-card__save-status {
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 36px;
}

/* ============================================================
   RANKING
   ============================================================ */
.podium {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-lg) var(--space-md) var(--space-md);
}
.podium__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-sm);
  max-width: 120px;
}
.podium__medal { font-size: 1.75rem; line-height: 1; }
.podium__bar {
  width: 100%;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: var(--space-sm);
  gap: var(--space-xs);
}
.podium__bar--1st { background: rgba(249,115,22,0.2); border: 1px solid rgba(249,115,22,0.4); height: 90px; }
.podium__bar--2nd { background: rgba(148,163,184,0.1); border: 1px solid var(--border); height: 70px; }
.podium__bar--3rd { background: rgba(148,163,184,0.07); border: 1px solid var(--border); height: 55px; }
.podium__name { font-size: var(--text-xs); color: var(--muted2); text-align: center; }
.podium__pts  { font-family: var(--font-display); font-weight: 800; color: var(--text); font-size: var(--text-md); }

.ranking-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.ranking-row--me   { background: rgba(249,115,22,0.06); }
.ranking-row__pos  { font-family: var(--font-display); font-weight: 800; font-size: var(--text-lg); color: var(--muted); min-width: 24px; text-align: center; }
.ranking-row__info { flex: 1; min-width: 0; }
.ranking-row__name { font-weight: 600; color: var(--text); }
.ranking-row__sub  { font-size: var(--text-xs); color: var(--muted2); }
.ranking-row__pts  { font-family: var(--font-display); font-weight: 800; color: var(--accent); font-size: var(--text-xl); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes slideInRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.15); }
}
@keyframes pointsPopIn {
  0%   { opacity: 0; transform: scale(0.5); }
  70%  { transform: scale(1.2); }
  100% { opacity: 1; transform: scale(1); }
}

.animate-fade-in-up { animation: fadeInUp 0.35s ease both; }
.animate-slide-in   { animation: slideInRight 0.3s ease both; }
.animate-pulse      { animation: pulse 0.6s ease; }
.stagger > * { animation: fadeInUp 0.35s ease both; }
.stagger > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger > *:nth-child(2)  { animation-delay: 0.10s; }
.stagger > *:nth-child(3)  { animation-delay: 0.15s; }
.stagger > *:nth-child(4)  { animation-delay: 0.20s; }
.stagger > *:nth-child(5)  { animation-delay: 0.25s; }
.stagger > *:nth-child(6)  { animation-delay: 0.30s; }
.stagger > *:nth-child(n+7){ animation-delay: 0.35s; }

/* ============================================================
   ADDITIONAL JOGO CARD VARIANTS
   ============================================================ */
.jogo-card--palpitado { border-color: var(--green); }
.jogo-card__placar {
  display: flex;
  align-items: center;
  padding: var(--space-md);
  gap: var(--space-sm);
}
.jogo-card__time--right { align-items: center; }
.jogo-card__nome  { font-size: var(--text-sm); font-weight: 600; color: var(--text); text-align: center; }
.jogo-card__hora  { font-size: var(--text-xs); color: var(--muted2); }
.jogo-card__resultado { font-family: var(--font-display); font-weight: 800; font-size: var(--text-xl); color: var(--accent); }
.jogo-card__centro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.jogo-card__input {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border);
}
.jogo-card__feedback {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
}
.jogo-card__meu-palpite { color: var(--muted2); }
.jogo-card__status { display: flex; align-items: center; flex-shrink: 0; }

/* Ranking aliases */
.ranking-row__nome { font-weight: 600; color: var(--text); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Podium extras */
.podium__nome { font-size: var(--text-xs); color: var(--muted2); text-align: center; }
.podium__pts  { font-family: var(--font-display); font-weight: 800; color: var(--text); font-size: var(--text-md); }
.podium__item--winner .avatar { box-shadow: 0 0 0 3px var(--accent); }
