@font-face {
  font-family: 'Minecraft';
  src: url('minecraft.ttf') format('truetype');
  font-display: swap;
}

:root {
  --bg: #0a0712;
  --panel: rgba(26, 16, 44, 0.72);
  --panel-solid: #150d28;
  --border: #5e3a99;
  --border-soft: #3a2456;
  --accent: #a855f7;
  --accent-bright: #c084fc;
  --accent-deep: #7c3aed;
  --text: #ece4f7;
  --muted: #9d8cb8;
  --mc: 'Minecraft', 'Segoe UI', sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: radial-gradient(1200px 600px at 50% -10%, #1d0f38 0%, var(--bg) 55%);
  color: var(--text);
  font-family: var(--sans);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient animated glow */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(500px 500px at 15% 20%, rgba(124,58,237,0.18), transparent 70%),
    radial-gradient(600px 600px at 85% 70%, rgba(168,85,247,0.14), transparent 70%);
  animation: drift 14s ease-in-out infinite alternate;
}
@keyframes drift {
  from { transform: translate(-20px, -10px) scale(1); }
  to   { transform: translate(20px, 10px) scale(1.08); }
}

/* ─── HEADER ─── */
.header {
  background: linear-gradient(180deg, rgba(40,22,70,0.85), rgba(20,12,40,0.6));
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 12px 0;
  margin-bottom: 28px;
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-img {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  filter: drop-shadow(0 0 10px rgba(168,85,247,0.6));
}

.logo {
  font-family: var(--mc);
  font-size: 1.5rem;
  font-weight: 400;
  letter-spacing: 2px;
  color: #fff;
  line-height: 1;
  text-shadow: 0 0 12px rgba(168,85,247,0.8), 0 0 30px rgba(124,58,237,0.5);
}

.logo-sub {
  font-family: var(--mc);
  font-size: 0.55rem;
  letter-spacing: 4px;
  color: var(--accent-bright);
  opacity: 0.8;
}

.btn {
  padding: 9px 16px;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.82rem;
  transition: 0.18s;
  font-family: var(--sans);
}

.btn-console {
  background: rgba(168,85,247,0.12);
  color: var(--accent-bright);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 7px;
}
.btn-console:hover {
  background: rgba(168,85,247,0.25);
  box-shadow: 0 0 16px rgba(168,85,247,0.35);
}
.btn-console.unlocked .lock-icon::before { content: "🔓"; }
.btn-console.unlocked .lock-icon { font-size: 0; }
.btn-console.unlocked .lock-icon::before { font-size: 0.9rem; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px 40px;
}

.section-title {
  font-family: var(--mc);
  font-size: 1rem;
  font-weight: 400;
  color: var(--accent-bright);
  letter-spacing: 2px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-soft);
  text-shadow: 0 0 10px rgba(168,85,247,0.4);
}

/* ─── PLAYERS ─── */
.players-section { margin-bottom: 36px; }

.players-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 6px 10px;
  transition: 0.18s;
  backdrop-filter: blur(6px);
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 0 16px rgba(168,85,247,0.3);
  transform: translateY(-1px);
}

.card-idx {
  position: absolute;
  top: 3px;
  right: 6px;
  font-family: var(--mc);
  font-size: 0.5rem;
  color: var(--muted);
  opacity: 0.6;
}

.card img {
  width: 26px;
  height: 26px;
  border-radius: 5px;
  flex-shrink: 0;
  image-rendering: pixelated;
  box-shadow: 0 0 0 1px var(--border-soft);
}

