
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
  --bg: #0b0913;
  --panel: #151222;
  --panel-light: #1d1930;
  --text: #f7f4ff;
  --muted: #a49bb9;
  --accent: #9565ff;
  --accent-light: #bd8cff;
  --border: rgba(255,255,255,.09);
  --danger: #e94d70;
  --success: #48d6a0;
  --radius: 18px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, sans-serif;
  background:
    radial-gradient(ellipse at 12% 0%, rgba(123,75,255,.17), transparent 35%),
    radial-gradient(ellipse at 90% 20%, rgba(80,50,160,.12), transparent 30%),
    var(--bg);
}

button, input {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

button:disabled {
  opacity: .5;
  cursor: not-allowed;
}

#app {
  width: min(1180px, 92%);
  min-height: 100vh;
  margin: auto;
  display: flex;
  flex-direction: column;
}

.topbar {
  min-height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border-bottom: 1px solid var(--border);
}

.brand {
  color: white;
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -1px;
  text-decoration: none;
  white-space: nowrap;
}

.brand span {
  color: var(--accent-light);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 7px;
}

.main-nav button,
.text-button {
  padding: 10px 13px;
  color: var(--muted);
  background: transparent;
  border-radius: 9px;
  font-weight: 600;
  transition: .2s;
}

.main-nav button:hover,
.text-button:hover {
  color: white;
  background: var(--panel-light);
}

#account-area {
  display: flex;
  align-items: center;
  gap: 9px;
}

main {
  flex: 1;
  padding: 35px 0 75px;
}

.page {
  display: none;
  animation: pageIn .3s ease;
}

.page.active {
  display: block;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: translateY(0); }
}

#message {
  display: none;
  padding: 13px 16px;
  margin-top: 14px;
  border-radius: 10px;
  background: var(--panel-light);
  border: 1px solid var(--border);
  line-height: 1.5;
}

#message.show {
  display: block;
}

#message.error {
  color: #ff9aae;
  border-color: #a92d4b;
}

#message.success {
  color: #78e6bd;
  border-color: #268b68;
}

/* BOUTONS */

.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  padding: 13px 19px;
  border-radius: 11px;
  font-weight: 700;
  transition: .2s;
}

