:root {
  --ink: #10151f;
  --navy: #081626;
  --navy-2: #102943;
  --ocean: #153e5a;
  --red: #c92b2d;
  --red-dark: #8c1c1f;
  --gold: #e9b94f;
  --gold-soft: #f2d483;
  --paper: #f3ead2;
  --paper-2: #e6d7b4;
  --white: #fffdf6;
  --muted: #9eb0c1;
  --success: #4ea875;
  --danger: #d86161;
  --shadow: 0 20px 50px rgba(0,0,0,.28);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--white);
  background:
    radial-gradient(circle at 20% 0%, rgba(233,185,79,.12), transparent 32rem),
    radial-gradient(circle at 100% 30%, rgba(201,43,45,.12), transparent 28rem),
    linear-gradient(180deg, #07111d 0%, var(--navy) 48%, #06101a 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: linear-gradient(to bottom, #000, transparent 85%);
}

a { color: inherit; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(233,185,79,.15);
  background: rgba(6,16,26,.86);
  backdrop-filter: blur(18px);
}

.nav {
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  margin-right: auto;
  font-weight: 900;
  letter-spacing: .08em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: var(--gold);
  border: 3px solid var(--red);
  box-shadow: 0 0 0 4px rgba(233,185,79,.12);
  font-size: 23px;
}

.brand small {
  display: block;
  color: var(--gold-soft);
  font-size: 10px;
  letter-spacing: .22em;
  font-weight: 800;
}

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  padding: 10px 12px;
  border-radius: 10px;
  color: #c6d2dc;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
}
.nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.065); color: #fff; }
.nav-links .admin-link { color: var(--gold-soft); border: 1px solid rgba(233,185,79,.2); }

.hero { padding: 72px 0 36px; }
.hero-grid { display: grid; grid-template-columns: 1.3fr .7fr; gap: 34px; align-items: center; }
.eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 7px 10px;
  border: 1px solid rgba(233,185,79,.25);
  border-radius: 999px;
  color: var(--gold-soft);
  background: rgba(233,185,79,.07);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

