:root {
  --green-950: #041812;
  --green-900: #063321;
  --green-700: #119447;
  --green-500: #22c55e;
  --yellow: #facc15;
  --yellow-strong: #f5b700;
  --blue: #1d4ed8;
  --white: #f8fafc;
  --muted: #b8c4c0;
  --black: #050806;
  --line: rgba(248, 250, 252, 0.12);
  --panel: rgba(255, 255, 255, 0.055);
  --panel-strong: rgba(255, 255, 255, 0.09);
  --panel-solid: #08261b;
  --danger: #ef4444;
  --success: #22c55e;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--white);
  background:
    linear-gradient(122deg, rgba(4, 24, 18, 0.98) 0%, rgba(5, 31, 22, 0.98) 55%, rgba(3, 8, 18, 0.98) 100%),
    var(--green-950);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

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

button,
input,
select,
textarea {
  font: inherit;
}

.site-header,
.site-footer,
.page {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  color: var(--black);
  border-radius: 0;
  background: transparent;
  font-weight: 900;
  flex: 0 0 auto;
  overflow: hidden;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0;
}

.brand strong {
  font-size: 0.98rem;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
}

.nav a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  padding: 8px 10px;
  border-radius: 6px;
}

.nav a:hover,
.text-link:hover {
  color: var(--yellow);
}

.nav-pill {
  color: var(--black) !important;
  background: var(--yellow);
}

.page {
  padding: 18px 0 46px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  align-items: end;
  min-height: 68vh;
  padding: 36px 0 22px;
}

.qr-login {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(22px, 5vw, 54px);
  align-items: center;
  min-height: calc(100svh - 150px);
  padding: 12px 0 34px;
}

.cup-copy {
  display: grid;
  gap: 16px;
}

.cup-copy h1 {
  max-width: 660px;
  margin: 0;
  font-size: clamp(2.5rem, 12vw, 5.9rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.cup-copy p:not(.eyebrow) {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(1rem, 2.4vw, 1.12rem);
}

.cup-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.cup-stats span,
.next-match {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.cup-stats span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 14px;
  color: var(--muted);
  font-weight: 900;
}

.cup-stats strong {
  color: var(--yellow);
  font-size: 1.35rem;
}

.next-match {
  display: grid;
  gap: 4px;
  max-width: 520px;
  padding: 15px;
  border-left: 4px solid var(--yellow);
}

.next-match span {
  color: var(--yellow);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.next-match small:first-of-type,
.game-stage,
.match-stage {
  width: fit-content;
  color: var(--yellow);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.next-match strong {
  font-size: 1.25rem;
}

.next-match small {
  color: var(--muted);
}

.hero-content h1,
.auth-copy h1,
.section-heading h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: 0;
  line-height: 1.02;
}

.hero-content h1 {
  font-size: clamp(3rem, 16vw, 6.8rem);
}

.hero-content p:not(.eyebrow) {
  max-width: 620px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 3.5vw, 1.45rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-panel,
.card,
.game-card,
.table-card,
.metric-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-panel {
  display: grid;
  gap: 6px;
  padding: 22px;
  border-left: 4px solid var(--blue);
}

.hero-panel strong {
  font-size: 1.45rem;
}

.hero-panel small,
.panel-label,
.eyebrow,
.section-heading p,
.game-card p,
.guess-form p {
  color: var(--muted);
}

.eyebrow,
.panel-label {
  margin: 0 0 10px;
  color: var(--yellow);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  font-weight: 900;
  text-align: center;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  color: var(--black);
  background: var(--yellow);
  box-shadow: 0 10px 24px rgba(250, 204, 21, 0.14);
}

.btn-primary:hover {
  background: #fde047;
}

.btn-secondary {
  color: var(--white);
  border-color: rgba(250, 204, 21, 0.35);
  background: rgba(255, 255, 255, 0.04);
}

.btn-danger {
  color: #fff;
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.22);
}

.section {
  display: grid;
  gap: 18px;
  padding: 18px 0;
}

.section-heading h1,
.section-heading h2 {
  font-size: clamp(2rem, 9vw, 3.2rem);
}

.split-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.cards-grid,
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 12px;
}

.game-card,
.card,
.metric-card,
.table-card {
  padding: 16px;
}

.game-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.game-stage {
  margin-top: -4px;
}

.game-card h3 {
  margin: 0;
  font-size: clamp(1rem, 2.6vw, 1.22rem);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.game-card small,
.match-title small {
  color: var(--yellow);
}

.status {
  display: inline-flex;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.78rem;
  font-weight: 900;
}

.status-aberto,
.status-acertou {
  color: #052e16;
  background: var(--green-500);
}

.status-fechado,
.status-aguardando {
  color: var(--black);
  background: var(--yellow);
}

.status-finalizado,
.status-errou {
  background: var(--blue);
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  min-height: 68vh;
}

.compact-auth {
  place-items: center;
}

.auth-copy h1 {
  max-width: 620px;
  font-size: clamp(2.4rem, 11vw, 4.8rem);
}

.auth-copy p:not(.eyebrow) {
  max-width: 520px;
  color: var(--muted);
}

.form-card,
.admin-form,
.guess-form {
  display: grid;
  gap: 12px;
}

.form-card {
  width: 100%;
  max-width: 430px;
}

.access-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(250, 204, 21, 0.35);
  background: rgba(6, 51, 33, 0.88);
}

.access-card::before {
  content: "";
  display: block;
  height: 7px;
  margin: -18px -18px 10px;
  background: linear-gradient(90deg, var(--green-500), var(--yellow), var(--blue));
}

.form-badge {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--black);
  background: var(--yellow);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.form-card h1,
.form-card h2,
.admin-form h2 {
  margin: 0;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
}

input,
select,
textarea {
  width: 100%;
  color: var(--white);
  border: 1px solid var(--line);
  border-radius: 7px;
  outline: none;
  background: rgba(0, 0, 0, 0.32);
}

input,
select {
  min-height: 48px;
  padding: 0 13px;
}

textarea {
  min-height: 220px;
  padding: 13px;
  resize: vertical;
}

select option {
  color: var(--black);
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--yellow);
}

.message,
.flash {
  margin: 0;
  padding: 12px 14px;
  border-radius: 7px;
  font-weight: 800;
}

.flash {
  margin-bottom: 18px;
  color: #052e16;
  background: var(--green-500);
}

.error,
.flash-error {
  color: #fff;
  background: rgba(239, 68, 68, 0.22);
  border: 1px solid rgba(239, 68, 68, 0.45);
}

.match-title {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  font-size: clamp(1.16rem, 5.8vw, 2.1rem);
  font-weight: 900;
  text-align: center;
  overflow-wrap: anywhere;
}

.score-inputs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  gap: 12px;
}

