/* Import modern fonts from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;600;800;900&display=swap');

:root {
  --bg-body: #06090c;
  --bg-panel: #0d1217;
  --bg-card: rgba(18, 26, 35, 0.75);
  --bg-card-hover: rgba(23, 34, 46, 0.9);
  --bg-input: #121920;
  
  --color-primary: #00e676; /* Neon Green */
  --color-primary-glow: rgba(0, 230, 118, 0.35);
  --color-secondary: #ffd700; /* Gold */
  --color-accent: #00b0ff; /* Electric Blue */
  --color-danger: #ff3d00; /* Neon Red */
  
  --text-main: #f5f7fa;
  --text-muted: #8e9cae;
  --text-dark: #06090c;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-neon: rgba(0, 230, 118, 0.35);
  --border-radius-lg: 16px;
  --border-radius-md: 10px;
  --border-radius-sm: 6px;
  
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
  --shadow-neon: 0 0 15px rgba(0, 230, 118, 0.2);
  --shadow-neon-strong: 0 0 30px rgba(0, 230, 118, 0.5);
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--bg-body);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  background-image:
    linear-gradient(rgba(6, 9, 12, 0.66), rgba(6, 9, 12, 0.9)),
    url('/api/imagem-site'),
    linear-gradient(180deg, rgba(0, 230, 118, 0.04) 0%, transparent 260px),
    radial-gradient(circle at 10% 20%, rgba(0, 230, 118, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 88% 24%, rgba(255, 215, 0, 0.04) 0%, transparent 34%),
    radial-gradient(circle at 90% 80%, rgba(0, 176, 255, 0.04) 0%, transparent 40%);
  background-size: cover, cover, auto, auto, auto, auto;
  background-position: center, center, center, center, center, center;
  background-attachment: fixed, fixed, scroll, scroll, scroll, scroll;
}

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

button,
input,
select,
textarea {
  font-family: inherit;
  max-width: 100%;
}

