:root {
  color-scheme: dark;
  --bg: #05080e;
  --panel: rgba(6, 14, 24, 0.82);
  --panel-strong: rgba(8, 20, 34, 0.94);
  --line: rgba(105, 204, 255, 0.45);
  --line-dim: rgba(105, 204, 255, 0.18);
  --blue: #50c8ff;
  --blue-soft: #9be7ff;
  --red: #ff4b43;
  --red-soft: #ff8a80;
  --gold: #efb84d;
  --green: #68dd64;
  --purple: #c45cff;
  --text: #eef8ff;
  --muted: #9cb1c2;
  --shadow-blue: 0 0 18px rgba(80, 200, 255, 0.55);
  --shadow-red: 0 0 18px rgba(255, 72, 64, 0.52);
  font-family: "Segoe UI", "Inter", "Arial", sans-serif;
  font-size: 16px;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  min-height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 18% 36%, rgba(120, 46, 150, 0.22) 0 9%, transparent 23%),
    radial-gradient(circle at 78% 42%, rgba(51, 154, 205, 0.22) 0 8%, transparent 24%),
    radial-gradient(circle at 28% 74%, rgba(60, 110, 190, 0.16) 0 7%, transparent 22%),
    linear-gradient(180deg, #03060b 0%, #07111d 52%, #04070d 100%);
  color: var(--text);
}

body.page-command-shell {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body.page-command-shell #app {
  height: auto;
  min-height: 100dvh;
}

.portrait-orientation-guard {
  position: fixed;
  z-index: 2147483646;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 8px;
  padding: 24px;
  background: #00060b;
  color: var(--text);
  text-align: center;
}

.portrait-orientation-guard[hidden] {
  display: none;
}

.portrait-orientation-guard strong {
  color: var(--blue-soft);
  font-size: 1.15rem;
}

.portrait-orientation-guard span {
  color: var(--muted);
  font-size: 0.9rem;
}

body.has-app-splash {
  background: #00060b;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.95) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(125, 213, 255, 0.9) 0 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 120, 120, 0.75) 0 1px, transparent 1px);
  background-size: 79px 79px, 127px 127px, 181px 181px;
  background-position: 8px 20px, 38px 61px, 17px 93px;
  opacity: 0.64;
}

body::after {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.68)),
    linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.44));
}

body.page-match {
  background:
    linear-gradient(112deg, rgba(114, 36, 150, 0.24) 0%, rgba(44, 28, 84, 0.15) 24%, transparent 46%),
    linear-gradient(68deg, transparent 45%, rgba(22, 96, 138, 0.14) 66%, rgba(34, 162, 222, 0.22) 100%),
    linear-gradient(180deg, #01040a 0%, #071320 48%, #02050b 100%);
}

body.has-app-splash.page-match {
  background: #00060b;
}

body.page-match::before {
  background-image:
    radial-gradient(circle, rgba(255, 255, 255, 0.98) 0 1px, transparent 1.15px),
    radial-gradient(circle, rgba(141, 224, 255, 0.9) 0 1px, transparent 1.15px),
    radial-gradient(circle, rgba(255, 118, 114, 0.76) 0 1px, transparent 1.1px),
    radial-gradient(circle, rgba(218, 238, 255, 0.42) 0 1px, transparent 1.2px);
  background-size: 72px 72px, 118px 118px, 173px 173px, 37px 37px;
  background-position: 8px 20px, 38px 61px, 17px 93px, 11px 9px;
  opacity: 0.82;
}

body.page-match::after {
  background:
    linear-gradient(90deg, rgba(255, 55, 50, 0.2) 0%, rgba(255, 55, 50, 0.05) 16%, transparent 35%, transparent 65%, rgba(58, 186, 255, 0.06) 84%, rgba(58, 186, 255, 0.2) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0%, transparent 18%, rgba(0, 0, 0, 0.48) 100%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

/* Controls have game feedback; keep native text selection in forms and reports. */
button,
[role="button"] {
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-splash {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  display: grid;
  place-items: center;
  background: #00060b;
  opacity: 1;
  visibility: visible;
  cursor: pointer;
  transition: opacity 280ms ease, visibility 280ms ease;
}

.app-splash[hidden] {
  display: none;
}

.app-splash::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(80, 200, 255, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.28));
  pointer-events: none;
}

.app-splash-logo-frame {
  position: relative;
  z-index: 1;
  width: min(100vw, 1000px);
  height: min(100vh, 562px);
  max-width: 100vw;
  max-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.app-splash-logo-frame::before {
  content: "";
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 96%;
  width: min(44%, 440px);
  height: clamp(30px, 5.8vw, 48px);
  transform: translate(-50%, -50%);
  background:
    linear-gradient(90deg, transparent 0%, rgba(0, 8, 15, 0.92) 12%, rgba(0, 10, 18, 0.98) 50%, rgba(0, 8, 15, 0.92) 88%, transparent 100%),
    radial-gradient(circle at 50% 44%, rgba(42, 172, 236, 0.2), transparent 68%);
  box-shadow:
    0 0 18px rgba(20, 164, 233, 0.2),
    inset 0 0 12px rgba(120, 219, 255, 0.1);
  pointer-events: none;
}

.app-splash-logo-picture,
.app-splash-logo {
  display: block;
  width: 100%;
  height: 100%;
}

.app-splash-logo {
  object-fit: contain;
  image-rendering: auto;
}

.app-splash-version {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 96%;
  transform: translate(-50%, -50%);
  color: #8fe8ff;
  font-size: clamp(0.78rem, 2.35vw, 1.38rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow:
    0 0 10px rgba(95, 213, 255, 0.86),
    0 0 26px rgba(25, 143, 225, 0.56);
  pointer-events: none;
}

.app-splash.is-hiding {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .app-splash {
    transition-duration: 220ms;
  }
}