.card .info {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.card .name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card .tier {
  font-family: var(--mc);
  font-size: 0.5rem;
  font-weight: 400;
  letter-spacing: 1px;
  padding: 3px 6px 2px;
  border-radius: 4px;
  flex-shrink: 0;
}

.tier-HT1 { background: rgba(251,191,36,0.18); color: #fbbf24; border: 1px solid rgba(251,191,36,0.4); }
.tier-HT2 { background: rgba(251,146,60,0.18); color: #fb923c; border: 1px solid rgba(251,146,60,0.4); }
.tier-HT3 { background: rgba(248,113,113,0.18); color: #f87171; border: 1px solid rgba(248,113,113,0.4); }
.tier-LT1 { background: rgba(96,165,250,0.18); color: #60a5fa; border: 1px solid rgba(96,165,250,0.4); }
.tier-LT2 { background: rgba(192,132,252,0.18); color: #c084fc; border: 1px solid rgba(192,132,252,0.4); }
.tier-LT3 { background: rgba(244,114,182,0.18); color: #f472b6; border: 1px solid rgba(244,114,182,0.4); }

/* ─── BRACKET ─── */
.bracket-section { margin-bottom: 36px; }

.bracket-wrapper {
  background: linear-gradient(160deg, rgba(30,18,52,0.6), rgba(16,10,30,0.6));
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 24px 20px;
  overflow-x: auto;
  position: relative;
  min-height: 520px;
  box-shadow: inset 0 0 60px rgba(124,58,237,0.08);
}

.bracket-canvas {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 0;
}

.bracket {
  display: flex;
  gap: 56px;
  min-width: 880px;
  align-items: stretch;
  min-height: 600px;
  position: relative;
  z-index: 1;
}

.round {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.round-title {
  font-family: var(--mc);
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--accent-bright);
  letter-spacing: 2px;
  margin-bottom: 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border-soft);
  text-align: center;
  text-shadow: 0 0 8px rgba(168,85,247,0.4);
}

.round-matches {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  justify-content: space-around;
}

.match-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: center;
}

.match {
  display: flex;
  align-items: stretch;
  background: linear-gradient(160deg, rgba(42,26,68,0.95), rgba(26,16,44,0.95));
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  max-width: 218px;
  transition: 0.18s;
  box-shadow: 0 2px 10px rgba(0,0,0,0.4), 0 0 0 1px rgba(168,85,247,0.05);
}
.match:hover {
  border-color: var(--accent-bright);
  box-shadow: 0 0 20px rgba(168,85,247,0.4);
}

.match-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  flex-shrink: 0;
  font-family: var(--mc);
  font-size: 0.46rem;
  color: var(--accent-bright);
  background: rgba(124,58,237,0.22);
  border-right: 1px solid var(--border);
}

.match-teams {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.team {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  font-size: 0.78rem;
  min-height: 25px;
  border-bottom: 1px solid var(--border-soft);
}
.team:last-child { border-bottom: none; }

.team img {
  width: 17px;
  height: 17px;
  border-radius: 3px;
  image-rendering: pixelated;
  flex-shrink: 0;
}

.team span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
}

.team .score {
  font-family: var(--mc);
  font-weight: 400;
  color: var(--muted);
  font-size: 0.6rem;
  min-width: 14px;
  text-align: center;
  flex: 0 0 auto;
}

.team.winner {
  background: linear-gradient(90deg, rgba(74,222,128,0.12), transparent);
}
.team.winner span {
  color: #4ade80;
  font-weight: 700;
}
.team.winner .score { color: #4ade80; }

.team.tbd span { color: #6b5b85; font-style: italic; }
.team.tbd img { background: rgba(124,58,237,0.15); }

.round-4 .match {
  border-color: var(--accent-bright);
  box-shadow: 0 0 24px rgba(168,85,247,0.45);
}
.round-4 .round-title { color: #fde68a; text-shadow: 0 0 10px rgba(251,191,36,0.5); }

/* ─── FOOTER ─── */
.footer {
  display: flex;
  justify-content: center;
  padding: 16px 16px 40px;
}

.server-badge {
  font-family: var(--mc);
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 1px;
  padding: 11px 24px;
  border-radius: 24px;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: 0 0 24px rgba(168,85,247,0.5);
}
.server-badge .dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px #4ade80;
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ─── LOGIN MODAL ─── */
.login-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8,5,16,0.75);
  backdrop-filter: blur(6px);
}
.login-modal.hidden { display: none; }

.login-box {
  width: 340px;
  max-width: 90vw;
  background: linear-gradient(160deg, rgba(36,22,60,0.97), rgba(20,12,38,0.97));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 26px;
  text-align: center;
  box-shadow: 0 0 50px rgba(124,58,237,0.4);
}
.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  margin-bottom: 14px;
  filter: drop-shadow(0 0 14px rgba(168,85,247,0.7));
}
.login-box h3 {
  font-family: var(--mc);
  font-weight: 400;
  letter-spacing: 1px;
  font-size: 1.05rem;
  margin-bottom: 6px;
}
.login-hint { color: var(--muted); font-size: 0.78rem; margin-bottom: 18px; }

.login-box input {
  width: 100%;
  padding: 11px 14px;
  background: rgba(10,6,20,0.8);
  border: 1px solid var(--border);
  border-radius: 9px;
  color: var(--text);
  font-size: 0.9rem;
  text-align: center;
  letter-spacing: 2px;
}
.login-box input:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 14px rgba(168,85,247,0.4);
}

.login-error {
  color: #f87171;
  font-size: 0.78rem;
  height: 0;
  opacity: 0;
  overflow: hidden;
  transition: 0.2s;
}
.login-error.show { height: 18px; opacity: 1; margin-top: 8px; }

.login-actions {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}
.login-actions .btn { flex: 1; margin: 0; }

.shake { animation: shake 0.4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-9px); }
  40%,80% { transform: translateX(9px); }
}

/* ─── ADMIN CONSOLE ─── */
.console {
  position: fixed;
  top: 0;
  right: 0;
  width: 350px;
  max-width: 92vw;
  height: 100vh;
  background: linear-gradient(180deg, rgba(28,17,48,0.98), rgba(16,10,30,0.98));
  border-left: 1px solid var(--border);
  box-shadow: -8px 0 40px rgba(124,58,237,0.3);
  backdrop-filter: blur(14px);
  z-index: 150;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease;
}
.console.hidden {
  transform: translateX(100%);
  pointer-events: none;
}

.console-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  flex-shrink: 0;
}
.console-header h3 {
  font-family: var(--mc);
  font-weight: 400;
  letter-spacing: 1px;
  font-size: 0.95rem;
  color: #fff;
}
.close-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}
.close-btn:hover { opacity: 0.75; }

