:root{
  color-scheme:dark;
  --bg:#07111f;
  --panel:rgba(8,18,32,.86);
  --line:rgba(245,215,122,.22);
  --gold:#f5d77a;
  --blue:#22d3ee;
  --text:#eef6ff;
  --muted:#9fb2c7;
  --danger:#fb7185;
  --ok:#86efac;
}

*{box-sizing:border-box}
html,
body{
  overflow-x:hidden;
}
body{
  margin:0;
  min-height:100vh;
  font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at 15% 10%, rgba(34,211,238,.16), transparent 32%),
    radial-gradient(circle at 90% 0%, rgba(245,215,122,.14), transparent 28%),
    linear-gradient(180deg,#06101e,#020617 70%);
}

.tournaments-bg-carousel,
.tournaments-bg-overlay,
.tournaments-bg-meta,
.tournaments-bg-dots{
  position:fixed;
  pointer-events:none;
}

.tournaments-bg-carousel{
  inset:0;
  z-index:-3;
  overflow:hidden;
  background:#020617;
}

.tournaments-bg-overlay{
  inset:0;
  z-index:-2;
  background:
    radial-gradient(circle at 15% 12%, rgba(34,211,238,.13), transparent 34%),
    linear-gradient(180deg,rgba(2,6,23,.42),rgba(2,6,23,.74));
  backdrop-filter:blur(1.5px);
}

.tournaments-bg-slide{
  position:absolute;
  inset:0;
  opacity:0;
  background-size:cover;
  background-position:center;
  background-repeat:no-repeat;
  transform:scale(1);
  transition:opacity 1.8s ease;
  will-change:opacity,transform;
}

.tournaments-bg-slide.is-active{
  opacity:1;
  animation:tournament-bg-kenburns 10s ease-in-out forwards;
}

.tournaments-bg-meta{
  left:18px;
  bottom:18px;
  z-index:1;
  max-width:min(280px,calc(100vw - 130px));
  color:rgba(238,246,255,.72);
  font-size:12px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  text-shadow:0 2px 12px rgba(0,0,0,.75);
}

.tournaments-bg-dots{
  right:18px;
  bottom:20px;
  z-index:1;
  display:flex;
  gap:7px;
  align-items:center;
  padding:7px 9px;
  border:1px solid rgba(255,255,255,.12);
  border-radius:999px;
  background:rgba(2,6,23,.28);
  backdrop-filter:blur(8px);
}

.tournaments-bg-dot{
  width:7px;
  height:7px;
  border-radius:50%;
  background:rgba(238,246,255,.36);
  box-shadow:0 0 0 1px rgba(2,6,23,.32);
  transition:background .35s ease,transform .35s ease;
}

.tournaments-bg-dot.is-active{
  background:var(--gold);
  transform:scale(1.28);
}

@keyframes tournament-bg-kenburns{
  from{transform:scale(1) translate3d(0,0,0)}
  to{transform:scale(1.07) translate3d(-1.2%,-.8%,0)}
}

a{color:inherit}
button,input,select{
  font:inherit;
}
button{
  cursor:pointer;
  border:1px solid rgba(34,211,238,.36);
  border-radius:10px;
  padding:10px 14px;
  color:var(--text);
  background:linear-gradient(135deg,rgba(14,165,233,.22),rgba(245,215,122,.14));
}
button:hover{border-color:var(--gold)}
button:disabled{
  opacity:.45;
  cursor:not-allowed;
}
input,select{
  width:100%;
  border:1px solid rgba(255,255,255,.12);
  border-radius:10px;
  padding:11px 12px;
  color:var(--text);
  background:rgba(2,6,23,.7);
}
label{
  display:grid;
  gap:8px;
  color:var(--muted);
  font-size:14px;
}

