/* El Octágono — dark / glassmorphism / neomorphism / bento design system */

:root {
  --bg: #0b0910;
  --bg-grid: #0e0c15;
  --surface: #171420;
  --surface-2: #1d1828;
  --glass-bg: rgba(255, 255, 255, 0.045);
  --glass-bg-hover: rgba(255, 255, 255, 0.075);
  --glass-border: rgba(255, 255, 255, 0.09);
  --shadow-dark: rgba(0, 0, 0, 0.65);
  --shadow-light: rgba(255, 255, 255, 0.035);

  --text: #eceef2;
  --text-dim: #9096a3;
  --text-faint: #5c6272;

  --accent: #9b4dff;
  --accent-2: #ff6ec7;
  --accent-glow: rgba(155, 77, 255, 0.35);

  --win: #35e0b0;
  --win-glow: rgba(53, 224, 176, 0.3);
  --lose: #565c6b;

  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  background:
    radial-gradient(circle at 15% 0%, rgba(155, 77, 255, 0.10), transparent 40%),
    radial-gradient(circle at 85% 20%, rgba(255, 110, 199, 0.08), transparent 45%),
    var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Inter", system-ui, -apple-system, sans-serif;
  padding: 32px 20px 80px;
  line-height: 1.4;
}

a { color: inherit; }

::selection { background: var(--accent-glow); }

/* ---------- Layout shell ---------- */

.page {
  max-width: 1100px;
  margin: 0 auto;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
  text-decoration: none;
  color: var(--text);
}

.brand-icon {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
}

.brand-arena {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.subtitle {
  color: var(--text-dim);
  font-size: 0.95rem;
  margin-top: 4px;
}

.back-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  transition: all 0.15s ease;
}
.back-link:hover { background: var(--glass-bg-hover); color: var(--text); }

/* ---------- Bento grid ---------- */

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

.bento-grid.two-col {
  grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 720px) {
  .bento-grid.two-col { grid-template-columns: 1fr; }
}

/* ---------- Glass + neomorphic cards ---------- */

.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    10px 10px 24px var(--shadow-dark),
    -6px -6px 18px var(--shadow-light);
  padding: 28px;
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.glass-card.interactive {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  display: block;
}
.glass-card.interactive:hover {
  transform: translateY(-4px);
  background: var(--glass-bg-hover);
}

.mode-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mode-card .icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
}

.mode-card h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}

.mode-card p {
  color: var(--text-dim);
  margin: 0;
  font-size: 0.95rem;
}

.mode-card .btn {
  align-self: flex-start;
  margin-top: 24px;
}

.mode-card .tag {
  align-self: flex-start;
  margin-top: 18px;
  font-size: 0.78rem;
  color: var(--accent-2);
  border: 1px solid rgba(255, 110, 199, 0.35);
  background: rgba(155, 77, 255, 0.1);
  padding: 4px 10px;
  border-radius: 999px;
}

/* neomorphic solid surface (used for score displays, inputs container) */
.neo-surface {
  background: var(--surface);
  border-radius: var(--radius-md);
  box-shadow:
    inset 4px 4px 10px rgba(0, 0, 0, 0.45),
    inset -4px -4px 10px rgba(255, 255, 255, 0.02);
  padding: 20px;
}

/* ---------- Forms ---------- */

label {
  display: block;
  font-size: 0.85rem;
  color: var(--text-dim);
  margin-bottom: 6px;
}

input[type="text"], select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  color: var(--text);
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input[type="text"]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.field { margin-bottom: 14px; }

.player-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 18px 0 24px;
}

.manual-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin: 18px 0 24px;
}

.manual-team-group {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow:
    6px 6px 14px var(--shadow-dark),
    -4px -4px 12px var(--shadow-light);
}

.manual-team-group h3 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.manual-team-group .field:last-child { margin-bottom: 0; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, opacity 0.12s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #1a1000;
  box-shadow: 0 6px 18px var(--accent-glow);
}
.btn-primary:hover { box-shadow: 0 8px 24px var(--accent-glow); }

.btn-ghost {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text);
}
.btn-ghost:hover { background: var(--glass-bg-hover); }

.btn-danger {
  background: rgba(255, 90, 90, 0.12);
  border: 1px solid rgba(255, 90, 90, 0.35);
  color: #ff9c9c;
}

.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; }

.actions-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 18px;
}

/* ---------- Team chips ---------- */

.team-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.team-color-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  flex-shrink: 0;
  box-shadow: 0 0 10px currentColor;
}

