/* ==========================================================================
   Canadixa — feuille de style unique. Verre ambré, pin, érable.
   ========================================================================== */

:root {
  --pine-obsidian: #0a130f;
  --midnight-slate: #131c16;
  --maple: #ff5722;
  --gold: #ffa000;
  --gold-bright: #ffc046;
  --neon-pine: #00e676;
  --birch: #f4e9d8;

  --glass-fill: rgba(255, 152, 0, 0.05);
  --glass-border: rgba(255, 176, 48, 0.16);
  --glass-border-strong: rgba(255, 196, 90, 0.32);

  --font-display: 'Outfit', ui-sans-serif, system-ui, sans-serif;
  --font-body: 'Inter', ui-sans-serif, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-color: var(--glass-border);
}

* {
  margin: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}

body {
  min-height: 100dvh;
  background-color: var(--pine-obsidian);
  color: var(--birch);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* La pièce où l'arcade est installée : deux mares de lumière chaude sur le pin. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -3;
  background:
    radial-gradient(58rem 42rem at 12% -8%, rgba(255, 87, 34, 0.16), transparent 62%),
    radial-gradient(48rem 38rem at 92% 4%, rgba(255, 160, 0, 0.12), transparent 60%),
    radial-gradient(70rem 50rem at 50% 108%, rgba(0, 230, 118, 0.08), transparent 66%),
    linear-gradient(180deg, #0a130f 0%, #131c16 46%, #0a130f 100%);
}

/* Grain de pellicule, pour que les grands aplats ne paraissent jamais plastiques. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  opacity: 0.32;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

#leaf-field {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

::selection {
  background: rgba(255, 87, 34, 0.32);
  color: #fff6e9;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 6px;
}

::-webkit-scrollbar {
  width: 11px;
  height: 11px;
}
::-webkit-scrollbar-track {
  background: rgba(10, 19, 15, 0.9);
}
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 87, 34, 0.55), rgba(255, 160, 0, 0.4));
  border-radius: 999px;
  border: 2px solid rgba(10, 19, 15, 0.9);
}

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

img,
svg,
canvas {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 100;
  background: var(--gold);
  color: var(--pine-obsidian);
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-weight: 600;
}

/* --------------------------------- surfaces ------------------------------ */

.glass {
  background: var(--glass-fill);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(18px) saturate(135%);
  -webkit-backdrop-filter: blur(18px) saturate(135%);
}

.glass-strong {
  background:
    linear-gradient(140deg, rgba(255, 214, 150, 0.1) 0%, rgba(255, 152, 0, 0.045) 45%, rgba(255, 255, 255, 0) 78%),
    rgba(19, 28, 22, 0.72);
  border: 1px solid var(--glass-border-strong);
  backdrop-filter: blur(26px) saturate(150%);
  -webkit-backdrop-filter: blur(26px) saturate(150%);
}

/* Pin scié : fines lignes de fil sur une base d'écorce chaude. */
.timber {
  background-color: #1c2a21;
  background-image:
    repeating-linear-gradient(92deg, rgba(255, 190, 120, 0.055) 0 1px, transparent 1px 5px),
    repeating-linear-gradient(88deg, rgba(0, 0, 0, 0.22) 0 2px, transparent 2px 11px),
    linear-gradient(150deg, #24352a 0%, #16211a 100%);
  border: 1px solid rgba(255, 176, 48, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 214, 150, 0.14), inset 0 -1px 0 rgba(0, 0, 0, 0.55);
}

.grad-maple {
  background: linear-gradient(120deg, #ffc046 0%, #ff7043 45%, #ff5722 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.grad-pine {
  background: linear-gradient(120deg, #00e676 0%, #ffc046 120%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.birch {
  color: var(--birch);
}

.rule {
  height: 1px;
  margin: 1rem 0;
  background: linear-gradient(90deg, transparent, rgba(255, 176, 48, 0.28) 22%, rgba(0, 230, 118, 0.22) 62%, transparent);
}

/* --------------------------------- boutons ------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 0;
  border-radius: 0.75rem;
  padding: 0.62rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease;
}
.btn:active {
  transform: translateY(1px) scale(0.985);
}

.btn-lg {
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
}
.btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.btn-primary {
  background: linear-gradient(135deg, #ff5722 0%, #ffa000 100%);
  color: #1a0d05;
  box-shadow: 0 0 0 1px rgba(255, 196, 90, 0.35), 0 14px 34px -14px rgba(255, 87, 34, 0.9);
}
.btn-primary:hover {
  box-shadow: 0 0 0 1px rgba(255, 214, 150, 0.5), 0 20px 46px -14px rgba(255, 120, 40, 1);
  filter: brightness(1.06);
}

.btn-ghost {
  background: rgba(255, 152, 0, 0.05);
  border: 1px solid var(--glass-border);
  color: var(--birch);
}
.btn-ghost:hover {
  background: rgba(255, 152, 0, 0.1);
  border-color: var(--glass-border-strong);
}

.btn-pine {
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.32);
  color: #7dffbc;
}
.btn-pine:hover {
  background: rgba(0, 230, 118, 0.18);
}

.icon-btn {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  flex: 0 0 auto;
  font-size: 1rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: rgba(255, 152, 0, 0.07);
  border: 1px solid var(--glass-border);
  color: rgba(244, 233, 216, 0.72);
}
.chip-live {
  border-color: rgba(255, 87, 34, 0.3);
  background: rgba(255, 87, 34, 0.1);
  color: var(--gold-bright);
}
.chip-pine {
  border-color: rgba(0, 230, 118, 0.3);
  color: var(--neon-pine);
}

.dot {
  position: relative;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--neon-pine);
}
.dot::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--neon-pine);
  animation: ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ping {
  75%,
  100% {
    transform: scale(2.4);
    opacity: 0;
  }
}

/* ------------------------------- navigation ------------------------------ */

.nav-wrap {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  justify-content: center;
  padding: 0.75rem;
  pointer-events: none;
}

.nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 1rem;
  width: 100%;
  max-width: 72rem;
  padding: 0.6rem 1rem;
  border-radius: 1rem;
  transition: all 0.3s ease;
}
.nav.is-scrolled {
  background:
    linear-gradient(140deg, rgba(255, 214, 150, 0.1) 0%, rgba(255, 152, 0, 0.045) 45%, rgba(255, 255, 255, 0) 78%),
    rgba(19, 28, 22, 0.82);
  border-color: var(--glass-border-strong);
  box-shadow: 0 18px 50px -30px rgba(255, 120, 40, 0.9);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.brand-leaf {
  display: block;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.brand:hover .brand-leaf {
  transform: rotate(-14deg) scale(1.08);
}
.brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
}
.brand-play {
  color: rgba(244, 233, 216, 0.9);
}

.nav-links {
  display: none;
  gap: 0.25rem;
}
.nav-links a {
  border-radius: 0.5rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(244, 233, 216, 0.55);
  transition: color 0.2s;
}
.nav-links a:hover,
.nav-links a.is-active {
  color: var(--birch);
}

.nav-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0.75rem;
  padding: 0.35rem 0.7rem;
}
.coins {
  display: none;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--gold-bright);
}

.exp-ring {
  position: relative;
  width: 1.75rem;
  height: 1.75rem;
  flex: 0 0 auto;
}
.exp-ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  transition: stroke-dashoffset 0.6s ease;
}
.exp-level {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}
.exp-text {
  display: none;
  line-height: 1.1;
}
.exp-label {
  display: block;
  font-size: 9px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(244, 233, 216, 0.45);
}
.exp-value {
  font-size: 12px;
  font-weight: 600;
  color: var(--neon-pine);
}

@media (min-width: 640px) {
  .coins,
  .exp-text {
    display: flex;
  }
  .exp-text {
    display: block;
  }
}
@media (min-width: 768px) {
  .nav-links {
    display: flex;
  }
}

/* ---------------------------------- héros -------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 92vh;
  overflow: hidden;
  padding: 8rem 1rem 6rem;
  text-align: center;
}

#pine-parallax {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
}

.hero-glow {
  position: absolute;
  left: 50%;
  top: 22%;
  z-index: -1;
  width: 64rem;
  max-width: 120vw;
  height: 34rem;
  transform: translateX(-50%);
  border-radius: 999px;
  opacity: 0.7;
  filter: blur(110px);
  background: conic-gradient(from 210deg at 50% 50%, rgba(255, 87, 34, 0.5), rgba(255, 160, 0, 0.42), rgba(0, 230, 118, 0.22), rgba(255, 87, 34, 0.5));
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  margin: 0 auto;
  width: 100%;
  max-width: 64rem;
}

.hero-title {
  margin-top: 1.5rem;
  font-size: clamp(2.75rem, 9vw, 6.5rem);
  font-weight: 800;
  line-height: 0.92;
  letter-spacing: -0.035em;
}

.hero-sub {
  margin: 1.75rem auto 0;
  max-width: 42rem;
  font-size: 1.0625rem;
  color: rgba(244, 233, 216, 0.65);
}

.hero-cta {
  margin-top: 2.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

.stats-ticker {
  margin: 3.5rem auto 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  width: fit-content;
  max-width: 100%;
  border-radius: 1rem;
  overflow: hidden;
}
.stats-ticker > div {
  padding: 0.85rem 1.5rem;
  text-align: center;
}
.stats-ticker span {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--gold-bright);
}
.stats-ticker small {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: rgba(244, 233, 216, 0.45);
}
@media (min-width: 720px) {
  .stats-ticker {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* -------------------------------- sections ------------------------------- */

.section {
  position: relative;
  margin: 0 auto;
  width: 100%;
  max-width: 72rem;
  padding: 5rem 1rem;
  scroll-margin-top: 7rem;
}
.section-tight {
  padding-block: 2.5rem;
}

.section-head {
  max-width: 42rem;
  margin-bottom: 2.5rem;
}
.section-head h2 {
  margin-top: 1.25rem;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 800;
}
.section-head p {
  margin-top: 1rem;
  color: rgba(244, 233, 216, 0.6);
}

/* --------------------------------- cartes -------------------------------- */

.game-grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
}

