:root {
  color-scheme: dark;
  --green-950: #080b14;
  --green-900: #10172a;
  --green-800: #151d33;
  --green-700: #202b48;
  --green-500: #6873f3;
  --gold: #61d9fa;
  --gold-light: #a1eaff;
  --ink: #f4f7ff;
  --muted: #a4afc8;
  --line: rgba(192, 210, 255, .13);
  --card: rgba(20, 27, 46, .94);
  --danger: #e78c7d;
  font-family: "Inter", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    repeating-linear-gradient(133deg, transparent 0 42px, rgba(202, 215, 255, .025) 42px 44px, transparent 44px 85px),
    radial-gradient(ellipse at 50% -18%, rgba(93, 104, 221, .35), transparent 49%),
    linear-gradient(145deg, var(--green-800), var(--green-950) 73%);
}

body::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(90deg, transparent calc(50% - 1px), rgba(202, 215, 255, .035) 50%, transparent calc(50% + 1px)),
    radial-gradient(ellipse at center, transparent 0 155px, rgba(202, 215, 255, .035) 156px 157px, transparent 158px);
}

button, input, select { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.page-shell {
  width: min(100% - 40px, 1040px);
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.site-header { padding-top: 34px; }
.brand-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: center;
  gap: 24px;
  max-width: 760px;
  margin: 0 auto;
  text-align: center;
}

.logo-frame {
  width: 82px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(230, 189, 98, .5);
  border-radius: 50%;
  background: rgba(9, 26, 15, .55);
  box-shadow: 0 0 0 5px rgba(230, 189, 98, .055), 0 9px 26px rgba(0, 0, 0, .18);
}

.logo-frame img {
  width: 100%;
  height: 100%;
  padding: 8px;
  object-fit: contain;
  border-radius: 50%;
  background: #f9f8f2;
}

.logo-placeholder {
  color: var(--gold);
  font-family: "Oswald", sans-serif;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .12em;
}

.brand-copy h1, h2, h3, .summary-title, .stat-value {
  font-family: "Oswald", sans-serif;
  font-weight: 500;
}

.brand-copy h1 {
  margin: 2px 0 0;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1.08;
  letter-spacing: .015em;
}

.brand-copy h1 span { color: var(--gold); }
.eyebrow, .section-kicker {
  margin: 0;
  color: var(--gold);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.school-name { margin: 8px 0 0; color: #e1e9dd; font-size: .95rem; }
.school-name span { padding: 0 5px; color: var(--gold); }
.credit { margin: 8px 0 0; color: var(--muted); font-size: .75rem; }
.credit strong { color: #d7e1d4; font-weight: 600; }

.header-rule {
  position: relative;
  height: 1px;
  margin: 30px 0 0;
  background: linear-gradient(90deg, transparent, rgba(230, 189, 98, .42), transparent);
}
.header-rule span {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 9px;
  height: 9px;
  transform: translateX(-50%) rotate(45deg);
  border: 1px solid var(--gold);
  background: var(--green-900);
}

main { flex: 1; padding: 36px 0 52px; }
.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .92fr);
  align-items: center;
  gap: clamp(28px, 7vw, 82px);
}

.intro-copy { padding: 18px 0 18px 18px; }
.intro-copy h2 {
  margin: 11px 0 13px;
  font-size: clamp(2.6rem, 5vw, 4.1rem);
  line-height: 1.02;
  letter-spacing: -.025em;
}
.intro-copy > p:not(.section-kicker) {
  max-width: 400px;
  margin: 0;
  color: #c1cdbf;
  font-size: .94rem;
  line-height: 1.8;
}
.event-note {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
  color: #dce5d8;
  font-size: .77rem;
}
.note-mark { color: var(--gold); font-size: 1rem; }

.card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, .17);
  backdrop-filter: blur(14px);
}
.signup-card { padding: 26px 28px 20px; }
.card-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; }
.card-heading h2 {
  margin: 5px 0 0;
  font-size: 1.55rem;
}
.heading-ball {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  color: var(--green-900);
  border-radius: 50%;
  background: var(--gold);
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .16);
}

