:root {
  --neon-blue: #00f2ff;
  --dark-bg: #0d1117;
  --panel-bg: #161b22;
  --border-color: #30363d;
  --error-red: #ff4d4f;
  --success-green: #00ff9d;
  --text-secondary: #8b949e;
  --text-primary: #ffffff;
}

body {
  background-color: var(--dark-bg);
  font-family: "Segoe UI", system-ui, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  margin: 0;
  padding: 20px;
  color: var(--text-primary);
  background-image:
    radial-gradient(
      circle at 20% 30%,
      rgba(0, 242, 255, 0.05) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(0, 242, 255, 0.03) 0%,
      transparent 50%
    );
}

.signup-card {
  background: var(--panel-bg);
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--border-color);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.4),
    0 0 0 1px rgba(0, 242, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
  width: 100%;
  max-width: 450px;
  position: relative;
  overflow: hidden;
}

.signup-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--neon-blue),
    transparent
  );
}

h2 {
  margin: 0 0 1.5rem 0;
  font-size: 1.75rem;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--neon-blue);
  text-transform: uppercase;
  text-align: center;
  position: relative;
  padding-bottom: 0.5rem;
}

h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--neon-blue),
    transparent
  );
}

.input-group {
  margin-bottom: 1.5rem;
  position: relative;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  transition: color 0.2s;
}

.input-row {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

input {
  width: 100%;
  padding: 0.875rem 1rem;
  background: rgba(13, 17, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  box-sizing: border-box;
}

input::placeholder {
  color: var(--text-secondary);
  opacity: 0.7;
}

input:focus {
  outline: none;
  border-color: var(--neon-blue);
  box-shadow:
    0 0 0 3px rgba(0, 242, 255, 0.1),
    0 0 20px rgba(0, 242, 255, 0.2);
  background: rgba(13, 17, 23, 0.8);
}

/* Game ID input with paste button */
.game-id-group {
  position: relative;
  flex: 2;
}

.game-id-group .action-btn {
  position: absolute;
  right: 0.75rem;
  top: 2.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neon-blue);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.game-id-group .action-btn:hover {
  background: rgba(0, 242, 255, 0.1);
  border-color: var(--neon-blue);
  transform: translateY(-1px);
}

/* Age input */
.age-group {
  flex: 1;
}

.age-group input[type="number"] {
  text-align: center;
}

/* Preview Display */
.name-preview {
  background: rgba(0, 242, 255, 0.05);
  border: 1px dashed var(--neon-blue);
  padding: 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  text-align: center;
  transition: all 0.3s ease;
}

.name-preview.loading {
  border-color: var(--text-secondary);
  background: rgba(13, 17, 23, 0.3);
}

.name-preview.error {
  border-color: var(--error-red);
  background: rgba(255, 77, 79, 0.05);
}

.preview-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  display: block;
}

.display-text {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--neon-blue);
  letter-spacing: 0.5px;
}

.loading-text {
  color: var(--text-secondary);
  font-style: italic;
}

.error-text {
  color: var(--error-red);
  font-weight: 500;
}

/* Password inputs with toggle buttons */
.password-group {
  position: relative;
}

.password-group .action-btn {
  position: absolute;
  right: 0.75rem;
  top: 2.5rem;
  background: transparent;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 0.25rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--neon-blue);
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.password-group .action-btn:hover {
  background: rgba(0, 242, 255, 0.1);
  border-color: var(--neon-blue);
  transform: translateY(-1px);
}

