:root {
  --bg-0: #05080f;
  --bg-1: #0a1220;
  --surface: rgba(15, 23, 42, 0.55);
  --ink: #e8eef7;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --line: rgba(125, 211, 252, 0.14);
  --accent: #34d399;
  --accent-soft: rgba(52, 211, 153, 0.12);
  --accent-2: #38bdf8;
  --danger: #f87171;
  --warn: #facc15;
  --radius: 0.7rem;
  --font: "Instrument Sans", "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --nav-h: 3.75rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: clip;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.ambient::before,
.ambient::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.35;
}

.ambient::before {
  width: 42vw;
  height: 42vw;
  top: -12%;
  left: -8%;
  background: radial-gradient(circle, rgba(52, 211, 153, 0.35), transparent 70%);
}

.ambient::after {
  width: 36vw;
  height: 36vw;
  right: -10%;
  bottom: 10%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.28), transparent 70%);
}

.grid-fade {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 20%, transparent 70%);
  opacity: 0.5;
}

.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  backdrop-filter: blur(14px);
  background: rgba(5, 8, 15, 0.72);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 1.05rem;
}

.brand span {
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  flex-wrap: wrap;
  font-size: 0.92rem;
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.65rem 1.15rem;
  cursor: pointer;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), border-color 0.2s;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent);
  color: #04110c;
  font-weight: 650;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: rgba(56, 189, 248, 0.45);
}

.btn-soft {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(52, 211, 153, 0.25);
}

.wrap {
  width: min(1100px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  min-height: calc(100dvh - var(--nav-h));
  padding: 2rem 0 3rem;
}

.hero-brand {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  font-weight: 750;
  margin: 0 0 1rem;
}

.hero-brand em {
  font-style: normal;
  color: var(--accent);
}

.hero p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 34ch;
  line-height: 1.45;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.preview {
  position: relative;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.2rem);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.9), rgba(5, 8, 15, 0.85));
  padding: 1rem;
  overflow: hidden;
  min-height: 280px;
  animation: rise-in 0.7s var(--ease) both;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.live-dot::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: pulse 1.8s ease-out infinite;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes feed-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes win-pop {
  0% {
    transform: scale(0.96);
    opacity: 0;
  }
  60% {
    transform: scale(1.02);
  }
  100% {
    transform: none;
    opacity: 1;
  }
}

.preview-match {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  padding: 0.7rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 0.92rem;
}

.preview-match:first-of-type {
  border-top: 0;
}

.score {
  font-family: var(--mono);
  color: var(--accent-2);
}

.section {
  padding: 1.5rem 0 3rem;
}

.section h1,
.section h2 {
  letter-spacing: -0.03em;
  margin: 0 0 0.35rem;
}

.lead {
  color: var(--muted);
  margin: 0 0 1.25rem;
}

.board {
  display: grid;
  gap: 0.85rem;
}

.page-enter {
  animation: rise-in 0.55s var(--ease) both;
}

.room-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}

.room-card:hover {
  border-color: rgba(52, 211, 153, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.room-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

/* —— Live board: list + peek —— */
.live-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 0.35rem;
}

.live-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.85rem 0 1rem;
}

.live-filter {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font: inherit;
  font-size: 0.86rem;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), color 0.2s var(--ease);
}

.live-filter.is-active {
  border-color: rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.12);
}

.live-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
  gap: 1rem;
  align-items: start;
  min-height: 420px;
}

.live-board {
  display: grid;
  gap: 0.65rem;
}

a.live-card {
  color: inherit;
  text-decoration: none;
}

.live-card {
  appearance: none;
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.95rem 1rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.1rem);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.88), rgba(8, 12, 22, 0.92));
  color: inherit;
  cursor: pointer;
  font: inherit;
  transition: border-color 0.22s var(--ease), transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
  animation: rise-in 0.45s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 0.045s);
}

.live-card.no-anim {
  animation: none;
}

.live-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.live-card.is-active {
  border-color: rgba(52, 211, 153, 0.55);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2), 0 14px 32px rgba(0, 0, 0, 0.3);
}

