* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'VT323', monospace;
  background: #000;
  color: #00ff00;
  overflow: hidden;
  line-height: 1.6;
  height: 100vh;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

#main-page {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #0a0a0a 0%, #000 100%);
}

/* Glitch background effect */
.glitch-background {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 80%, rgba(0, 255, 0, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 0, 0, 0.05) 0%, transparent 50%),
    radial-gradient(circle at 50% 50%, rgba(0, 0, 255, 0.03) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
  animation: background-pulse 8s ease-in-out infinite;
}

@keyframes background-pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

/* Main container */
.cryptic-container {
  position: relative;
  z-index: 2;
  text-align: center;
  max-width: 800px;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.8);
  border: 2px solid #00ff00;
  border-radius: 10px;
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.3);
  animation: container-glow 4s ease-in-out infinite;
}

@keyframes container-glow {
  0%, 100% { box-shadow: 0 0 30px rgba(0, 255, 0, 0.3); }
  50% { box-shadow: 0 0 50px rgba(0, 255, 0, 0.6); }
}

/* Title section */
.title-section {
  margin-bottom: 3rem;
}

.main-title {
  font-family: 'Orbitron', monospace;
  font-size: 3rem;
  font-weight: 900;
  color: #00ff00;
  text-shadow: 0 0 20px #00ff00;
  margin-bottom: 1rem;
  letter-spacing: 0.2em;
  animation: title-flicker 3s infinite;
}

@keyframes title-flicker {
  0%, 100% { opacity: 1; }
  95% { opacity: 1; }
  96% { opacity: 0.8; }
  97% { opacity: 1; }
  98% { opacity: 0.9; }
  99% { opacity: 1; }
}

.subtitle {
  font-size: 1.2rem;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Warning section */
.warning-section {
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: rgba(255, 0, 0, 0.1);
  border: 1px solid #ff0000;
  border-radius: 5px;
}

.warning-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: warning-pulse 2s infinite;
}

@keyframes warning-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.warning-text {
  color: #ff0000;
  font-size: 1.1rem;
  text-shadow: 0 0 5px #ff0000;
}

/* Button section */
.button-section {
  margin-bottom: 3rem;
}

.enter-button {
  position: relative;
  background: #000;
  border: 3px solid #00ff00;
  color: #00ff00;
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  font-weight: 700;
  padding: 1.5rem 3rem;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  min-width: 300px;
}

.enter-button:hover {
  background: #00ff00;
  color: #000;
  transform: scale(1.05);
  box-shadow: 0 0 30px rgba(0, 255, 0, 0.8);
}

.enter-button:active {
  transform: scale(0.95);
}

.button-glow {
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 255, 0, 0.3), transparent);
  transition: left 0.5s ease;
}

.enter-button:hover .button-glow {
  left: 100%;
}

/* Status section */
.status-section {
  border-top: 1px solid #333;
  padding-top: 1.5rem;
}

.status-line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #00ff00;
  border-radius: 50%;
  animation: status-pulse 2s infinite;
}

@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.status-text {
  color: #00ff00;
  font-size: 1rem;
  text-shadow: 0 0 5px #00ff00;
}

/* Warning Modal */
.warning-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 1000;
  backdrop-filter: blur(5px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.warning-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modal-fade-in 0.3s ease-out;
}

@keyframes modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background: #000;
  border: 3px solid #ff0000;
  border-radius: 15px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  text-align: center;
  box-shadow: 0 0 50px rgba(255, 0, 0, 0.5);
  animation: modal-shake 0.5s ease-out;
  margin: 2rem auto;
  min-height: fit-content;
}

@keyframes modal-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.modal-header h2 {
  color: #ff0000;
  font-family: 'Orbitron', monospace;
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  text-shadow: 0 0 10px #ff0000;
}

.modal-body {
  margin-bottom: 2rem;
}

.warning-message p {
  color: #ccc;
  margin-bottom: 1rem;
  font-size: 1.1rem;
  line-height: 1.6;
}

.warning-message .highlight {
  color: #00ff00;
  font-weight: bold;
  text-shadow: 0 0 5px #00ff00;
}

.warning-message strong {
  color: #ff0000;
  font-size: 1.2rem;
}

.warning-note {
  color: #ffff00 !important;
  font-style: italic;
  font-size: 1rem;
  text-shadow: 0 0 5px #ffff00;
}

/* Passkey Section */
.passkey-section {
  margin-top: 2rem;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid #333;
  border-radius: 8px;
  text-align: center;
}

.passkey-icon {
  font-size: 2rem;
  margin-bottom: 1rem;
  animation: key-bounce 2s ease-in-out infinite;
}

@keyframes key-bounce {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5px) rotate(5deg); }
}

.passkey-section h3 {
  color: #00ffff;
  font-family: 'Orbitron', monospace;
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-shadow: 0 0 10px #00ffff;
}

