/* ==========================================================================
   CursorHunter — Charte Graphique Officielle SEEWORLD
   Minimalisme direct inspiré de multi-motors.fr et seeworld.fr
   - Blanc Papier (#FFFFFF) et Noir Encre (#000000)
   - Typographie officielle : Glacial Indifference
   - Contour pointillé signature : 2px dashed rgba(0, 0, 0, 0.45)
   - Arrondis : 12px (cartes/conteneurs), 15px (pilules/boutons)
   - Majuscules & espacement étendu (letter-spacing: 0.12em - 0.15em)
   ========================================================================== */

@font-face {
  font-family: "Glacial Indifference";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("./fonts/glacial-indifference-400.woff2") format("woff2"),
       url("/cursorhunter/fonts/glacial-indifference-400.woff2") format("woff2");
}

@font-face {
  font-family: "Glacial Indifference";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("./fonts/glacial-indifference-700.woff2") format("woff2"),
       url("/cursorhunter/fonts/glacial-indifference-700.woff2") format("woff2");
}

:root {
  --paper: #ffffff;
  --ink: #000000;
  --dash: rgba(0, 0, 0, 0.45);
  --dash-light: rgba(0, 0, 0, 0.15);
  --hover-bg: #fafafa;
  --discret: rgba(0, 0, 0, 0.6);
  --font: "Glacial Indifference", "Century Gothic", "Futura", "Trebuchet MS", sans-serif;
  
  --radius-card: 12px;
  --radius-pill: 15px;
  
  color-scheme: light;
}

*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  user-select: none;
}

body, html {
  width: 100%;
  height: 100%;
  background-color: var(--paper);
  color: var(--ink);
  font: 700 14px/1.4 var(--font);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ================= TOPNAV SEEWORLD ================= */
.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  min-height: 56px;
  padding: 0 clamp(16px, 3vw, 36px);
  border-bottom: 2px dashed var(--dash);
  background: var(--paper);
  z-index: 50;
  width: 100%;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.site-logo img {
  width: 26px;
  height: 26px;
  display: block;
}

.site-name {
  font: 700 16px/1 var(--font);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
}

.site-subname {
  font: 400 11px/1 var(--font);
  letter-spacing: 0.1em;
  color: var(--discret);
  text-transform: uppercase;
}

.nav-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ================= ÉCRANS ================= */
.screen {
  position: absolute;
  top: 56px;
  left: 0;
  width: 100vw;
  height: calc(100vh - 56px);
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.screen.active {
  display: flex;
  opacity: 1;
}

/* ================= LOBBY (ACCUEIL) ================= */
#lobby-screen {
  justify-content: center;
  align-items: center;
  background: var(--paper);
  overflow-y: auto;
  padding: 24px;
}

.lobby-container {
  width: 100%;
  max-width: 920px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: auto;
}

.game-header {
  text-align: center;
}

.logo-badge {
  display: inline-block;
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink);
  background: var(--paper);
  border: 2px dashed var(--dash);
  padding: 4px 14px;
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.main-title {
  font-family: var(--font);
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 6px;
}

.subtitle {
  color: var(--discret);
  font-size: 1rem;
  font-weight: 400;
  letter-spacing: 0.05em;
}

.lobby-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 20px;
}

@media (max-width: 768px) {
  .lobby-grid {
    grid-template-columns: 1fr;
  }
  .main-title {
    font-size: 2rem;
  }
}

/* ================= CARTES PROJET SEEWORLD ================= */
.card {
  background: var(--paper);
  border: 2px dashed var(--dash);
  border-radius: var(--radius-card);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: border-color 0.15s ease, border-style 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-style: solid;
  border-color: var(--ink);
  transform: translateY(-2px);
}

.card h2 {
  font-family: var(--font);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ================= FORMULAIRES & INPUTS ================= */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--discret);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

input[type="text"] {
  background: var(--paper);
  border: 2px dashed var(--dash);
  border-radius: 8px;
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 10px 14px;
  outline: none;
  transition: all 0.15s ease;
}

input[type="text"]:focus {
  border-style: solid;
  border-color: var(--ink);
  background: var(--hover-bg);
}

.input-with-button {
  display: flex;
  gap: 8px;
}

.input-with-button input {
  flex: 1;
}

/* Nuancier de couleurs */
.color-palette {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.color-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid #ccc;
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.color-dot:hover {
  transform: scale(1.15);
  border-color: var(--ink);
}

.color-dot.active {
  border: 2px solid var(--ink);
  transform: scale(1.25);
  box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink);
}

/* Aperçu curseur */
.cursor-preview-box {
  background: var(--hover-bg);
  border: 2px dashed var(--dash-light);
  border-radius: var(--radius-card);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px;
}

.preview-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--discret);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* ================= BOUTONS & PILULES ================= */
.btn {
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 11px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn-large {
  font-size: 0.95rem;
  padding: 14px 24px;
}

/* Bouton primaire : Noir Encre sur Blanc Papier, inverse au hover */
.btn-primary {
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
}

.btn-primary:hover {
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
}

/* Bouton secondaire / pilule : Blanc avec contour pointillé */
.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 2px dashed var(--dash);
}

.btn-secondary:hover {
  border-style: solid;
  border-color: var(--ink);
  background: var(--hover-bg);
  transform: translateY(-2px);
}

.btn-accent {
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
}

.btn-accent:hover {
  background: var(--paper);
  color: var(--ink);
  transform: translateY(-2px);
}

.btn-pill {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink);
  border: 2px dashed var(--dash);
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-pill:hover {
  border-style: solid;
  border-color: var(--ink);
  background: var(--hover-bg);
}