/* Custom Gender Select */
.custom-select {
  position: relative;
  width: 100%;
  background: rgba(13, 17, 23, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.custom-select.active {
  border-color: var(--neon-blue);
  box-shadow: 0 0 0 3px rgba(0, 242, 255, 0.1);
}

.select-trigger {
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.select-trigger i {
  color: var(--neon-blue);
  font-size: 1.1rem;
}

.select-trigger span {
  flex: 1;
  color: var(--text-primary);
  font-size: 0.95rem;
}

.select-trigger .bx-chevron-down {
  color: var(--text-secondary);
  transition: transform 0.3s ease;
}

.custom-select.active .bx-chevron-down {
  transform: rotate(180deg);
}

.options-list {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--panel-bg);
  border: 1px solid var(--neon-blue);
  border-radius: 8px;
  margin-top: 0.5rem;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.custom-select.active .options-list {
  display: block;
}

.option {
  padding: 0.875rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(48, 54, 61, 0.3);
}

.option:last-child {
  border-bottom: none;
}

.option:hover {
  background: rgba(0, 242, 255, 0.1);
  color: var(--neon-blue);
}

.option i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* Register Button */
.btn-signup {
  width: 100%;
  padding: 1rem;
  background: linear-gradient(135deg, var(--neon-blue) 0%, #00c6ff 100%);
  border: none;
  border-radius: 8px;
  color: var(--dark-bg);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 1rem;
  position: relative;
  overflow: hidden;
}

.btn-signup::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: 0.5s;
}

.btn-signup:hover {
  box-shadow:
    0 10px 25px rgba(0, 242, 255, 0.4),
    0 0 0 1px rgba(0, 242, 255, 0.2);
  transform: translateY(-2px);
}

.btn-signup:hover::before {
  left: 100%;
}

.btn-signup:active {
  transform: translateY(0);
}

.login-link {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.login-link a {
  color: var(--neon-blue);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  position: relative;
}

.login-link a::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--neon-blue);
  transition: width 0.3s ease;
}

.login-link a:hover::after {
  width: 100%;
}

.login-link a:hover {
  color: #00e5ff;
}

/* BYN Logo at bottom-left */
.byn-logo {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.byn-logo:hover {
  opacity: 1;
}

.byn-logo img {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 2px rgba(0, 242, 255, 0.5));
}

.byn-text {
  font-size: 0.75rem;
  color: var(--neon-blue);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.byn-subtitle {
  font-size: 0.65rem;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

/* Developer credit */
.developer-credit {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  font-size: 0.65rem;
  color: var(--text-secondary);
  text-align: right;
  opacity: 0.7;
  transition: opacity 0.3s ease;
}

.developer-credit:hover {
  opacity: 1;
}

.developer-credit .title {
  color: var(--neon-blue);
  font-weight: 600;
  display: block;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: rgba(26, 26, 26, 0.95);
  backdrop-filter: blur(10px);
  padding: 1rem 1.5rem;
  display: none;
  align-items: center;
  gap: 0.75rem;
  border-radius: 8px;
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(0, 242, 255, 0.1);
  z-index: 1001;
  animation: slideIn 0.3s ease-out;
  max-width: 350px;
}

.error-toast {
  border-left: 4px solid var(--error-red);
}

.success-toast {
  border-left: 4px solid var(--success-green);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast i {
  font-size: 1.25rem;
  flex-shrink: 0;
}

.error-toast i {
  color: var(--error-red);
}

.success-toast i {
  color: var(--success-green);
}

.toast span {
  color: #ffffff;
  font-size: 0.9rem;
  line-height: 1.4;
}

/* Loading Overlay */
.loader-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(13, 17, 23, 0.95);
  backdrop-filter: blur(4px);
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.neon-spinner {
  width: 60px;
  height: 60px;
  border: 3px solid transparent;
  border-top-color: var(--neon-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  box-shadow:
    0 0 20px var(--neon-blue),
    inset 0 0 20px rgba(0, 242, 255, 0.2);
  position: relative;
}

.neon-spinner::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -3px;
  right: -3px;
  bottom: -3px;
  border: 3px solid transparent;
  border-radius: 50%;
  border-top-color: rgba(0, 242, 255, 0.3);
  animation: spin 2s linear infinite reverse;
}

.loader-overlay p {
  margin-top: 1.5rem;
  color: var(--neon-blue);
  font-size: 1rem;
  letter-spacing: 1px;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@media (max-width: 480px) {
  .signup-card {
    padding: 1.2rem;
  }
  .login-link {
    margin-bottom: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-secondary);
  }
}

/* ===== Confirm Modal Responsive Fix (390px) ===== */
.confirm-card {
  padding: 1.2rem;
}

.confirm-card h2 {
  font-size: 1.05rem;
}

.confirm-card p {
  font-size: 0.75rem;
  margin-bottom: 1rem;
}

.confirm-card .input-group label {
  font-size: 0.75rem;
}

.confirm-card .display-text,
#modalUsername,
#modalPassword {
  font-size: 0.9rem;
  word-break: break-all;
}

/* Button layout */
.confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.confirm-actions button {
  width: 100%;
  padding: 0.85rem;
  font-size: 0.85rem;
}

@media (max-width: 480px) {
  .confirm-card {
    padding: 1rem;
    max-width: 350px;
  }
}

@media (max-width: 390px) {
  .confirm-card {
    padding: 1rem;
    max-width: 300px;
  }
  .confirm-actions {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
  }
}