img,
svg {
  max-width: 100%;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-body);
}
::-webkit-scrollbar-thumb {
  background: #1a242f;
  border-radius: var(--border-radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* Typography Helpers */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 800;
  letter-spacing: 0;
}

.text-gradient {
  background: linear-gradient(135deg, #ffffff 0%, var(--color-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Header & Navigation */
header {
  background-color: var(--bg-panel);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 2rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-width: 0;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.logo-badge {
  background: var(--color-primary);
  color: var(--text-dark);
  padding: 0.35rem 0.75rem;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.2rem;
  box-shadow: var(--shadow-neon);
  animation: pulse-glow 2s infinite alternate;
}

.logo-text {
  font-size: 1.5rem;
  font-family: var(--font-title);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.btn-nav-admin {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.9rem;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.btn-nav-admin:hover {
  color: var(--color-primary);
}

/* Banner Principal */
.banner {
  background:
    linear-gradient(180deg, rgba(6, 9, 12, 0.28) 0%, rgba(6, 9, 12, 0.9) 100%),
    linear-gradient(135deg, rgba(0, 230, 118, 0.1) 0%, rgba(2, 12, 20, 0.32) 48%, rgba(0, 176, 255, 0.08) 100%),
    url('/api/imagem-site');
  background-size: cover, cover, cover;
  background-position: center, center, center 22%;
  border-bottom: 1px solid var(--border-neon);
  padding: 5.5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(circle at center, rgba(0, 230, 118, 0.15) 0%, transparent 60%);
  pointer-events: none;
}

.banner::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -150px;
  width: min(920px, 90vw);
  height: 300px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse at center, rgba(0, 230, 118, 0.18), transparent 68%);
  pointer-events: none;
}

.banner-content {
  max-width: 1080px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.banner h1 {
  font-size: clamp(3rem, 6vw, 5.8rem);
  margin-bottom: 1rem;
  line-height: 1.1;
  text-transform: uppercase;
  text-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

.banner p {
  color: #bdc8d5;
  font-size: 1.2rem;
  margin-bottom: 1.25rem;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.45;
}

.bet-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  padding: 0.5rem 1.25rem;
  border-radius: 50px;
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-neon);
}

.hero-flag-ribbon {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(6, 9, 12, 0.56);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

.hero-flag-ribbon img,
.section-flags img {
  width: 38px;
  height: 26px;
  border-radius: 5px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.hero-stats span {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 0.55rem 0.9rem;
}

.hero-stats strong {
  color: var(--color-secondary);
}

/* Main Container */
.main-container {
  max-width: 1200px;
  margin: clamp(1.25rem, 4vw, 2rem) auto;
  padding: 0 clamp(1rem, 4vw, 1.5rem);
  flex: 1;
  width: 100%;
}

.admin-main-container {
  margin: clamp(1.25rem, 4vw, 2rem) auto;
}

/* Seções */
section {
  margin-bottom: 3.5rem;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-kicker {
  color: var(--color-accent);
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
}

.section-title {
  font-size: 1.8rem;
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  padding-left: 1rem;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 4px;
  background: var(--color-primary);
  border-radius: 2px;
  box-shadow: var(--shadow-neon);
}

.section-flags {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: 0.45rem;
}

/* Grid de Jogos */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: 1.5rem;
}

/* Game Card */
.game-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
}

.game-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transition: var(--transition);
}

.game-card:hover {
  background: var(--bg-card-hover);
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
}

.game-card.active:hover {
  border-color: var(--border-neon);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(0, 230, 118, 0.1);
}

.game-card.active::after {
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
}

.game-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
}

.campeonato-badge {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius-sm);
  letter-spacing: 0.05em;
}

.status-badge {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
}

.status-badge.aberto {
  color: var(--color-primary);
}
.status-badge.aberto .status-dot {
  background-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary);
  animation: pulse-dot 1.5s infinite;
}

.status-badge.encerrado {
  color: var(--color-danger);
}
.status-badge.encerrado .status-dot {
  background-color: var(--color-danger);
}

/* Match UI (Teams & score inputs) */
.match-teams {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.team {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.team-badge {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.3rem;
  color: #fff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.15);
  margin-bottom: 0.25rem;
  border: 2px solid rgba(255, 255, 255, 0.08);
  transition: var(--transition);
}

.game-card:hover .team-badge {
  transform: scale(1.1) rotate(6deg);
  box-shadow: var(--shadow-neon);
  border-color: rgba(0, 230, 118, 0.4);
}

.team-badge-flag {
  width: 78px;
  height: 54px;
  border-radius: var(--border-radius-md);
  background: #fff;
  padding: 0.25rem;
  overflow: hidden;
}

.team-badge-flag img {
  width: 100%;
  height: 100%;
  border-radius: calc(var(--border-radius-md) - 3px);
  object-fit: cover;
  display: block;
}

.game-card:hover .team-badge-flag {
  transform: scale(1.05);
}

.team-name {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.05rem;
  color: #fff;
  margin-top: 0.45rem;
  word-break: break-word;
  line-height: 1.15;
}

.vs-or-inputs {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.score-inputs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.score-input {
  width: 44px;
  height: 44px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--border-radius-md);
  text-align: center;
  font-family: var(--font-title);
  font-size: 1.3rem;
  font-weight: 800;
  transition: var(--transition);
}

.score-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-neon);
}

.score-input:disabled {
  background-color: transparent;
  border-color: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
}

.vs-divider {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
}

.match-date-time {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.05);
  padding-top: 0.75rem;
}

/* Button Bet */
.btn-bet {
  width: 100%;
  background: linear-gradient(135deg, var(--color-primary) 0%, #00c853 100%);
  color: var(--text-dark);
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1rem;
  padding: 0.85rem;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 230, 118, 0.15);
}

.btn-bet:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-neon-strong);
  filter: brightness(1.1);
}

.btn-bet:active {
  transform: translateY(0);
}

.btn-bet:disabled {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* Score display in ended games */
.score-result-badge {
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid var(--color-secondary);
  color: var(--color-secondary);
  padding: 0.4rem 1rem;
  border-radius: 50px;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  font-family: var(--font-title);
  margin: 0.5rem 0;
}

/* Layout de Duas Colunas (Ranking e Histórico) */
.layout-split {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .layout-split {
    grid-template-columns: 1fr;
  }
}

/* List Panel */
.list-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
}

.panel-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Participant List Items */
.items-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.item-row {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 0.9rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
}

.item-row:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
}

.item-row.won {
  border-color: var(--color-secondary);
  background: rgba(255, 215, 0, 0.03);
}

.item-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.item-name {
  font-weight: 700;
  color: #fff;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.item-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.item-badge-win {
  background: linear-gradient(135deg, var(--color-secondary) 0%, #ff8f00 100%);
  color: var(--text-dark);
  font-weight: 900;
  font-size: 0.7rem;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: var(--border-radius-sm);
  display: inline-block;
  margin-top: 0.25rem;
  letter-spacing: 0.05em;
}

.item-guess {
  font-family: var(--font-title);
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--color-primary);
  background: rgba(0, 230, 118, 0.05);
  padding: 0.35rem 0.75rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(0, 230, 118, 0.15);
}

