:root{
  --bg: #0b0f14;
  --card: #101722;
  --card2:#0e1520;
  --text: #e7eef8;
  --muted: rgba(231,238,248,.72);
  --muted2: rgba(231,238,248,.55);
  --line: rgba(231,238,248,.10);
  --accent: #25d4c7;
  --accent2:#1ea7ff;
  --danger:#ff4d6d;
  --ok:#35d07f;
  --warn:#ffd166;
  --shadow: 0 12px 36px rgba(0,0,0,.45);
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family:var(--sans);
  background: radial-gradient(1200px 700px at 20% 0%, rgba(37,212,199,.18), transparent 60%),
              radial-gradient(900px 600px at 80% 10%, rgba(30,167,255,.18), transparent 60%),
              var(--bg);
  color:var(--text);
}

.topbar{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:16px 20px;
  border-bottom:1px solid var(--line);
  background: linear-gradient(180deg, rgba(16,23,34,.92), rgba(11,15,20,.72));
  position:sticky;
  top:0;
  z-index:10;
  backdrop-filter: blur(10px);
}

.topbar__actions{ display:flex; align-items:center; gap:10px; }
.btn--sm{ padding:8px 10px; border-radius:12px; font-size:12px; }

.brand__title{
  font-weight:800;
  letter-spacing:.6px;
  text-transform:uppercase;
}
.brand__sub{color:var(--muted2); font-size:12px; margin-top:2px}

.status{ text-align:right; }
.status__row{ display:flex; justify-content:flex-end; gap:8px; align-items:center;}
.status__row--small{ margin-top:4px; color:var(--muted2); font-size:12px;}
.pill{
  display:inline-flex;
  padding:4px 10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(16,23,34,.7);
  font-size:12px;
  letter-spacing:.3px;
}
.pill--muted{ color: var(--muted2); }

.wrap{ max-width: 1100px; margin: 18px auto; padding: 0 14px 40px; display:flex; flex-direction:column; gap:14px;}
.card{
  background: linear-gradient(180deg, rgba(16,23,34,.92), rgba(14,21,32,.92));
  border:1px solid var(--line);
  border-radius:16px;
  padding:16px 16px 14px;
  box-shadow: var(--shadow);
}
.card h2{ margin:0 0 10px; font-size:18px;}
.card h3{ margin:12px 0 6px; font-size:14px; color: rgba(231,238,248,.88); }
.muted{ color: var(--muted); }
.small{ font-size:12px; }
.mono{ font-family:var(--mono); }
.hidden{ display:none; }

.grid2{ display:grid; grid-template-columns: 1fr 1fr; gap:14px; }
@media (max-width: 900px){ .grid2{ grid-template-columns:1fr; } .status{display:none;} }

.rules{ margin:6px 0 0; padding-left:18px; }
.rules li{ margin:6px 0; color: rgba(231,238,248,.86); }

.rule-head{ margin: 12px 0 6px; }
.rule-badge{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(231,238,248,.14);
  background: rgba(7,10,15,.35);
  font-size:12px;
  letter-spacing:.3px;
  text-transform:uppercase;
}
.rule-dot{
  font-family: var(--mono);
  font-size:14px;
  line-height:1;
}
.rule-badge--light{
  border-color: rgba(53,208,127,.35);
  background: rgba(53,208,127,.08);
  color: rgba(231,238,248,.92);
}
.rule-badge--light .rule-dot{ color: var(--ok); }

.rule-badge--mid{
  border-color: rgba(255,209,102,.35);
  background: rgba(255,209,102,.08);
  color: rgba(231,238,248,.92);
}
.rule-badge--mid .rule-dot{ color: var(--warn); }

.rule-badge--hard{
  border-color: rgba(255,77,109,.35);
  background: rgba(255,77,109,.08);
  color: rgba(231,238,248,.92);
}
.rule-badge--hard .rule-dot{ color: var(--danger); }

.note{
  margin-top:12px;
  padding:10px 12px;
  border-radius:12px;
  border:1px dashed rgba(37,212,199,.32);
  background: rgba(37,212,199,.06);
  color: rgba(231,238,248,.84);
}

.label{ display:block; margin:10px 0 6px; font-size:12px; color: var(--muted2); }
.input, .textarea, select.input{
  width:100%;
  padding:10px 10px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(7,10,15,.55);
  color: var(--text);
  outline:none;
}
.textarea{ resize:vertical; }