.live-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
}

.live-card-titles {
  margin-top: 0.45rem;
  font-size: 0.8rem;
  color: var(--muted-2);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-card-side {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
}

.prog-ring {
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
}

.prog-ring .ring-bg {
  fill: none;
  stroke: rgba(148, 163, 184, 0.18);
  stroke-width: 4;
}

.prog-ring .ring-fg {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  transition: stroke-dasharray 0.45s var(--ease);
}

.prog-ring.ring-live .ring-fg {
  stroke: #34d399;
}

.prog-ring.ring-idle .ring-fg {
  stroke: #38bdf8;
}

.live-peek {
  position: sticky;
  top: calc(var(--nav-h) + 0.75rem);
  min-height: 380px;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 80% 0%, rgba(52, 211, 153, 0.1), transparent 55%),
    linear-gradient(165deg, rgba(15, 23, 42, 0.95), rgba(5, 8, 15, 0.9));
  animation: peek-in 0.5s var(--ease) both;
}

@keyframes peek-in {
  from {
    opacity: 0;
    transform: translateX(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.live-peek-empty[hidden],
.live-peek-body[hidden] {
  display: none !important;
}

.live-peek-empty {
  position: relative;
  display: grid;
  gap: 0.55rem;
  place-content: center;
  text-align: center;
  min-height: 340px;
  padding: 1.5rem;
  color: var(--muted);
}

.live-peek-empty strong {
  color: var(--ink);
  font-size: 1.1rem;
}

.live-peek-empty p {
  margin: 0;
  max-width: 16rem;
  justify-self: center;
  line-height: 1.45;
  font-size: 0.92rem;
}

.live-peek-glow {
  width: 4.5rem;
  height: 4.5rem;
  margin: 0 auto 0.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.35), transparent 70%);
  animation: pulse 2.4s ease-out infinite;
}

.live-peek-body {
  animation: rise-in 0.35s var(--ease) both;
}

.live-peek-head h2 {
  margin: 0.45rem 0 0.25rem;
  font-size: 1.25rem;
  text-transform: none;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.live-peek-head .lead {
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}

.live-peek-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: 0.55rem;
  background: rgba(8, 14, 24, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.live-peek-progress strong {
  font-family: var(--mono);
  font-size: 1.15rem;
  color: var(--accent);
}

.live-peek-progress span {
  color: var(--muted);
  font-size: 0.85rem;
}

.live-peek-stats {
  flex-basis: 100%;
  font-size: 0.8rem !important;
}

.live-peek-matches {
  max-height: 240px;
  overflow: auto;
  margin-bottom: 0.75rem;
}

.peek-row {
  font-size: 0.88rem;
  animation: feed-in 0.3s var(--ease) both;
}

.live-peek-cta {
  margin-top: 0.35rem;
}

.peek-win {
  margin-bottom: 0.75rem;
}

.live-peek-loading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-height: 200px;
  justify-content: center;
  color: var(--muted);
}

.live-empty a {
  color: var(--accent);
}

.auth-box,
.wizard,
.preview-panel,
.room-layout > .panel,
.combos-panel,
.stats-grid .stat {
  animation: rise-in 0.5s var(--ease) both;
}

.stats-grid .stat:nth-child(2) { animation-delay: 0.05s; }
.stats-grid .stat:nth-child(3) { animation-delay: 0.1s; }
.stats-grid .stat:nth-child(4) { animation-delay: 0.15s; }
.stats-grid .stat:nth-child(5) { animation-delay: 0.2s; }
.stats-grid .stat:nth-child(6) { animation-delay: 0.25s; }

.mode-bar {
  display: grid;
  gap: 0.55rem;
}

.mode-bar-row {
  display: grid;
  grid-template-columns: 7rem 1fr auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 14, 24, 0.55);
  animation: rise-in 0.4s var(--ease) both;
}

.mode-bar-track {
  height: 0.4rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.15);
  overflow: hidden;
}

.mode-bar-fill {
  height: 100%;
  width: var(--w, 0%);
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #38bdf8);
  transform-origin: left center;
  animation: bar-grow 0.7s var(--ease) both;
}

