html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000000;
}

canvas {
  display: block;
  width: 100vw;
  height: 100vh;
  background: #000000;
  image-rendering: auto;
}

[hidden] {
  display: none !important;
}

.start-ui {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: end center;
  padding: 0 24px 68px;
  box-sizing: border-box;
  pointer-events: none;
}

.start-ui.is-booting {
  visibility: hidden;
}

.identity-panel {
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 48px));
  pointer-events: auto;
}

.unsupported-device-screen {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  box-sizing: border-box;
  color: #ffffff;
  pointer-events: auto;
  text-align: center;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.9);
}

.unsupported-device-panel {
  max-width: 560px;
}

.unsupported-device-panel h1 {
  margin: 0 0 14px;
  font: 700 34px Arial, sans-serif;
}

.unsupported-device-panel p {
  margin: 0;
  font: 400 20px Arial, sans-serif;
  line-height: 1.35;
}

.intro-screen {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.intro-screen.is-service-only .intro-prompt {
  display: none;
}

.intro-screen.is-service-only .intro-language {
  opacity: 0;
  pointer-events: none;
}

.intro-screen.is-service-only .intro-logo {
  display: none;
}

.intro-screen.is-service-only .intro-engine,
.intro-screen.is-service-only .intro-version {
  opacity: 0;
}

.intro-language {
  position: fixed;
  left: 24px;
  top: 20px;
  pointer-events: auto;
  opacity: 1;
  transition: opacity 1000ms ease;
}

.intro-language-select {
  min-width: 150px;
  background: rgba(0, 0, 0, 0.42);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 4px;
  padding: 5px 8px;
  font: 400 13px Arial, sans-serif;
  letter-spacing: 0;
  outline: none;
}

.intro-language-select:focus {
  border-color: rgba(255, 255, 255, 0.82);
}

.intro-prompt {
  position: fixed;
  left: 50%;
  bottom: 86px;
  color: #ffffff;
  font: 400 28px Arial, sans-serif;
  letter-spacing: 0;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.9);
  transform: translateX(-50%);
  white-space: nowrap;
  animation: intro-pulse 2.2s ease-in-out infinite;
}

.intro-fullscreen-hint {
  position: fixed;
  left: 50%;
  bottom: 44px;
  color: rgba(255, 255, 255, 0.76);
  font: 400 15px Arial, sans-serif;
  letter-spacing: 0;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.9);
  transform: translateX(-50%);
  white-space: nowrap;
}

.intro-service-block {
  position: fixed;
  right: 30px;
  bottom: 22px;
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #ffffff;
  font: 400 13px Arial, sans-serif;
  letter-spacing: 0;
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.95);
}

.intro-logo {
  width: 172px;
  height: auto;
  display: none;
  margin-bottom: 0;
}

.intro-engine,
.intro-version {
  white-space: nowrap;
  transition: opacity 1000ms ease;
}

.intro-engine {
  font-size: 13px;
  text-align: center;
}

.intro-server-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.intro-server-indicator {
  width: 6px;
  height: 17px;
  image-rendering: pixelated;
}

@keyframes intro-pulse {
  0%,
  100% {
    opacity: 0.42;
  }

  50% {
    opacity: 1;
  }
}

.nick-input,
.password-input {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  color: #000000;
  font: 16px Arial, sans-serif;
  letter-spacing: 0;
  padding: 2px 6px;
  text-align: center;
}

.nick-input::placeholder,
.password-input::placeholder {
  color: #777777;
}

.warrior-button {
  background: #1f7a24;
  border-color: #145717;
  color: #ffffff;
  cursor: pointer;
  font: 700 16px "Arial Narrow", Arial, sans-serif;
  letter-spacing: 0;
  padding: 6px 10px;
}

.back-button {
  cursor: pointer;
  font: 14px Arial, sans-serif;
  letter-spacing: 0;
  padding: 2px 8px;
}

.user-cabinet {
  display: grid;
  justify-items: center;
  gap: 8px;
  color: #ffffff;
  text-align: center;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.9);
}

.cabinet-avatar {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.48) center / cover no-repeat;
  font: 700 36px Arial, sans-serif;
  overflow: hidden;
}

.cabinet-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
}

.cabinet-nick {
  font: 700 22px Arial, sans-serif;
}

.cabinet-badge {
  font: 20px Arial, sans-serif;
}

.cabinet-status {
  max-width: 320px;
  font: 14px Arial, sans-serif;
}

.cabinet-stats {
  display: flex;
  gap: 14px;
  justify-content: center;
  font: 700 14px Arial, sans-serif;
}

.cabinet-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.service-line {
  position: fixed;
  left: 50%;
  bottom: 10px;
  color: #ffffff;
  font: 400 13px "Arial", sans-serif;
  letter-spacing: 0;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.85);
  transform: translateX(-50%);
  white-space: nowrap;
}

.entrance-popup-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  pointer-events: auto;
}

.entrance-popup-panel {
  --popup-x: 0px;
  --popup-y: 0px;
  box-sizing: border-box;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: min(43vw, 380px);
  max-height: 82vh;
  color: #101510;
  border: 10px solid transparent;
  border-radius: 22px;
  background:
    linear-gradient(135deg, #fff27a 0%, #ffed76 52%, #ffe45e 100%) padding-box,
    repeating-linear-gradient(135deg, #15140a 0 14px, #ffed76 14px 28px) border-box;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.42);
  font: 400 clamp(14px, 2.1vh, 21px) Arial, sans-serif;
  line-height: 1.45;
  opacity: 0;
  overflow: hidden;
  transform: translate(var(--popup-x), var(--popup-y)) scale(0.96);
  transition: opacity 180ms ease, transform 220ms ease;
}

.entrance-popup-overlay.is-open .entrance-popup-panel {
  opacity: 1;
  transform: translate(var(--popup-x), var(--popup-y)) scale(1);
}

.entrance-popup-overlay.is-closing .entrance-popup-panel {
  opacity: 0;
  transform: translate(var(--popup-x), var(--popup-y)) scale(0.98);
}

.entrance-popup-panel.is-dragging,
.entrance-popup-scroll.is-scrolling {
  cursor: grabbing;
  transition: none;
}

.entrance-popup-scroll {
  min-height: 0;
  padding: clamp(22px, 4vh, 36px) clamp(24px, 4vw, 42px) 12px;
  overflow-y: auto;
  cursor: grab;
  scrollbar-color: rgba(16, 21, 16, 0.35) transparent;
}

.entrance-popup-title {
  margin: 0 0 18px;
  font: 700 1.08em Arial, sans-serif;
}

.entrance-popup-body {
  display: grid;
  gap: 1.05em;
}

.entrance-popup-body p {
  margin: 0;
}

.entrance-popup-link {
  color: #101510;
  cursor: pointer;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.entrance-popup-link:hover {
  color: #273727;
}

.entrance-popup-actions {
  display: grid;
  place-items: center;
  padding: 10px clamp(24px, 4vw, 42px) clamp(22px, 4vh, 34px);
}

.entrance-popup-ok {
  min-width: 118px;
  min-height: 46px;
  color: #101510;
  background: rgba(16, 21, 16, 0.08);
  border: 2px solid rgba(16, 21, 16, 0.72);
  border-radius: 9px;
  cursor: pointer;
  font: 700 1em Arial, sans-serif;
  transition: background 80ms ease, transform 80ms ease;
}

.entrance-popup-ok:active,
.entrance-popup-ok.is-pressed {
  background: rgba(16, 21, 16, 0.24);
  transform: translateY(2px) scale(0.97);
}