.btn-leave:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn-text {
  background: none;
  border: none;
  color: var(--ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
}

.btn-text:hover {
  text-decoration: underline;
}

/* ================= ONGLETS DU LOBBY ================= */
.tab-header {
  display: flex;
  border-bottom: 2px dashed var(--dash-light);
  gap: 10px;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--discret);
  font-family: var(--font);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s ease;
}

.tab-btn:hover {
  color: var(--ink);
}

.tab-btn.active {
  color: var(--ink);
  border-bottom: 2px solid var(--ink);
}

.tab-content {
  display: none;
  flex-direction: column;
  gap: 12px;
}

.tab-content.active {
  display: flex;
}

/* Liste des Salons */
.rooms-list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--discret);
}

.rooms-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
}

.room-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--hover-bg);
  border: 2px dashed var(--dash-light);
  padding: 10px 14px;
  border-radius: var(--radius-card);
  transition: all 0.15s ease;
}

.room-item:hover {
  border-style: solid;
  border-color: var(--ink);
  background: var(--paper);
}

.room-info {
  display: flex;
  flex-direction: column;
}

.room-name {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.room-meta {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--discret);
  letter-spacing: 0.05em;
}

.room-empty {
  text-align: center;
  color: var(--discret);
  padding: 24px 0;
  font-style: italic;
  font-weight: 400;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: var(--discret);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  margin: 8px 0;
}

.divider::before, .divider::after {
  content: '';
  flex: 1;
  border-bottom: 2px dashed var(--dash-light);
}

.divider span {
  padding: 0 10px;
}

.small-text {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--discret);
  letter-spacing: 0.04em;
}

/* Règles du jeu */
.rules-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.85rem;
  font-weight: 400;
}

.rules-list strong {
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink);
}

.key-badge {
  display: inline-block;
  background: var(--paper);
  color: var(--ink);
  border: 2px dashed var(--dash);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 6px;
}

.stat-badge {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  border: 2px solid var(--ink);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-right: 6px;
}

.lobby-footer {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--discret);
}

/* ================= ÉCRAN DE JEU & ARÈNE 16:9 ================= */
#game-screen {
  background-color: var(--hover-bg);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Conteneur 16:9 avec bordure pointillée signature */
#arena-container {
  position: relative;
  width: 100vw;
  height: 56.25vw; /* 16:9 */
  max-height: calc(100vh - 56px);
  max-width: calc((100vh - 56px) * 1.7777); /* 16:9 */
  background: var(--paper);
  border: 2px dashed var(--dash);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  cursor: none;
}

#game-canvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: none;
}

/* ================= HUD EN JEU ================= */
#hud-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hud-top-bar {
  position: absolute;
  top: 14px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hud-room-info {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.room-pill {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  background: var(--paper);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  border: 2px dashed var(--dash);
}

.code-pill {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--ink);
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  border: 2px solid var(--ink);
}

/* Killfeed */
.killfeed-container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.killfeed-item {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px dashed var(--dash);
  animation: fadeInRight 0.2s ease;
  width: fit-content;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(-15px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Leaderboard */
.hud-leaderboard {
  position: absolute;
  top: 14px;
  right: 16px;
  background: var(--paper);
  border: 2px dashed var(--dash);
  border-radius: var(--radius-card);
  padding: 12px 16px;
  width: 200px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.leaderboard-title {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink);
  border-bottom: 2px dashed var(--dash-light);
  padding-bottom: 6px;
  margin-bottom: 8px;
}

#leaderboard-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.8rem;
}

.lb-entry {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.lb-name {
  max-width: 130px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.lb-score {
  font-family: var(--font);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--ink);
}

/* Cooldowns circulaires */
.hud-cooldowns {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 20px;
}

.cooldown-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.cd-circle {
  position: relative;
  width: 52px;
  height: 52px;
}

.cd-circle svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: var(--paper);
  stroke: var(--dash-light);
  stroke-width: 3.5;
}

.circle-progress {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3.5;
  stroke-linecap: round;
  transition: stroke-dasharray 0.05s linear;
}

.circle-progress.parry-prog {
  stroke: var(--ink);
}

.cd-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.08em;
}

.action-name {
  font-family: var(--font);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--discret);
}

/* Bannière d'action */
.action-banner {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  pointer-events: none;
  opacity: 0;
  color: var(--ink);
  background: var(--paper);
  border: 2px dashed var(--dash);
  padding: 8px 24px;
  border-radius: var(--radius-pill);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.action-banner.show {
  opacity: 1;
  transform: translate(-50%, -60%) scale(1.05);
}

/* ================= MODALE DE MORT (RESPAWN SEEWORLD) ================= */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  pointer-events: auto;
  cursor: default;
}

.modal-overlay.hidden {
  display: none;
}

.death-card {
  background: var(--paper);
  border: 2px dashed var(--dash);
  border-radius: var(--radius-card);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
  padding: 32px 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 400px;
  width: 90%;
  animation: zoomIn 0.2s ease-out;
}

@keyframes zoomIn {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.death-header {
  font-family: var(--font);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.death-sub {
  color: var(--discret);
  font-size: 0.95rem;
  font-weight: 400;
}

.death-sub strong {
  color: var(--ink);
  font-weight: 700;
  text-transform: uppercase;
}

.death-stats {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin: 6px 0;
}

.stat-box {
  display: flex;
  flex-direction: column;
  background: var(--hover-bg);
  border: 2px dashed var(--dash-light);
  padding: 10px 18px;
  border-radius: var(--radius-card);
}

.stat-value {
  font-family: var(--font);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
}

.stat-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--discret);
}

#btn-respawn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}
