* {
  box-sizing: border-box;
}
html,
body {
  margin: 0;
  height: 100%;
  background: #1a0a2e;
  font-family: system-ui, sans-serif;
  color: #f0e6ff;
}
#wrap {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#game {
  display: block;
  max-width: 100%;
  height: auto;
  border: 2px solid #c77dff;
  box-shadow: 0 0 24px rgba(199, 125, 255, 0.35);
  background: #2d1b4e;
  border-radius: 4px;
}
#hud {
  margin-top: 8px;
  font-size: 14px;
  opacity: 0.85;
}
.screen-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 5, 20, 0.72);
  backdrop-filter: blur(2px);
  z-index: 20;
}
.screen-overlay.hidden {
  display: none;
}
#main-menu-overlay {
  z-index: 15;
}
#name-overlay,
#records-overlay {
  z-index: 25;
}
#overlay {
  z-index: 18;
}
.main-menu-panel {
  text-align: center;
}
.main-menu-sub {
  margin: 0 0 18px !important;
  opacity: 0.88;
}
.main-menu-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.menu-main-btn {
  width: 100%;
  justify-content: center;
}
.name-row {
  text-align: center;
  margin: 0 !important;
}
.btn-inline {
  font-size: 13px;
  padding: 6px 12px;
}
.name-hint {
  font-size: 13px;
  line-height: 1.45;
  margin-bottom: 12px !important;
  opacity: 0.88;
}
.name-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  border-radius: 8px;
  border: 1px solid rgba(199, 125, 255, 0.55);
  background: rgba(0, 0, 0, 0.25);
  color: #f0e6ff;
  margin-bottom: 14px;
}
.name-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
}
.name-status {
  min-height: 18px;
  margin: 0 0 10px !important;
  font-size: 13px !important;
  opacity: 0.95;
}
.records-footer {
  margin-top: 12px;
  text-align: center;
}
.end-game-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: stretch;
  margin-top: 8px;
}
.end-game-actions .bar-btn,
.end-game-actions .btn-secondary {
  width: 100%;
}
.player-tag {
  font-size: 14px;
  font-weight: 600;
  color: #c4b5fd;
  margin-right: 4px;
}
.panel {
  text-align: center;
  padding: 24px 32px;
  border: 2px solid #e0aaff;
  border-radius: 8px;
  background: rgba(45, 27, 78, 0.95);
  box-shadow: 0 0 32px rgba(224, 170, 255, 0.25);
}
.panel h1 {
  margin: 0 0 12px;
  font-size: 28px;
  letter-spacing: 0.06em;
}
.panel p {
  margin: 0;
  font-size: 15px;
  opacity: 0.9;
}
.panel-wide {
  max-width: 420px;
  text-align: left;
}
.panel-wide h1 {
  text-align: center;
}
.run-stats {
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.2);
}
.lb-title {
  font-size: 17px;
  margin: 0 0 8px;
  font-weight: 600;
}
.leaderboard {
  margin: 0 0 16px;
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.55;
}
.hint-restart {
  text-align: center;
  font-size: 14px;
  opacity: 0.85;
}
.promo-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.promo-label {
  font-size: 13px;
  opacity: 0.9;
}
.promo-input {
  width: 120px;
  padding: 6px 10px;
  font-size: 14px;
  font-family: inherit;
  border-radius: 6px;
  border: 1px solid rgba(199, 125, 255, 0.55);
  background: rgba(0, 0, 0, 0.25);
  color: #f0e6ff;
}
.promo-input::placeholder {
  opacity: 0.45;
}
.promo-btn {
  padding: 6px 14px;
}
.promo-feedback {
  font-size: 12px;
  min-width: 0;
  max-width: 160px;
}
.app-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 18px;
  background: rgba(26, 10, 46, 0.95);
  border-bottom: 2px solid #6b3fa0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.brand {
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  color: #e0aaff;
  margin-right: 8px;
}
.bar-btn {
  padding: 8px 18px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  border: 2px solid #c77dff;
  border-radius: 8px;
  background: linear-gradient(180deg, #4a2d6e 0%, #2d1b4e 100%);
  color: #f5e9ff;
}
.bar-btn:hover {
  border-color: #e0aaff;
  background: #5a3d82;
}
.points-display {
  margin-left: auto;
  font-size: 15px;
  font-weight: 600;
  color: #ffd78c;
}
.menu-back-wrap {
  text-align: center;
  margin-top: 12px;
}
.btn-secondary {
  padding: 8px 16px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  border: 1px solid #9d8cc4;
  border-radius: 8px;
  background: rgba(60, 40, 90, 0.6);
  color: #e8e0f5;
}
.btn-secondary:hover {
  background: rgba(80, 55, 120, 0.8);
}
.skins-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 5, 20, 0.78);
  backdrop-filter: blur(3px);
  z-index: 50;
}
.skins-overlay.hidden {
  display: none;
}
.skins-panel {
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
}
.skins-hint {
  font-size: 13px;
  line-height: 1.45;
  opacity: 0.92;
  margin: 0 0 14px;
}
.skins-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.skin-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(199, 125, 255, 0.35);
}
.skin-swatch {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  flex-shrink: 0;
}
.skin-info {
  flex: 1;
  min-width: 0;
}
.skin-name {
  font-weight: 600;
  margin: 0 0 2px;
}
.skin-meta {
  font-size: 12px;
  opacity: 0.85;
  margin: 0;
}
.skin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.skin-actions button {
  padding: 6px 12px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 6px;
  border: 1px solid #a878e8;
  background: #3d2860;
  color: #f0e6ff;
}
.skin-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.skin-actions .equip-active {
  border-color: #7cfc9a;
  color: #c8ffd4;
}
.skins-footer {
  margin: 16px 0 0;
  text-align: center;
}
.btn-show-overlay {
  position: fixed;
  right: 14px;
  bottom: 92px;
  z-index: 30;
  padding: 10px 14px;
  font-size: 14px;
  border: 1px solid #9d8cc4;
  border-radius: 10px;
  background: rgba(60, 40, 90, 0.88);
  color: #e8e0f5;
}
.btn-show-overlay.hidden {
  display: none;
}

.mobile-controls {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 14px;
  display: flex;
  justify-content: center;
  gap: 12px;
  z-index: 12;
  pointer-events: none;
}
.mobile-controls.hidden {
  display: none;
}
.mobile-btn.hidden {
  display: none;
}
.mobile-btn {
  pointer-events: auto;
  min-width: 132px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: rgba(35, 20, 55, 0.78);
  backdrop-filter: blur(2px);
  touch-action: manipulation;
}
.mobile-btn-jump {
  border-color: #4ade80;
}
.mobile-btn-shoot {
  border-color: #fda4af;
}

@media (pointer: coarse) {
  html,
  body {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
  }
  #wrap,
  #game,
  #hud,
  #mobile-controls,
  .mobile-btn,
  .app-bar {
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: none;
  }
  #overlay .panel {
    width: 80vw;
    max-width: 80vw;
    max-height: 70vh;
    overflow: auto;
  }
  .btn-show-overlay {
    bottom: 14px;
  }
  #hud {
    display: none;
  }
}