.console-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}

.console-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-soft);
}
.console-section:last-child { border-bottom: none; margin-bottom: 0; }

.console-section h4 {
  font-family: var(--mc);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 2px;
  color: var(--accent-bright);
  margin-bottom: 14px;
}

.console-input-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 11px;
}
.console-input-group label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}
.console-input-group input,
.console-input-group select {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 0.84rem;
  font-family: var(--sans);
  background: rgba(10,6,20,0.7);
  color: var(--text);
}
.console-input-group input:focus,
.console-input-group select:focus {
  outline: none;
  border-color: var(--accent-bright);
  box-shadow: 0 0 12px rgba(168,85,247,0.3);
}
.console-input-group select option { background: var(--panel-solid); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent-deep), var(--accent));
  color: #fff;
  width: 100%;
  margin-top: 4px;
  box-shadow: 0 0 16px rgba(168,85,247,0.25);
}
.btn-primary:hover { box-shadow: 0 0 24px rgba(168,85,247,0.5); }

.btn-secondary {
  background: rgba(168,85,247,0.1);
  color: var(--accent-bright);
  border: 1px solid var(--border);
  width: 100%;
  margin-top: 8px;
}
.btn-secondary:hover { background: rgba(168,85,247,0.22); }
.btn-secondary.danger {
  color: #f87171;
  border-color: rgba(248,113,113,0.4);
  background: rgba(248,113,113,0.08);
}
.btn-secondary.danger:hover { background: rgba(248,113,113,0.18); }

/* ─── SCROLLBARS ─── */
.bracket-wrapper::-webkit-scrollbar,
.console-body::-webkit-scrollbar { height: 8px; width: 8px; }
.bracket-wrapper::-webkit-scrollbar-thumb,
.console-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 8px;
}
.bracket-wrapper::-webkit-scrollbar-track,
.console-body::-webkit-scrollbar-track { background: transparent; }

/* ─── RESPONSIVE ─── */
@media (max-width: 900px) {
  .bracket { gap: 38px; min-width: 760px; }
}
@media (max-width: 768px) {
  .players-grid { grid-template-columns: repeat(2, 1fr); }
  .bracket { gap: 30px; min-width: 680px; }
  .logo { font-size: 1.2rem; }
}
@media (max-width: 400px) {
  .players-grid { grid-template-columns: 1fr; }
}

