:root {
  --ice: #e8f4ff;
  --frost: #9fd4ff;
  --deep: #061525;
  --mid: #0b2a45;
  --accent: #3ecfff;
  --warm: #ffb457;
  --ink: #f3f8ff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--deep);
  color: var(--ink);
  font-family: "DM Sans", system-ui, sans-serif;
}

#unity-container,
#unity-container.unity-desktop,
#unity-container.unity-mobile {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: none;
  left: 0;
  top: 0;
}

#unity-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: radial-gradient(120% 80% at 50% 20%, #123758 0%, var(--deep) 70%);
}

#unity-footer,
#unity-logo,
#unity-logo-title-footer,
#unity-build-title,
#unity-loading-bar {
  display: none !important;
}

#unity-warning {
  position: fixed;
  left: 50%;
  top: 1.25rem;
  transform: translateX(-50%);
  z-index: 50;
  max-width: min(92vw, 42rem);
  display: none;
}

#unity-warning > div {
  border-radius: 10px;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  line-height: 1.35;
}

.is-hidden { display: none !important; }

#boot {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(100% 70% at 50% -10%, rgba(62, 207, 255, 0.28), transparent 55%),
    linear-gradient(165deg, #0a243d 0%, var(--deep) 55%, #02080f 100%);
  transition: opacity 0.55s ease, visibility 0.55s ease;
}

#boot.is-done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  display: none;
}

.boot-glow {
  position: absolute;
  width: 55vmax;
  height: 55vmax;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(62, 207, 255, 0.18), transparent 65%);
  animation: pulse 4.5s ease-in-out infinite;
  pointer-events: none;
}

.boot-inner {
  position: relative;
  width: min(92vw, 28rem);
  text-align: center;
  padding: 1rem;
}

.boot-brand {
  margin: 0;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(3.5rem, 14vw, 6.5rem);
  letter-spacing: 0.06em;
  line-height: 0.9;
  color: var(--ice);
  text-shadow: 0 0 40px rgba(62, 207, 255, 0.35);
}

.boot-tag {
  margin: 0.85rem 0 0;
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
  color: rgba(232, 244, 255, 0.78);
}

.boot-bar {
  width: min(100%, 16rem);
  height: 6px;
  margin: 1.6rem auto 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.boot-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #57c2ff, var(--accent), #b8f0ff);
  box-shadow: 0 0 18px rgba(62, 207, 255, 0.55);
  transition: width 0.15s linear;
}

.boot-status {
  margin: 0.9rem 0 0;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(232, 244, 255, 0.55);
}

.boot-flake {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.55);
  animation: fall linear infinite;
  pointer-events: none;
}

#html-lobby {
  position: fixed;
  inset: 0;
  z-index: 25;
  display: grid;
  place-items: center;
  pointer-events: none;
  padding: 1rem;
}

#html-lobby:not(.is-hidden) .lobby-card {
  pointer-events: auto;
}

.lobby-card {
  width: min(92vw, 26rem);
  padding: 1.6rem 1.4rem 1.35rem;
  border-radius: 18px;
  background: rgba(6, 21, 37, 0.88);
  box-shadow:
    0 0 0 1px rgba(159, 212, 255, 0.18),
    0 24px 60px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(14px);
  text-align: center;
}

.lobby-card h1 {
  margin: 0;
  font-family: "Bebas Neue", Impact, sans-serif;
  font-size: clamp(2.8rem, 10vw, 3.8rem);
  letter-spacing: 0.06em;
  color: var(--ice);
}

.lobby-card .tag {
  margin: 0.35rem 0 1.2rem;
  color: rgba(232, 244, 255, 0.72);
  font-size: 0.95rem;
}

.lobby-card label {
  display: block;
  text-align: left;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(232, 244, 255, 0.5);
  margin: 0 0 0.35rem;
}

.lobby-card input {
  width: 100%;
  height: 2.6rem;
  border-radius: 10px;
  border: 1px solid rgba(159, 212, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: var(--ice);
  font: inherit;
  font-size: 1rem;
  padding: 0 0.85rem;
  outline: none;
}

.lobby-card input:focus {
  border-color: rgba(62, 207, 255, 0.7);
  box-shadow: 0 0 0 3px rgba(62, 207, 255, 0.15);
}

.lobby-card .btn {
  width: 100%;
  height: 2.75rem;
  margin-top: 0.85rem;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #042033;
  background: linear-gradient(180deg, #7fe0ff, var(--accent));
  box-shadow: 0 8px 24px rgba(62, 207, 255, 0.25);
}

.lobby-card .btn:hover { filter: brightness(1.05); }
.lobby-card .btn:active { transform: translateY(1px); }

.lobby-card .btn.secondary {
  width: auto;
  min-width: 5.5rem;
  margin-top: 0;
  color: var(--ice);
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.lobby-row {
  display: flex;
  gap: 0.55rem;
  margin-top: 0.85rem;
  align-items: stretch;
}

.lobby-row input { flex: 1; }

.lobby-meta {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: rgba(232, 244, 255, 0.55);
  letter-spacing: 0.04em;
}

#lobby-share {
  margin-top: 0.45rem;
  font-size: 0.78rem;
  color: rgba(159, 212, 255, 0.85);
  word-break: break-all;
}

#lobby-start { margin-top: 0.75rem; }

#unity-fullscreen-button {
  position: fixed;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 30;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.14), rgba(255,255,255,0.04)),
    rgba(6, 21, 37, 0.55);
  color: var(--ice);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

#unity-fullscreen-button.is-ready {
  opacity: 1;
  pointer-events: auto;
}

#unity-fullscreen-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

@keyframes pulse {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.05); opacity: 0.9; }
}

@keyframes fall {
  0% { transform: translate3d(0, -10vh, 0); opacity: 0; }
  15% { opacity: 0.45; }
  100% { transform: translate3d(12px, 110vh, 0); opacity: 0; }
}