.team-name-input {
  background: transparent;
  border: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1rem;
  padding: 4px 0;
  width: 100%;
}
.team-name-input:focus { outline: none; border-bottom: 1px solid var(--accent); }

.team-players {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-top: 2px;
}

/* ---------- Bracket ---------- */

.bracket {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  align-items: center;
}

@media (max-width: 860px) {
  .bracket { grid-template-columns: 1fr; }
}

.bracket-col {
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: center;
  height: 100%;
}

.bracket-col-label {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: -6px;
}

.match {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow:
    6px 6px 14px var(--shadow-dark),
    -4px -4px 12px var(--shadow-light);
}

.match-slot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s ease;
}
.match-slot:hover { background: rgba(255, 255, 255, 0.04); }
.match-slot.winner {
  background: rgba(53, 224, 176, 0.1);
  box-shadow: inset 0 0 0 1px rgba(53, 224, 176, 0.4);
}
.match-slot.loser { opacity: 0.45; }
.match-slot.disabled { cursor: not-allowed; opacity: 0.35; }

.match-slot .name {
  font-weight: 600;
  font-size: 0.92rem;
}

.match-slot .win-star { color: var(--accent-2); font-size: 0.85rem; }

.match-divider {
  height: 1px;
  background: var(--glass-border);
  margin: 0 8px;
}

.match-title {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 0 2px;
}

/* champion / result banners */

.champion-banner {
  text-align: center;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(155, 77, 255, 0.18), rgba(255, 110, 199, 0.1));
  border: 1px solid rgba(255, 110, 199, 0.3);
  margin-bottom: 26px;
}
.champion-banner .label {
  color: var(--accent-2);
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 2px;
}
.champion-banner .name {
  font-size: 2rem;
  font-weight: 800;
  margin: 6px 0;
}
.champion-banner .sub {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ---------- Series (4v4) ---------- */

.series-score {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 24px;
}

.series-team {
  text-align: center;
  min-width: 140px;
}
.series-team .score {
  font-size: 3rem;
  font-weight: 800;
  line-height: 1;
}
.series-team .name { margin-top: 6px; font-weight: 600; }

.series-vs {
  color: var(--text-faint);
  font-weight: 700;
  font-size: 1.1rem;
}

.game-log {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.game-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  font-size: 0.88rem;
}

.game-row .game-label { color: var(--text-dim); }

.pill-buttons {
  display: flex;
  gap: 8px;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.section-sub {
  color: var(--text-dim);
  font-size: 0.88rem;
  margin: 0 0 18px;
}

.standings-table {
  width: 100%;
  border-collapse: collapse;
}
.standings-table th, .standings-table td {
  text-align: left;
  padding: 10px 12px;
  font-size: 0.9rem;
}
.standings-table thead th {
  color: var(--text-faint);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 1px;
  border-bottom: 1px solid var(--glass-border);
}
.standings-table tbody tr { border-bottom: 1px solid rgba(255, 255, 255, 0.04); }
.standings-table .rank { font-weight: 700; color: var(--accent-2); }

.empty-hint {
  color: var(--text-faint);
  font-size: 0.85rem;
  text-align: center;
  padding: 30px 10px;
}

/* ---------- Landing: hero + plans ---------- */

.hero {
  text-align: center;
  padding: 20px 10px 8px;
  margin-bottom: 8px;
}

.hero h1 {
  font-size: 2.1rem;
  margin: 0 0 10px;
}

.hero p {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto;
  font-size: 1rem;
}

.section-heading {
  text-align: center;
  margin: 48px 0 22px;
}

.section-heading h2 {
  font-size: 1.4rem;
  margin: 0 0 6px;
}

.section-heading p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
}

.fee-card h2 {
  margin: 4px 0 2px;
  font-size: 1.3rem;
}

.fee-card p {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 10px 0 0;
}

.fee-price {
  font-size: 1.7rem;
  font-weight: 800;
  margin: 6px 0 0;
}
.fee-price .unit {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dim);
}

.readonly .match-slot { cursor: default; }
.readonly .match-slot:hover { background: none; }

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--win);
  border: 1px solid rgba(53, 224, 176, 0.35);
  background: rgba(53, 224, 176, 0.08);
  padding: 4px 10px;
  border-radius: 999px;
}
.live-badge .blip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--win);
  box-shadow: 0 0 8px var(--win-glow);
  animation: blip-pulse 1.6s ease-in-out infinite;
}
@keyframes blip-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

footer.credits {
  text-align: center;
  color: var(--text-faint);
  font-size: 0.78rem;
  margin-top: 60px;
}