/* ════════════════════════════════════════════
   V2 — ADVANCED FX
   ════════════════════════════════════════════ */

#fx-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.cursor-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(circle, rgba(168,85,247,0.18) 0%, rgba(124,58,237,0.08) 35%, transparent 70%);
  mix-blend-mode: screen;
  transition: transform 0.18s ease-out;
}

/* ── Entrance reveal ── */
.reveal {
  opacity: 0;
  animation: reveal 0.6s cubic-bezier(.2,.7,.2,1) forwards;
  animation-delay: calc(var(--i, 0) * 0.05s);
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(16px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.card, .match {
  will-change: transform;
  transform-style: preserve-3d;
}

/* ── Shimmering logo ── */
.logo {
  background: linear-gradient(100deg, #fff 10%, #c084fc 30%, #fff 50%, #a855f7 70%, #fff 90%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  text-shadow: none;
  filter: drop-shadow(0 0 14px rgba(168,85,247,0.65));
  animation: shimmer 5s linear infinite;
}
@keyframes shimmer { to { background-position: 220% center; } }

.logo-img { animation: floaty 4s ease-in-out infinite; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(3deg); }
}

/* ── Animated section underline ── */
.section-title {
  position: relative;
  border-bottom: none;
}
.section-title::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 100%;
  background: linear-gradient(90deg, var(--accent), transparent);
  box-shadow: 0 0 10px rgba(168,85,247,0.6);
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  height: 2px;
  width: 70px;
  background: var(--accent-bright);
  box-shadow: 0 0 14px var(--accent-bright);
  animation: scan 3s ease-in-out infinite;
}
@keyframes scan {
  0%, 100% { left: 0; }
  50% { left: calc(100% - 70px); }
}

/* ── Winner match breathing glow ── */
.round-4 .match { animation: champGlow 2.4s ease-in-out infinite; }
@keyframes champGlow {
  0%, 100% { box-shadow: 0 0 18px rgba(168,85,247,0.35); }
  50% { box-shadow: 0 0 34px rgba(168,85,247,0.7); }
}

/* ── Champion card ── */
.champion {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 16px 14px 14px;
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(60,38,98,0.6), rgba(26,16,44,0.6));
  border: 1px solid var(--border-soft);
  position: relative;
  overflow: hidden;
}
.champion.crowned {
  border-color: transparent;
  background:
    linear-gradient(160deg, rgba(60,38,98,0.85), rgba(26,16,44,0.85)) padding-box,
    conic-gradient(from var(--a, 0deg), #fbbf24, #a855f7, #4ade80, #fbbf24) border-box;
  border: 2px solid transparent;
  animation: spinBorder 6s linear infinite;
  box-shadow: 0 0 30px rgba(251,191,36,0.35);
}
@property --a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes spinBorder { to { --a: 360deg; } }

.champion .crown {
  font-size: 1.6rem;
  filter: drop-shadow(0 0 10px rgba(251,191,36,0.8));
  animation: crownBounce 1.8s ease-in-out infinite;
}
.champion .crown.dim { filter: none; opacity: 0.5; animation: none; }
@keyframes crownBounce {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.12); }
}
.champion img {
  width: 42px; height: 42px;
  border-radius: 8px;
  image-rendering: pixelated;
  box-shadow: 0 0 0 2px rgba(251,191,36,0.5), 0 0 16px rgba(251,191,36,0.4);
}
.champion .champ-name {
  font-family: var(--mc);
  font-size: 0.78rem;
  color: #fde68a;
  text-shadow: 0 0 10px rgba(251,191,36,0.5);
  max-width: 130px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.champion .champ-name.dim { color: var(--muted); text-shadow: none; }
.champion .champ-label {
  font-family: var(--mc);
  font-size: 0.5rem;
  letter-spacing: 3px;
  color: var(--accent-bright);
  opacity: 0.85;
}

/* ── Button sheen ── */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::after {
  content: "";
  position: absolute;
  top: 0; left: -120%;
  width: 60%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
}
.btn-primary:hover::after { animation: sheen 0.8s ease; }
@keyframes sheen { to { left: 130%; } }

/* ── Respect reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  *, .reveal { animation: none !important; opacity: 1 !important; }
}

/* ════════════════════════════════════════════
   V3 — BACKEND UI (stats, analytics, presence)
   ════════════════════════════════════════════ */

.offline-banner {
  position: sticky;
  top: 0;
  z-index: 60;
  text-align: center;
  font-size: 0.78rem;
  padding: 7px 14px;
  background: rgba(248,113,113,0.15);
  color: #fca5a5;
  border-bottom: 1px solid rgba(248,113,113,0.3);
}
.offline-banner code {
  background: rgba(0,0,0,0.3);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.72rem;
}
.offline-banner.hidden { display: none; }

.header-right { display: flex; align-items: center; gap: 12px; }

.online-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-bright);
  background: rgba(74,222,128,0.08);
  border: 1px solid rgba(74,222,128,0.25);
  padding: 5px 11px;
  border-radius: 20px;
}
.online-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 8px #4ade80;
  animation: pulse 1.6s ease-in-out infinite;
}