.card {
  height: 23rem;
  perspective: 1400px;
}

.card-inner {
  position: relative;
  height: 100%;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform 0.62s cubic-bezier(0.22, 1, 0.36, 1);
}
.card.is-flipped .card-inner {
  transform: rotateY(180deg);
}

.card-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 1rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  display: flex;
  flex-direction: column;
}

.card-front::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(28rem 22rem at var(--gx, 50%) var(--gy, 50%), color-mix(in srgb, var(--accent) 18%, transparent), transparent 68%);
}
.card-front::after {
  content: '';
  position: absolute;
  inset: 0.5rem;
  border-radius: 0.75rem;
  border: 1px solid color-mix(in srgb, var(--accent) 15%, transparent);
  pointer-events: none;
}

.card-back {
  transform: rotateY(180deg);
  padding: 1.25rem;
  gap: 0.75rem;
}

.card-top {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.25rem;
}

.card-emoji {
  display: grid;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 0.75rem;
  font-size: 1.85rem;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 15%, transparent), transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent), 0 12px 30px -16px var(--accent);
  transition: transform 0.25s;
}
.card:hover .card-emoji {
  transform: scale(1.1) rotate(-8deg);
}

.card-badges {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
}
.chip-diff {
  padding-block: 0.1rem;
  font-size: 10px;
}
.diff-facile {
  color: var(--neon-pine);
  border-color: rgba(0, 230, 118, 0.25);
}
.diff-moyen {
  color: var(--gold);
  border-color: rgba(255, 160, 0, 0.25);
}
.diff-difficile {
  color: var(--maple);
  border-color: rgba(255, 87, 34, 0.25);
}