.item-row.won .item-guess {
  color: var(--color-secondary);
  background: rgba(255, 215, 0, 0.05);
  border-color: rgba(255, 215, 0, 0.2);
}

.empty-state {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  padding: 1.5rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background-color: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.4rem;
}

.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  transition: var(--transition);
}
.btn-close-modal:hover {
  color: #fff;
}

.modal-body {
  padding: 1.5rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.form-control {
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  color: #fff;
  border-radius: var(--border-radius-md);
  padding: 0.85rem 1rem;
  font-size: 0.95rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: var(--shadow-neon);
}

/* Pix checkout styles */
.pix-checkout-box {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1.5rem;
}

.pix-price-badge {
  display: inline-block;
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  font-size: 1.8rem;
  font-family: var(--font-title);
  font-weight: 900;
  padding: 0.5rem 1.5rem;
  border-radius: var(--border-radius-md);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-neon);
}

.pix-qr-box {
  background: #fff;
  width: 160px;
  height: 160px;
  margin: 1.25rem auto;
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.75rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  color: #111;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}

.pix-qr-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pix-receiver-name {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
  word-break: break-word;
}

.pix-receiver-name strong {
  color: #fff;
}

.pix-key-container {
  display: flex;
  margin-top: 1rem;
  min-width: 0;
}

.pix-key-input {
  flex: 1;
  min-width: 0;
  background: var(--bg-body);
  border: 1px solid var(--border-color);
  border-right: none;
  color: var(--color-primary);
  font-weight: 600;
  font-family: monospace;
  padding: 0.75rem;
  border-radius: var(--border-radius-md) 0 0 var(--border-radius-md);
  text-align: center;
}

.btn-copy {
  background: var(--color-primary);
  color: var(--text-dark);
  border: none;
  padding: 0 1.25rem;
  border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}
.btn-copy:hover {
  background: #00c853;
}

/* Alerts / Toast Messages */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #111;
  border-left: 4px solid var(--color-primary);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  transform: translateY(100px);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  max-width: calc(100vw - 2rem);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.error {
  border-left-color: var(--color-danger);
}

/* --- ADMIN PANEL SPECIFIC STYLES --- */

/* Login Container */
.login-container {
  max-width: 400px;
  margin: 8rem auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.login-logo {
  text-align: center;
  margin-bottom: 2rem;
}

/* Dashboard Statistics Cards */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: var(--transition);
}

.stat-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.stat-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 1.8rem;
  font-family: var(--font-title);
  font-weight: 900;
  color: #fff;
}

.stat-card.accent .stat-value {
  color: var(--color-primary);
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.2);
}
.stat-card.revenue .stat-value {
  color: var(--color-secondary);
}

/* Payment settings */
.payment-settings-panel {
  margin-bottom: 2rem;
}

.payment-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 1.5rem;
  align-items: start;
}

.admin-page-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.form-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.form-grid-center {
  align-items: center;
}

.form-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

textarea.form-control {
  min-height: 112px;
  resize: vertical;
  line-height: 1.4;
}

.payment-preview-panel {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 1rem;
}

.admin-qr-preview {
  width: 180px;
  height: 180px;
  background: #fff;
  border-radius: var(--border-radius-md);
  margin: 0.75rem auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #111;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  padding: 0.75rem;
}

.admin-qr-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.payment-preview-copy {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  text-align: center;
  margin-bottom: 1rem;
  word-break: break-word;
}

.payment-preview-copy span {
  color: #fff;
  font-weight: 700;
}

.payment-preview-copy code {
  color: var(--color-primary);
  background: rgba(0, 230, 118, 0.06);
  border: 1px solid rgba(0, 230, 118, 0.15);
  border-radius: var(--border-radius-sm);
  padding: 0.45rem;
}

.payment-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.team-flags-admin {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.team-flag-field {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.team-flag-field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.team-flag-preview {
  width: 108px;
  height: 74px;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: #111;
  font-size: 0.8rem;
  font-weight: 800;
}

.team-flag-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.admin-team-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.admin-team-flag-thumb {
  width: 36px;
  height: 26px;
  border-radius: 4px;
  object-fit: cover;
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
}

.admin-team-flag-thumb.empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.04);
}

/* Admin Panels Flex/Grid Layout */
.admin-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

/* Admin Tables */
.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  margin-top: 1rem;
  max-width: 100%;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

