/* unrinked css 046 — safari pointer-lock viewport pin */
:root {
  --ice: #f4fbff;
  --navy: #1b2744;
  --ink: #1b2744;
  --cream: #fff6e8;
  --accent: #ff7a3d;
  --accent-dark: #c94a18;
  --cyan: #3ecfff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  background: #152238;
  color: var(--cream);
  font-family: "Nunito", 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;
  z-index: 0;
  touch-action: none;
}

#unity-canvas {
  width: 100% !important;
  height: 100% !important;
  display: block;
  background: #152238;
}

#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: 80;
  max-width: min(92vw, 42rem);
  display: none;
}

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

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

/* Shared still poster — covers Unity splash, zero animation cost */
#boot,
#html-lobby {
  background:
    linear-gradient(180deg, rgba(12, 22, 40, 0.28) 0%, transparent 28%, transparent 58%, rgba(12, 22, 40, 0.55) 100%),
    #152238 url("keyart-desktop.jpg?v=053") center / cover no-repeat;
}

/* ============================= LOADING ============================= */

#boot {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: stretch;
  overflow: hidden;
  transition: opacity 0.28s ease;
}

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

.boot-hud {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(1.2rem, 4vh, 2.4rem) 1.2rem calc(1.3rem + env(safe-area-inset-bottom));
  text-align: center;
  pointer-events: none;
}

.brand {
  margin: 2vh 0 0;
  font-family: "Lilita One", "Impact", sans-serif;
  font-size: clamp(3.4rem, 12vw, 6.8rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 0.92;
  color: #fffdf6;
  text-shadow:
    0 3px 0 #1b2744,
    3px 5px 0 #1b2744,
    0 10px 28px rgba(8, 14, 28, 0.45);
}

.brand-sub {
  display: block;
  margin-top: 0.45rem;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: clamp(0.78rem, 2vw, 0.95rem);
  font-weight: 800;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 246, 232, 0.88);
  text-shadow: 0 2px 10px rgba(8, 14, 28, 0.55);
}

.boot-dock {
  width: min(90vw, 22rem);
  margin: 0 auto;
}

.boot-bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(12, 22, 40, 0.55);
  box-shadow: inset 0 0 0 2px rgba(255, 246, 232, 0.22);
  overflow: hidden;
}

.boot-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: #ff7a3d;
  transition: width 0.15s linear;
}

.boot-readout {
  display: flex;
  justify-content: space-between;
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 246, 232, 0.86);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.boot-pct {
  font-family: "Lilita One", Impact, sans-serif;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
}

.boot-tip {
  margin: 0.7rem 0 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(255, 246, 232, 0.9);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

/* ============================== LOBBY ============================== */

#html-lobby {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: stretch;
  pointer-events: none;
}

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

.lobby-shell {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: clamp(1rem, 3.5vh, 2.2rem) 1.1rem calc(1.1rem + env(safe-area-inset-bottom));
}

.lobby-hero { text-align: center; }

.lobby-eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-indent: 0.28em;
  text-transform: uppercase;
  color: rgba(255, 246, 232, 0.82);
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.lobby-hero h1 {
  margin: 0;
  font-family: "Lilita One", Impact, sans-serif;
  font-size: clamp(3.2rem, 11vw, 6.4rem);
  font-weight: 400;
  letter-spacing: 0.06em;
  line-height: 0.92;
  color: #fffdf6;
  text-shadow:
    0 3px 0 #1b2744,
    3px 5px 0 #1b2744,
    0 10px 28px rgba(8, 14, 28, 0.45);
}