/* footer stats */
.footer {
  flex-direction: column;
  gap: 18px;
}
.footer-stats {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  justify-content: center;
}
.fstat { text-align: center; }
.fstat span {
  display: block;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.55rem;
  color: #f0e6ff;
  text-shadow: 0 0 14px rgba(168,85,247,0.6);
}
.fstat label {
  font-size: 0.62rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
}

/* console header actions */
.console-header-actions { display: flex; align-items: center; gap: 6px; }
.logout-btn {
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 28px; height: 28px;
  border-radius: 6px;
  font-size: 1rem;
  cursor: pointer;
}
.logout-btn:hover { background: rgba(255,255,255,0.25); }

/* admin status toast */
.admin-status {
  min-height: 0;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: center;
  border-radius: 7px;
  transition: 0.2s;
  overflow: hidden;
}
.admin-status.ok, .admin-status.err {
  min-height: 32px;
  line-height: 32px;
  margin-bottom: 14px;
}
.admin-status.ok { background: rgba(74,222,128,0.15); color: #4ade80; }
.admin-status.err { background: rgba(248,113,113,0.15); color: #fca5a5; }

/* analytics dashboard */
.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.an-card {
  background: rgba(124,58,237,0.12);
  border: 1px solid var(--border-soft);
  border-radius: 9px;
  padding: 10px 4px;
  text-align: center;
}
.an-card span {
  display: block;
  font-family: var(--sans);
  font-weight: 800;
  font-size: 1.15rem;
  color: #f0e6ff;
}
.an-card label {
  font-size: 0.52rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--muted);
}
.an-chart-label {
  font-size: 0.62rem;
  color: var(--muted);
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.an-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 90px;
  padding: 6px 4px;
  background: rgba(10,6,20,0.5);
  border-radius: 9px;
  margin-bottom: 12px;
}
.an-bar {
  flex: 1;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent-deep));
  border-radius: 4px 4px 0 0;
  position: relative;
  min-height: 4px;
  display: flex;
  justify-content: center;
  box-shadow: 0 0 8px rgba(168,85,247,0.4);
}
.an-bar span {
  position: absolute;
  bottom: -16px;
  font-size: 0.5rem;
  color: var(--muted);
  white-space: nowrap;
}