th {
  background-color: rgba(255, 255, 255, 0.03);
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
  overflow-wrap: anywhere;
}

td code {
  white-space: normal;
  overflow-wrap: anywhere;
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background-color: rgba(255, 255, 255, 0.01);
}

/* Badges and action links inside tables */
.badge-correct {
  background: rgba(0, 230, 118, 0.15);
  color: var(--color-primary);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--border-radius-sm);
  border: 1px solid rgba(0, 230, 118, 0.3);
  display: inline-block;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.8rem;
  border-radius: var(--border-radius-sm);
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  margin: 0.12rem;
}

.btn-primary-sm {
  background: var(--color-primary);
  color: var(--text-dark);
}
.btn-primary-sm:hover {
  background: #00c853;
}

.btn-secondary-sm {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid var(--border-color);
}
.btn-secondary-sm:hover {
  background: rgba(255, 255, 255, 0.1);
}

.btn-danger-sm {
  background: rgba(255, 61, 0, 0.1);
  color: var(--color-danger);
  border: 1px solid rgba(255, 61, 0, 0.2);
}
.btn-danger-sm:hover {
  background: var(--color-danger);
  color: #fff;
}

.btn-gold-sm {
  background: rgba(255, 215, 0, 0.1);
  color: var(--color-secondary);
  border: 1px solid rgba(255, 215, 0, 0.2);
}
.btn-gold-sm.active {
  background: var(--color-secondary);
  color: var(--text-dark);
}
.btn-gold-sm:hover {
  background: var(--color-secondary);
  color: var(--text-dark);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.3);
}

/* Export and creation action block */
.actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.search-filters {
  display: flex;
  gap: 0.75rem;
  flex: 1;
  max-width: 600px;
}

.btn-action-main {
  background: linear-gradient(135deg, var(--color-primary) 0%, #00c853 100%);
  color: var(--text-dark);
  font-family: var(--font-title);
  font-weight: 800;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-action-main:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-neon);
}

.btn-action-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: #fff;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-action-secondary:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Footer styling */
footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  background-color: var(--bg-panel);
  padding: 2rem;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer strong {
  color: #fff;
}

/* Animations */
@keyframes pulse-glow {
  0% {
    box-shadow: 0 0 5px rgba(0, 230, 118, 0.2);
  }
  100% {
    box-shadow: 0 0 15px rgba(0, 230, 118, 0.6);
  }
}

@keyframes pulse-dot {
  0% {
    transform: scale(0.9);
    opacity: 0.6;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(0.9);
    opacity: 0.6;
  }
}

@media (max-width: 900px) {
  .payment-settings-grid {
    grid-template-columns: 1fr;
  }

  .admin-page-heading,
  .actions-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .search-filters {
    max-width: none;
    width: 100%;
  }
}