.passkey-instruction {
  color: #ccc;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.passkey-input {
  width: 100%;
  max-width: 300px;
  padding: 0.8rem 1rem;
  background: #000;
  border: 2px solid #333;
  border-radius: 5px;
  color: #00ff00;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  text-align: center;
  outline: none;
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.passkey-input:focus {
  border-color: #00ff00;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.3);
}

.passkey-input.valid {
  border-color: #00ff00;
  box-shadow: 0 0 15px rgba(0, 255, 0, 0.5);
}

.passkey-input.invalid {
  border-color: #ff0000;
  box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
}

.passkey-input.typing {
  border-color: #ffff00;
  box-shadow: 0 0 15px rgba(255, 255, 0, 0.5);
  animation: typing-pulse 1s ease-in-out infinite;
}

@keyframes typing-pulse {
  0%, 100% { box-shadow: 0 0 15px rgba(255, 255, 0, 0.5); }
  50% { box-shadow: 0 0 25px rgba(255, 255, 0, 0.8); }
}

.passkey-status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.passkey-status.locked {
  color: #ff0000;
}

.passkey-status.unlocked {
  color: #00ff00;
}

.passkey-status.typing {
  color: #ffff00;
  animation: typing-status-pulse 1s ease-in-out infinite;
}

@keyframes typing-status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.status-icon {
  font-size: 1.2rem;
}

.status-text {
  font-weight: bold;
  text-shadow: 0 0 5px currentColor;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cancel-button, .accept-button {
  padding: 1rem 2rem;
  border: 2px solid;
  border-radius: 8px;
  font-family: 'VT323', monospace;
  font-size: 1.1rem;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  min-width: 150px;
}

.cancel-button {
  background: #000;
  border-color: #666;
  color: #666;
}

.cancel-button:hover {
  background: #333;
  border-color: #999;
  color: #fff;
  transform: scale(1.05);
}

.accept-button {
  background: #000;
  border-color: #00ff00;
  color: #00ff00;
}

.accept-button:hover:not(:disabled) {
  background: #00ff00;
  color: #000;
  transform: scale(1.05);
  box-shadow: 0 0 20px rgba(0, 255, 0, 0.5);
}

.accept-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.accept-button:disabled:hover {
  background: #000;
  color: #00ff00;
  transform: none;
  box-shadow: none;
}

/* Responsive design */
@media (max-width: 768px) {
  .cryptic-container {
    padding: 1.5rem;
    margin: 1rem;
  }
  
  .main-title {
    font-size: 2rem;
  }
  
  .enter-button {
    min-width: 250px;
    padding: 1.2rem 2rem;
    font-size: 1rem;
  }
  
  .modal-content {
    padding: 1.5rem;
    margin: 1rem;
    max-height: 90vh;
    overflow-y: auto;
  }
  
  .modal-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .cancel-button, .accept-button {
    width: 100%;
    max-width: 200px;
  }
  
  /* Mobile keyboard handling */
  .warning-modal {
    align-items: flex-start;
    padding-top: 2rem;
  }
  
  .passkey-input {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

@media (max-width: 480px) {
  .main-title {
    font-size: 1.5rem;
  }
  
  .enter-button {
    min-width: 200px;
    padding: 1rem 1.5rem;
    font-size: 0.9rem;
  }
  
  /* Mobile passkey modal improvements */
  .modal-content {
    padding: 1rem;
    margin: 1rem;
    width: 95%;
  }
  
  /* Hide warning message on mobile - show only passkey section */
  .modal-header {
    display: none;
  }
  
  .warning-message {
    display: none;
  }
  
  .passkey-input {
    font-size: 1rem;
    padding: 1rem;
    max-width: 100%;
  }
  
  .passkey-section {
    padding: 2rem 1rem;
    margin-top: 0; /* Remove top margin since warning is hidden */
    background: rgba(0, 0, 0, 0.9);
    border: 2px solid #00ff00;
    border-radius: 10px;
    text-align: center;
  }
  
  .passkey-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .passkey-instruction {
    font-size: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .modal-actions {
    flex-direction: column;
    gap: 0.8rem;
  }
  
  .cancel-button, .accept-button {
    width: 100%;
    max-width: none;
    padding: 1.2rem 1rem;
  }
}

/* Extra small mobile devices - further optimize passkey modal */
@media (max-width: 360px) {
  .modal-content {
    padding: 0.5rem;
    margin: 0.5rem;
    width: 98%;
  }
  
  .passkey-section {
    padding: 1.5rem 0.5rem;
  }
  
  .passkey-section h3 {
    font-size: 1.2rem;
  }
  
  .passkey-instruction {
    font-size: 0.9rem;
  }
  
  .passkey-input {
    font-size: 16px; /* Prevent zoom on iOS */
    padding: 0.8rem;
  }
}