/* ── HERO ── */
.hero {
  text-align: center;
  padding: 8px 16px 26px;
  position: relative;
}
.hero-inner { max-width: 1200px; margin: 0 auto; }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mc);
  font-size: 0.6rem;
  letter-spacing: 2px;
  color: #4ade80;
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.35);
  padding: 5px 13px;
  border-radius: 20px;
  margin-bottom: 14px;
}
.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 10px #4ade80;
  animation: pulse 1.4s ease-in-out infinite;
}
.hero-title {
  font-family: var(--mc);
  font-size: clamp(1.8rem, 5vw, 3.2rem);
  font-weight: 400;
  letter-spacing: 4px;
  background: linear-gradient(100deg, #fff 10%, #c084fc 35%, #fff 55%, #a855f7 75%, #fff 95%);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 22px rgba(168,85,247,0.55));
  animation: shimmer 5s linear infinite;
  line-height: 1.1;
}
.hero-sub {
  margin-top: 12px;
  font-family: var(--mc);
  font-size: 0.6rem;
  letter-spacing: 3px;
  color: var(--muted);
}
@media (max-width: 600px) { .hero-sub { font-size: 0.5rem; letter-spacing: 1.5px; } }

/* ════════════════════════════════════════════
   V4 — IMAGE ASSETS & RICHER FX
   ════════════════════════════════════════════ */

/* ── Hero with crystal-cavern background ── */
.hero {
  position: relative;
  overflow: hidden;
  padding: 46px 16px 52px;
  margin-bottom: 10px;
}
/* Abstract crystal-glow backdrop (pure CSS, particles show through, no raster) */
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  will-change: transform;
  background:
    radial-gradient(70% 90% at 50% -10%, rgba(124,58,237,0.40), transparent 60%),
    radial-gradient(45% 70% at 16% 18%, rgba(168,85,247,0.22), transparent 70%),
    radial-gradient(45% 70% at 84% 22%, rgba(192,132,252,0.20), transparent 70%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 0%, #000 58%, transparent 100%);
}
/* faint hairline separators top & bottom for a clean "section" feel */
.hero::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 14px;
  width: 120px;
  height: 2px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 14px rgba(168,85,247,0.7);
}
.hero-inner { position: relative; z-index: 2; }
.hero-title {
  filter: drop-shadow(0 0 26px rgba(168,85,247,0.7)) drop-shadow(0 4px 12px rgba(0,0,0,0.6));
}
.hero-sub { color: #d9caf2; text-shadow: 0 2px 8px rgba(0,0,0,0.7); }

.console-body { position: relative; }

/* ── Champion trophy image ── */
.champion.crowned { padding-top: 24px; }
.champion.crowned::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 50%;
  width: 150px; height: 150px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(192,132,252,0.5) 0%, rgba(168,85,247,0.18) 42%, transparent 70%);
  filter: blur(8px);
  z-index: 0;
  pointer-events: none;
}
.champion > * { position: relative; z-index: 1; }
.champion .trophy {
  width: 64px;
  height: auto;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5)) drop-shadow(0 0 18px rgba(192,132,252,0.9));
  animation: floaty 3.4s ease-in-out infinite;
  margin: -6px 0 0;
}
.champion .trophy.dim {
  width: 48px;
  filter: grayscale(0.6) brightness(0.7) drop-shadow(0 0 6px rgba(120,90,160,0.4));
  opacity: 0.5;
  animation: none;
}
.champion .champ-skin {
  width: 40px; height: 40px;
  border-radius: 8px;
  image-rendering: pixelated;
  box-shadow: 0 0 0 2px rgba(251,191,36,0.6), 0 0 16px rgba(251,191,36,0.45);
  margin-top: 4px;
}

/* ── Confetti burst when a champion is crowned ── */
.confetti {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}
.confetti i {
  position: absolute;
  top: -12px;
  width: 9px; height: 14px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall var(--d, 2.6s) ease-in forwards;
  animation-delay: var(--delay, 0s);
}
@keyframes confettiFall {
  0% { transform: translateY(-20px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(720deg); opacity: 0.9; }
}

/* ════════════════════════════════════════════
   V5 — PREMIUM POLISH (pure CSS/SVG)
   ════════════════════════════════════════════ */

/* ── Header logo glow ring ── */
.header-left { position: relative; }
.logo-img { position: relative; z-index: 1; }
.header-left::before {
  content: "";
  position: absolute;
  left: 23px; top: 50%;
  width: 46px; height: 46px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168,85,247,0.55), transparent 68%);
  filter: blur(6px);
  animation: pulse 2.6s ease-in-out infinite;
  pointer-events: none;
}

/* ── Living aurora in hero ── */
.hero-bg::before, .hero-bg::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(46px);
  pointer-events: none;
}
.hero-bg::before {
  width: 48%; height: 150%; left: 6%; top: -25%;
  background: radial-gradient(circle, rgba(168,85,247,0.28), transparent 70%);
  animation: blob1 13s ease-in-out infinite alternate;
}
.hero-bg::after {
  width: 44%; height: 140%; right: 6%; top: -15%;
  background: radial-gradient(circle, rgba(124,58,237,0.26), transparent 70%);
  animation: blob2 16s ease-in-out infinite alternate;
}
@keyframes blob1 { to { transform: translate(46px, 22px) scale(1.12); } }
@keyframes blob2 { to { transform: translate(-44px, 14px) scale(1.1); } }

