:root {
  color-scheme: dark;
  --bg: #07110e;
  --panel: rgba(255, 255, 255, 0.08);
  --panel-strong: rgba(255, 255, 255, 0.13);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f7f8f5;
  --muted: #b6c0b9;
  --gold: #f5c84b;
  --gold-soft: rgba(245, 200, 75, 0.2);
  --green: #3ddc97;
  --red: #ff6b6b;
  --blue: #69a7ff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(61, 220, 151, 0.16), transparent 30%),
    radial-gradient(circle at 85% 12%, rgba(245, 200, 75, 0.14), transparent 28%),
    linear-gradient(145deg, #07110e 0%, #101914 48%, #090d0b 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(16px, 4vw, 48px);
  background: rgba(7, 17, 14, 0.78);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 1.05rem;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(245, 200, 75, 0.45);
  border-radius: 50%;
  background: rgba(245, 200, 75, 0.14);
  color: var(--gold);
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav a,
.nav button,
.button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.nav a:hover,
.nav button:hover,
.button:hover {
  transform: translateY(-1px);
  border-color: rgba(245, 200, 75, 0.7);
  background: rgba(245, 200, 75, 0.12);
}

.button.primary {
  background: var(--gold);
  color: #15120a;
  border-color: transparent;
  font-weight: 800;
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 56px;
}

.hero {
  display: grid;
  gap: 14px;
  padding: 28px 0 18px;
}

.eyebrow {
  color: var(--gold);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 850px;
  font-size: clamp(2.35rem, 7vw, 5.4rem);
  line-height: 0.95;
}

h2 {
  font-size: clamp(1.45rem, 3vw, 2.2rem);
}

p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.hero p {
  max-width: 700px;
  font-size: 1.06rem;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin: 32px 0 16px;
}

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

.card,
.auth-panel,
.table-panel,
.admin-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.match-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.teams {
  display: grid;
  gap: 10px;
}

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

.flag {
  display: grid;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.25), rgba(255, 255, 255, 0.06));
  box-shadow: inset 0 1px 10px rgba(255, 255, 255, 0.15), 0 8px 20px rgba(0, 0, 0, 0.2);
  font-size: 1.35rem;
}

.team-name {
  overflow-wrap: anywhere;
  font-weight: 800;
}

.meta {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.vote-zone {
  padding: 20px;
  border: 1px solid rgba(245, 200, 75, 0.34);
  background: linear-gradient(145deg, rgba(245, 200, 75, 0.16), rgba(255, 255, 255, 0.07));
}

.vote-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.stars {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.star {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(245, 200, 75, 0.42);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--gold);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.star:hover,
.star.active {
  background: var(--gold-soft);
  transform: translateY(-1px);
}

.message {
  min-height: 24px;
  margin-top: 12px;
  color: var(--green);
  font-weight: 700;
}

.message.error {
  color: var(--red);
}

.auth-panel,
.admin-panel,
.table-panel {
  padding: 20px;
}

form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

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

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

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

.stat {
  padding: 16px;
  border-radius: 8px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
}

.stat strong {
  display: block;
  font-size: 2rem;
}

.loading {
  opacity: 0.75;
  animation: pulse 1.2s ease-in-out infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.52; }
  to { opacity: 1; }
}

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

  .nav {
    width: 100%;
    justify-content: flex-start;
  }

  .nav a,
  .nav button {
    padding-inline: 12px;
  }

  .layout {
    width: min(100% - 24px, 1180px);
    padding-top: 20px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .star {
    width: 44px;
    height: 44px;
  }

  .table-wrap {
    overflow-x: auto;
  }
}
