:root {
  color-scheme: light;
  --ink: #17211a;
  --muted: #69746c;
  --line: #dfe7dc;
  --paper: #f8faf5;
  --panel: #ffffff;
  --green: #087f5b;
  --gold: #e5a91a;
  --blue: #1f67d2;
  --red: #c92a2a;
  --shadow: 0 18px 45px rgba(20, 35, 27, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--green);
  color: white;
  cursor: pointer;
  font-weight: 750;
  min-height: 42px;
  padding: 0 14px;
}

button.secondary {
  background: #e8efe9;
  color: var(--ink);
}

button.warning {
  background: var(--gold);
  color: #221700;
}

button.danger {
  background: var(--red);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
  padding: 9px 11px;
}

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

.shell {
  min-height: 100vh;
}

.topbar {
  align-items: center;
  background: #0f3d2e;
  color: white;
  display: flex;
  justify-content: space-between;
  padding: 16px clamp(16px, 4vw, 44px);
}

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

.brand-mark {
  align-items: center;
  background: var(--gold);
  border-radius: 50%;
  color: #17211a;
  display: grid;
  font-size: 1.15rem;
  font-weight: 900;
  height: 42px;
  justify-items: center;
  width: 42px;
}

.brand h1 {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  margin: 0;
}

.brand span {
  color: #bfe3d4;
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
}

.page {
  display: grid;
  gap: 22px;
  margin: 0 auto;
  max-width: 1180px;
  padding: 24px clamp(14px, 4vw, 34px) 48px;
}

.auth-layout {
  align-items: start;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  margin: 0 auto;
  max-width: 1100px;
  padding: 54px clamp(16px, 4vw, 44px);
}

.hero {
  display: grid;
  gap: 22px;
  min-height: 460px;
  padding-top: 30px;
}

.hero h2 {
  font-size: clamp(2.15rem, 6vw, 4.6rem);
  line-height: 0.98;
  margin: 0;
  max-width: 720px;
}

.hero p {
  color: #405247;
  font-size: clamp(1rem, 2vw, 1.2rem);
  line-height: 1.55;
  margin: 0;
  max-width: 650px;
}

.pitch-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  max-width: 720px;
}

.pitch {
  background: #eaf4ec;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.pitch b {
  display: block;
  font-size: 1.3rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.card h2,
.card h3 {
  margin: 0 0 14px;
}

.stack {
  display: grid;
  gap: 12px;
}

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

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
}

.tabs button {
  background: #e8efe9;
  color: var(--ink);
  white-space: nowrap;
}

.tabs button.active {
  background: var(--green);
  color: white;
}

.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.two {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.pool {
  display: grid;
  gap: 13px;
}

.badge {
  align-items: center;
  background: #edf2ff;
  border-radius: 999px;
  color: var(--blue);
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 800;
  min-height: 28px;
  padding: 4px 10px;
  width: fit-content;
}

.badge.ok {
  background: #e6fcf5;
  color: var(--green);
}

.badge.wait {
  background: #fff6db;
  color: #8a5a00;
}

.badge.stop {
  background: #ffe3e3;
  color: var(--red);
}

.game-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(110px, 1fr) 62px 28px 62px minmax(110px, 1fr);
  padding: 12px 0;
}

.game-row strong:first-child {
  text-align: right;
}

.game-row input {
  text-align: center;
}

.ranking-row,
.admin-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 42px minmax(0, 1fr) 80px;
  padding: 10px 0;
}

.admin-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.admin-user-row {
  grid-template-columns: 42px minmax(0, 1fr) 150px;
}

.admin-user-actions {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.pool-participants {
  align-items: flex-start;
  color: var(--muted);
  display: flex;
  font-size: 0.86rem;
  gap: 8px;
  grid-column: 1 / -1;
  line-height: 1.4;
  min-width: 0;
}

.pool-participant-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.participant-chip {
  align-items: center;
  background: #f3f7f0;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: inline-flex;
  gap: 8px;
  padding: 5px 6px 5px 10px;
}

button.small {
  font-size: 0.78rem;
  min-height: 28px;
  padding: 0 8px;
}

.pix-box {
  background: #f3f7f0;
  border: 1px dashed var(--green);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  padding: 10px;
}

.pix-box img {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 180px;
  padding: 8px;
  width: 180px;
}

.pix-box span {
  color: var(--green);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.pix-box textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 86px;
  padding: 8px;
  resize: vertical;
  width: 100%;
}

.payment-row {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  grid-template-columns: 90px minmax(0, 1fr);
  padding: 10px 0;
}

.payment-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  grid-column: 1 / -1;
  justify-content: flex-start;
}

.payment-actions button {
  min-height: 34px;
}

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

.notice {
  background: #fff9db;
  border: 1px solid #ffe066;
  border-radius: 8px;
  color: #5f3f00;
  padding: 12px 14px;
}

.error {
  background: #ffe3e3;
  border: 1px solid #ffa8a8;
  border-radius: 8px;
  color: #8b1a1a;
  padding: 12px 14px;
}

.success {
  background: #e6fcf5;
  border: 1px solid #96f2d7;
  border-radius: 8px;
  color: #065f46;
  padding: 12px 14px;
}

.footer-note {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.5;
}

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

  .hero {
    min-height: auto;
    padding-top: 0;
  }

  .pitch-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .game-row {
    grid-template-columns: minmax(0, 1fr) 54px 18px 54px minmax(0, 1fr);
  }

  .game-row strong {
    font-size: 0.84rem;
  }

  .admin-row {
    grid-template-columns: 1fr;
  }

  .payment-row {
    align-items: stretch;
    grid-template-columns: 1fr;
  }
}