.lobby-hero .tag {
  margin: 0.4rem auto 0;
  font-size: clamp(0.95rem, 2.2vw, 1.1rem);
  font-weight: 800;
  color: #fff6e8;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* Cartoon sign — opaque, no glass, sits on the art */
.lobby-dock,
.queue-card {
  width: min(92vw, 22.5rem);
  margin: 0 auto;
  padding: 1rem 1.05rem 0.95rem;
  border-radius: 18px;
  background: var(--cream);
  color: var(--navy);
  box-shadow:
    0 0 0 4px #1b2744,
    0 14px 0 #1b2744;
  text-align: center;
}

.lobby-dock label {
  display: block;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(27, 39, 68, 0.55);
  margin: 0 0 0.3rem;
}

.lobby-dock input,
.lobby-friends-body input {
  width: 100%;
  height: 2.7rem;
  border-radius: 12px;
  border: 3px solid #1b2744;
  background: #fff;
  color: var(--navy);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  padding: 0 0.85rem;
  outline: none;
}

.lobby-dock input:focus,
.lobby-friends-body input:focus {
  border-color: #ff7a3d;
}

.btn {
  width: 100%;
  height: 3.15rem;
  margin-top: 0.7rem;
  border: 3px solid #1b2744;
  border-radius: 14px;
  cursor: pointer;
  font-family: "Lilita One", Impact, sans-serif;
  font-size: 1.35rem;
  letter-spacing: 0.08em;
  color: #fffdf6;
  background: #ff7a3d;
  box-shadow: 0 5px 0 #c94a18;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 #c94a18;
}

.btn.secondary,
.btn.ghost {
  color: var(--navy);
  background: #fff;
  box-shadow: 0 4px 0 #1b2744;
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.btn.ghost {
  height: 2.6rem;
  margin-top: 0.85rem;
}

.lobby-friends {
  margin-top: 0.7rem;
  border-radius: 12px;
  border: 3px solid #1b2744;
  background: #fff;
  overflow: hidden;
  text-align: left;
}

.lobby-friends > summary {
  list-style: none;
  cursor: pointer;
  padding: 0.7rem 0.9rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(27, 39, 68, 0.7);
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}

.lobby-friends > summary::-webkit-details-marker { display: none; }
.lobby-friends > summary::after {
  content: "+";
  font-size: 1.1rem;
  color: var(--navy);
}
.lobby-friends[open] > summary::after { content: "–"; }

.lobby-friends-body { padding: 0 0.85rem 0.85rem; }
.lobby-friends-body .btn {
  margin-top: 0.55rem;
  height: 2.5rem;
}

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

.lobby-row input {
  flex: 1;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  text-align: center;
  height: 2.5rem;
}

.lobby-row .btn.secondary {
  min-width: 5.2rem;
  margin-top: 0;
  width: auto;
}

.lobby-hints {
  display: flex;
  justify-content: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.lobby-hints span {
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(27, 39, 68, 0.7);
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  background: rgba(27, 39, 68, 0.08);
  white-space: nowrap;
}

.lobby-hints b { color: var(--navy); }

.lobby-meta {
  margin-top: 0.65rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(27, 39, 68, 0.6);
}

#lobby-share {
  margin-top: 0.4rem;
  font-size: 0.76rem;
  color: #c94a18;
  word-break: break-all;
}

#lobby-start { margin-top: 0.65rem; width: 100%; }

.room-panel {
  margin-top: 0.85rem;
  pointer-events: auto;
}

.lobby-roster {
  margin-top: 0.65rem;
  text-align: left;
}

.lobby-roster-label {
  margin: 0 0 0.3rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(27, 39, 68, 0.55);
}

#lobby-roster-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  min-height: 1.6rem;
}

#lobby-roster-list li {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.55rem;
  border-radius: 10px;
  border: 2px solid #1b2744;
  background: #fff;
  color: var(--navy);
  font-size: 0.88rem;
  font-weight: 800;
}

#lobby-roster-list li .dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #ff7a3d;
  flex-shrink: 0;
}

#lobby-roster-list li.is-you {
  background: #fff2e8;
  border-color: #ff7a3d;
}

#lobby-roster-list li .tag {
  margin-left: auto;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(27, 39, 68, 0.5);
}

#lobby-roster-list li.is-host .tag {
  color: #c94a18;
}

.lobby-roster-count {
  margin: 0.35rem 0 0;
  font-size: 0.75rem;
  font-weight: 800;
  color: rgba(27, 39, 68, 0.55);
}

.lobby-status-line {
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: rgba(27, 39, 68, 0.72);
  line-height: 1.35;
}

.start-hint {
  margin: 0.4rem 0 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: #c94a18;
}

#lobby-start:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.host-settings {
  margin-top: 0.7rem;
}

.host-settings-label {
  margin: 0 0 0.35rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(27, 39, 68, 0.62);
}

.fill-picks {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
}

.fill-pick {
  height: 2.4rem;
  border: 3px solid #1b2744;
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  font-family: "Nunito", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 3px 0 #1b2744;
}