.tournament-topbar{
  position:sticky;
  top:0;
  z-index:10;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:18px;
  padding:14px clamp(16px,3vw,36px);
  border-bottom:1px solid var(--line);
  background:rgba(2,6,23,.78);
  backdrop-filter:blur(14px);
}
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  text-decoration:none;
  font-weight:900;
}
.brand img{
  width:48px;
  height:48px;
  object-fit:contain;
}
.tournament-topbar nav{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.tournament-topbar nav a{
  text-decoration:none;
  color:var(--muted);
}
.tournament-shell{
  width:min(1180px,calc(100% - 28px));
  margin:24px auto 60px;
  display:grid;
  gap:18px;
}
.hero-card,.panel{
  border:1px solid var(--line);
  border-radius:16px;
  background:var(--panel);
  box-shadow:0 20px 80px rgba(0,0,0,.26);
}
.hero-card{
  display:flex;
  justify-content:space-between;
  gap:18px;
  padding:28px;
}
.hero-card h1{
  margin:6px 0 10px;
  max-width:760px;
  font-size:clamp(30px,4vw,52px);
  line-height:1;
}
.hero-card p{color:var(--muted)}
.eyebrow{
  color:var(--gold)!important;
  text-transform:uppercase;
  letter-spacing:.08em;
  font-size:12px;
  font-weight:800;
}
.grid{
  display:grid;
  grid-template-columns:minmax(280px,380px) 1fr;
  gap:18px;
}
.panel{
  padding:20px;
}
.panel h2{
  margin:0 0 16px;
}
.panel-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:14px;
}
.form-row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
form{
  display:grid;
  gap:14px;
}
.swiss-settings{
  display:grid;
  gap:14px;
}
.badge{
  border:1px solid rgba(245,215,122,.3);
  border-radius:999px;
  padding:6px 10px;
  color:var(--gold);
  background:rgba(245,215,122,.08);
}
.notice{
  border:1px solid rgba(245,215,122,.24);
  border-radius:12px;
  padding:12px 14px;
  color:var(--gold);
  background:rgba(245,215,122,.08);
}
.hidden{display:none!important}
.empty-state,.muted{color:var(--muted)}
.actions{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:14px;
}
.players-list{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(210px,1fr));
  gap:10px;
}
.champion-box{
  display:flex;
  align-items:center;
  gap:14px;
  margin:0 0 16px;
  padding:16px;
  border:1px solid rgba(245,215,122,.48);
  border-radius:14px;
  background:
    radial-gradient(circle at 100% 0%, rgba(245,215,122,.2), transparent 34%),
    rgba(2,6,23,.58);
}
.champion-box.hidden{display:none}
.champion-box img{
  width:64px;
  height:64px;
  border:2px solid rgba(245,215,122,.7);
  border-radius:50%;
  object-fit:cover;
}
.champion-box span{
  color:var(--gold);
  font-size:12px;
  font-weight:900;
  letter-spacing:.08em;
  text-transform:uppercase;
}
.champion-box strong{
  display:block;
  font-size:22px;
}
.champion-box p,
.champion-box small{
  margin:3px 0 0;
  color:var(--muted);
}
.player-card{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:12px;
  background:rgba(2,6,23,.48);
}
.player-card img{
  width:42px;
  height:42px;
  border-radius:50%;
  object-fit:cover;
}
.player-card strong{display:block}
.player-card span{font-size:12px;color:var(--muted)}
.table-wrap{overflow:auto}
table{
  width:100%;
  border-collapse:collapse;
}
th,td{
  padding:10px;
  border-bottom:1px solid rgba(255,255,255,.08);
  text-align:left;
  white-space:nowrap;
}
th{color:var(--gold)}
.rounds-root{
  display:grid;
  gap:18px;
}
.round-card{
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px;
  background:rgba(8,18,32,.72);
}
.matches-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(280px,1fr));
  gap:14px;
}
.match-card{
  display:grid;
  gap:12px;
  border:1px solid rgba(34,211,238,.18);
  border-radius:14px;
  padding:14px;
  background:rgba(2,6,23,.56);
}
.match-title{
  display:flex;
  justify-content:space-between;
  color:var(--gold);
  font-weight:800;
}
.versus{
  display:grid;
  gap:6px;
  font-size:18px;
  font-weight:800;
}
.match-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}
.external-box{
  display:grid;
  gap:8px;
}
.result-row{
  display:grid;
  grid-template-columns:1fr;
  gap:8px;
}
.danger{
  border-color:rgba(251,113,133,.4);
  color:#fecdd3;
}
.ok{color:var(--ok)}
.round-table-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(140px,1fr));
  gap:10px;
  margin-bottom:18px;
}
.round-table-summary article{
  border:1px solid rgba(245,215,122,.2);
  border-radius:14px;
  padding:14px;
  background:rgba(2,6,23,.48);
}
.round-table-summary span{
  display:block;
  color:var(--muted);
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.round-table-summary strong{
  display:block;
  margin-top:6px;
  color:var(--gold);
  font-size:20px;
}
.round-table-lists{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
  margin-top:16px;
}
.queue-list,
.history-list{
  min-height:90px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:14px;
  padding:14px 18px;
  background:rgba(2,6,23,.44);
}
.queue-list li{margin:6px 0}
.history-list p{margin:0 0 8px;color:var(--muted)}
.ranked-toggle{
  display:flex;
  align-items:center;
  gap:10px;
}
.ranked-toggle input{
  width:auto;
}
.ranking-status{
  margin-top:10px;
  padding:10px 12px;
  border-radius:8px;
  background:rgba(14,165,233,.12);
  border:1px solid rgba(14,165,233,.28);
}
.ranking-status.unranked{
  background:rgba(245,158,11,.12);
  border-color:rgba(245,158,11,.34);
}
.hall-tabs{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-bottom:16px;
}
.hall-tabs button.active{
  background:var(--gold);
  color:#111827;
}
.hall-player-cell{
  display:flex;
  align-items:center;
  gap:10px;
}
.hall-player-cell img{
  width:30px;
  height:30px;
  border-radius:50%;
  object-fit:cover;
}

@media(max-width:760px){
  .tournaments-bg-meta{
    display:none;
  }
  .tournaments-bg-dots{
    right:12px;
    bottom:12px;
    gap:6px;
    padding:6px 8px;
  }
  .tournaments-bg-dot{
    width:6px;
    height:6px;
  }
  .tournament-topbar,.hero-card,.panel-header{
    align-items:flex-start;
    flex-direction:column;
  }
  .grid,.form-row,.round-table-summary,.round-table-lists{
    grid-template-columns:1fr;
  }
  .tournament-topbar nav{
    width:100%;
  }
  .tournament-topbar nav button,
  .tournament-topbar nav a{
    width:100%;
  }
}