.row{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding-bottom:8px;
}
.row--end{ justify-content:flex-end; }
.field{ flex:1; }

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--line);
  background: rgba(16,23,34,.75);
  color: var(--text);
  cursor:pointer;
  user-select:none;
  transition: transform .06s ease, border-color .14s ease, background .14s ease;
}
.btn:hover{ border-color: rgba(37,212,199,.35); }
.btn:active{ transform: translateY(1px); }
.btn--primary{
  border-color: rgba(37,212,199,.55);
  background: linear-gradient(180deg, rgba(37,212,199,.20), rgba(16,23,34,.75));
}
.btn--blocked{
  border-color: rgba(255,209,102,.55);
  background: linear-gradient(180deg, rgba(255,209,102,.12), rgba(16,23,34,.75));
}
.btn--ghost{
  background: transparent;
  border-color: rgba(231,238,248,.18);
  color: rgba(231,238,248,.85);
}

.tournament-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:12px; }
.tournament-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap;}

.round-view{ display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.match{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background: rgba(7,10,15,.35);
}
.match__title{ display:flex; justify-content:space-between; gap:10px; align-items:center; }
.match__title .muted{ font-size:12px; }
.teams{ display:grid; grid-template-columns: 1fr 1fr; gap:10px; margin-top:10px; }
.team{
  border:1px solid rgba(231,238,248,.10);
  border-radius:12px;
  padding:10px;
  background: rgba(16,23,34,.45);
}
.team__name{ font-weight:700; }
.team__players{ margin-top:6px; color: rgba(231,238,248,.80); font-size:13px;}
.score-entry{ display:flex; gap:8px; align-items:center; margin-top:10px; }
.score-entry input{ width:80px; text-align:center; font-family:var(--mono); }
.score-entry .btn{ margin-left:auto; }

.wheel-result{
  margin-top:12px;
  padding:12px;
  border-radius:14px;
  border:1px solid rgba(37,212,199,.22);
  background: rgba(37,212,199,.06);
  min-height:48px;
  display:flex;
  align-items:center;
  white-space: pre-wrap;
}

.wheel-attn{
  position: relative;
  border-color: rgba(37,212,199,.55);
  box-shadow: 0 0 0 1px rgba(37,212,199,.20), 0 18px 60px rgba(37,212,199,.10);
}
.wheel-attn::after{
  content:"";
  position:absolute;
  inset:0;
  border-radius:16px;
  background: rgba(0,0,0,.55);
  z-index: 2;
  pointer-events: auto;
}
.wheel-attn #btn-spin{
  position: relative;
  z-index: 3;
  border-color: rgba(37,212,199,.75);
  background: linear-gradient(180deg, rgba(37,212,199,.28), rgba(16,23,34,.78));
  box-shadow: 0 0 0 1px rgba(37,212,199,.22), 0 16px 40px rgba(0,0,0,.55);
  animation: pulseSpin 1.1s ease-in-out infinite;
}
.wheel-attn h2,
.wheel-attn .muted,
.wheel-attn .wheel-result,
.wheel-attn .details{
  position: relative;
  z-index: 1;
}
.wheel-attn .tournament-actions{
  position: relative;
  z-index: 3;
}

@keyframes pulseSpin{
  0%{ transform: translateY(0); filter: brightness(1.05); }
  50%{ transform: translateY(-1px); filter: brightness(1.22); }
  100%{ transform: translateY(0); filter: brightness(1.05); }
}

.details{ margin-top:10px; }
.details summary{ cursor:pointer; color: rgba(231,238,248,.92); }

.table-wrap{ overflow:auto; border-radius:14px; border:1px solid var(--line); }
.table{ width:100%; border-collapse:collapse; min-width:700px; background: rgba(7,10,15,.30); }
.table th,.table td{ padding:10px 10px; border-bottom:1px solid rgba(231,238,248,.08); font-size:13px; }
.table th{ text-align:left; color: rgba(231,238,248,.92); background: rgba(16,23,34,.55); position:sticky; top:0; }
.table td{ color: rgba(231,238,248,.84); }
.table tr:hover td{ background: rgba(37,212,199,.05); }
.tag{ font-family:var(--mono); font-size:12px; padding:2px 8px; border-radius:999px; border:1px solid rgba(231,238,248,.14); color: rgba(231,238,248,.78);}

.history{ display:flex; flex-direction:column; gap:10px; margin-top:10px; }
.history-item{
  border:1px solid var(--line);
  border-radius:14px;
  padding:12px;
  background: rgba(7,10,15,.35);
}
.history-item__head{ display:flex; justify-content:space-between; align-items:center; gap:10px; }
.history-item__meta{ color: var(--muted2); font-size:12px; }
.history-item__wheel{ margin-top:10px; color: rgba(231,238,248,.80); }

.footer{ padding:16px 14px 24px; text-align:center; border-top:1px solid var(--line); color: var(--muted2); }