.fill-pick.on {
  background: #ff7a3d;
  color: #fffdf6;
  box-shadow: 0 3px 0 #c94a18;
}

.bot-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

.bot-stepper button {
  width: 2.5rem;
  height: 2.5rem;
  border: 3px solid #1b2744;
  border-radius: 12px;
  background: #fff;
  color: var(--navy);
  font-family: "Lilita One", Impact, sans-serif;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 0 #1b2744;
}

.bot-stepper span {
  flex: 1;
  text-align: center;
  font-weight: 800;
  color: var(--navy);
}

.fill-hint {
  margin: 0.45rem 0 0;
  font-size: 0.74rem;
  font-weight: 700;
  color: rgba(27, 39, 68, 0.58);
}

.queue-card { pointer-events: auto; }

.queue-card h2 {
  margin: 0;
  font-family: "Lilita One", Impact, sans-serif;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  letter-spacing: 0.04em;
  color: var(--navy);
}

.queue-sub {
  margin: 0.3rem 0 1rem;
  color: rgba(27, 39, 68, 0.6);
  font-size: 0.88rem;
  font-weight: 700;
}

.queue-seats {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin: 0 auto;
  max-width: 15rem;
}

.queue-seats i {
  display: block;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(27, 39, 68, 0.1);
  box-shadow: inset 0 0 0 2px rgba(27, 39, 68, 0.18);
}

/* UI direction removed during rollback. */
#html-lobby .lobby-shell {
  padding: clamp(1.25rem, 4vw, 3rem) clamp(1.25rem, 4vw, 4rem) calc(1.25rem + env(safe-area-inset-bottom));
}

#html-lobby .lobby-hero {
  align-self: flex-start;
  text-align: left;
  max-width: 32rem;
}

#html-lobby .lobby-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.45rem 0.7rem;
  border: 1px solid rgba(180, 239, 255, 0.42);
  border-radius: 999px;
  background: rgba(7, 20, 42, 0.52);
  color: #b9efff;
  letter-spacing: 0.18em;
  backdrop-filter: blur(12px);
}

#html-lobby .lobby-eyebrow::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #7ff3c6;
  box-shadow: 0 0 12px #7ff3c6;
}

#html-lobby .lobby-hero h1 {
  margin-top: 0.75rem;
  font-size: clamp(3rem, 9vw, 6rem);
  letter-spacing: 0.03em;
}

#html-lobby .lobby-hero .tag {
  margin: 0.55rem 0 0;
  color: rgba(239, 249, 255, 0.82);
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  letter-spacing: 0.04em;
}

#html-lobby .lobby-dock,
#html-lobby .queue-card {
  width: min(92vw, 25rem);
  margin: 0 clamp(0rem, 5vw, 4rem) 0 auto;
  padding: 1.15rem;
  border: 1px solid rgba(172, 232, 255, 0.42);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(9, 28, 55, 0.9), rgba(9, 18, 38, 0.78));
  color: #effaff;
  box-shadow: 0 20px 55px rgba(0, 7, 20, 0.42), inset 0 1px 0 rgba(255,255,255,0.14);
  backdrop-filter: blur(18px) saturate(130%);
  text-align: left;
}

#html-lobby .lobby-dock label {
  color: rgba(213, 241, 255, 0.62);
  letter-spacing: 0.2em;
}

#html-lobby .lobby-dock input,
#html-lobby .lobby-friends-body input {
  height: 3rem;
  border: 1px solid rgba(180, 232, 255, 0.5);
  border-radius: 12px;
  background: rgba(2, 13, 29, 0.62);
  color: #f5fcff;
  box-shadow: inset 0 1px 8px rgba(0,0,0,0.22);
}

#html-lobby .btn {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(100deg, #ff9a57, #ff6747);
  box-shadow: 0 8px 22px rgba(255, 103, 71, 0.28);
}

#html-lobby .btn.secondary,
#html-lobby .btn.ghost {
  border: 1px solid rgba(180, 232, 255, 0.35);
  color: #dff7ff;
  background: rgba(12, 39, 70, 0.68);
  box-shadow: none;
}

#html-lobby .lobby-friends {
  border: 1px solid rgba(180, 232, 255, 0.35);
  background: rgba(12, 39, 70, 0.5);
}

#html-lobby .lobby-hints {
  margin-top: 0.9rem;
  color: rgba(220, 246, 255, 0.64);
}

