/* Make-me-wet.de – Beer Pong Rot / Blau */
@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap");

:root {
  --bg: #070f1c;
  --bg-elevated: #0c1829;
  --surface: #122038;
  --surface-hover: #1a2d4d;
  --text: #f1f5f9;
  --muted: #8fa3bf;
  --red: #e63946;
  --red-bright: #ff4d5a;
  --red-dim: rgba(230, 57, 70, 0.18);
  --blue: #2563eb;
  --blue-bright: #3b82f6;
  --blue-dim: rgba(37, 99, 235, 0.18);
  --ball: #f8fafc;
  --border: rgba(148, 163, 184, 0.14);
  --border-strong: rgba(148, 163, 184, 0.28);
  --success: #22c55e;
  --error: #f87171;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --font: "Outfit", system-ui, sans-serif;
  --header-h: 4rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
  background-image:
    radial-gradient(ellipse 90% 60% at 0% 0%, var(--red-dim), transparent 55%),
    radial-gradient(ellipse 90% 60% at 100% 0%, var(--blue-dim), transparent 55%),
    radial-gradient(ellipse 70% 50% at 50% 100%, rgba(15, 40, 80, 0.4), transparent);
}

a {
  color: var(--blue-bright);
  text-decoration: none;
  transition: color 0.15s;
}

a:hover {
  color: var(--red-bright);
}

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  height: var(--header-h);
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 15, 28, 0.88);
  backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  color: var(--text);
}

.logo img {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  box-shadow: 0 0 0 2px var(--border-strong);
}

.logo-accent {
  background: linear-gradient(90deg, var(--red-bright), var(--blue-bright));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-header nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.site-header nav > a:not(.btn) {
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: none;
}

.site-header nav > a:not(.btn):hover {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
}

.nav-user {
  padding: 0.35rem 0.75rem;
  font-size: 0.85rem;
  color: var(--muted);
  border-left: 1px solid var(--border);
  margin-left: 0.25rem;
  padding-left: 0.85rem;
}

/* Layout */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}

.page-hero {
  text-align: center;
  padding: 2.5rem 1rem 3rem;
  margin-bottom: 2rem;
  border-radius: var(--radius-lg);
  background: linear-gradient(
    135deg,
    rgba(230, 57, 70, 0.12) 0%,
    rgba(18, 32, 56, 0.9) 45%,
    rgba(37, 99, 235, 0.12) 100%
  );
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2394a3b8' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.6;
  pointer-events: none;
}

.page-hero > * {
  position: relative;
}

.hero-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 1rem;
  filter: drop-shadow(0 4px 20px rgba(37, 99, 235, 0.35));
}

.page-hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 0.6rem;
  text-shadow: none;
}

.page-hero .lead {
  max-width: 36rem;
  margin: 0 auto 1.5rem;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.page-header {
  margin-bottom: 1.75rem;
}

.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.page-header .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.page-header .back-link:hover {
  color: var(--blue-bright);
}

h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
}

.lead {
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow);
  transition: border-color 0.2s, transform 0.2s;
}

.card:hover {
  border-color: var(--border-strong);
}

.card-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.tournament-card {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
}

.tournament-card__bar {
  height: 4px;
  background: linear-gradient(90deg, var(--red), var(--blue));
}

.tournament-card__body {
  padding: 1.35rem 1.5rem 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.tournament-card h2 {
  margin-top: 0.65rem;
  margin-bottom: 0.35rem;
}

.tournament-card .meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  flex: 1;
}

