/* SYKO — Connexion (thème cartoon) */
:root {
  --ink: #3b2a20;
  --ink-soft: #6b5344;
  --ink-mute: #9a8677;
  --cream: #fff4e3;
  --paper: #fffdf8;
  --paper-2: #fff1dc;
  --peach: #f8d9b4;
  --sky: #cdeff6;
  --teal: #3fb8c8;
  --coral: #ff6b6b;
  --coral-deep: #e0484f;
  --sun: #ffcf4a;
  --lilac: #d9cdf5;
  --leaf: #8ed36a;
  --line: 3px;
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', 'Fredoka', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background:
    radial-gradient(ellipse 45% 38% at 8% 12%, rgba(217, 205, 245, 0.75) 0%, transparent 70%),
    radial-gradient(ellipse 40% 32% at 92% 18%, rgba(205, 239, 246, 0.9) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(248, 217, 180, 0.8) 0%, transparent 70%),
    var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
.bg-particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(59, 42, 32, 0.07) 1.5px, transparent 1.6px);
  background-size: 26px 26px;
}
/* Décos flottantes (formes dessinées) */
.deco-line,
.corner-ornament {
  position: fixed;
  pointer-events: none;
  border: var(--line) solid var(--ink);
  background: var(--sun);
  border-radius: 50%;
  opacity: 0.9;
  animation: floaty 6s ease-in-out infinite;
}
.deco-line-top { width: 90px; height: 90px; top: 8%; left: 10%; background: var(--lilac); border-radius: 30%; transform: rotate(12deg); }
.deco-line-bottom { width: 120px; height: 120px; bottom: 6%; right: 8%; background: var(--sky); border-radius: 30%; animation-delay: -2s; }
.corner-tl { width: 34px; height: 34px; top: 30%; left: 4%; background: var(--coral); animation-delay: -1s; }
.corner-tr { width: 26px; height: 26px; top: 14%; right: 18%; background: var(--leaf); animation-delay: -3s; }
.corner-bl { width: 48px; height: 48px; bottom: 18%; left: 16%; background: var(--sun); border-radius: 30%; animation-delay: -4s; }
.corner-br { width: 22px; height: 22px; bottom: 32%; right: 24%; background: var(--teal); animation-delay: -5s; }
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(8deg); }
}
@media (max-width: 600px) {
  .deco-line, .corner-ornament { transform: scale(0.6); }
  .corner-br, .corner-bl { display: none; }
}

.login-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
  animation: enter 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes enter {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: none; }
}

/* Logo */
.login-logo { text-align: center; }
.logo-glow { display: none; }
.logo-text {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3.6rem, 12vw, 5rem);
  line-height: 1;
  letter-spacing: 0.06em;
  color: var(--coral);
  text-shadow:
    5px 5px 0 var(--ink),
    -2px -2px 0 var(--ink), 2px -2px 0 var(--ink), -2px 2px 0 var(--ink), 2px 2px 0 var(--ink);
  transform: rotate(-3deg);
  display: inline-block;
}
.logo-text::first-letter { color: var(--sun); }
.logo-subtitle {
  margin-top: 12px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--paper);
  border: 2px solid var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.subtitle-line { display: none; }

/* Carte */
.login-card {
  position: relative;
  width: 100%;
  padding: 26px 24px;
  border-radius: 24px;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  box-shadow: 0 8px 0 var(--ink), 0 7px 0 var(--ink), 0 6px 0 var(--ink), 0 5px 0 var(--ink), 0 4px 0 var(--ink), 0 3px 0 var(--ink), 0 2px 0 var(--ink), 0 1px 0 var(--ink);
}
.card-shine { display: none; }
.login-card h2 {
  margin: 0 0 18px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
}

/* Boutons */
.oauth-buttons { display: flex; flex-direction: column; gap: 12px; }
.oauth-btn,
.guest-btn,
.pseudo-modal-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 14px 18px;
  border-radius: 16px;
  border: var(--line) solid var(--ink);
  box-shadow: 0 5px 0 var(--ink), 0 4px 0 var(--ink), 0 3px 0 var(--ink), 0 2px 0 var(--ink), 0 1px 0 var(--ink);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
/* Le survol n'existe qu'avec une vraie souris. Sur un téléphone, le navigateur le simule au premier
   appui et le garde ensuite : le bouton restait soulevé après le doigt. */
