*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  font-family: "Atkinson Hyperlegible", "Segoe UI", Inter, system-ui, sans-serif;
  background-color: #08111d;
  color: #edf4ff;
}

html,
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 36%),
    radial-gradient(circle at 82% 12%, rgba(34, 197, 94, 0.1), transparent 28%),
    linear-gradient(180deg, #07111d 0%, #091523 48%, #060d18 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent 80%);
}

a {
  color: inherit;
}

button,
input,
select {
  font: inherit;
}

button,
.button-link {
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.app-shell {
  min-height: 100vh;
  padding: 0 0 4rem;
}

.platform-home,
.platform-page {
  display: grid;
  gap: 2.5rem;
}

.nav-bar,
.hero,
.game-card,
.admin-card,
.empty-card,
.notice,
.config-card,
.ops-panel,
.slot-card {
  background: rgba(10, 19, 34, 0.8);
  border: 1px solid rgba(118, 145, 180, 0.22);
  box-shadow: 0 28px 80px rgba(1, 7, 18, 0.36);
  backdrop-filter: blur(18px);
}

.nav-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 auto;
  width: min(1320px, calc(100% - 2rem));
  border-radius: 0 0 1.4rem 1.4rem;
  border-top: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.4rem;
}

.nav-brand,
.nav-actions,
.nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  text-decoration: none;
  font-weight: 700;
}

.logo-mark {
  font-size: 1.2rem;
  color: #ffffff;
}

.logo-text,
.nav-links a {
  color: #b9cae6;
  text-decoration: none;
}

.logo-text {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
}

.nav-links a {
  font-size: 0.92rem;
}

.nav-links a:hover {
  color: #ffffff;
}

.nav-group {
  position: relative;
}

.dropdown {
  position: absolute;
  top: calc(100% + 0.55rem);
  right: 0;
  min-width: 13rem;
  display: flex;
  flex-direction: column;
  border-radius: 1rem;
  padding: 0.45rem;
  background: rgba(7, 14, 25, 0.98);
  border: 1px solid rgba(118, 145, 180, 0.26);
}

.dropdown a,
.dropdown button {
  border-radius: 0.8rem;
  padding: 0.75rem 0.9rem;
  text-decoration: none;
  color: #edf4ff;
  background: transparent;
  text-align: left;
  border: none;
  cursor: pointer;
}

.dropdown a:hover,
.dropdown button:hover {
  background: rgba(52, 84, 124, 0.28);
}

.hero,
.game-section,
.admin-section,
.notice {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
}

.hero {
  margin-top: 1.6rem;
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 1.4rem;
  padding: clamp(1.5rem, 3vw, 2.4rem);
  border-radius: 2rem;
}

.hero-copy {
  display: grid;
  gap: 0.95rem;
  align-content: start;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
}

.eyebrow {
  margin: 0;
  color: #8fd3ff;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  font-weight: 800;
}

.subtitle,
.section-copy,
.summary,
.ops-help,
.ops-note,
.note {
  margin: 0;
  color: #b6c8e1;
  line-height: 1.6;
}

.hero-actions,
.card-actions,
.admin-card-meta,
.stats-row,
.meta,
.tags,
.nav-actions {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.hero-panel {
  display: grid;
  gap: 1rem;
  align-content: start;
  padding: 1.2rem;
  border-radius: 1.5rem;
  background: rgba(7, 14, 25, 0.74);
  border: 1px solid rgba(118, 145, 180, 0.18);
}

.hero-panel-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.hero-status,
.badge,
.section-count,
.game-card-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  border: 1px solid rgba(118, 145, 180, 0.22);
  background: rgba(17, 29, 50, 0.72);
  font-size: 0.78rem;
}

.hero-status {
  color: #cdd9ed;
}

.hero-status--active,
.badge.public {
  color: #9af0b9;
}

.badge.private {
  color: #f4c17e;
}

.hero-metrics,
.admin-grid {
  display: grid;
  gap: 1rem;
}

.hero-metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-metric {
  display: grid;
  gap: 0.25rem;
  padding: 0.95rem 1rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(118, 145, 180, 0.16);
  background: rgba(15, 24, 42, 0.72);
}

.hero-metric-value {
  font-size: 1.8rem;
  font-weight: 800;
}

.hero-metric-label,
.stat-label,
.admin-card-label,
.room-label {
  color: #9eb4d1;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-panel-note {
  margin: 0;
  color: #8fa8c8;
}

.notice {
  border-radius: 1.4rem;
  padding: 1rem 1.2rem;
}

.error {
  margin: 0;
  color: #fecaca;
}

.game-section,
.admin-section {
  display: grid;
  gap: 1.2rem;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
}

.section-heading h2,
.section-heading h3 {
  margin: 0.15rem 0 0;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.section-count {
  color: #cbd8eb;
}

.empty-card {
  border-radius: 1.5rem;
  padding: 1.5rem;
}

.empty-card h3 {
  margin: 0 0 0.45rem;
}

.game-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1rem;
}

.game-card,
.admin-card {
  display: grid;
  gap: 1rem;
  border-radius: 1.5rem;
  padding: 1.2rem;
}

.game-card-topline,
.game-card-header,
.stats-row,
.ops-row {
  display: flex;
  justify-content: space-between;
  gap: 0.9rem;
  align-items: start;
}