/* ── Floating crystal shards ── */
.shard {
  position: absolute;
  z-index: 1;
  width: 14px; height: 22px;
  background: linear-gradient(160deg, rgba(233,213,255,0.85), rgba(124,58,237,0.5));
  clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%);
  filter: drop-shadow(0 0 8px rgba(168,85,247,0.7));
  opacity: 0.7;
  animation: shardFloat 7s ease-in-out infinite;
}
.shard.s1 { left: 8%;  top: 30%; transform: scale(0.8);  animation-delay: 0s; }
.shard.s2 { left: 20%; top: 62%; transform: scale(1.15); animation-delay: 1.1s; }
.shard.s3 { right: 14%; top: 26%; transform: scale(0.9);  animation-delay: 2.2s; }
.shard.s4 { right: 24%; top: 66%; transform: scale(0.65); animation-delay: 0.6s; }
.shard.s5 { left: 47%; top: 16%; transform: scale(0.55); animation-delay: 1.7s; }
@keyframes shardFloat {
  0%, 100% { transform: translateY(0) rotate(-8deg); }
  50% { transform: translateY(-16px) rotate(10deg); }
}
@media (max-width: 700px) { .shard { display: none; } }

/* ── Hero chips ── */
.hero-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.chip {
  font-family: var(--mc);
  font-size: 0.55rem;
  letter-spacing: 1.5px;
  color: var(--accent-bright);
  background: rgba(124,58,237,0.14);
  border: 1px solid var(--border-soft);
  padding: 6px 12px 5px;
  border-radius: 20px;
  backdrop-filter: blur(6px);
  transition: 0.2s;
}
.chip:hover { border-color: var(--accent); box-shadow: 0 0 14px rgba(168,85,247,0.4); transform: translateY(-2px); }
.chip.gold { color: #fde68a; border-color: rgba(251,191,36,0.4); background: rgba(251,191,36,0.1); }

/* ── Deeper glass on panels ── */
.bracket-wrapper { backdrop-filter: blur(8px); }
.card { box-shadow: 0 4px 18px rgba(0,0,0,0.25); }
.footer-stats .fstat { transition: 0.2s; cursor: default; }
.footer-stats .fstat:hover { transform: translateY(-3px); }
.footer-stats .fstat:hover span { text-shadow: 0 0 22px rgba(168,85,247,0.9); }

/* ════════════════════════════════════════════
   V6 — MOBILE / RESPONSIVE
   ════════════════════════════════════════════ */
@media (max-width: 680px) {
  .header { padding: 10px 0; margin-bottom: 16px; }
  .header-content { padding: 0 12px; gap: 8px; }
  .logo-img { width: 36px; height: 36px; }
  .header-left { gap: 10px; }
  .header-left::before { left: 18px; width: 36px; height: 36px; }
  .logo { font-size: 1.05rem; letter-spacing: 1px; }
  .logo-sub { font-size: 0.46rem; letter-spacing: 2px; }
  .online-pill { display: none; }            /* keep header clean; stays in footer */
  .btn-console { padding: 7px 12px; font-size: 0.74rem; }

  .hero { padding: 22px 12px 26px; }
  .hero-title { font-size: 1.55rem; letter-spacing: 2px; }
  .hero-chips { gap: 6px; margin-top: 12px; }
  .chip { font-size: 0.5rem; padding: 5px 9px 4px; letter-spacing: 1px; }
  .shard { display: none; }

  .container { padding: 0 12px 28px; }
  .section-title { font-size: 0.85rem; margin-bottom: 12px; }

  .players-grid { grid-template-columns: 1fr 1fr; gap: 6px; }
  .card { padding: 5px 8px; gap: 7px; }
  .card .name { font-size: 0.78rem; }

  .bracket-wrapper { padding: 16px 12px; min-height: 400px; border-radius: 12px; }
  .bracket { gap: 24px; min-width: 600px; min-height: 460px; }
  .match { max-width: 166px; }

  .footer { padding: 14px 12px 30px; gap: 14px; }
  .footer-stats { gap: 22px; }
  .fstat span { font-size: 1.25rem; }
  .server-badge { font-size: 0.72rem; padding: 9px 18px; }

  .console { width: 100vw; max-width: 100vw; }
}

@media (max-width: 480px) {
  .hero-title { font-size: 1.3rem; letter-spacing: 1px; }
  /* keep the chip row minimal on small phones */
  .chip:nth-child(3), .chip:nth-child(4) { display: none; }
}
@media (max-width: 400px) {
  .players-grid { grid-template-columns: 1fr; }
  .footer-stats { gap: 16px; }
  .fstat span { font-size: 1.05rem; }
}

/* Tap targets comfortable on touch devices */
@media (hover: none) {
  .btn, .chip, select, input { min-height: 38px; }
  .card:hover, .match:hover { transform: none; }   /* no sticky hover on touch */
}

/* ── Light copy-deterrent: no UI text selection, but keep inputs usable ── */
body { -webkit-user-select: none; -ms-user-select: none; user-select: none; }
input, textarea, select { -webkit-user-select: text; user-select: text; }
img { -webkit-user-drag: none; user-drag: none; }

/* ════════════════════════════════════════════
   V7 — EASTER EGG FX
   ════════════════════════════════════════════ */
.egg-toast {
  position: fixed;
  left: 50%; top: 20%;
  transform: translate(-50%, -12px);
  background: rgba(26,16,44,0.96);
  border: 1px solid var(--accent);
  color: #fff;
  font-family: var(--mc);
  font-size: 0.68rem;
  letter-spacing: 2px;
  padding: 12px 22px;
  border-radius: 12px;
  box-shadow: 0 0 34px rgba(168,85,247,0.6);
  opacity: 0;
  transition: 0.4s cubic-bezier(.2,.8,.2,1);
  z-index: 600;
  pointer-events: none;
  white-space: nowrap;
}
.egg-toast.show { opacity: 1; transform: translate(-50%, 0); }

.egg-rain { position: fixed; inset: 0; pointer-events: none; z-index: 400; overflow: hidden; }
.egg-rain i {
  position: absolute;
  top: -28px;
  clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%);
  opacity: 0.9;
  filter: drop-shadow(0 0 6px rgba(168,85,247,0.8));
  animation: eggFall var(--d) linear var(--delay) forwards;
}
@keyframes eggFall { to { transform: translateY(112vh) rotate(var(--rot)); opacity: 0.85; } }

