:root {
  color-scheme: dark;
  --bg: #08090c;
  --panel: #11141a;
  --panel-2: #181c24;
  --line: rgba(255, 255, 255, 0.09);
  --text: #f7f7f8;
  --muted: #9299a8;
  --orange: #ff7a18;
  --red: #ff3d3d;
  --green: #36d17c;
  --yellow: #ffd166;
  --blue: #5e8bff;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -10%, rgba(255, 61, 61, 0.18), transparent 34rem),
    radial-gradient(circle at 85% 10%, rgba(255, 122, 24, 0.12), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: white;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 8px 28px rgba(255, 83, 36, 0.3);
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--red), var(--orange));
  color: white;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: 160ms ease;
}

.button:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  filter: grayscale(0.7);
  opacity: 0.45;
  transform: none;
}

.button.secondary {
  border-color: var(--line);
  background: var(--panel-2);
}

.button.danger {
  border-color: rgba(255, 61, 61, 0.3);
  background: rgba(255, 61, 61, 0.12);
  color: #ff8a8a;
}

.button.success {
  background: linear-gradient(135deg, #168f55, var(--green));
}

.hero {
  display: grid;
  min-height: 650px;
  align-items: center;
  gap: 60px;
  grid-template-columns: 1.05fr 0.95fr;
  padding: 76px 0 100px;
}

.eyebrow {
  color: var(--orange);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  margin: 18px 0;
  font-size: clamp(3.2rem, 7vw, 6.4rem);
  letter-spacing: -0.07em;
  line-height: 0.9;
}

.gradient-text {
  background: linear-gradient(100deg, var(--red), var(--orange), var(--yellow));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-copy {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.preview {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 50%),
    #101218;
  box-shadow: var(--shadow);
}

.preview::after {
  position: absolute;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: rgba(255, 72, 48, 0.18);
  content: "";
  filter: blur(70px);
  inset: 55% auto auto 55%;
}

.preview-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 61, 61, 0.14);
  color: #ff8585;
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.1em;
}

.preview-live::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  content: "";
  box-shadow: 0 0 0 6px rgba(255, 61, 61, 0.12);
}

.preview-bomb {
  position: relative;
  z-index: 1;
  margin: 54px 0 30px;
  font-size: 7rem;
  text-align: center;
  transform: rotate(-8deg);
}

.preview-holder {
  position: relative;
  z-index: 1;
  font-size: 2.4rem;
  font-weight: 950;
  text-align: center;
}

.preview-code {
  position: relative;
  z-index: 1;
  width: fit-content;
  margin: 14px auto 0;
  padding: 10px 18px;
  border: 1px solid rgba(255, 209, 102, 0.3);
  border-radius: 14px;
  background: rgba(255, 209, 102, 0.1);
  color: var(--yellow);
  font-weight: 900;
}

.section {
  padding: 90px 0;
  border-top: 1px solid var(--line);
}

.section h2 {
  margin: 10px 0 38px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  letter-spacing: -0.04em;
}

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

.card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(17, 20, 26, 0.82);
}

.card-number {
  color: var(--orange);
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.card h3 {
  margin: 18px 0 10px;
  font-size: 1.2rem;
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.footer {
  padding: 30px 0 44px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}

/* Panel */
.panel-page {
  padding-bottom: 70px;
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 44px 0 30px;
}

.panel-head h1 {
  margin: 5px 0 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
  letter-spacing: -0.05em;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.status-pill::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #707785;
  content: "";
}

.status-pill.online::before {
  background: var(--green);
  box-shadow: 0 0 12px rgba(54, 209, 124, 0.8);
}

.panel-grid {
  display: grid;
  align-items: start;
  gap: 20px;
  grid-template-columns: repeat(12, 1fr);
}

.panel-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(17, 20, 26, 0.92);
  box-shadow: 0 16px 60px rgba(0, 0, 0, 0.16);
}

.panel-card h2 {
  margin: 0 0 5px;
  font-size: 1.1rem;
}

.panel-card .sub {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.span-7 {
  grid-column: span 7;
}

.span-5 {
  grid-column: span 5;
}

.span-12 {
  grid-column: span 12;
}

.field {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.field label {
  color: #c8ccd5;
  font-size: 0.82rem;
  font-weight: 800;
}

.input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  outline: none;
  background: #0b0d11;
  color: white;
}

.input:focus {
  border-color: rgba(255, 122, 24, 0.6);
  box-shadow: 0 0 0 3px rgba(255, 122, 24, 0.1);
}

.inline-form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.inline-form .field {
  flex: 1;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.notice {
  display: none;
  margin-bottom: 20px;
  padding: 13px 15px;
  border: 1px solid rgba(255, 61, 61, 0.25);
  border-radius: 12px;
  background: rgba(255, 61, 61, 0.1);
  color: #ff9b9b;
  line-height: 1.45;
}

.notice.visible {
  display: block;
}

.notice.success {
  border-color: rgba(54, 209, 124, 0.25);
  background: rgba(54, 209, 124, 0.1);
  color: #8ce7b6;
}

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

.metric {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #0c0e13;
}

.metric-label {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.metric-value {
  margin-top: 9px;
  font-size: 1.35rem;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.event-log {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--orange);
  border-radius: 4px 12px 12px 4px;
  background: rgba(255, 122, 24, 0.08);
  color: #f4c49f;
}

.players {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.player {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 11px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #0c0e13;
}

.player.current {
  border-color: rgba(255, 122, 24, 0.65);
  background: rgba(255, 122, 24, 0.1);
}

.avatar {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  color: #101014;
  font-weight: 950;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.player-name {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.empty {
  padding: 25px;
  border: 1px dashed var(--line);
  border-radius: 13px;
  color: var(--muted);
  text-align: center;
}

.auth-wall {
  display: grid;
  min-height: calc(100vh - 76px);
  place-items: center;
}

.auth-card {
  width: min(460px, 100%);
}

.hidden {
  display: none !important;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .preview {
    min-height: 390px;
  }

  .cards {
    grid-template-columns: 1fr;
  }

  .span-5,
  .span-7 {
    grid-column: span 12;
  }
}

@media (max-width: 620px) {
  .shell {
    width: min(100% - 24px, 1160px);
  }

  .topbar {
    min-height: 66px;
  }

  .hero {
    min-height: auto;
    padding: 58px 0 70px;
  }

  .hero h1 {
    font-size: 3.6rem;
  }

  .preview {
    min-height: 350px;
    padding: 24px;
  }

  .preview-bomb {
    margin-top: 45px;
    font-size: 5.5rem;
  }

  .panel-head {
    align-items: start;
    flex-direction: column;
  }

  .state-box {
    grid-template-columns: 1fr;
  }

  .inline-form {
    align-items: stretch;
    flex-direction: column;
  }

  .inline-form .button {
    min-height: 46px;
  }
}