.game-card-header h3,
.admin-card h3,
.ops-panel h4,
.config-card h4 {
  margin: 0;
}

.game-card-status {
  color: #8fd3ff;
}

.stats-row {
  flex-wrap: wrap;
}

.stat-chip {
  display: grid;
  gap: 0.25rem;
  min-width: 8rem;
  padding: 0.8rem 0.9rem;
  border-radius: 1rem;
  border: 1px solid rgba(118, 145, 180, 0.18);
  background: rgba(15, 24, 42, 0.7);
}

.stat-chip strong,
.meta span,
.admin-card-meta span {
  color: #f7fbff;
}

.meta,
.admin-card-meta {
  color: #9eb4d1;
  font-size: 0.92rem;
}

.tags span {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: rgba(24, 46, 78, 0.7);
  color: #9ed6ff;
  font-size: 0.82rem;
}

.admin-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.admin-card {
  background: rgba(10, 19, 34, 0.7);
}

.admin-card--dev {
  background: linear-gradient(180deg, rgba(13, 27, 49, 0.88), rgba(10, 19, 34, 0.8));
}

.admin-section--page,
.admin-section--dev {
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
}

.config-card {
  border-radius: 1.4rem;
  padding: 1.1rem 1.2rem;
}

.config-block {
  overflow-x: auto;
  border-radius: 1rem;
  padding: 1rem;
  background: rgba(6, 12, 22, 0.92);
  color: #d8e6fa;
}

.ops-panel {
  display: grid;
  gap: 0.9rem;
  border-radius: 1.2rem;
  padding: 1rem;
  background: rgba(7, 14, 25, 0.72);
}

.ops-copy,
.ops-form {
  display: grid;
  gap: 0.35rem;
}

.ops-title {
  color: #ffffff;
  font-weight: 700;
}

.ops-form-row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.ops-form-row select {
  min-width: 0;
  flex: 1 1 12rem;
}

.slot-card {
  display: grid;
  gap: 0.8rem;
  padding: 0.9rem;
}

.ops-status {
  margin: 0;
  padding: 0.85rem 0.95rem;
  border-radius: 1rem;
  border: 1px solid rgba(118, 145, 180, 0.18);
  background: rgba(10, 19, 34, 0.6);
  color: #d8e6fa;
}

.badge.install-status {
  width: fit-content;
}

.badge.install-status.queued {
  color: #9ed6ff;
}

.badge.install-status.running {
  color: #fcd27f;
}

.badge.install-status.completed {
  color: #9af0b9;
}

.badge.install-status.failed {
  color: #fca5a5;
}

.badge.install-status.default {
  color: #cbd5e1;
}

button,
.button-link {
  border-radius: 999px;
  padding: 0.82rem 1.15rem;
  border: 1px solid transparent;
  font-weight: 700;
}

button {
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.primary {
  background: linear-gradient(135deg, #68b8ff, #5f8dff);
  color: #07111e;
  box-shadow: 0 10px 24px rgba(96, 165, 250, 0.22);
}

.secondary {
  background: rgba(11, 19, 35, 0.78);
  color: #edf4ff;
  border-color: rgba(118, 145, 180, 0.28);
}

.ghost {
  background: transparent;
  color: #d8e6fa;
  border-color: rgba(118, 145, 180, 0.2);
}

.danger {
  background: rgba(127, 29, 29, 0.22);
  color: #fecaca;
  border-color: rgba(248, 113, 113, 0.28);
}

button:hover:not(:disabled),
.button-link:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

#blazor-error-ui {
  background: #08111d;
  color: #edf4ff;
  bottom: 0;
  display: none;
  left: 0;
  padding: 0.7rem 1.2rem;
  position: fixed;
  width: 100%;
  border-top: 1px solid rgba(118, 145, 180, 0.24);
  z-index: 1000;
}

#blazor-error-ui .dismiss {
  cursor: pointer;
  position: absolute;
  right: 0.75rem;
  top: 0.5rem;
}

.loading-progress {
  position: relative;
  display: block;
  width: 6rem;
  height: 6rem;
  margin: 20vh auto 1rem auto;
}

.loading-progress circle {
  fill: none;
  stroke: #1f2937;
  stroke-width: 0.6rem;
  transform-origin: 50% 50%;
  transform: rotate(-90deg);
}

.loading-progress circle:last-child {
  stroke: #68b8ff;
  stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
  transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
  position: absolute;
  text-align: center;
  font-weight: 600;
  inset: calc(20vh + 2.5rem) 0 auto 0.2rem;
  color: #94a3b8;
}

.loading-progress-text:after {
  content: var(--blazor-load-percentage-text, "Loading");
}

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

  .hero-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-bar,
  .hero,
  .game-section,
  .admin-section,
  .notice,
  .admin-section--page,
  .admin-section--dev {
    width: min(100%, calc(100% - 1rem));
  }

  .nav-bar {
    flex-direction: column;
    align-items: start;
  }

  .nav-brand {
    width: 100%;
    flex-direction: column;
    align-items: start;
  }

  .section-heading,
  .game-card-topline,
  .game-card-header,
  .ops-row {
    flex-direction: column;
    align-items: start;
  }

  .ops-form-row {
    flex-direction: column;
  }

  .button-link,
  button {
    width: 100%;
  }

  .nav-actions button,
  .nav-group {
    width: 100%;
  }
}