@media (max-width: 760px) {
  body {
    background-attachment: scroll, scroll, scroll, scroll, scroll, scroll;
    background-position: center top, center top, center, center, center, center;
  }

  header {
    padding: 0.85rem max(1rem, env(safe-area-inset-right)) 0.85rem max(1rem, env(safe-area-inset-left));
  }

  .header-container {
    gap: 0.75rem;
    width: 100%;
  }

  .logo-badge {
    flex-shrink: 0;
    font-size: 1rem;
    padding: 0.32rem 0.62rem;
  }

  .logo-text {
    font-size: 1.05rem;
  }

  .btn-nav-admin {
    flex-shrink: 0;
    font-size: 0.82rem;
  }

  .banner {
    padding: 3.4rem 1rem 2.8rem;
    background-position: center, center, center top;
    min-height: auto;
  }

  .banner h1 {
    font-size: clamp(2.15rem, 11vw, 3.4rem);
    line-height: 0.98;
  }

  .banner p {
    font-size: 1rem;
    line-height: 1.5;
  }

  .bet-badge {
    max-width: 100%;
    justify-content: center;
    white-space: normal;
  }

  .hero-flag-ribbon {
    max-width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
    scrollbar-width: none;
  }

  .hero-flag-ribbon::-webkit-scrollbar,
  .section-flags::-webkit-scrollbar {
    display: none;
  }

  .hero-stats {
    align-items: stretch;
  }

  .hero-stats span {
    flex: 1 1 100%;
    text-align: center;
  }

  .main-container {
    margin-top: 1.25rem;
    padding-inline: 1rem;
  }

  section {
    margin-bottom: 2rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.85rem;
    margin-bottom: 1rem;
  }

  .section-title {
    font-size: 1.45rem;
    line-height: 1.08;
  }

  .games-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .game-card {
    padding: 1.15rem;
    border-radius: var(--border-radius-md);
  }

  .game-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.55rem;
  }

  .match-teams {
    gap: 0.55rem;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  }

  .score-inputs {
    gap: 0.35rem;
  }

  .score-input {
    width: 40px;
    height: 42px;
    font-size: 1.15rem;
  }

  .team-badge-flag {
    width: clamp(58px, 18vw, 68px);
    height: clamp(42px, 13vw, 48px);
  }

  .team-name {
    font-size: 0.9rem;
    max-width: 100%;
  }

  .btn-bet,
  .btn-action-main,
  .btn-action-secondary,
  .btn-copy {
    min-height: 46px;
    justify-content: center;
    text-align: center;
  }

  .list-panel {
    border-radius: var(--border-radius-md);
    padding: 1rem;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.75rem;
  }

  .item-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
  }

  .item-guess {
    align-self: flex-start;
  }

  .modal-overlay {
    align-items: flex-start;
    padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(0.75rem, env(safe-area-inset-bottom));
  }

  .modal-content {
    border-radius: var(--border-radius-md);
    max-height: calc(100dvh - 1.5rem);
  }

  .modal-header,
  .modal-body {
    padding: 1rem;
  }

  .modal-header h2 {
    font-size: 1.12rem;
    line-height: 1.2;
  }

  .form-control,
  .score-input {
    font-size: 1rem;
  }

  .form-grid-2,
  .team-flags-admin {
    grid-template-columns: 1fr;
  }

  .payment-settings-grid {
    grid-template-columns: 1fr;
  }

  .payment-actions {
    flex-direction: column;
  }

  .payment-actions button {
    width: 100%;
    justify-content: center;
  }

  .form-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .form-actions > * {
    flex: none !important;
    width: 100% !important;
    justify-content: center;
  }

  .pix-checkout-box {
    padding: 1rem;
  }

  .pix-price-badge {
    font-size: 1.45rem;
    width: 100%;
  }

  .pix-key-container {
    flex-direction: column;
    gap: 0.75rem;
  }

  .pix-key-input,
  .btn-copy {
    border-radius: var(--border-radius-md);
    width: 100%;
  }

  .pix-key-input {
    border-right: 1px solid var(--border-color);
    text-align: left;
  }

  .admin-page-heading h1 {
    font-size: 1.55rem !important;
    line-height: 1.05;
  }

  .stats-grid {
    gap: 0.85rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .table-container {
    margin-inline: -0.25rem;
  }

  th,
  td {
    padding: 0.8rem;
  }

  .search-filters {
    flex-direction: column;
  }

  footer {
    padding: 1.5rem 1rem;
  }

  .toast {
    left: 1rem;
    right: 1rem;
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: auto;
  }
}

@media (max-width: 440px) {
  .header-container {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
    gap: 0.75rem;
  }

  .btn-nav-admin,
  #btn-logout {
    width: auto;
  }

  .section-flags {
    width: 100%;
    overflow-x: auto;
  }

  .banner {
    padding-top: 2.8rem;
  }

  .banner h1 {
    font-size: clamp(1.95rem, 12vw, 2.75rem);
  }

  .hero-flag-ribbon img,
  .section-flags img {
    width: 34px;
    height: 23px;
    flex: 0 0 auto;
  }

  .match-teams {
    grid-template-columns: 1fr;
    gap: 0.9rem;
  }

  .vs-or-inputs {
    order: 2;
  }

  .team:first-child {
    order: 1;
  }

  .team:last-child {
    order: 3;
  }

  .score-inputs {
    justify-content: center;
  }

  .team-badge,
  .team-badge-flag {
    margin-bottom: 0.15rem;
  }

  .team-badge-flag {
    width: 76px;
    height: 52px;
  }

  .btn-bet {
    font-size: 0.94rem;
    padding-inline: 0.75rem;
  }

  .login-container {
    margin: 3rem auto;
    padding: 1.35rem;
  }

  .admin-qr-preview,
  .pix-qr-box {
    width: min(160px, 62vw);
    height: min(160px, 62vw);
  }
}

@media (max-width: 360px) {
  .main-container {
    padding-inline: 0.75rem;
  }

  .logo-text {
    font-size: 0.98rem;
  }

  .section-title {
    font-size: 1.3rem;
  }

  .game-card,
  .list-panel,
  .modal-body,
  .modal-header {
    padding: 0.85rem;
  }

  .hero-stats span,
  .bet-badge {
    font-size: 0.84rem;
  }
}