.live-count {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 11px;
  color: rgba(244, 233, 216, 0.55);
}
.live-count .mono {
  font-weight: 600;
  color: var(--neon-pine);
}

.card-body {
  position: relative;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 0 1.25rem 1.25rem;
}
.card-genre {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: rgba(244, 233, 216, 0.4);
}
.card-body h3 {
  font-size: 1.375rem;
  font-weight: 700;
}
.card-body p {
  font-size: 0.875rem;
  color: rgba(244, 233, 216, 0.55);
}
.card-actions {
  margin-top: 0.6rem;
  display: flex;
  gap: 0.5rem;
}
.card-play {
  flex: 1;
}

.card-back-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-back-head h4 {
  font-size: 1rem;
  font-weight: 700;
}
.card-enter {
  margin-top: auto;
  width: 100%;
}

.steps {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.steps li {
  display: flex;
  gap: 0.65rem;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(244, 233, 216, 0.7);
}
.step-num {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.1rem;
  border-radius: 0.375rem;
  font-size: 10px;
  font-weight: 700;
  background: color-mix(in srgb, var(--accent, #ffa000) 14%, transparent);
  color: var(--accent, #ffa000);
}

.controls > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.4rem;
}
.controls dt {
  flex: 0 0 auto;
  border-radius: 0.375rem;
  background: rgba(0, 0, 0, 0.3);
  padding: 0.25rem 0.5rem;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-bright);
}
.controls dd {
  margin: 0;
  text-align: right;
  font-size: 12px;
  color: rgba(244, 233, 216, 0.55);
}

/* -------------------------------- piliers -------------------------------- */

.pillars {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
}
.pillar {
  border-radius: 1rem;
  padding: 1.5rem;
}
.pillar > span {
  font-size: 1.5rem;
}
.pillar h3 {
  margin-top: 1rem;
  font-size: 1.125rem;
  font-weight: 700;
}
.pillar p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: rgba(244, 233, 216, 0.55);
}

/* ------------------------------ classements ------------------------------ */

.board-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.board-tab.is-active {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--birch);
}