@keyframes bar-grow {
  from {
    transform: scaleX(0.08);
  }
  to {
    transform: scaleX(1);
  }
}

.build-preset {
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}

.build-preset:hover {
  transform: translateY(-2px);
  border-color: rgba(56, 189, 248, 0.4);
}

.mode-opt {
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), background 0.2s var(--ease);
}

.mode-opt:hover {
  transform: translateY(-1px);
}

@media (max-width: 960px) {
  .live-stage {
    grid-template-columns: 1fr;
  }

  .live-peek {
    position: relative;
    top: 0;
    min-height: 280px;
  }
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--muted);
}

.chip.plus {
  color: var(--accent);
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--accent-soft);
}

.chip.live {
  color: var(--accent-2);
  border-color: rgba(56, 189, 248, 0.3);
}

.progress {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink);
}

.room-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.1rem;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 1rem;
}

.panel h2 {
  font-size: 0.95rem;
  margin: 0 0 0.85rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.match-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.75rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
}

.match-row:first-child {
  border-top: 0;
}

.outcome {
  font-size: 0.82rem;
  color: var(--muted);
}

.outcome.done {
  color: var(--accent);
}

.feed {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 420px;
  overflow: auto;
}

.feed-item {
  padding: 0.65rem 0.75rem;
  border-radius: 0.55rem;
  background: rgba(8, 14, 24, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.08);
  font-size: 0.9rem;
  animation: feed-in 0.35s var(--ease) both;
}

.feed-item.win {
  border-color: rgba(52, 211, 153, 0.35);
  animation: win-pop 0.45s var(--ease) both;
}

.feed-item .ts {
  display: block;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted-2);
  margin-bottom: 0.2rem;
}

.winner-box {
  margin-top: 0.85rem;
  padding: 0.85rem;
  border-radius: 0.55rem;
  background: var(--accent-soft);
  border: 1px solid rgba(52, 211, 153, 0.3);
  animation: win-pop 0.5s var(--ease) both;
}

.room-progress-track {
  margin-top: 0.75rem;
  height: 0.35rem;
  max-width: 18rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.16);
  overflow: hidden;
}

.room-progress-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #34d399, #38bdf8);
  transition: width 0.45s var(--ease);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.35);
}

.winner-box .cta-row {
  margin-top: 0.75rem;
}

.showcase-card-actions {
  margin-top: 0.65rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.showcase-card-actions .btn {
  font-size: 0.82rem;
  padding: 0.4rem 0.75rem;
}

.wizard {
  display: grid;
  gap: 1rem;
  max-width: 560px;
}

.field {
  display: grid;
  gap: 0.4rem;
}

.field label {
  font-size: 0.88rem;
  color: var(--muted);
}

.field select,
.field input[type="number"],
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="url"],
.field input[type="search"] {
  background: rgba(8, 14, 24, 0.92);
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  color: var(--ink);
  padding: 0.7rem 0.8rem;
  color-scheme: dark;
  outline: none;
  transition: border-color 0.15s var(--ease);
}

.field select {
  appearance: none;
  -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 1.05rem) calc(50% - 0.15rem), calc(100% - 0.75rem) calc(50% - 0.15rem);
  background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
  background-repeat: no-repeat;
  padding-right: 2rem;
  cursor: pointer;
}

.field select:hover,
.field select:focus,
.field input:hover,
.field input:focus {
  border-color: rgba(56, 189, 248, 0.45);
}

.field select option {
  background: #0b1220;
  color: var(--ink);
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
}

.mode-opt {
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.75rem;
  cursor: pointer;
  background: rgba(8, 14, 24, 0.72);
  text-align: left;
  color: var(--ink);
}

.mode-opt:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-1px);
}

.mode-opt.active {
  border-color: rgba(52, 211, 153, 0.55);
  background: rgba(52, 211, 153, 0.14);
  color: var(--ink);
}

.mode-opt strong {
  display: block;
  margin-bottom: 0.25rem;
  color: #f1f5f9;
  font-weight: 650;
}

