/* ─── Variables (thème sombre par défaut) ────────────────────── */
:root {
  --bg: #12121c;
  --surface: #1a1a28;
  --surface2: #222232;
  --red: #e31537;
  --yellow: #f5c842;
  --yellow-dim: rgba(245, 200, 66, 0.13);
  --yellow-glow: rgba(245, 200, 66, 0.28);
  --green-glow: rgba(34, 197, 94, 0.35);
  --text: #dcdce8;
  --text-muted: #7a8299;
  --border: rgba(255, 255, 255, 0.07);
  --input-bg: rgba(255, 255, 255, 0.04);
  --input-border: rgba(255, 255, 255, 0.1);
}

html.light {
  --bg: #f2efe9;
  --surface: #faf8f4;
  --surface2: #e8e4dc;
  --text: #1e1c2c;
  --text-muted: #717080;
  --border: rgba(0, 0, 0, 0.08);
  --input-bg: rgba(0, 0, 0, 0.03);
  --input-border: rgba(0, 0, 0, 0.12);
}

/* ─── Base ───────────────────────────────────────────────────── */
html { font-size: 18px; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  transition: background 0.2s, color 0.2s;
}

/* ─── Header base ────────────────────────────────────────────── */
header {
  width: 100%;
  padding: 1.2rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(227,21,55,0.08) 0%, transparent 100%);
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

.header-title { text-align: left; }

.logo {
  font-size: 1.8rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--yellow) 0%, #ff8c42 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  padding-bottom: 0.12em;
}