h1, h2, h3 { margin-top: 0; }
h1 { font-size: clamp(42px, 7vw, 82px); line-height: .94; letter-spacing: -.05em; margin: 18px 0 22px; }
h1 .accent { color: var(--gold); text-shadow: 0 4px 0 rgba(140,28,31,.65); }
.hero p { max-width: 700px; color: #b8c6d2; font-size: 18px; line-height: 1.7; }

.hero-card {
  position: relative;
  padding: 28px;
  border-radius: 26px;
  color: var(--ink);
  background:
    linear-gradient(rgba(255,255,255,.14), rgba(255,255,255,0)),
    var(--paper);
  box-shadow: var(--shadow);
  transform: rotate(1.2deg);
  border: 2px solid rgba(140,28,31,.75);
}
.hero-card::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px dashed rgba(16,21,31,.28);
  border-radius: 18px;
  pointer-events: none;
}
.hero-card > * { position: relative; z-index: 1; }
.hero-card .stamp { color: var(--red-dark); font-weight: 950; letter-spacing: .06em; text-transform: uppercase; }
.hero-card .big { font-size: 58px; font-weight: 950; line-height: 1; margin: 8px 0; }
.hero-card .muted-dark { color: #5e5648; }

.section { padding: 34px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.section-head h2 { margin-bottom: 4px; font-size: clamp(25px, 3vw, 34px); }
.section-head p { margin: 0; color: var(--muted); }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }

.panel {
  background: linear-gradient(180deg, rgba(16,41,67,.78), rgba(8,22,38,.9));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: 0 14px 40px rgba(0,0,0,.16);
}
.panel-pad { padding: 22px; }

.stat-card { padding: 22px; min-height: 130px; }
.stat-label { color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.stat-value { font-size: 35px; line-height: 1.1; font-weight: 900; margin-top: 8px; }
.stat-note { color: #9eb0c1; font-size: 13px; margin-top: 6px; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--muted); }
.status-dot.live { background: var(--success); box-shadow: 0 0 0 5px rgba(78,168,117,.13); }
.status-dot.finished { background: var(--gold); }

.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; min-width: 690px; }
th, td { padding: 15px 16px; border-bottom: 1px solid rgba(255,255,255,.07); text-align: left; }
th { color: #8fa5b8; font-size: 11px; text-transform: uppercase; letter-spacing: .09em; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: rgba(255,255,255,.025); }
.rank { width: 60px; color: var(--gold-soft); font-weight: 900; }
.points { color: var(--gold); font-weight: 900; font-size: 18px; }
.player-name { font-weight: 850; }
.subline { color: #7f96a9; font-size: 12px; margin-top: 3px; }

.podium { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; margin-bottom: 18px; }
.podium-card {
  padding: 20px;
  border-radius: 16px;
  border: 1px solid rgba(233,185,79,.14);
  background: linear-gradient(150deg, rgba(233,185,79,.08), rgba(255,255,255,.02));
}
.podium-card:first-child { border-color: rgba(233,185,79,.38); }
.podium-place { color: var(--gold-soft); font-weight: 900; }
.podium-name { font-weight: 900; font-size: 20px; margin: 8px 0 2px; }

.round-stack { display: grid; gap: 20px; }
.round-panel { overflow: hidden; }
.round-title {
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.round-title h3 { margin: 0; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: .07em;
  border: 1px solid rgba(255,255,255,.1);
  color: #b9c8d5;
}
.badge.open { color: #a8e2c1; border-color: rgba(78,168,117,.3); }
.badge.locked { color: var(--gold-soft); border-color: rgba(233,185,79,.24); }

.match-list { padding: 10px; display: grid; gap: 8px; }
.match-row {
  display: grid;
  grid-template-columns: 70px 1fr 44px 1fr 100px;
  gap: 12px;
  align-items: center;
  padding: 12px 12px;
  background: rgba(0,0,0,.14);
  border-radius: 12px;
}
.table-no { color: #7f96a9; font-size: 12px; font-weight: 800; }
.vs { text-align: center; color: #70869a; font-weight: 900; font-size: 12px; }
.winner { color: var(--gold-soft); }
.result { text-align: right; color: #b6c6d3; font-size: 13px; font-weight: 800; }

.rules-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.rule-card { padding: 22px; }
.rule-card h3 { color: var(--gold-soft); margin-bottom: 9px; }
.rule-card p, .rule-card li { color: #b6c5d1; line-height: 1.65; }
.rule-card ul { padding-left: 20px; }
.notice {
  padding: 16px 18px;
  border-left: 4px solid var(--gold);
  border-radius: 10px;
  background: rgba(233,185,79,.07);
  color: #d5dfE7;
  line-height: 1.6;
}
.notice strong { color: var(--gold-soft); }

.btn {
  border: 0;
  border-radius: 11px;
  padding: 11px 15px;
  background: rgba(255,255,255,.08);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}
.btn:hover { filter: brightness(1.08); }
.btn-primary { background: linear-gradient(135deg, var(--red), var(--red-dark)); box-shadow: 0 8px 20px rgba(201,43,45,.22); }
.btn-gold { background: var(--gold); color: var(--ink); }

.empty { padding: 36px 20px; text-align: center; color: var(--muted); }

.footer { padding: 52px 0 38px; color: #71879b; font-size: 12px; }
.footer-line { border-top: 1px solid rgba(255,255,255,.07); padding-top: 20px; display: flex; justify-content: space-between; gap: 18px; }

.loading { opacity: .65; }

@media (max-width: 850px) {
  .nav { min-height: 66px; }
  .nav-links a:not(.admin-link) { display: none; }
  .hero { padding-top: 44px; }
  .hero-grid, .grid-3, .grid-2, .rules-grid { grid-template-columns: 1fr; }
  .hero-card { transform: none; }
  .podium { grid-template-columns: 1fr; }
  .match-row { grid-template-columns: 52px 1fr 32px 1fr; }
  .match-row .result { grid-column: 2 / -1; text-align: left; padding-top: 4px; }
  .footer-line { flex-direction: column; }
}

@media (max-width: 540px) {
  .shell { width: min(100% - 22px, 1180px); }
  .brand-text { font-size: 13px; }
  h1 { font-size: 46px; }
  .hero p { font-size: 16px; }
  .section-head { align-items: start; flex-direction: column; }
  .match-row { grid-template-columns: 42px 1fr; gap: 8px; }
  .match-row .vs { display: none; }
  .match-row .player-b { grid-column: 2; }
  .match-row .result { grid-column: 2; }
}
