:root {
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  height: 100%;
  background: #000;
  color: #eee;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  gap: 0.75rem;
}

/* `display: flex` ci-dessus annule sinon l'attribut hidden par défaut du navigateur. */
.screen[hidden] {
  display: none;
}

#start-screen h1 {
  font-size: 1.6rem;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.hint {
  opacity: 0.6;
  font-size: 0.9rem;
}

#start-button {
  margin-top: 1.5rem;
  padding: 0.9rem 2rem;
  font-size: 1rem;
  border-radius: 999px;
  border: 1px solid #666;
  background: #111;
  color: #eee;
  cursor: pointer;
}

#start-button:active {
  background: #222;
}

.error {
  color: #ff6b6b;
  font-size: 0.85rem;
  max-width: 28rem;
}

#story-screen .pulse {
  font-size: 2rem;
  opacity: 0.5;
  animation: pulse 3s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 0.6; }
}

.story-text {
  letter-spacing: 0.15em;
  font-size: 0.9rem;
  opacity: 0.7;
}

.story-subtext {
  font-size: 0.75rem;
  opacity: 0.4;
}

.restart-button {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  padding: 0.6rem 1.2rem;
  font-size: 0.75rem;
  border-radius: 999px;
  border: 1px solid #666;
  background: #111;
  color: #ccc;
  cursor: pointer;
  z-index: 5;
}

.restart-button:active {
  background: #222;
}

/* Panneau debug : tiroir en bas d'écran, replié par défaut pour laisser voir l'interface réelle */
.debug-panel {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 60vh;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.95);
  padding: 0.75rem 1rem 2rem;
  font-size: 0.75rem;
  z-index: 10;
  border-top: 1px solid #333;
  border-radius: 12px 12px 0 0;
  transition: transform 0.2s ease;
}

.debug-panel.collapsed {
  transform: translateY(calc(100% - 3rem));
}

.debug-toggle {
  position: sticky;
  top: 0;
  width: 100%;
  background: #161616;
  border: 1px solid #444;
  color: #ccc;
  padding: 0.5rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.8rem;
}

.debug-panel h2 {
  font-size: 0.9rem;
  margin: 0 0 0.75rem;
}

.debug-block {
  border-top: 1px solid #333;
  padding: 0.75rem 0;
}

.debug-block pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #111;
  padding: 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
}

.zone-row {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed #333;
}

.zone-row .state-ok { color: #6bff8f; }
.zone-row .state-pending { color: #f5c66b; }

.sim-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.4rem 0;
}

.sim-row input {
  flex: 1;
  min-width: 5rem;
  background: #111;
  border: 1px solid #444;
  color: #eee;
  padding: 0.4rem;
  border-radius: 4px;
}

.sim-row button {
  background: #222;
  border: 1px solid #555;
  color: #eee;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}

.debug-log {
  max-height: 12rem;
  overflow-y: auto;
  background: #111;
  padding: 0.5rem;
  border-radius: 4px;
  font-family: ui-monospace, monospace;
  font-size: 0.68rem;
  line-height: 1.4;
}
