/* Layout and colors follow the original Ugadayka reference. */
:root {
  --panel: rgba(14, 16, 22, 0.64);
  --accent: #bdc8da;
  --accent-deep: #e6ebf3;
  --accent-soft: rgba(173, 187, 212, 0.08);
  --pearl-blue: #a6b8d2;
  --pearl-line: rgba(173, 187, 212, 0.2);
  --pearl-glow: rgba(173, 187, 212, 0.08);
  --gold: #f0cd83;
  --radius: 14px;
  --shadow: none;
}
body { isolation: isolate; }
.bg {
  background:
    radial-gradient(650px 500px at 12% 25%, rgba(109, 166, 232, 0.075), transparent 70%),
    radial-gradient(700px 550px at 87% 76%, rgba(137, 150, 218, 0.06), transparent 70%),
    linear-gradient(165deg, #0c0e13, #13161d 65%, #171a22);
}
.shell { width: min(940px, calc(100% - 2rem)); padding: 2.2rem 0 6rem; }
.brand { position: relative; isolation: isolate; text-align: center; margin-bottom: 1.4rem; }
.brand::before {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
  width: min(620px, 94vw);
  height: 190px;
  top: -70px;
  left: 50%;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(126, 182, 247, 0.14), transparent 68%);
  filter: blur(18px);
}
.brand h1 {
  display: inline-flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.28em;
  flex-wrap: wrap;
  font-family: var(--font-display);
  font-size: clamp(2.55rem, 6.4vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1;
  text-shadow: 0 0 18px rgba(173, 208, 255, 0.2), 0 0 40px rgba(128, 177, 241, 0.09);
}
.brand-lixxx {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.25em 0.6em;
  border: 2px solid #8d9eb9;
  border-radius: 0.15em;
  font-size: 0.44em;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e5eeff;
  text-shadow: 0 0 7px rgba(180, 215, 255, 0.5), 0 0 18px rgba(140, 188, 246, 0.28), 0 0 30px rgba(140, 188, 246, 0.1);
  background: rgba(16, 19, 26, 0.45);
  box-shadow: 0 0 15px rgba(143, 185, 239, 0.18), inset 0 0 10px rgba(143, 185, 239, 0.04);
}
.active-banner { box-shadow: 0 0 18px rgba(132, 174, 229, 0.07); }
.tagline { margin: 0.85rem 0 0; font-size: 0.95rem; color: var(--muted); }
/* The outlined Lixxx wordmark is permanent; tournament names remain configurable. */
.tournament-badge {
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: inherit;
  -webkit-text-fill-color: currentColor;
  background: none;
  box-shadow: none;
  font: inherit;
  letter-spacing: 0;
  text-transform: none;
  animation: none;
}
.tabs { justify-content: center; margin: 0 0 1.1rem; gap: 0.5rem; }
.tab { font-size: 0.95rem; border-radius: 999px; }
.tab.is-active, .search button {
  background: #e6e9f0;
  color: #171823;
}
.tab.is-active { border-color: #b6c1d2; }
.search button:hover { background: #f2f4f8; }
.search { margin-bottom: 0.7rem; }
.search input { min-width: 0; }
.board {
  border: 1px solid var(--pearl-line);
  border-radius: 17px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(196, 218, 247, 0.06), 0 0 35px rgba(113, 152, 211, 0.035);
  backdrop-filter: blur(12px);
  overflow: hidden;
}
.board-head, .row { grid-template-columns: 72px minmax(0, 1fr) 65px minmax(10.5rem, 13rem); gap: 0.55rem 1.15rem; padding: 0.88rem 1.05rem; }
.board-head { border-bottom: 1px solid var(--line); background: none; font-size: 0.78rem; }
.board-head > :nth-child(4) { display: block; text-align: right; }
.row .row-prize { display: inline-flex; overflow-wrap: anywhere; }
.row-prize-skin { white-space: normal; overflow-wrap: anywhere; }
.board-meta { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem 1rem; flex-wrap: wrap; margin-top: 0.9rem; }
.board-meta .participants-chip { margin-top: 0; }
.prizes-note { margin: 0; color: var(--muted); font-size: 0.8rem; }
.prizes-note[hidden] { display: none; }
.board-body { display: block; }
.row-block {
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: none;
  backdrop-filter: none;
}
.row-block:last-child { border-bottom: 0; }
.row { min-height: 49px; }
.row-block:has(.place.p1) {
  background: linear-gradient(90deg, rgba(226, 178, 74, 0.13), transparent 70%);
}
.row-block:has(.place.p1) .row:hover { background: rgba(240, 205, 131, 0.06); }
.row-block:has(.place.p1) .points { color: var(--gold); }
.row-block:has(.place.p2) { background: linear-gradient(90deg, rgba(197, 206, 216, 0.075), transparent 65%); }
.row-block:has(.place.p3) { background: linear-gradient(90deg, rgba(208, 145, 100, 0.075), transparent 65%); }
.place.p2 { text-shadow: 0 0 10px rgba(197, 206, 216, 0.28); }
.place.p3 { text-shadow: 0 0 10px rgba(208, 145, 100, 0.3); }
.row-block:has(.place.p2) .points, .finale-row:has(.place.p2) .points { color: #d6dce5; text-shadow: 0 0 12px rgba(197, 206, 216, 0.15); }
.row-block:has(.place.p3) .points, .finale-row:has(.place.p3) .points { color: #d3aa8c; text-shadow: 0 0 12px rgba(208, 145, 100, 0.15); }
.row-block.is-expanded:not(:has(.place.p1, .place.p2, .place.p3)) { background: rgba(159, 170, 245, 0.035); }
.row .nick { font-weight: 600; font-size: 1rem; }
.nick-name { text-decoration: underline; text-decoration-color: rgba(255, 255, 255, 0.28); text-underline-offset: 0.18em; }
.nick-toggle:hover .nick-name { text-decoration: underline; text-underline-offset: 0.18em; }
.points { justify-self: end; }
.row .points, .finale-row .points { font-family: var(--font-body); font-size: 1rem; font-weight: 800; }
.row-preds { border-top: 1px solid var(--line); padding: 0.75rem 1rem; }
.accuracy { font-size: 0.78rem; font-weight: 600; }
.participants-chip {
  padding: 0.45rem 1rem 0.45rem 0.85rem;
  margin-top: 0.9rem;
  gap: 0.55rem;
  border: 1px solid var(--pearl-line);
  border-radius: 999px;
  background: var(--panel);
  box-shadow: inset 0 1px 0 rgba(196, 218, 247, 0.04);
  backdrop-filter: blur(12px);
}
.participants-icon { display: block; width: 1.25rem; height: 1.25rem; color: var(--muted); opacity: 1; }
.participants-num { font-family: var(--font-display); font-size: 1.2rem; font-weight: 800; font-style: italic; color: var(--ink); text-shadow: none; }
.participants-label { font-family: var(--font-body); font-size: 0.9rem; font-weight: 600; color: var(--muted); }
/* The reference's final-results view keeps its original narrow composition. */
.finale { max-width: 40rem; }
body:not(.has-prizes) .finale-row { grid-template-columns: 3.2rem minmax(0, 1fr) auto; }
.finale-row { min-height: 49px; }
.finale-row:has(.place.p1) {
  border-color: rgba(236, 192, 99, 0.5);
  background: linear-gradient(90deg, rgba(226, 178, 74, 0.17), var(--panel) 70%);
  box-shadow: 0 0 18px rgba(228, 180, 78, 0.06);
}
.finale-row:has(.place.p1) .points { color: var(--gold); }
.finale-row:has(.place.p2) {
  background: linear-gradient(90deg, rgba(197, 206, 216, 0.075), var(--panel) 65%);
  box-shadow: 0 0 14px rgba(197, 206, 216, 0.045);
}
.finale-row:has(.place.p3) {
  background: linear-gradient(90deg, rgba(208, 145, 100, 0.075), var(--panel) 65%);
  box-shadow: 0 0 14px rgba(208, 145, 100, 0.045);
}
.row-prize, .finale-prize { color: #b9b4c9; }
.row-block:has(.place.p1) .row-prize, .finale-row:has(.place.p1) .finale-prize { color: var(--gold); }
.rules-contact { color: #bfcce0; font-weight: 600; text-underline-offset: 0.2em; }
.rules-contact:hover { color: #e2e8f2; }
.finale-text { font-size: 1rem; }
.lixxx-footer { font-family: var(--font-body); }
.lixxx-telegram {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 1.05rem;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: min(34rem, calc(100% - 18rem));
  min-height: 2.75rem;
  padding: 0.65rem 3.5rem;
  border: 1px solid var(--pearl-line);
  border-radius: 999px;
  background: rgba(16, 19, 26, 0.88);
  box-shadow: inset 0 1px 0 rgba(220, 232, 255, 0.04), 0 6px 24px rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(12px);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: border-color 0.18s, background-color 0.18s;
}
.lixxx-telegram svg { flex: none; width: 1.1rem; height: 1.1rem; color: var(--pearl-blue); }
.lixxx-telegram:hover { border-color: var(--pearl-blue); background: rgba(24, 29, 39, 0.96); }
.lixxx-telegram:focus-visible { outline: 2px solid var(--pearl-blue); outline-offset: 4px; }
.telegram-handle { color: var(--muted); font-size: 0.8rem; font-weight: 500; }
.telegram-arrow { color: var(--pearl-blue); }
.lixxx-telegram .gambling-age { position:absolute; top:50%; right:1rem; transform:translateY(-50%); display:inline-flex; align-items:center; justify-content:center; width:2.2rem; height:1.45rem; margin:0; padding:0; border:1px solid #5d6674; border-radius:6px; color:#c8cfda; font-size:.7rem; font-weight:600; line-height:1; text-align:center; letter-spacing:0; white-space:nowrap; }
.gambling-warning { position:fixed; z-index:21; left:50%; bottom:calc(1.05rem + 2.75rem + .65rem); transform:translateX(-50%); width:min(34rem,calc(100vw - 1.5rem)); padding:15px 18px; border:1px solid #475263; border-radius:12px; background:#191e27; color:#e0e5ec; box-shadow:0 10px 32px #0006; font-size:.82rem; font-weight:400; line-height:1.6; text-align:left; visibility:hidden; opacity:0; transition:opacity .15s; }
.gambling-warning::after { content:""; position:absolute; left:0; right:0; bottom:-.7rem; height:.7rem; }
.lixxx-telegram:hover + .gambling-warning,.lixxx-telegram:focus + .gambling-warning,.gambling-warning:hover { visibility:visible; opacity:1; }
.lixxx-telegram[data-warning-dismissed] + .gambling-warning { visibility:hidden; opacity:0; }
@media(max-width:860px) { .gambling-warning { bottom:calc(.75rem + 2.75rem + .65rem); } }
.corner-btn--rules { font-size: 0.86rem; }
.lixxx-channel {
  right: 1rem;
  bottom: 1.05rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
}
.lixxx-channel svg { display: block; width: 1.3rem; height: 1.3rem; color: var(--pearl-blue); }
.preview-label {
  position: fixed;
  bottom: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.7rem;
  color: var(--muted);
}
@media (min-height: 900px) and (min-width: 1100px) {
  .shell { padding-top: 1.65rem; }
  .brand h1 { font-size: 3.5rem; }
  .row { padding: 0.75rem 1rem; }
}
@media (max-width: 860px) {
  .shell { width: calc(100% - 1.25rem); padding-top: 1.9rem; padding-bottom: 9rem; }
  .lixxx-telegram { width: calc(100% - 1.5rem); bottom: 0.75rem; font-size: 0.82rem; min-height: 2.75rem; }
  .corner-btn--rules { bottom: 4rem; left: 0.75rem; }
  .lixxx-channel { right: 0.75rem; bottom: 4rem; width: 2.45rem; height: 2.45rem; }
  .preview-label { bottom: 4.7rem; font-size: 0.65rem; }
}
@media (max-width: 640px) {
  .brand h1 { font-size: clamp(1.9rem, 7.4vw, 3rem); }
  .brand-lixxx { font-size: 0.46em; }
  .tagline { font-size: 0.85rem; }
  .tab { font-size: 0.82rem; padding: 0.6rem 0.85rem; }
  .board-head { display: none; }
  .row {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    grid-template-areas: "place nick points";
    padding: 0.75rem;
    gap: 0.25rem 0.65rem;
  }
  .row { grid-template-areas: "place nick points" "place prize prize"; }
  .row .row-prize.is-empty { display: none; }
  .row .nick { font-size: 0.85rem; }
  .place { font-size: 0.9rem; }
  body:not(.has-prizes) .finale-row {
    grid-template-columns: 2.6rem minmax(0, 1fr) auto;
    grid-template-areas: "place nick points";
  }
  .finale-title { font-size: clamp(1.6rem, 6vw, 2.5rem); }
  .finale-nick { font-size: 0.9rem; }
  .preview-label { max-width: 45%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) {
  .brand, .tabs, .panel, .row-preds, .participants-chip, .finale { animation: none; }
  .tournament-badge { color: var(--muted); -webkit-text-fill-color: currentColor; }
}
