* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  background: #0f1220;
  color: #e8eaf6;
  font-family: 'Segoe UI', system-ui, sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  user-select: none;
  position: relative;
}

#menuBg {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(74,74,255,.15), transparent 40%),
    radial-gradient(circle at 80% 70%, rgba(168,136,255,.15), transparent 40%),
    radial-gradient(circle at 50% 100%, rgba(255,217,59,.08), transparent 50%),
    #0f1220;
  z-index: 0;
  animation: bgShift 20s ease-in-out infinite;
}
@keyframes bgShift {
  0%, 100% { filter: hue-rotate(0deg); }
  50% { filter: hue-rotate(30deg); }
}

#menuMain {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 420px;
  width: 100%;
  padding: 40px 30px;
  background: rgba(20, 24, 41, .75);
  backdrop-filter: blur(10px);
  border: 1px solid #2a3355;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .5), 0 0 40px rgba(108, 204, 255, .15);
  animation: menuIn .6s ease;
}
@keyframes menuIn {
  from { opacity: 0; transform: translateY(20px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.logo {
  font-size: 3.5rem;
  margin-bottom: 4px;
  animation: floatLogo 4s ease-in-out infinite;
}
@keyframes floatLogo {
  0%, 100% { transform: translateY(0) rotate(-5deg); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

h1 {
  font-size: 2.4rem;
  letter-spacing: 6px;
  font-weight: 900;
  background: linear-gradient(90deg, #6cf, #a8f, #ffd93b, #a8f, #6cf);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  background-size: 200% auto;
  animation: shine 4s linear infinite;
  margin-bottom: 4px;
}
@keyframes shine {
  to { background-position: 200% center; }
}

.subtitle {
  font-size: .85rem;
  opacity: .6;
  letter-spacing: 2px;
  text-transform: lowercase;
  margin-bottom: 24px;
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}

.menu-btn {
  padding: 14px 22px;
  border: none;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
  background: transparent;
  color: #9ab;
  border: 1px solid #3a4466;
  font-family: inherit;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.menu-btn:hover:not(:disabled) {
  border-color: #6cf;
  color: #6cf;
  transform: translateY(-2px);
}
.menu-btn.primary {
  background: #4a4aff;
  color: #fff;
  border: none;
  font-size: 1.05rem;
  padding: 16px 22px;
}
.menu-btn.primary:hover {
  background: #6a6aff;
  box-shadow: 0 0 24px rgba(74, 74, 255, .5);
}
.menu-btn small {
  font-size: .7rem;
  opacity: .75;
  font-weight: 400;
  letter-spacing: .3px;
}
.menu-btn.small {
  padding: 8px 14px;
  font-size: .85rem;
  flex: 1;
  border: 1px solid #3a4466;
  color: #9ab;
}
.menu-btn.hidden { display: none; }

.version {
  margin-top: 24px;
  font-size: .7rem;
  opacity: .35;
  letter-spacing: 1px;
}

/* Модалки */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 20, .85);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn .25s;
}
.overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #141829;
  border: 1px solid #3a4a6a;
  border-radius: 18px;
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .7);
  animation: popIn .3s ease;
  text-align: left;
}
@keyframes popIn {
  from { transform: scale(.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal h2 {
  color: #6cf;
  margin-bottom: 16px;
  font-size: 1.3rem;
  text-align: center;
}

.modal-btn {
  padding: 10px 20px;
  border-radius: 10px;
  border: 1px solid #3a4466;
  background: transparent;
  color: #9ab;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
  font-family: inherit;
  margin-top: 16px;
  width: 100%;
}
.modal-btn:hover { border-color: #6cf; color: #6cf; }
.modal-btn.primary {
  background: #4a4aff;
  color: #fff;
  border: none;
}
.modal-btn.primary:hover { background: #6a6aff; }

/* Как играть */
.howto-content {
  line-height: 1.6;
  font-size: .9rem;
  color: #c8d0e0;
}
.howto-content p {
  margin-bottom: 12px;
}
.howto-content p b { color: #6cf; }
.howto-content ul {
  margin: 0 0 14px 20px;
  padding: 0;
}
.howto-content li {
  margin-bottom: 6px;
}
.howto-content li b { color: #ffd93b; }

/* Профиль */
.profile-uid-label {
  font-size: .9rem;
  text-align: center;
  margin-bottom: 6px;
}
.profile-uid-label b {
  color: #6cf;
  font-family: monospace;
  word-break: break-all;
  font-size: .85rem;
}
.profile-hint {
  font-size: .75rem;
  opacity: .55;
  text-align: center;
  margin-bottom: 18px;
  line-height: 1.4;
}
.profile-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}
.profile-login {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.profile-login input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #3a4466;
  background: #0f1322;
  color: #e8f0ff;
  font-size: .85rem;
  outline: none;
  font-family: inherit;
}
.profile-login input:focus {
  border-color: #6cf;
  box-shadow: 0 0 12px rgba(108, 204, 255, .3);
}
.profile-login .modal-btn {
  margin-top: 0;
  width: auto;
  padding: 10px 18px;
}