label { display: block; margin: 15px 0 7px; color: #e2e8de; font-size: .78rem; font-weight: 600; }
.required-mark { color: var(--gold); }
.optional-mark { color: var(--muted); font-size: .7rem; font-weight: 400; }
input, select {
  width: 100%;
  min-height: 46px;
  padding: 0 13px;
  color: var(--ink);
  border: 1px solid rgba(222, 237, 218, .16);
  border-radius: 8px;
  background: rgba(7, 24, 13, .52);
  font-size: .82rem;
}
input::placeholder { color: #809182; }
select { color: #c4d0c1; }
select option { color: #f5f4ed; background: var(--green-900); }
input:focus, select:focus { border-color: var(--gold); outline: none; }

.button {
  min-height: 42px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: .76rem;
  font-weight: 700;
  transition: background .18s ease, border-color .18s ease, transform .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button-primary {
  min-height: 48px;
  color: #10172a;
  background: linear-gradient(135deg, #a1eaff, #61d9fa);
  box-shadow: 0 8px 22px rgba(97, 217, 250, .18);
}
.button-primary:hover { background: #c1f1ff; }
.button:disabled { cursor: wait; opacity: .7; transform: none; }
.button-full { width: 100%; margin-top: 21px; }
.button-full span { font-size: 1rem; }
.form-message { min-height: 18px; margin: 12px 0 0; font-size: .75rem; line-height: 1.5; }
.is-success { color: #a8e0a9 !important; }
.is-error { color: #f0a69a !important; }
.player-id-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 3px 9px;
  color: #10172a;
  border-radius: 6px;
  background: var(--gold);
  font-family: "Oswald", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .06em;
  vertical-align: middle;
}
.form-footnote { margin: 1px 0 0; color: #829183; font-size: .65rem; }
.form-footnote span { margin-right: 4px; color: var(--gold); }

.public-list-card { margin-top: 28px; padding: 0 24px; }
.public-list-card details > summary {
  min-height: 82px;
  display: flex;
  align-items: center;
  gap: 20px;
  cursor: pointer;
  list-style: none;
}
.public-list-card summary::-webkit-details-marker { display: none; }
.summary-copy { display: grid; gap: 4px; margin-right: auto; }
.summary-title { font-size: 1.2rem; }
.total-pill, .count-badge {
  padding: 7px 11px;
  color: #e7d29a;
  border: 1px solid rgba(230, 189, 98, .25);
  border-radius: 999px;
  background: rgba(230, 189, 98, .08);
  font-size: .7rem;
  white-space: nowrap;
}
.total-pill strong { color: var(--gold-light); }
.summary-chevron { color: var(--gold); font-size: 1.4rem; transition: transform .2s ease; }
details[open] .summary-chevron { transform: rotate(180deg); }
.public-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 0 0 22px; }
.public-group { padding: 15px 17px; border: 1px solid var(--line); border-radius: 10px; background: rgba(4, 20, 10, .24); }
.public-group h3, .admin-group h3 { margin: 0; color: var(--gold-light); font-size: 1rem; }
.student-list, .admin-student-list { padding: 0; margin: 10px 0 0; list-style: none; }
.student-list li {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  color: #e2e9df;
  border-top: 1px solid rgba(220, 237, 216, .08);
  font-size: .77rem;
}
.team-name { color: var(--muted); font-size: .7rem; text-align: right; }
.empty-state { margin: 0; padding: 20px 0; color: var(--muted); font-size: .82rem; line-height: 1.6; }
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0 23px;
  color: #829183;
  border-top: 1px solid rgba(224, 239, 218, .09);
  font-size: .68rem;
}
.site-footer p { margin: 0; }
.site-footer p span { padding: 0 5px; color: var(--gold); }
.site-footer a, .back-link { color: #aab9a8; text-decoration-color: rgba(170, 185, 168, .4); text-underline-offset: 3px; }
.site-footer a { font-size: .66rem; }
.site-footer a:hover, .back-link:hover { color: var(--gold-light); }

/* Painel de administração */
.admin-shell main { max-width: 920px; width: 100%; margin: 0 auto; }
.admin-header { padding-top: 26px; }
.admin-header .brand-row { grid-template-columns: 68px minmax(0, 1fr); gap: 20px; }
.admin-header .logo-frame { width: 64px; }
.admin-header .brand-copy h1 { font-size: clamp(2.1rem, 5vw, 3rem); }
.admin-header .header-rule { margin-top: 22px; }
.login-card { width: min(100%, 410px); margin: 18px auto 0; padding: 30px; text-align: center; }
.login-icon { display: grid; width: 48px; height: 48px; place-items: center; margin: 0 auto 18px; color: var(--green-900); border-radius: 50%; background: var(--gold); }
.login-card h2 { margin: 7px 0 0; font-size: 1.65rem; }
.login-description { margin: 9px 0 20px; color: var(--muted); font-size: .79rem; line-height: 1.6; }
.login-card form { text-align: left; }
.login-card .button { margin-top: 18px; }
.login-card .form-message { text-align: center; }
.back-link { display: inline-block; margin-top: 16px; font-size: .72rem; }
#admin-panel[hidden], #login-panel[hidden] { display: none; }
.admin-title-row, .admin-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.admin-title-row { margin-bottom: 20px; }
.admin-title-row h2 { margin: 4px 0 0; font-size: 1.8rem; }
.button-quiet { color: #d1dbcf; border-color: rgba(220, 237, 216, .18); background: rgba(255, 255, 255, .035); }
.button-quiet:hover, .button-secondary:hover { border-color: var(--gold); }
.stats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.stat-card { min-height: 138px; display: flex; flex-direction: column; justify-content: center; padding: 19px 21px; }
.stat-highlight { border-color: rgba(230, 189, 98, .32); }
.stat-label { color: #aab8a9; font-size: .7rem; }
.stat-value { margin-top: 5px; color: var(--gold-light); font-size: 2.2rem; line-height: 1.1; }
.stat-class-name { font-size: 1.65rem; }
.stat-caption { margin-top: 3px; color: #7f9181; font-size: .66rem; }
.admin-toolbar { margin: 30px 0 14px; }
.admin-toolbar h3 { margin: 0; font-family: "Oswald", sans-serif; font-size: 1.3rem; font-weight: 500; }
.toolbar-actions { display: flex; gap: 9px; }
.button-secondary { color: var(--gold-light); border-color: rgba(230, 189, 98, .35); background: rgba(230, 189, 98, .08); }
.button-danger { color: #f0aaa0; border-color: rgba(231, 140, 125, .28); background: rgba(231, 140, 125, .07); }
.button-danger:hover { background: rgba(231, 140, 125, .16); }
.admin-message { min-height: 0; margin: 0; font-size: .75rem; }
.admin-message:not(:empty) { margin: 10px 0; }
.admin-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.admin-group { padding: 17px 18px; }
.admin-group-heading { display: flex; justify-content: space-between; align-items: center; }
.count-badge { padding: 4px 9px; }
.admin-student-list { margin-top: 10px; }
.admin-student-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid rgba(220, 237, 216, .08); }
.student-details { display: grid; gap: 4px; min-width: 0; }
.student-details strong { overflow-wrap: anywhere; color: #e2e9df; font-size: .77rem; font-weight: 500; }
.student-details span { overflow-wrap: anywhere; color: var(--muted); font-size: .68rem; }
.student-details .player-id-admin { color: var(--gold-light); font-size: .76rem; font-weight: 700; letter-spacing: .06em; }
.button-remove { min-height: 32px; flex: 0 0 auto; padding: 0 10px; color: #e9a69b; border-color: rgba(231, 140, 125, .2); background: rgba(231, 140, 125, .06); font-size: .67rem; }
.button-remove:hover { background: rgba(231, 140, 125, .15); }
.admin-empty { padding: 22px; }

@media (max-width: 700px) {
  .page-shell { width: min(100% - 30px, 520px); }
  .site-header { padding-top: 25px; }
  .brand-row { grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
  .logo-frame { width: 52px; box-shadow: 0 0 0 3px rgba(230, 189, 98, .055); }
  .logo-frame img { padding: 5px; }
  .brand-copy h1 { font-size: clamp(2rem, 8vw, 3rem); }
  .eyebrow { font-size: .55rem; letter-spacing: .12em; }
  .school-name { font-size: .78rem; }
  .credit { font-size: .65rem; }
  .header-rule { margin-top: 22px; }
  main { padding: 26px 0 38px; }
  .intro-grid { grid-template-columns: 1fr; gap: 20px; }
  .intro-copy { padding: 0 4px; }
  .intro-copy h2 { margin: 8px 0; font-size: 2.7rem; }
  .intro-copy > p:not(.section-kicker) { font-size: .85rem; }
  .event-note { margin-top: 13px; font-size: .72rem; }
  .signup-card { padding: 22px 20px 18px; }
  .public-list-card { margin-top: 20px; padding: 0 17px; }
  .public-list-card details > summary { min-height: 76px; gap: 10px; }
  .summary-title { font-size: 1.05rem; }
  .total-pill { padding: 6px 8px; font-size: .63rem; }
  .public-groups, .admin-groups { grid-template-columns: 1fr; }
  .admin-shell { width: min(100% - 30px, 520px); }
  .admin-header .brand-row { grid-template-columns: 48px minmax(0, 1fr); gap: 10px; }
  .admin-header .logo-frame { width: 46px; }
  .admin-header .brand-copy h1 { font-size: clamp(1.9rem, 7vw, 2.5rem); }
  .stats-grid { gap: 8px; }
  .stat-card { min-height: 115px; padding: 14px 12px; }
  .stat-label { font-size: .61rem; }
  .stat-value { font-size: 1.8rem; }
  .stat-class-name { font-size: 1.25rem; }
  .stat-caption { font-size: .58rem; }
  .admin-title-row { align-items: flex-end; }
  .admin-title-row h2 { font-size: 1.5rem; }
  .button-quiet { min-height: 36px; padding: 0 10px; font-size: .67rem; }
}

@media (max-width: 420px) {
  .page-shell, .admin-shell { width: min(100% - 24px, 390px); }
  .brand-row { grid-template-columns: 40px minmax(0, 1fr); gap: 8px; }
  .logo-frame { width: 38px; }
  .brand-copy h1 { font-size: 1.9rem; }
  .school-name { font-size: .7rem; }
  .credit { font-size: .58rem; }
  .admin-header .brand-row { grid-template-columns: 38px minmax(0, 1fr); gap: 8px; }
  .admin-header .logo-frame { width: 36px; }
  .admin-header .brand-copy h1 { font-size: 1.8rem; }
  .admin-toolbar { align-items: flex-start; flex-direction: column; }
  .toolbar-actions { width: 100%; }
  .toolbar-actions .button { flex: 1; padding: 0 8px; font-size: .66rem; }
  .login-card { padding: 25px 20px; }
  .site-footer { font-size: .62rem; }
}

/* Botões e campos maiores para inscrição com o tablet na sala de aula. */
@media (min-width: 701px) {
  input, select { min-height: 54px; font-size: .9rem; }
  label { margin-top: 18px; font-size: .84rem; }
  .button-primary { min-height: 56px; font-size: .88rem; }
  .signup-card { padding: 32px 34px 25px; }
  .intro-copy > p:not(.section-kicker) { font-size: 1rem; }
}