.primary-button {
  color: white;
  background: linear-gradient(135deg, #9565ff, #7544e8);
  box-shadow: 0 7px 22px rgba(117,68,232,.17);
}

.primary-button:hover {
  filter: brightness(1.14);
  transform: translateY(-2px);
}

.secondary-button {
  color: white;
  background: var(--panel-light);
  border: 1px solid var(--border);
}

.secondary-button:hover {
  border-color: var(--accent);
  background: #29213f;
}

.danger-button {
  color: white;
  background: #a92d4b;
}

.danger-button:hover {
  background: #c83b5c;
}

.block-button {
  width: 100%;
}

.back-button {
  padding: 10px 0;
  margin-bottom: 24px;
  color: var(--muted);
  background: transparent;
  font-weight: 600;
}

.back-button:hover {
  color: white;
}

/* ACCUEIL */

.hero {
  min-height: 410px;
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  align-items: center;
  gap: 25px;
  padding: 45px 35px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 26px;
  background:
    radial-gradient(circle at 80% 45%, rgba(135,88,255,.2), transparent 35%),
    linear-gradient(120deg, #1b1530, #100d1c);
}

.hero-content {
  position: relative;
  z-index: 2;
}

.eyebrow {
  display: inline-block;
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.hero h1 {
  margin: 20px 0;
  font-size: clamp(43px, 6vw, 68px);
  line-height: 1.04;
  letter-spacing: -3px;
}

.hero h1 span {
  color: var(--accent-light);
}

.hero-content > p {
  max-width: 480px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.hero-art {
  position: relative;
  min-height: 290px;
  display: grid;
  place-items: center;
}

.hero-orb {
  width: 210px;
  height: 210px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #b88cff, #6841bd 60%, #24153e);
  box-shadow: 0 0 75px rgba(149,101,255,.35), inset 0 0 35px #fff2;
  font-size: 80px;
  transform: rotate(-8deg);
}

.floating-card {
  position: absolute;
  padding: 14px 17px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(27,22,44,.9);
  box-shadow: 0 12px 30px #0005;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.floating-one {
  top: 28px;
  right: 0;
}

.floating-two {
  bottom: 30px;
  left: 0;
}

.home-categories {
  margin-top: 65px;
}

.section-heading {
  margin-bottom: 22px;
}

.section-heading h2 {
  margin-top: 9px;
  font-size: 27px;
}

.section-heading p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.6;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.category-card {
  min-height: 225px;
  padding: 28px;
  text-align: left;
  color: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  transition: .25s;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: 0 15px 40px #0005;
}

.multi-card {
  background: linear-gradient(145deg, #211a3a, #151222);
}

.solo-card {
  background: linear-gradient(145deg, #1d203b, #151222);
}

.category-icon {
  display: block;
  margin-bottom: 20px;
  font-size: 35px;
}

.category-card h2 {
  margin-bottom: 10px;
  font-size: 23px;
}

.category-card p {
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.category-card strong {
  color: var(--accent-light);
  font-size: 13px;
}

/* TITRES DE PAGES */

.page-heading {
  margin-bottom: 30px;
}

.page-heading h1 {
  margin: 10px 0;
  font-size: clamp(30px, 5vw, 43px);
  letter-spacing: -1.5px;
}

.page-heading p {
  color: var(--muted);
  line-height: 1.7;
}

/* PANNEAUX ET FORMULAIRES */

.section-card {
  padding: 25px;
  margin-bottom: 25px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}

.section-card h2 {
  margin-bottom: 12px;
  font-size: 19px;
}

.section-card > p {
  color: var(--muted);
  line-height: 1.6;
}

.inline-form {
  display: flex;
  gap: 10px;
  margin-top: 18px;
}

input {
  width: 100%;
  min-width: 0;
  padding: 14px 15px;
  color: white;
  background: #0e0b18;
  border: 1px solid var(--border);
  border-radius: 11px;
  outline: none;
  transition: .2s;
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px #9565ff22;
}

input::placeholder {
  color: #716982;
}

.form-group {
  margin-bottom: 22px;
}

.form-group label {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  font-weight: 700;
}

.form-help {
  display: block;
  margin-top: 9px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.create-lobby-panel {
  max-width: 650px;
}

/* JEUX */

.game-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 17px;
}

.game-card {
  min-height: 160px;
  padding: 22px;
  text-align: left;
  color: white;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 17px;
  transition: .2s;
}

.game-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  background: #1d1830;
}

.game-card .game-icon {
  display: block;
  margin-bottom: 17px;
  font-size: 32px;
}

.game-card h3 {
  margin-bottom: 7px;
  font-size: 17px;
}

.game-card p {
  color: var(--muted);
  font-size: 13px;
}

/* ACTIONS DU JEU */

.action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.action-card {
  min-height: 215px;
  padding: 30px;
  text-align: left;
  color: white;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
  transition: .2s;
}

.action-card:hover {
  border-color: var(--accent);
  transform: translateY(-4px);
  background: #1d1830;
}

.action-icon {
  display: block;
  margin-bottom: 20px;
  font-size: 35px;
}

.action-card h2 {
  margin-bottom: 10px;
}

.action-card p {
  color: var(--muted);
  line-height: 1.6;
}

/* VISIBILITÉ */

.visibility-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  background: var(--panel-light);
  border-radius: 13px;
}

.visibility-control strong {
  display: block;
  margin-bottom: 5px;
  font-size: 13px;
}

.visibility-control p {
  color: var(--muted);
  font-size: 11px;
}

.switch {
  position: relative;
  display: inline-block;
  width: 52px;
  height: 29px;
  flex-shrink: 0;
}

.switch input {
  width: 0;
  height: 0;
  opacity: 0;
}

.switch-slider {
  position: absolute;
  inset: 0;
  border-radius: 30px;
  background: #514963;
  cursor: pointer;
  transition: .2s;
}

.switch-slider::before {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: white;
  transition: .2s;
}

.switch input:checked + .switch-slider {
  background: var(--accent);
}

.switch input:checked + .switch-slider::before {
  transform: translateX(23px);
}

/* LOBBIES */

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-heading h2 {
  margin: 0;
}

.lobby-list,
.player-list {
  display: grid;
  gap: 12px;
}

.lobby-item,
.player-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: var(--panel-light);
}

.lobby-item h3 {
  margin-bottom: 7px;
  font-size: 16px;
}

.lobby-item p {
  color: var(--muted);
  font-size: 13px;
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  line-height: 1.7;
  border: 1px dashed var(--border);
  border-radius: 13px;
}

/* AUTHENTIFICATION */

.auth-layout {
  min-height: 570px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 45px;
  max-width: 950px;
  margin: auto;
}

.auth-decoration h2 {
  margin: 20px 0;
  font-size: clamp(40px, 5vw, 60px);
  line-height: 1.05;
}

.auth-decoration p {
  max-width: 360px;
  color: var(--muted);
  line-height: 1.8;
}

.auth-card {
  padding: 30px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--panel);
}

.auth-card h1 {
  margin: 10px 0;
  font-size: 27px;
}

.auth-card > p {
  color: var(--muted);
  line-height: 1.6;
}

.auth-tabs {
  display: flex;
  gap: 8px;
  padding: 5px;
  margin-bottom: 23px;
  border-radius: 12px;
  background: #0e0b18;
}

.auth-tabs button {
  flex: 1;
  padding: 11px;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font-weight: 700;
}

.auth-tabs button.active {
  color: white;
  background: var(--accent);
}

.auth-card form {
  margin-top: 23px;
}

.auth-feedback {
  margin: 13px 0;
  font-size: 13px;
}

.auth-card .text-button {
  margin-top: 10px;
}

/* INVITÉ */

.guest-card {
  max-width: 570px;
  margin: 30px auto;
}

.guest-card h1 {
  margin: 13px 0;
  font-size: 30px;
}

.guest-card > p {
  margin-bottom: 22px;
  color: var(--muted);
  line-height: 1.6;
}

/* SALLE D'ATTENTE */

.lobby-code-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px;
  border: 1px dashed #8d6be1;
  border-radius: 13px;
  background: #0e0b18;
}

.lobby-code {
  display: block;
  margin-top: 8px;
  font-size: 23px;
  letter-spacing: 4px;
}

.lobby-meta {
  margin: 18px 0 25px;
  color: var(--muted);
  font-size: 14px;
}

.player-item .host-label {
  color: var(--accent-light);
  font-size: 12px;
  font-weight: 700;
}

.lobby-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 25px;
}

/* PROFIL */

.profile-banner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 25px;
  margin-bottom: 30px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, #281b48, #171225);
}

