/* Porte d'Essence : même tableau et même verre ; l'invitation ouvre les
   gestes Jouer / Installer. La connexion précède l'ajout à l'écran d'accueil. */

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

:root {
  --gold: 226, 183, 106;
}

html, body { min-height: 100%; }

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: #05080a;
  color: #fff;
  font-family: system-ui, -apple-system, sans-serif;
}

.gate-art {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: url("./assets/brand/hot-warrior-three-times.png") 50% 30% / cover no-repeat;
}

.gate {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 20px;
}

.login-box {
  position: relative;
  width: min(100%, 400px);
  padding: 32px 28px;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

h1 {
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  margin-bottom: 24px;
  letter-spacing: 3px;
  font-weight: 500;
  text-transform: uppercase;
}

.access-progress { color: #ddd4c1; font-size: 14px; line-height: 1.5; }
#welcome { display: grid; gap: 12px; }
.welcome-mark {
  width: 88px;
  height: 88px;
  object-fit: contain;
  justify-self: center;
  margin: 0 0 12px;
  filter: drop-shadow(0 0 16px rgba(var(--gold), .35));
}
.play-now {
  display: grid;
  place-items: center;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid rgba(var(--gold), .8);
  border-radius: 8px;
  background: rgb(var(--gold));
  color: #18120a;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}
.play-now:hover { background: #f0d9a3; }
.play-now:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.input-group {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  overflow: hidden;
  transition: border-color 0.2s;
}

.input-group:focus-within,
.input-group.open {
  border-color: rgba(var(--gold), 0.6);
}

.input-group.error {
  border-color: rgba(239, 68, 68, 0.7);
  animation: shake 0.4s ease;
}

input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 15px;
  text-align: center;
  letter-spacing: 1px;
}

input::placeholder {
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 2px;
}

input:focus { outline: none; }

.eye-btn {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, opacity 0.2s;
  padding: 8px;
}

.eye-btn:hover { transform: scale(1.08); }
.eye-btn:active { transform: scale(0.95); }
.eye-btn:focus-visible { outline: none; }

.eye-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.eye-btn img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 8px rgba(var(--gold), 0.4));
  transition: filter 0.2s;
}

.eye-btn:hover img,
.eye-btn:focus-visible img {
  filter: drop-shadow(0 0 12px rgba(var(--gold), 0.7));
}

.eye-btn.loading img { animation: pulse 1s ease-in-out infinite; }

/* Clé acceptée : l'icône devient la frappe dorée et brille. */
.eye-btn.open {
  opacity: 1;
  cursor: wait;
}

.eye-btn.open img {
  animation: ignite 0.9s ease-out forwards;
}

.hint {
  color: rgba(255, 255, 255, 0.3);
  font-size: 11px;
  margin-top: 16px;
  letter-spacing: 1px;
}

.error-msg {
  color: #ef4444;
  margin-top: 12px;
  font-size: 13px;
  min-height: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}

.error-msg.visible { opacity: 1; }
.error-msg:not(.visible) { display: none; }

.language {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 4px;
}

.language button {
  padding: 5px 7px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 5px;
  background: transparent;
  color: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  font: 700 9px/1 system-ui, -apple-system, sans-serif;
  letter-spacing: 0.14em;
  transition: color 0.2s, border-color 0.2s;
}

.language button:hover,
.language button:focus-visible {
  color: rgba(255, 255, 255, 0.9);
  outline: none;
}

.language button[aria-pressed="true"] {
  border-color: rgba(var(--gold), 0.6);
  color: rgb(var(--gold));
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; filter: drop-shadow(0 0 8px rgba(var(--gold), 0.4)); }
  50% { opacity: 0.6; filter: drop-shadow(0 0 15px rgba(var(--gold), 0.8)); }
}

@keyframes ignite {
  0% {
    transform: scale(1);
    filter: drop-shadow(0 0 8px rgba(var(--gold), 0.4));
  }
  45% {
    transform: scale(1.35);
    filter: drop-shadow(0 0 16px rgba(255, 224, 160, 1)) drop-shadow(0 0 36px rgba(var(--gold), 0.9));
  }
  100% {
    transform: scale(1.2);
    filter: drop-shadow(0 0 12px rgba(255, 224, 160, 0.9)) drop-shadow(0 0 26px rgba(var(--gold), 0.7));
  }
}

@media (max-width: 560px) {
  .gate-art { background-position: 47% 50%; }
  .login-box { padding: 28px 20px; }
  input::placeholder { letter-spacing: 1px; }
}

@media (prefers-reduced-motion: reduce) {
  .input-group.error,
  .eye-btn.loading img,
  .eye-btn.open img { animation: none; }
}