.subtitle {
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

/* ─── Header auth zone ───────────────────────────────────────── */
.header-auth {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

/* ─── Burger button ──────────────────────────────────────────── */
.burger-btn {
  width: 40px; height: 40px;
  background: none;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s, border-color 0.15s;
}
html.light .burger-btn { border-color: rgba(0,0,0,0.12); }
.burger-btn:hover { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.25); }
html.light .burger-btn:hover { background: rgba(0,0,0,0.04); }

.burger-btn span {
  display: block; width: 16px; height: 1.5px;
  background: var(--text); border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.burger-btn.open span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.burger-btn.open span:nth-child(2) { opacity: 0; }
.burger-btn.open span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ─── Burger dropdown ────────────────────────────────────────── */
.burger-menu {
  position: absolute;
  top: calc(100% + 0.5rem); right: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
  min-width: 180px;
  padding: 0.5rem;
  display: none;
  flex-direction: column;
  z-index: 200;
  animation: dropIn 0.15s ease;
}
html.light .burger-menu { box-shadow: 0 8px 32px rgba(0,0,0,0.15); }
.burger-menu.open { display: flex; }

@keyframes dropIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.burger-avatar-row {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.5rem 0.6rem 0.65rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.25rem;
}
.burger-av {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface); border: 1.5px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 800; color: var(--yellow);
  overflow: hidden;
}
.burger-av img { width: 100%; height: 100%; object-fit: cover; }
.burger-av-name {
  font-size: 0.82rem; font-weight: 600; color: var(--text);
  max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.burger-item {
  display: flex; align-items: center; gap: 0.55rem;
  padding: 0.52rem 0.75rem;
  border-radius: 8px; border: none; background: none;
  color: var(--text); cursor: pointer;
  font-size: 0.85rem; font-weight: 500;
  text-decoration: none;
  transition: background 0.1s;
  width: 100%;
}
.burger-item:hover { background: rgba(255,255,255,0.06); }
html.light .burger-item:hover { background: rgba(0,0,0,0.04); }
.burger-item.primary { color: var(--yellow); font-weight: 700; }
.burger-item.danger  { color: #f87171; }

.burger-divider { height: 1px; background: var(--border); margin: 0.3rem 0; }

.burger-settings {
  display: flex; gap: 0.3rem; padding: 0.35rem 0.4rem 0.15rem;
  position: relative;
}
.burger-settings .setting-btn {
  flex: 1; padding: 0.38rem 0.3rem; border-radius: 6px;
  border: 1px solid var(--border); background: none;
  color: var(--text-muted); cursor: pointer; font-size: 0.73rem;
  font-weight: 500; transition: background 0.1s, color 0.1s;
  text-align: center; white-space: nowrap;
}
.burger-settings .setting-btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
html.light .burger-settings .setting-btn:hover { background: rgba(0,0,0,0.04); }

/* ─── Dropdown langue ────────────────────────────────────────── */
.lang-menu {
  position: absolute;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  z-index: 200;
  min-width: 130px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  margin-top: 0.25rem;
}
.lang-option {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 0.55rem 0.75rem;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 0.8rem; font-weight: 500;
  transition: background 0.1s, color 0.1s;
  text-align: left; gap: 0.5rem;
}
.lang-option:hover { background: rgba(255,255,255,0.07); color: var(--text); }
html.light .lang-option:hover { background: rgba(0,0,0,0.05); }
.lang-option.active { color: var(--text); font-weight: 700; }
.lang-check { color: var(--yellow); font-weight: 700; }

/* ─── Buttons ────────────────────────────────────────────────── */
.btn {
  padding: 0.4rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.12);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
  text-decoration: none;
  display: inline-block;
}
html.light .btn { border-color: rgba(0,0,0,0.12); }
.btn:hover { background: rgba(255,255,255,0.06); color: var(--text); }
html.light .btn:hover { background: rgba(0,0,0,0.04); }
.btn-primary {
  background: var(--yellow); color: #111;
  border-color: var(--yellow); font-weight: 700;
}
.btn-primary:hover { background: #e6be00; color: #111; }

/* ─── Modal base ─────────────────────────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.65); backdrop-filter: blur(4px);
}
.modal-box {
  position: relative; z-index: 1;
  background: var(--surface2); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 16px; padding: 2rem; width: min(420px, 92vw);
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
html.light .modal-box { border-color: rgba(0,0,0,0.08); box-shadow: 0 24px 80px rgba(0,0,0,0.2); }
.modal-box h2 { font-size: 1.25rem; font-weight: 800; margin-bottom: 1.2rem; color: var(--text); }
.modal-close {
  position: absolute; top: 1rem; right: 1rem;
  background: none; border: none; color: var(--text-muted); cursor: pointer;
  font-size: 1.2rem; line-height: 1; padding: 0.2rem 0.4rem; border-radius: 4px;
}
.modal-close:hover { color: var(--text); background: rgba(255,255,255,0.06); }
html.light .modal-close:hover { background: rgba(0,0,0,0.04); }

/* ─── Auth modal ─────────────────────────────────────────────── */
.auth-tabs {
  display: flex; margin-bottom: 1.4rem;
  border-radius: 8px; overflow: hidden; border: 1px solid var(--border);
}
.auth-tabs .tab-btn {
  flex: 1; padding: 0.5rem; background: transparent; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 0.85rem;
  font-weight: 600; transition: background 0.15s, color 0.15s;
}
.auth-tabs .tab-btn.active { background: var(--yellow); color: #111; }

.auth-field {
  width: 100%; padding: 0.65rem 0.9rem; margin-bottom: 0.75rem;
  background: var(--input-bg); border: 1px solid var(--input-border);
  border-radius: 8px; color: var(--text); font-size: 0.9rem; outline: none;
  transition: border-color 0.15s;
}
.auth-field:focus { border-color: var(--yellow); }
.auth-field::placeholder { color: var(--text-muted); }

.auth-error {
  background: rgba(227,21,55,0.12); border: 1px solid rgba(227,21,55,0.3);
  border-radius: 8px; padding: 0.6rem 0.9rem; margin-bottom: 0.75rem;
  font-size: 0.83rem; color: #f87171;
}
.auth-submit {
  width: 100%; padding: 0.7rem; border-radius: 8px; border: none;
  background: var(--yellow); color: #111; font-weight: 800; font-size: 0.95rem;
  cursor: pointer; transition: background 0.15s;
}
.auth-submit:hover { background: #e6be00; }
.auth-submit:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-divider {
  display: flex; align-items: center; gap: 0.75rem;
  margin: 1rem 0; color: var(--text-muted); font-size: 0.78rem;
}
.auth-divider::before, .auth-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.discord-btn {
  width: 100%; padding: 0.7rem; border-radius: 8px; border: none;
  background: #5865F2; color: #fff; font-weight: 700; font-size: 0.95rem;
  cursor: pointer; transition: background 0.15s;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  text-decoration: none;
}
.discord-btn:hover { background: #4752c4; }

/* ─── Legal modal ────────────────────────────────────────────── */
.legal-box { width: min(600px, 92vw); max-height: 80vh; overflow-y: auto; }
.legal-box h3 { font-size: 0.95rem; font-weight: 700; color: var(--yellow); margin: 1.2rem 0 0.4rem; }
.legal-box p  { font-size: 0.83rem; color: var(--text-muted); line-height: 1.6; }
.legal-box p + p { margin-top: 0.5rem; }

/* ─── Footer ─────────────────────────────────────────────────── */
.site-footer {
  width: 100%;
  padding: 0.55rem 2rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.site-footer a, .site-footer button {
  background: none; border: none; padding: 0;
  color: var(--text-muted); cursor: pointer; font-size: inherit;
  text-decoration: underline; text-underline-offset: 2px;
}
.site-footer button:hover { color: var(--text); }

/* ─── Spinner ────────────────────────────────────────────────── */
.spinner {
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,0.08);
  border-top-color: var(--yellow);
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
html.light .spinner { border-color: rgba(0,0,0,0.08); border-top-color: var(--yellow); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Ad block notice ────────────────────────────────────────── */
#adblock-notice {
  position: fixed; bottom: 1rem; left: 50%; transform: translateX(-50%);
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.7rem 1rem;
  display: flex; align-items: center; gap: 0.75rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
  z-index: 500; max-width: min(540px, 92vw);
  font-size: 0.82rem; color: var(--text-muted);
  animation: fadeIn 0.2s ease;
}
#adblock-notice span { flex: 1; line-height: 1.45; }
#adblock-notice button {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 1rem; padding: 0.1rem 0.3rem;
  flex-shrink: 0; border-radius: 4px;
}
#adblock-notice button:hover { color: var(--text); background: rgba(255,255,255,0.06); }
html.light #adblock-notice button:hover { background: rgba(0,0,0,0.04); }

/* ─── Shared hints ───────────────────────────────────────────── */
.hints-row {
  display: flex;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.hint-slot {
  min-width: 130px;
  padding: 0.5rem 0.9rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  text-align: center;
  font-size: 0.8rem;
}

.hint-lock  { color: var(--text-muted); font-size: 0.75rem; }
.hint-value { font-weight: 700; color: var(--yellow); animation: hintReveal 0.4s ease; }

@keyframes hintReveal {
  from { opacity: 0; transform: scale(0.85); }
  to   { opacity: 1; transform: scale(1); }
}

/* ─── Animations ─────────────────────────────────────────────── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