.avatar {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #38245e;
  font-size: 28px;
}

.profile-banner p {
  margin: 5px 0;
  color: var(--muted);
}

.profile-tag {
  color: var(--accent-light);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  margin-bottom: 30px;
}

.stat-card {
  padding: 23px;
  border: 1px solid var(--border);
  border-radius: 15px;
  background: var(--panel);
}

.stat-card strong {
  display: block;
  margin: 10px 0 5px;
  font-size: 32px;
}

.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

/* FOOTER */

footer {
  padding: 27px 0;
  text-align: center;
  border-top: 1px solid var(--border);
}

footer .brand {
  margin-bottom: 9px;
  font-size: 20px;
}

footer p,
footer > span {
  color: var(--muted);
  font-size: 12px;
  line-height: 2;
}

/* RESPONSIVE */

@media (max-width: 800px) {
  .topbar {
    flex-wrap: wrap;
    padding: 17px 0;
  }

  .main-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .hero-art {
    min-height: 220px;
  }

  .auth-layout {
    grid-template-columns: 1fr;
    gap: 25px;
  }

  .auth-decoration {
    text-align: center;
  }

  .auth-decoration p {
    margin: auto;
  }

  .game-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  #app {
    width: 94%;
  }

  main {
    padding-top: 22px;
  }

  .topbar {
    gap: 12px;
  }

  .brand {
    font-size: 21px;
  }

  #account-area {
    gap: 5px;
  }

  #account-area button {
    padding: 10px;
    font-size: 12px;
  }

  .main-nav button {
    padding: 9px;
    font-size: 12px;
  }

  .hero {
    padding: 30px 21px;
  }

  .hero h1 {
    font-size: 45px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .hero-actions button {
    width: 100%;
  }

  .category-grid,
  .game-grid,
  .action-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .category-card {
    min-height: 190px;
  }

  .inline-form {
    flex-direction: column;
  }

  .section-card {
    padding: 19px;
  }

  .visibility-control {
    gap: 7px;
  }

  .visibility-control p {
    display: none;
  }

  .auth-card {
    padding: 21px;
  }

  .lobby-item {
    align-items: flex-start;
    flex-direction: column;
  }

  .profile-banner {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
.lobby-invite-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 600px) {
  .lobby-code-line {
    align-items: flex-start;
    flex-direction: column;
  }

  .lobby-invite-buttons {
    width: 100%;
    flex-direction: column;
  }

  .lobby-invite-buttons button {
    width: 100%;
  }
}