#html-lobby .queue-card h2 { color: #f4fcff; }
#html-lobby .queue-sub { color: rgba(213, 241, 255, 0.64); }

@media (max-width: 640px) {
  #html-lobby .lobby-hero { align-self: center; text-align: center; }
  #html-lobby .lobby-hero .tag { margin-inline: auto; }
  #html-lobby .lobby-dock, #html-lobby .queue-card { margin-inline: auto; }
}

/* Rollback: restore the original MVP card presentation. */
#html-lobby .lobby-shell { padding: clamp(1rem, 3.5vh, 2.2rem) 1.1rem calc(1.1rem + env(safe-area-inset-bottom)); }
#html-lobby .lobby-hero { align-self: auto; text-align: center; max-width: none; }
#html-lobby .lobby-eyebrow { display: block; padding: 0; border: 0; border-radius: 0; background: transparent; color: rgba(255, 246, 232, 0.82); letter-spacing: 0.28em; backdrop-filter: none; }
#html-lobby .lobby-eyebrow::before { display: none; }
#html-lobby .lobby-hero h1 { margin-top: 0; font-size: clamp(3.2rem, 11vw, 6.4rem); letter-spacing: 0.06em; }
#html-lobby .lobby-hero .tag { margin: 0.4rem auto 0; color: #fff6e8; letter-spacing: normal; }
#html-lobby .lobby-dock, #html-lobby .queue-card { width: min(92vw, 22.5rem); margin: 0 auto; padding: 1rem 1.05rem 0.95rem; border: 0; border-radius: 18px; background: var(--cream); color: var(--navy); box-shadow: 0 0 0 4px #1b2744, 0 14px 0 #1b2744; backdrop-filter: none; text-align: center; }
#html-lobby .lobby-dock label { color: rgba(27, 39, 68, 0.55); letter-spacing: 0.16em; }
#html-lobby .lobby-dock input, #html-lobby .lobby-friends-body input { height: 2.7rem; border: 3px solid #1b2744; border-radius: 12px; background: #fff; color: var(--navy); box-shadow: none; }
#html-lobby .btn { border: 3px solid #1b2744; border-radius: 14px; background: #ff7a3d; box-shadow: 0 5px 0 #c94a18; }
#html-lobby .btn.secondary, #html-lobby .btn.ghost { border: 3px solid #1b2744; color: var(--navy); background: #fff; box-shadow: 0 4px 0 #1b2744; }
#html-lobby .lobby-friends { border: 3px solid #1b2744; background: #fff; }
#html-lobby .lobby-hints { color: inherit; }
#html-lobby .queue-card h2 { color: var(--navy); }
#html-lobby .queue-sub { color: rgba(27, 39, 68, 0.6); }

.queue-seats i.on {
  background: #ff7a3d;
  box-shadow: inset 0 0 0 2px #1b2744;
}

.queue-status {
  margin: 1rem 0 0;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(27, 39, 68, 0.7);
}

.queue-pulse {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-right: 0.4rem;
  border-radius: 50%;
  background: #ff7a3d;
  vertical-align: middle;
}

#spectate-leave {
  position: fixed;
  left: 50%;
  bottom: calc(1.1rem + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 56;
  min-width: 12.5rem;
  height: 3rem;
  padding: 0 1.2rem;
  border: 3px solid #1b2744;
  border-radius: 14px;
  cursor: pointer;
  font-family: "Lilita One", Impact, sans-serif;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: #fffdf6;
  background: #ff7a3d;
  box-shadow: 0 4px 0 #c94a18;
}

#spectate-leave:active {
  transform: translateX(-50%) translateY(2px);
  box-shadow: 0 2px 0 #c94a18;
}

#music-mute,
#unity-fullscreen-button {
  position: fixed;
  bottom: 0.85rem;
  z-index: 55;
  width: 44px;
  height: 44px;
  border: 3px solid #1b2744;
  border-radius: 12px;
  cursor: pointer;
  background: var(--cream);
  color: var(--navy);
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
}

#music-mute {
  right: 4.15rem;
}

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

#music-mute svg,
#unity-fullscreen-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#music-mute .icon-off { display: none; }
#music-mute.is-muted .icon-on { display: none; }
#music-mute.is-muted .icon-off { display: block; }

#unity-fullscreen-button {
  right: 0.85rem;
}