.egg-spark {
  position: fixed;
  width: 7px; height: 11px;
  clip-path: polygon(50% 0, 100% 35%, 50% 100%, 0 35%);
  pointer-events: none;
  z-index: 350;
  filter: drop-shadow(0 0 4px rgba(168,85,247,0.8));
  animation: eggSpark 0.6s ease-out forwards;
}
@keyframes eggSpark {
  from { opacity: 1; transform: translate(-50%, -50%); }
  to   { opacity: 0; transform: translate(-50%, -50%) translate(var(--tx), var(--ty)) scale(0.3); }
}

.egg-rave { animation: eggRave 1.3s linear infinite; }
@keyframes eggRave { to { filter: hue-rotate(360deg); } }

.egg-shake { animation: eggShake 0.55s ease; }
@keyframes eggShake {
  0%,100% { transform: translate(0,0); }
  20% { transform: translate(-9px, 4px); }
  40% { transform: translate(9px, -4px); }
  60% { transform: translate(-7px, -3px); }
  80% { transform: translate(7px, 3px); }
}

.egg-creeper {
  position: fixed; inset: 0;
  z-index: 450; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle, rgba(93,182,83,0.32), transparent 60%);
  animation: eggFlash 1.3s ease forwards;
}
@keyframes eggFlash { 0% { opacity: 0; } 15% { opacity: 1; } 100% { opacity: 0; } }
.egg-creeper svg {
  width: 116px; height: 116px;
  image-rendering: pixelated;
  filter: drop-shadow(0 0 22px rgba(93,182,83,0.9));
  animation: eggPop 0.5s cubic-bezier(.2,1.5,.4,1);
}
@keyframes eggPop { from { transform: scale(0.35); } to { transform: scale(1); } }
