/**
 * Start screen + login modal — Capsule Glass (matches in-game windows).
 */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #010208;
  font-family: var(--cg-font, "Rajdhani", "Monda", system-ui, sans-serif);
  color: var(--cg-text, #f0f4f8);
}

.start {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  display: flex;
  align-items: stretch;
  padding: 10px;
}

.start__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

/* —— Left panel (glass shell) —— */
.start-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 380px;
  height: 100%;
  align-self: stretch;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius);
  background:
    var(--lab-fx),
    linear-gradient(180deg, var(--lab-bg) 0%, var(--lab-bg-2) 100%);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    inset 0 1px 0 rgba(200, 230, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.45);
  transition:
    opacity 0.28s ease,
    transform 0.28s ease,
    visibility 0.28s ease,
    border-color 0.35s ease,
    box-shadow 0.4s ease;
}

.start-panel:hover {
  border-color: var(--lab-line);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.45) inset,
    inset 0 1px 0 rgba(200, 230, 255, 0.1),
    0 20px 44px rgba(0, 0, 0, 0.55);
}

.start-panel__logo {
  display: block;
  width: 260px;
  height: auto;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.start-panel__hero {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  object-position: center;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius);
  background: var(--lab-slot-bg);
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
}

.start-panel__body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1 1 auto;
  min-height: 0;
  margin-top: 16px;
  overflow: auto;
  padding-right: 10px;
  scrollbar-width: thin;
  scrollbar-color: rgba(var(--lab-glow-rgb), 0.35) transparent;
}

.start-panel__body::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

.start-panel__body::-webkit-scrollbar-corner {
  background: transparent;
}

.start-panel__body::-webkit-scrollbar-track {
  margin: 4px 0;
  background: transparent;
}

.start-panel__body::-webkit-scrollbar-thumb {
  background: rgba(var(--lab-glow-rgb), 0.28);
  border-radius: 1px;
}

.start-panel__body::-webkit-scrollbar-thumb:hover {
  background: rgba(var(--lab-glow-rgb), 0.45);
}

