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

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #000;
  color: #fff;
}

#app {
  width: 100%;
  height: 100%;
  position: relative;
}

.screen {
  display: none;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.screen.active {
  display: flex;
}

.fullscreen-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  text-align: center;
}

/* Typography */
h1 {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  margin: 20px 0;
  text-transform: uppercase;
}

.subtitle {
  font-size: 1.5rem;
  font-weight: 300;
  opacity: 0.7;
  margin-top: 10px;
}

/* Connecting Screen */
#connecting {
  background: #000;
}

.loader {
  border: 6px solid rgba(255, 255, 255, 0.1);
  border-top: 6px solid #fff;
  border-radius: 50%;
  width: 80px;
  height: 80px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Idle Screen */
#idle {
  background: #1a1a1a;
}

.status-pulse {
  width: 120px;
  height: 120px;
  background: #10b981;
  border-radius: 50%;
  margin-bottom: 40px;
  animation: pulse 2s infinite;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.5);
}

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

/* Instruction Screen */
#instruction {
  background: #0a0a0a;
}

.instruction-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-bottom: 40px;
}

.instruction-display p {
  font-size: 5rem;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  word-wrap: break-word;
  max-width: 100%;
}

/* DONE Button */
.done-button {
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #333;
  border-radius: 20px;
  padding: 40px 80px;
  font-size: 3rem;
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.done-button:active {
  transform: scale(0.95);
  background: #222;
  border-color: #555;
}

/* Error Screen */
#error {
  background: #1a0000;
  color: #ff6b6b;
}

#error h1 {
  color: #ff6b6b;
}

#errorMessage {
  font-size: 1.5rem;
  margin: 20px 0 40px 0;
  opacity: 0.8;
}

.retry-button {
  background: #ff6b6b;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 20px 60px;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

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

/* Mobile Optimizations */
@media (max-width: 768px) {
  h1 {
    font-size: 3rem;
  }

  .instruction-display p {
    font-size: 3.5rem;
  }

  .done-button {
    padding: 35px 70px;
    font-size: 2.5rem;
  }

  .subtitle {
    font-size: 1.2rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2.5rem;
  }

  .instruction-display p {
    font-size: 2.8rem;
  }

  .done-button {
    padding: 30px 60px;
    font-size: 2rem;
  }

  .subtitle {
    font-size: 1rem;
  }
}

/* Landscape optimizations */
@media (max-height: 500px) and (orientation: landscape) {
  .fullscreen-content {
    padding: 20px;
  }

  h1 {
    font-size: 2rem;
    margin: 10px 0;
  }

  .instruction-display {
    margin-bottom: 20px;
  }

  .instruction-display p {
    font-size: 2.5rem;
  }

  .done-button {
    padding: 20px 50px;
    font-size: 1.8rem;
  }

  .status-pulse {
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
  }
}

/* Prevent selection and unwanted interactions */
body {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Screen transitions */
.screen {
  transition: opacity 0.3s ease-in-out;
}