.mode-opt span {
  font-size: 0.8rem;
  color: #cbd5e1;
}

.mode-opt.active strong {
  color: #ecfdf5;
}

.mode-opt.active span {
  color: #a7f3d0;
}

.mode-opt-n {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mode-n-drop {
  display: grid;
  gap: 0.35rem;
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(52, 211, 153, 0.25);
}

.mode-n-drop[hidden] {
  display: none !important;
}

.mode-n-drop label {
  font-size: 0.78rem;
  color: #a7f3d0;
}

.mode-n-drop input {
  width: 100%;
  box-sizing: border-box;
  background: rgba(5, 8, 15, 0.85);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 0.45rem;
  color: var(--ink);
  padding: 0.45rem 0.55rem;
  color-scheme: dark;
}

.mode-n-hint {
  font-size: 0.72rem;
  color: var(--muted-2);
  line-height: 1.3;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.85rem;
}

.stat {
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}

.stat:hover {
  border-color: rgba(56, 189, 248, 0.35);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

.stat .n {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-family: var(--mono);
}

.stat .l {
  color: var(--muted);
  font-size: 0.88rem;
  margin-top: 0.25rem;
}

.cabinet-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0 0 1.25rem;
  padding: 0.3rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.15rem);
  background: rgba(8, 14, 26, 0.55);
  width: fit-content;
  max-width: 100%;
}

.cabinet-nav a {
  padding: 0.45rem 0.9rem;
  border-radius: 0.45rem;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.cabinet-nav a:hover {
  color: var(--ink);
  background: rgba(148, 163, 184, 0.08);
}

.cabinet-nav a.active {
  color: #04140e;
  background: var(--accent);
}

.cabinet-head {
  margin-bottom: 1.35rem;
}

.cabinet-head h1 {
  margin-bottom: 0.35rem;
}

.cabinet .lead {
  margin: 0;
  max-width: 42ch;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.overview-tile {
  padding: 1.1rem 1.15rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 14, 26, 0.72);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 11rem;
}

.overview-tile h2 {
  margin: 0;
  font-size: 1.05rem;
}

.kv {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.kv > div {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.5rem;
  align-items: baseline;
}

.kv dt {
  margin: 0;
  color: var(--muted-2);
  font-size: 0.82rem;
}

.kv dd {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9rem;
  word-break: break-all;
}

.balance-list {
  display: grid;
  gap: 0.45rem;
  flex: 1;
}

.balance-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.9rem;
}

.balance-n {
  font-family: var(--mono);
  font-weight: 600;
  min-width: 4.5rem;
  text-align: right;
}

.cabinet-link {
  margin-top: auto;
  color: var(--accent-2);
  font-size: 0.88rem;
  font-weight: 600;
}

.quick-links {
  display: grid;
  gap: 0.4rem;
}

.quick-links a {
  padding: 0.55rem 0.65rem;
  border-radius: 0.45rem;
  border: 1px solid transparent;
  color: var(--ink);
  background: rgba(15, 23, 42, 0.45);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.quick-links a:hover {
  border-color: rgba(56, 189, 248, 0.35);
  background: rgba(56, 189, 248, 0.08);
}

@media (max-width: 860px) {
  .overview-grid {
    grid-template-columns: 1fr;
  }
}

.bk-accounts {
  display: grid;
  gap: 1rem;
  max-width: 520px;
}

.bk-account-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 14, 26, 0.72);
  padding: 1rem 1.05rem;
}

.bk-account-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 0.75rem;
  margin-bottom: 0.65rem;
}

.bk-account-card .field {
  margin-bottom: 0.55rem;
}

.bk-code-row input {
  flex: 1 1 8rem;
  min-width: 0;
}

.auth-box {
  max-width: 420px;
  display: grid;
  gap: 0.85rem;
}

.msg {
  color: var(--muted);
  font-size: 0.9rem;
}

.msg.err {
  color: var(--danger);
}

.msg.ok {
  color: var(--accent);
}

.soon {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border: 1px dashed rgba(148, 163, 184, 0.25);
  border-radius: var(--radius);
  color: var(--muted-2);
  font-size: 0.88rem;
}