.start-panel__section-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.start-panel__section-title {
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.start-panel__rule {
  width: 100%;
  height: 1px;
  background: var(--lab-line-soft);
}

.start-panel__about {
  color: var(--lab-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.start-panel__highlights {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.start-panel__highlight p {
  position: relative;
  padding-left: 12px;
  color: var(--lab-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.start-panel__highlight p::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.2em;
  bottom: 0.2em;
  width: 2px;
  background: var(--lab-line-hot);
}

.start-panel__footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: auto;
  padding-top: 16px;
}

.start-panel__play-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.start-panel__play-note {
  margin: 2px 0 0;
  color: var(--lab-muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-align: center;
}

.start-panel__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 46px;
  min-height: 46px;
  max-height: 46px;
  padding: 5px 14px 3px;
  border: 1px solid var(--lab-line-hot);
  border-radius: 1px;
  background: var(--lab-btn-bg);
  color: var(--lab-accent-strong);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.14em;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(var(--lab-glow-rgb), 0.06);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.start-panel__play:hover {
  border-color: var(--lab-hover-line);
  background: var(--lab-btn-bg-hover);
  color: #fff;
  box-shadow: 0 0 12px rgba(var(--lab-glow-rgb), 0.18);
}

.start-panel__play--demo {
  border-color: var(--lab-line);
  color: var(--lab-accent);
  background: linear-gradient(180deg, rgba(40, 56, 70, 0.28), rgba(16, 24, 32, 0.42));
}

.start-panel__play--demo:hover {
  border-color: var(--lab-hover-line);
  color: #fff;
  background: var(--lab-btn-bg-hover);
}

.start-panel__socials {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  min-height: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.start-panel__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: var(--lab-btn-bg);
  text-decoration: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.start-panel__social:hover {
  border-color: var(--lab-hover-line);
  background: var(--lab-btn-bg-hover);
}

.start-panel__social img {
  display: block;
  width: 16px;
  height: 14px;
  object-fit: contain;
  opacity: 0.9;
}

.start-panel__version {
  color: var(--lab-muted);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

/* —— Login overlay / brief-style modal (matches demo-tutorial) —— */
.login-overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 20px;
  background: transparent;
  visibility: hidden;
  pointer-events: none;
}

.login-overlay.is-open {
  visibility: visible;
  pointer-events: auto;
}

.login-overlay__veil {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: rgba(1, 4, 10, 0.72);
  opacity: 0;
  transition: opacity 0.28s ease;
  pointer-events: none;
}

.login-overlay.is-open .login-overlay__veil {
  opacity: 1;
}

.login-modal {
  position: relative;
  z-index: 1;
  width: min(640px, calc(100vw - 32px));
  min-height: 0;
  padding: 12px 14px 14px;
  border: 1px solid var(--lab-line-soft);
  border-radius: var(--lab-radius);
  background:
    var(--lab-fx),
    linear-gradient(180deg, var(--lab-bg) 0%, var(--lab-bg-2) 100%);
  backdrop-filter: blur(22px) saturate(1.3);
  -webkit-backdrop-filter: blur(22px) saturate(1.3);
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.4) inset,
    inset 0 1px 0 rgba(200, 230, 255, 0.08),
    0 18px 40px rgba(0, 0, 0, 0.45);
  font-family: inherit;
  color: var(--lab-text);
  pointer-events: auto;
}

.login-modal__chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.login-modal__channel {
  margin: 0;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--lab-accent);
}

.login-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 1px;
  background: transparent;
  color: var(--lab-accent);
  cursor: pointer;
  transform: translateZ(0);
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

.login-modal__close:hover {
  background: rgba(var(--lab-glow-rgb), 0.12);
  color: #fff;
}

.login-modal__close-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 10px;
  height: 10px;
  transform: translateY(-1px);
}

.login-modal__close-icon svg {
  display: block;
  width: 10px;
  height: 10px;
}

.login-modal__layout {
  display: grid;
  grid-template-columns: 148px 1fr;
  gap: 14px;
  align-items: start;
}

.login-modal__guide {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
}

.login-modal__avatar {
  position: relative;
  width: 132px;
  height: 132px;
  overflow: hidden;
  border: 1px solid var(--lab-line);
  border-radius: 1px;
  background: #050c14;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}

.login-modal__avatar-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  animation: login-guide-breathe 4.8s ease-in-out infinite;
}

.login-modal__avatar-scan {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(15, 219, 251, 0.14) 48%,
    transparent 100%
  );
  background-size: 100% 220%;
  animation: login-guide-scan 2.8s linear infinite;
  pointer-events: none;
  mix-blend-mode: screen;
}

.login-modal__avatar-pulse {
  position: absolute;
  inset: -1px;
  border: 1px solid rgba(15, 219, 251, 0.25);
  animation: login-guide-pulse 2.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes login-guide-breathe {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
}

@keyframes login-guide-scan {
  0% {
    background-position: 0 -40%;
  }
  100% {
    background-position: 0 140%;
  }
}

@keyframes login-guide-pulse {
  0%,
  100% {
    opacity: 0.35;
    box-shadow: 0 0 0 0 rgba(15, 219, 251, 0);
  }
  50% {
    opacity: 1;
    box-shadow: 0 0 18px rgba(15, 219, 251, 0.25);
  }
}

.login-modal__copy-col {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.login-modal__heading {
  margin: 0 0 10px;
  color: var(--lab-text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.15;
  text-transform: uppercase;
}

.login-modal__copy {
  margin: 0;
  color: var(--lab-muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.login-modal__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.login-modal__actions--row {
  flex-direction: row;
}

.login-modal__actions--row .login-modal__btn {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
}

.login-modal__step[hidden],
.login-modal__btn[hidden] {
  display: none !important;
}

.login-modal__email {
  display: block;
  width: 100%;
  height: 26px;
  margin: 12px 0 0;
  padding: 0 10px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: var(--lab-input-bg);
  color: var(--lab-text);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 26px;
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.28);
  box-sizing: border-box;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease;
}

.login-modal__email::placeholder {
  color: rgba(170, 183, 195, 0.45);
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0.02em;
}

.login-modal__email:focus {
  border-color: var(--lab-line);
  background: var(--lab-input-bg-focus);
  color: var(--lab-accent-strong);
}

.login-modal__email.is-error {
  border-color: rgba(226, 90, 90, 0.75);
  color: #f0a8a8;
}

.login-modal__email.is-error:focus {
  border-color: rgba(226, 90, 90, 0.9);
}

.login-modal__email.is-error::placeholder {
  color: rgba(226, 90, 90, 0.55);
}

.login-error {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 8px 12px;
  border: 1px solid rgba(226, 90, 90, 0.55);
  border-radius: var(--lab-radius);
  background: rgba(80, 18, 18, 0.82);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
  transition:
    opacity 0.18s ease,
    visibility 0.18s ease,
    transform 0.18s ease;
}

.login-error.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.login-modal__btn {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: 26px;
  min-height: 26px;
  max-height: 26px;
  padding: 4px 12px 1px;
  border: 1px solid var(--lab-line-hot);
  border-radius: 1px;
  background: var(--lab-btn-bg);
  color: var(--lab-accent-strong);
  font-family: inherit;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  line-height: 1;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(var(--lab-glow-rgb), 0.06);
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.15s ease;
}

.login-modal__btn-label {
  display: block;
  margin: 0;
  padding: 0;
  font-weight: 500;
  line-height: 1;
}

.login-modal__btn--primary {
  background: linear-gradient(180deg, rgba(110, 148, 172, 0.5), rgba(48, 72, 92, 0.68));
  color: #fff;
  box-shadow: 0 0 10px rgba(var(--lab-glow-rgb), 0.12);
}

.login-modal__btn:hover:not(:disabled) {
  border-color: var(--lab-hover-line);
  background: var(--lab-btn-bg-hover);
  color: #fff;
  box-shadow: 0 0 12px rgba(var(--lab-glow-rgb), 0.18);
}

.login-modal__btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, rgba(128, 164, 188, 0.58), rgba(56, 82, 104, 0.74));
}

.login-modal__btn:disabled {
  opacity: 0.72;
  cursor: wait;
  pointer-events: none;
  border-color: rgba(164, 194, 214, 0.14);
  background: rgba(10, 16, 24, 0.35);
  color: var(--lab-muted);
  box-shadow: none;
}

.login-modal__actions:not(.login-modal__actions--row) .login-modal__btn {
  width: 100%;
}


@media (max-width: 900px) {
  .start-panel {
    width: min(380px, 42vw);
    min-width: 300px;
  }

  .start-panel.is-login-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(-24px);
  }
}

@media (max-width: 720px) {
  .start {
    padding: 8px;
    overflow: hidden;
  }

  .start-panel {
    width: 100%;
    min-width: 0;
    height: calc(100svh - 16px);
    max-height: calc(100svh - 16px);
  }

  .start-panel__logo {
    width: min(260px, 100%);
  }

  .start-panel__hero {
    height: clamp(120px, 28vw, 180px);
  }

  .login-overlay {
    padding: 12px;
    overflow: hidden;
  }

  .login-modal {
    width: min(640px, calc(100vw - 24px));
  }

  .login-modal__layout {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .login-modal__heading {
    text-align: center;
  }

  .login-modal__copy {
    text-align: left;
  }

  .login-modal__actions {
    justify-content: stretch;
  }

  .login-modal__btn {
    flex: 1;
  }

  .login-error {
    left: 8px;
    right: 8px;
    bottom: 8px;
  }
}

@media (max-width: 480px) {
  .start {
    padding: 6px;
  }

  .start-panel {
    padding: 12px;
    height: calc(100svh - 12px);
    max-height: calc(100svh - 12px);
  }

  .start-panel__logo {
    margin-bottom: 12px;
  }

  .start-panel__hero {
    height: 120px;
  }

  .start-panel__body {
    margin-top: 12px;
    gap: 12px;
    padding-right: 8px;
  }

  .start-panel__about,
  .start-panel__highlight p {
    font-size: 12px;
  }

  .start-panel__footer {
    gap: 12px;
    padding-top: 12px;
  }

  .start-panel__socials {
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px;
    padding: 0;
    height: auto;
    min-height: 0;
  }

  .login-overlay {
    padding: 10px;
  }

  .login-modal {
    width: calc(100vw - 20px);
    padding: 10px 12px 12px;
  }

  .login-modal__avatar {
    width: 112px;
    height: 112px;
  }

  .login-modal__heading {
    font-size: 16px;
  }

  .login-modal__copy {
    font-size: 12px;
  }

  .login-modal__btn {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .login-error {
    left: 6px;
    right: 6px;
    bottom: 6px;
    padding: 8px 10px;
  }
}

@media (max-height: 700px) and (min-width: 721px) {
  .start-panel__hero {
    height: 140px;
  }

  .start-panel__body {
    margin-top: 12px;
  }

  .start-panel__footer {
    gap: 12px;
    padding-top: 12px;
  }
}

/* Glass tip (shared Close / control hover tip) */
.glass-tip {
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  padding: 4px 9px 4px;
  border: 1px solid var(--lab-line-soft);
  border-radius: 1px;
  background: #060c12;
  box-shadow:
    0 0 0 1px rgba(0, 0, 0, 0.35) inset,
    0 8px 18px rgba(0, 0, 0, 0.35);
  color: var(--lab-text);
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
  white-space: normal;
  overflow-wrap: break-word;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition:
    opacity 0.18s ease 0.08s,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
    visibility 0s linear 0.26s;
}

.glass-tip[data-tip-side="above"] {
  transform: translateY(-6px);
}

.glass-tip[data-tip-side="right"] {
  transform: translateX(-6px);
}

.glass-tip[data-tip-side="below"] {
  transform: translateY(6px);
}

.glass-tip.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(0, 0);
  transition:
    opacity 0.18s ease 0.08s,
    transform 0.18s cubic-bezier(0.22, 1, 0.36, 1) 0.08s,
    visibility 0s linear 0s;
}