.tournament-card .btn {
  align-self: flex-start;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.badge-open {
  background: var(--blue-dim);
  color: var(--blue-bright);
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.badge-active {
  background: var(--red-dim);
  color: var(--red-bright);
  border: 1px solid rgba(255, 77, 90, 0.35);
  animation: pulse-badge 2s ease-in-out infinite;
}

.badge-finished {
  background: rgba(148, 163, 184, 0.12);
  color: var(--muted);
  border: 1px solid var(--border);
}

@keyframes pulse-badge {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.75; }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.35rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  font-family: inherit;
  border: none;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  background: linear-gradient(135deg, var(--red), #b91c2c);
  color: #fff;
  box-shadow: 0 4px 14px rgba(230, 57, 70, 0.35);
  transition: transform 0.15s, box-shadow 0.15s, filter 0.15s;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  text-decoration: none;
  color: #fff;
  box-shadow: 0 6px 20px rgba(230, 57, 70, 0.45);
}

.btn-blue {
  background: linear-gradient(135deg, var(--blue-bright), #1d4ed8);
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.btn-blue:hover {
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.45);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: none;
}

.btn-outline:hover {
  background: var(--surface-hover);
  border-color: var(--blue-bright);
  color: var(--blue-bright);
  box-shadow: none;
}

.btn-danger {
  background: linear-gradient(135deg, #ef4444, #b91c1c);
}

.btn-sm {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
}

/* Forms */
.form-group {
  margin-bottom: 1.15rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
select {
  width: 100%;
  max-width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 3px var(--blue-dim);
}

.auth-box {
  max-width: 440px;
  margin: 0 auto;
}

.auth-box .card {
  border-top: 3px solid transparent;
  border-image: linear-gradient(90deg, var(--red), var(--blue)) 1;
}

/* Alerts */
.alert {
  padding: 0.9rem 1.1rem;
  border-radius: 10px;
  margin-bottom: 1.25rem;
  font-size: 0.95rem;
}

.alert-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.4);
  color: #86efac;
}

.alert-error {
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.4);
  color: #fca5a5;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
}

.empty-state p {
  color: var(--muted);
  margin-bottom: 1rem;
}

/* Team list */
.team-list {
  list-style: none;
  display: grid;
  gap: 0.5rem;
}

.team-list li {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-elevated);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.team-list li::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.team-list li:nth-child(odd)::before {
  background: var(--red);
}

.team-list li:nth-child(even)::before {
  background: var(--blue);
}

/* Bracket */
.bracket-wrap {
  overflow-x: auto;
  padding: 0.5rem 0 1rem;
  margin: 0 -0.5rem;
}

.bracket {
  display: flex;
  gap: 1.25rem;
  min-width: min-content;
  padding: 0.5rem;
}

.bracket-round {
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  gap: 1rem;
  min-width: 220px;
}

.bracket-round h3 {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  text-align: center;
  font-weight: 700;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--red), var(--blue)) 1;
}

.match-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
  font-size: 0.88rem;
}

.match-card.ongoing {
  border-color: var(--blue-bright);
  box-shadow: 0 0 0 1px var(--blue-dim), 0 4px 20px rgba(37, 99, 235, 0.2);
}

.match-card.finished {
  border-left: 3px solid var(--red);
}

.match-card.bye {
  opacity: 0.65;
  font-style: italic;
}

.match-vs {
  text-align: center;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--muted);
  padding: 0.15rem 0;
}

.match-team {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  gap: 0.5rem;
}

.match-team.winner {
  color: var(--red-bright);
  font-weight: 700;
}

.match-card.finished .match-team.winner {
  color: var(--blue-bright);
}

.match-score {
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  border-top: 1px dashed var(--border);
}

.score-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.6rem;
}

.score-form input[type="number"] {
  width: 4rem;
  max-width: 4rem;
  padding: 0.4rem;
  text-align: center;
}

/* Table */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.table th,
.table td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
}

.table tr:last-child td {
  border-bottom: none;
}

.table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: center;
}

/* Footer */
.site-footer {
  text-align: center;
  padding: 2rem 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  background: rgba(7, 15, 28, 0.5);
}

.site-footer::before {
  content: "";
  display: block;
  width: 48px;
  height: 3px;
  margin: 0 auto 1rem;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--red), var(--blue));
}

.status-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--muted);
}

@media (max-width: 640px) {
  .site-header {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
  }

  .nav-user {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
    width: 100%;
    text-align: center;
  }

  .page-hero {
    padding: 1.75rem 1rem 2rem;
  }

  .card-grid {
    grid-template-columns: 1fr;
  }
}