.score-inputs strong {
  min-height: 46px;
  display: grid;
  place-items: center;
  color: var(--yellow);
}

.form-actions,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-form {
  display: inline;
  margin: 0;
}

.text-button {
  padding: 0;
  color: var(--yellow);
  border: 0;
  background: transparent;
  cursor: pointer;
  font-weight: 900;
}

.danger-text {
  color: #ff9a9a;
}

.muted-text {
  color: var(--muted);
}

.content-card {
  color: var(--white);
  font-size: clamp(1rem, 2.4vw, 1.08rem);
  line-height: 1.75;
  white-space: normal;
}

.table-card {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table-card h2 {
  margin: 0 0 14px;
}

table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

th,
td {
  padding: 13px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--yellow);
  font-size: 0.78rem;
  text-transform: uppercase;
}

td {
  color: var(--muted);
}

.metric-card {
  display: grid;
  gap: 6px;
}

.metric-card span {
  color: var(--muted);
  font-weight: 800;
}

.metric-card strong {
  color: var(--yellow);
  font-size: 2.35rem;
  line-height: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.actions {
  display: flex;
  gap: 10px;
  font-weight: 900;
}

.actions a:first-child {
  color: var(--yellow);
}

.actions a:last-child {
  color: #ff9a9a;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.games-filter input {
  max-width: 520px;
}

.filter-bar select {
  max-width: 360px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 24px 0 36px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 0.9rem;
}

@media (min-width: 760px) {
  .hero,
  .auth-shell {
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  }

  .hero-panel {
    margin-bottom: 28px;
  }

  .qr-login {
    grid-template-columns: minmax(0, 1.15fr) minmax(330px, 0.85fr);
  }

  .access-card {
    margin-left: auto;
  }
}

@media (min-width: 900px) {
  .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }

  .panel-page .cards-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 641px) and (max-width: 899px) {
  .site-header {
    align-items: flex-start;
  }

  .nav {
    max-width: 520px;
  }

  .qr-login {
    min-height: auto;
    padding-top: 18px;
  }

  .access-card {
    max-width: none;
  }

  .panel-page .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split-heading .btn {
    width: auto;
  }
}

@media (max-width: 640px) {
  .site-header,
  .site-footer,
  .page {
    width: min(100% - 24px, 1120px);
  }

  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-header {
    gap: 12px;
    padding: 12px 0 8px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
    font-size: 0.88rem;
  }

  .brand small {
    font-size: 0.74rem;
  }

  .nav {
    justify-content: flex-start;
    width: 100%;
    gap: 6px;
    font-size: 0.86rem;
  }

  .nav a {
    min-height: 36px;
    padding: 7px 9px;
  }

  .page {
    padding-top: 10px;
  }

  .qr-login {
    min-height: auto;
    gap: 18px;
    padding: 8px 0 28px;
  }

  .cup-copy {
    gap: 13px;
  }

  .cup-copy h1 {
    font-size: clamp(2.2rem, 14vw, 3.4rem);
  }

  .cup-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .cup-stats span {
    min-height: 42px;
    justify-content: center;
    padding: 0 10px;
  }

  .next-match {
    padding: 13px;
  }

  .next-match strong {
    font-size: 1.06rem;
  }

  .hero {
    min-height: auto;
  }

  .hero-actions .btn,
  .game-card .btn,
  .form-card .btn,
  .guess-form .btn,
  .split-heading .btn {
    width: 100%;
  }

  .section-heading h1,
  .section-heading h2 {
    font-size: clamp(1.75rem, 10vw, 2.45rem);
  }

  .game-card,
  .card,
  .metric-card,
  .table-card {
    padding: 14px;
  }

  .cards-grid,
  .metrics-grid {
    gap: 10px;
  }

  .score-inputs {
    grid-template-columns: 1fr;
  }

  .form-actions {
    display: grid;
  }

  .score-inputs strong {
    min-height: auto;
  }

  .match-title {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .match-title small {
    line-height: 1;
  }

  .filter-bar {
    padding: 10px;
  }

  .filter-bar select,
  .games-filter input {
    max-width: none;
  }

  .site-footer {
    padding: 18px 0 28px;
  }
}

@media (max-width: 380px) {
  .cup-stats {
    grid-template-columns: 1fr;
  }

  .brand strong {
    font-size: 0.92rem;
  }

  .cup-copy h1 {
    font-size: 2.08rem;
  }
}