.empty {
  color: var(--muted);
  padding: 2rem 0;
}

.auth-page {
  max-width: 480px;
}

.auth-switch {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--accent);
}

.home-page {
  padding: 1.5rem 0 3rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.hero-center {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 0 0.5rem;
  animation: rise-in 0.7s var(--ease) both;
}

.hero-center .hero-brand {
  margin-bottom: 1rem;
}

.hero-center p {
  margin: 0 0 1.5rem;
  color: var(--muted);
  font-size: 1.08rem;
  max-width: 36ch;
  line-height: 1.45;
}

.hero-center .cta-row {
  justify-content: center;
}

.home-feed {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  align-items: start;
  overflow: visible;
  animation: rise-in 0.75s var(--ease) 0.08s both;
}

.home-feed > .empty {
  grid-column: 1 / -1;
  text-align: center;
}

.bk-strip {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.1rem);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(5, 8, 15, 0.88));
  padding: 0.9rem 1rem;
  min-width: 0;
}

.bk-strip .preview-match {
  grid-template-columns: 1fr auto auto;
  align-items: center;
}

.bk-strip .preview-match > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted-2);
}

.showcase {
  display: grid;
  gap: 1.35rem;
}

.showcase-head h2 {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
}

.showcase-head .lead {
  margin-bottom: 0.25rem;
}

.showcase-head-center {
  text-align: center;
  max-width: 36rem;
  margin: 0 auto 0.35rem;
}

.showcase-head-center .lead {
  margin-left: auto;
  margin-right: auto;
}

.showcase-tabs,
.showcase-bk-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-top: 0.85rem;
}

.showcase-tabs {
  display: none;
}

.showcase-tab,
.showcase-bk-filter,
.build-preset {
  appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  border-radius: 999px;
  padding: 0.45rem 0.9rem;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.showcase-tab.is-active,
.showcase-bk-filter.is-active,
.build-preset.is-active {
  border-color: rgba(52, 211, 153, 0.55);
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.12);
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.2), 0 8px 22px rgba(16, 185, 129, 0.12);
}

.build-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 0 0 1.1rem;
  max-width: 42rem;
}

.build-preset {
  border-radius: 0.75rem;
  padding: 0.7rem 0.85rem;
  text-align: left;
  display: grid;
  gap: 0.2rem;
}

.build-preset strong {
  font-size: 0.95rem;
}

.build-preset span {
  font-size: 0.78rem;
  color: var(--muted);
}

#guestBanner a {
  color: var(--accent-2);
  text-decoration: underline;
  margin-left: 0.35rem;
}

@media (max-width: 860px) {
  .build-presets {
    grid-template-columns: 1fr;
  }
}

#showcaseBody,
.showcase-columns {
  display: grid;
  gap: 1.15rem;
}

.showcase-columns {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  align-items: start;
  gap: 1rem;
}

.showcase-col {
  display: grid;
  gap: 0.75rem;
  min-width: 0;
}

.showcase-col-head h3 {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: #f1f5f9;
}

.showcase-col-hint {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted-2);
  line-height: 1.35;
}

.showcase-col-list {
  display: grid;
  gap: 0.75rem;
}

.showcase-col-empty {
  border: 1px dashed rgba(148, 163, 184, 0.28);
  border-radius: var(--radius);
  padding: 1rem 0.85rem;
  font-size: 0.84rem;
  color: var(--muted-2);
  text-align: center;
}

.showcase-loading {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  min-height: 9.5rem;
  padding: 1.5rem 1rem;
  color: var(--muted-2);
  font-size: 0.95rem;
}

.showcase-spinner {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 50%;
  border: 2px solid rgba(148, 163, 184, 0.25);
  border-top-color: var(--accent);
  animation: showcase-spin 0.75s linear infinite;
}

@keyframes showcase-spin {
  to {
    transform: rotate(360deg);
  }
}

.showcase-card {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 0.1rem);
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.92), rgba(5, 8, 15, 0.88));
  padding: 1rem 1.1rem;
  animation: rise-in 0.55s var(--ease) both;
}