.board-panel {
  border-radius: 1rem;
  padding: 1.25rem;
}
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.75rem;
}
.board-head h3 {
  font-size: 1.0625rem;
  font-weight: 700;
}
.board-switch {
  display: flex;
  gap: 0.25rem;
  border-radius: 0.6rem;
  padding: 0.15rem;
  background: rgba(0, 0, 0, 0.28);
}
.board-switch button {
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  padding: 0.3rem 0.7rem;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(244, 233, 216, 0.5);
  cursor: pointer;
}
.board-switch button.is-active {
  background: rgba(255, 152, 0, 0.14);
  color: var(--gold-bright);
}

.board-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.board-row {
  display: grid;
  grid-template-columns: 2rem 1fr auto;
  align-items: center;
  gap: 0.75rem;
  border-radius: 0.6rem;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 255, 255, 0.02);
  font-size: 0.875rem;
}
.board-row .rank {
  font-size: 12px;
  font-weight: 700;
  color: rgba(244, 233, 216, 0.4);
}
.board-row.is-top .rank {
  color: var(--gold-bright);
}
.board-row .name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(244, 233, 216, 0.85);
}
.board-row .score {
  font-weight: 700;
  color: var(--gold-bright);
}
.board-empty {
  padding: 1.25rem 0;
  text-align: center;
  font-size: 0.8125rem;
  color: rgba(244, 233, 216, 0.4);
}

/* ------------------------------- page de jeu ----------------------------- */

.game-page {
  margin: 0 auto;
  width: 100%;
  max-width: 78rem;
  padding: 7.5rem 1rem 3rem;
}