@media (hover: hover) and (pointer: fine) {
  .oauth-btn:hover, .guest-btn:hover, .pseudo-modal-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 7px 0 var(--ink), 0 6px 0 var(--ink), 0 5px 0 var(--ink), 0 4px 0 var(--ink), 0 3px 0 var(--ink), 0 2px 0 var(--ink), 0 1px 0 var(--ink);
    filter: brightness(1.04);
  }
}
.oauth-btn:active, .guest-btn:active, .pseudo-modal-btn:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--ink);
}
.btn-bg { display: none; }
.oauth-btn svg { width: 24px; height: 24px; flex-shrink: 0; }
.oauth-btn.google { background: #fff; }
.oauth-btn.discord { background: #5865f2; color: #fff; }
.guest-btn { background: var(--leaf); }

.oauth-btn .loader {
  width: 20px;
  height: 20px;
  border: 3px solid var(--ink);
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: none;
}
.oauth-btn.loading .loader { display: block; }
.oauth-btn.loading span { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Séparateur */
.login-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.login-divider::before, .login-divider::after {
  content: '';
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--ink);
  opacity: 0.18;
}
.divider-diamond { display: none; }

/* Message */
.login-message {
  margin-top: 16px;
  padding: 10px 14px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  font-weight: 700;
  font-size: 0.9rem;
  text-align: center;
  display: none;
  animation: enter 0.3s ease-out;
}
.login-message.error { display: block; background: var(--coral); color: #fff; }
.login-message.success { display: block; background: var(--leaf); }
.login-message.info { display: block; background: var(--sky); }

/* Footer */
.login-footer {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
}
.footer-diamond { display: none; }

/* Modal pseudo */
.pseudo-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(59, 42, 32, 0.55);
  backdrop-filter: blur(3px);
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.pseudo-modal {
  width: min(380px, 100%);
  padding: 26px 24px;
  border-radius: 24px;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  box-shadow: 0 8px 0 var(--ink), 0 7px 0 var(--ink), 0 6px 0 var(--ink), 0 5px 0 var(--ink), 0 4px 0 var(--ink), 0 3px 0 var(--ink), 0 2px 0 var(--ink), 0 1px 0 var(--ink);
  text-align: center;
  animation: enter 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.pseudo-modal-icon {
  width: 72px;
  height: 72px;
  margin: -62px auto 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--sun);
  border: var(--line) solid var(--ink);
  box-shadow: 0 4px 0 var(--ink), 0 3px 0 var(--ink), 0 2px 0 var(--ink), 0 1px 0 var(--ink);
  font-size: 0;
}
.pseudo-modal-icon::before {
  content: '';
  width: 30px;
  height: 30px;
  background: var(--ink);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>") center / contain no-repeat;
          mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2'/><circle cx='12' cy='7' r='4'/></svg>") center / contain no-repeat;
}
.pseudo-modal h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.5rem;
}
.pseudo-modal p { margin: 0 0 16px; font-weight: 600; color: var(--ink-soft); font-size: 0.92rem; }
.pseudo-modal input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: var(--line) solid var(--ink);
  background: var(--paper-2);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.1rem;
  text-align: center;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 3px 0 rgba(59, 42, 32, 0.12);
}
.pseudo-modal input:focus { background: #fff; box-shadow: inset 0 3px 0 rgba(59, 42, 32, 0.12), 0 0 0 4px var(--sky); }
.pseudo-modal input::placeholder { color: var(--ink-mute); }
.pseudo-modal-hint { margin: 8px 0 14px; font-size: 0.8rem; font-weight: 700; color: var(--ink-mute); }
.pseudo-modal-btn { background: var(--sun); }
.pseudo-modal-btn:disabled { opacity: 0.55; cursor: not-allowed; filter: saturate(0.5); }
.pseudo-modal-error { margin-top: 10px; min-height: 1.2em; font-weight: 700; font-size: 0.85rem; color: var(--coral-deep); }

/* Modale pseudo : nouvelle structure (en-tête icône + texte, champ avec compteur) */
.pseudo-modal { text-align: left; }
.pseudo-modal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.pseudo-modal-head .pseudo-modal-icon { width: 56px; height: 56px; margin: 0; flex-shrink: 0; }
.pseudo-modal-head .pseudo-modal-icon svg { width: 28px; height: 28px; }
.pseudo-modal-head .pseudo-modal-icon::before { display: none; }
.pseudo-modal-head h2 { margin: 0 0 4px; font-size: 1.35rem; }
.pseudo-modal-head p { margin: 0; font-size: 0.88rem; }
.pseudo-modal label { display: block; margin-bottom: 6px; font-family: var(--font-display); font-weight: 700; font-size: 0.8rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.pseudo-modal-field { position: relative; }
.pseudo-modal-field input { text-align: left; padding-right: 64px; }
.pseudo-modal-count { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 0.78rem; font-weight: 800; color: var(--ink-mute); pointer-events: none; }
.pseudo-modal-error { margin: 8px 0 0; min-height: 0; text-align: left; }
.pseudo-modal-hint { margin: 6px 0 14px; text-align: left; }

/* Barres de défilement masquées (le défilement reste actif) */
* { scrollbar-width: none; }
*::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* Thème sombre (même palette que le jeu) */
html[data-theme="dark"] { --ink: #120e1c; --ink-soft: #c7bddc; --ink-mute: #9c92b8; --cream: #1d1930; --paper: #2a2542; --paper-2: #35305a; --peach: #4a4270; --sky: #2b4a63; color-scheme: dark; }
html[data-theme="dark"] body { color: #f4eefc; }
html[data-theme="dark"] body {
  background:
    radial-gradient(ellipse 45% 38% at 8% 12%, rgba(120, 96, 200, 0.35) 0%, transparent 70%),
    radial-gradient(ellipse 40% 32% at 92% 18%, rgba(63, 184, 200, 0.22) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(255, 107, 107, 0.14) 0%, transparent 70%),
    var(--cream);
}

/* Choix de la langue : deux pastilles sous les mentions légales */
.choix-langue { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.choix-langue:empty { display: none; }
.choix-langue button {
  font: 700 0.8rem var(--font-display);
  color: var(--ink-soft);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
  box-shadow: 0 2px 0 var(--ink);
}
.choix-langue button.active { background: var(--sun); color: var(--ink); cursor: default; }
.choix-langue button:not(.active):active { transform: translateY(2px); box-shadow: none; }