.showcase-card.no-anim {
  animation: none;
}

#showcaseBody {
  min-height: 12rem;
}

.showcase-card.hit {
  border-color: rgba(52, 211, 153, 0.35);
}

.showcase-card-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.85rem;
  align-items: center;
  margin-bottom: 0.75rem;
}

.showcase-card-head strong {
  color: #f1f5f9;
  font-weight: 600;
}

.showcase-odds {
  font-family: var(--mono);
  font-size: 1.15rem;
  color: var(--accent);
  font-weight: 700;
}

.showcase-when {
  margin-left: auto;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted-2);
  white-space: nowrap;
}

.showcase-matches,
.showcase-legs {
  display: grid;
  gap: 0.35rem;
}

.showcase-match,
.showcase-leg {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.65rem;
  align-items: center;
  padding: 0.45rem 0;
  border-top: 1px solid rgba(148, 163, 184, 0.1);
  font-size: 0.9rem;
  color: #e2e8f0;
}

.showcase-match:first-child,
.showcase-leg:first-child {
  border-top: 0;
}

.showcase-match.done {
  color: #a7f3d0;
}

.showcase-match > span:first-child,
.showcase-leg > span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-layout {
  display: grid;
  grid-template-columns: minmax(280px, 520px) 1fr;
  gap: 1.25rem;
  align-items: start;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.preview-panel {
  min-height: 280px;
}

.preview-combos {
  max-height: 320px;
  margin-top: 0.75rem;
}

.combos-panel h2 {
  margin: 0;
}

.combos-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}

.combos-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.combos-filters .filter {
  cursor: pointer;
  background: transparent;
}

.combos-filters .filter.active {
  color: var(--accent);
  border-color: rgba(52, 211, 153, 0.4);
  background: var(--accent-soft);
}

.combos-filters input[type="search"] {
  background: rgba(8, 14, 24, 0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  padding: 0.35rem 0.75rem;
  min-width: 8rem;
}

.combos-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 480px;
  overflow: auto;
}

.combo-row {
  padding: 0.7rem 0.8rem;
  border-radius: 0.55rem;
  border: 1px solid rgba(148, 163, 184, 0.1);
  background: rgba(8, 14, 24, 0.55);
}

.combo-row.status-win {
  border-color: rgba(52, 211, 153, 0.35);
  background: var(--accent-soft);
}

.combo-row.status-lose {
  opacity: 0.72;
}

.combo-top {
  display: flex;
  gap: 0.65rem;
  align-items: baseline;
  margin-bottom: 0.25rem;
}

.combo-odds {
  font-family: var(--mono);
  color: var(--accent-2);
  font-size: 0.9rem;
}

.combo-status {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: lowercase;
}

.combo-picks {
  font-size: 0.84rem;
  color: var(--muted);
  line-height: 1.35;
}

@media (max-width: 960px) {
  .home-feed {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .hero,
  .room-layout,
  .build-layout,
  .stats-grid,
  .mode-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .nav-links .hide-sm {
    display: none;
  }

  .hero {
    min-height: auto;
    padding-top: 1.5rem;
  }

  .hero-center {
    padding-top: 1.25rem;
  }

  .showcase-columns {
    grid-template-columns: 1fr;
  }

  .showcase-tabs {
    display: flex;
  }

  .showcase-columns-mobile {
    grid-template-columns: 1fr;
  }

  .showcase-card {
    padding: 0.85rem 0.9rem;
  }

  .showcase-card-head strong {
    flex: 1 1 100%;
    font-size: 0.95rem;
    line-height: 1.35;
  }

  .showcase-when {
    margin-left: 0;
    width: 100%;
  }

  .showcase-match,
  .showcase-leg {
    grid-template-columns: 1fr;
    gap: 0.2rem;
    font-size: 0.84rem;
  }

  .showcase-match > span:first-child,
  .showcase-leg > span:first-child {
    white-space: normal;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .cabinet-nav {
    width: 100%;
  }

  .cabinet-nav a {
    flex: 1 1 auto;
    text-align: center;
  }
}