.breadcrumb {
  display: flex;
  gap: 0.5rem;
  font-size: 12px;
  color: rgba(244, 233, 216, 0.4);
}
.breadcrumb a:hover {
  color: var(--gold-bright);
}

.game-head {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  margin: 1.25rem 0 1.75rem;
}
.game-emoji {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 4.5rem;
  height: 4.5rem;
  border-radius: 1rem;
  font-size: 2.25rem;
  background: linear-gradient(140deg, color-mix(in srgb, var(--accent) 18%, transparent), transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.game-head h1 {
  margin-top: 0.6rem;
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  font-weight: 800;
}
.game-head p {
  margin-top: 0.6rem;
  max-width: 46rem;
  font-size: 0.9375rem;
  color: rgba(244, 233, 216, 0.6);
}

.game-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1024px) {
  .game-layout {
    grid-template-columns: minmax(0, 1fr) 22rem;
  }
}

.stage-column {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.hud {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
  border-radius: 1rem;
  padding: 0.75rem 1rem;
}
.hud-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(244, 233, 216, 0.4);
}
.hud-score {
  font-size: 1.5rem;
  font-weight: 700;
}
.hud-best {
  font-size: 1.125rem;
  font-weight: 600;
  color: rgba(244, 233, 216, 0.75);
}
.hud-sep {
  width: 1px;
  height: 2.25rem;
  background: rgba(255, 176, 48, 0.16);
}
.hud-actions {
  margin-left: auto;
  display: flex;
  gap: 0.5rem;
}

.stage {
  position: relative;
  aspect-ratio: 16 / 10;
  width: 100%;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--pine-obsidian);
}
.stage canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
}
.stage:fullscreen {
  aspect-ratio: auto;
  height: 100%;
  border-radius: 0;
}

.overlay {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  padding: 1.5rem;
  text-align: center;
  background: rgba(10, 19, 15, 0.72);
  backdrop-filter: blur(10px);
  animation: fade-in 0.28s ease;
}
.overlay[hidden] {
  display: none;
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
.overlay-emoji {
  font-size: 3rem;
}
.overlay h2 {
  margin-top: 0.75rem;
  font-size: 1.75rem;
  font-weight: 800;
}
.overlay p {
  max-width: 30rem;
  font-size: 0.875rem;
  color: rgba(244, 233, 216, 0.6);
}
.overlay-hint {
  margin-top: 0.75rem;
  font-size: 12px;
  color: rgba(244, 233, 216, 0.4);
}
.overlay-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}
.over-score {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  font-weight: 800;
  line-height: 1;
}
.over-note {
  font-size: 12px;
  color: rgba(244, 233, 216, 0.45);
}
.over-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
}

.stage-note {
  padding: 0 0.25rem;
  font-size: 12px;
  color: rgba(244, 233, 216, 0.35);
}
.name-edit {
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 700;
  color: var(--gold-bright);
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}
.name-input {
  width: 8rem;
  border: 1px solid rgba(255, 176, 48, 0.3);
  border-radius: 0.375rem;
  background: rgba(0, 0, 0, 0.4);
  padding: 0.1rem 0.4rem;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--gold-bright);
  outline: none;
}

.side {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.side-card {
  border-radius: 1rem;
  padding: 1.25rem;
}
.side-card h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

/* ------------------------------ page 404 --------------------------------- */

.notfound {
  display: grid;
  place-items: center;
  gap: 0.75rem;
  min-height: 70vh;
  padding: 8rem 1rem 4rem;
  text-align: center;
}
.notfound span {
  font-size: 3rem;
}
.notfound h1 {
  font-size: clamp(2rem, 6vw, 3rem);
  font-weight: 800;
}
.notfound p {
  color: rgba(244, 233, 216, 0.55);
}

/* --------------------------- pages juridiques ---------------------------- */

.legal {
  margin: 0 auto;
  width: 100%;
  max-width: 56rem;
  padding: 7.5rem 1rem 2rem;
}
.legal-head {
  margin-bottom: 2rem;
}
.legal-head h1 {
  margin-top: 1.25rem;
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
}
.legal-meta {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: rgba(244, 233, 216, 0.45);
}
.legal-body {
  border-radius: 1rem;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  font-size: 0.95rem;
  line-height: 1.75;
  color: rgba(244, 233, 216, 0.72);
}
.legal-body h2 {
  margin-top: 2.25rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--birch);
}
.legal-body h2:first-child {
  margin-top: 0;
}
.legal-body p,
.legal-body ul,
.legal-body dl {
  margin-top: 0.85rem;
}
.legal-body ul {
  padding-left: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.legal-body li::marker {
  color: var(--gold);
}
.legal-body a {
  color: var(--gold-bright);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-body a:hover {
  color: var(--neon-pine);
}
.legal-body code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.85em;
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: rgba(244, 233, 216, 0.08);
  color: var(--birch);
}
.legal-lede {
  font-size: 1.05rem;
  color: rgba(244, 233, 216, 0.85);
}
.legal-note {
  font-size: 0.85rem;
  color: rgba(244, 233, 216, 0.5);
}
.legal-dl {
  display: grid;
  gap: 0.65rem;
}
.legal-dl > div {
  display: grid;
  gap: 0.15rem 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid rgba(255, 176, 48, 0.08);
}
.legal-dl dt {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: rgba(244, 233, 216, 0.4);
}
@media (min-width: 640px) {
  .legal-dl > div {
    grid-template-columns: 16rem 1fr;
    align-items: baseline;
  }
}

.contact-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  margin-bottom: 2rem;
}
.contact-card {
  display: block;
  border-radius: 1rem;
  padding: 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.contact-card:hover {
  transform: translateY(-3px);
  border-color: rgba(255, 176, 48, 0.35);
}
.contact-card > span[aria-hidden] {
  font-size: 1.5rem;
}
.contact-card h2 {
  margin-top: 0.6rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.contact-card p {
  margin-top: 0.35rem;
  font-size: 0.875rem;
  color: rgba(244, 233, 216, 0.55);
}
.contact-mail {
  display: block;
  margin-top: 0.9rem;
  font-size: 0.8rem;
  color: var(--gold-bright);
  word-break: break-all;
}

/* -------------------------------- pied de page --------------------------- */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 6rem;
  border-top: 1px solid rgba(255, 176, 48, 0.12);
  padding: 3.5rem 1rem;
}
.footer-grid {
  margin: 0 auto;
  display: grid;
  gap: 2.5rem;
  width: 100%;
  max-width: 72rem;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.footer-brand {
  grid-column: span 2;
}
.footer-copy {
  margin-top: 1rem;
  max-width: 24rem;
  font-size: 0.875rem;
  color: rgba(244, 233, 216, 0.5);
}
.footer-note {
  margin-top: 1.25rem;
  font-size: 12px;
  color: rgba(244, 233, 216, 0.35);
}
.footer-note a:hover {
  color: var(--gold-bright);
}
.site-footer h4 {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: rgba(244, 233, 216, 0.4);
}
.site-footer ul {
  list-style: none;
  padding: 0;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  font-size: 0.875rem;
  color: rgba(244, 233, 216, 0.6);
}
.site-footer ul a:hover {
  color: var(--gold-bright);
}
.site-footer .muted {
  color: rgba(244, 233, 216, 0.35);
}
.footer-bottom {
  margin: 3rem auto 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 72rem;
  border-top: 1px solid rgba(255, 176, 48, 0.1);
  padding-top: 1.5rem;
  font-size: 12px;
  color: rgba(244, 233, 216, 0.35);
}
@media (min-width: 640px) {
  .footer-bottom {
    flex-direction: row;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
