:root {
  --ink: #535353;
  --bg: #ffffff;
  --muted: #747474;
  /* Largeur de la colonne : c'est elle qui pilote la taille du jeu. */
  --column: 1040px;
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(20px, 4vh, 56px) clamp(16px, 4vw, 48px);
  -webkit-text-size-adjust: 100%;
  transition: background-color 500ms ease, color 500ms ease;
}

/* Night mode: exactement comme Chrome, on inverse toute la page. */
body.inverted {
  background: #000;
  filter: invert(1);
}

[hidden] { display: none !important; }

/* ------------------------------------------------------------------ *
 * Boutons pixel
 * ------------------------------------------------------------------ */

.pixel-btn {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  font: inherit;
  line-height: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.pixel-btn canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.pixel-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.pixel-btn:active { transform: translateY(2px); }

/* ------------------------------------------------------------------ *
 * Jeu
 * ------------------------------------------------------------------ */

.offline {
  width: 100%;
  max-width: var(--column);
  text-align: left;
}

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(8px, 1vw, 14px);
  margin: 0 0 clamp(14px, 1.8vw, 24px);
}

.runner-container {
  margin: 0 0 clamp(14px, 1.8vw, 26px);
  width: 100%;
}

#runner {
  display: block;
  width: 100%;
  height: auto;
  max-width: var(--column);
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  touch-action: manipulation;
  outline: none;
  cursor: pointer;
}

.hint {
  font-size: clamp(13px, 1.25vw, 17px);
  color: #9a9a9a;
  margin: 0;
  line-height: 1.7;
}

.hint b {
  font-weight: 600;
  color: var(--muted);
}

/* ------------------------------------------------------------------ *
 * Panneau de choix du wallet
 * ------------------------------------------------------------------ */

.pw-overlay {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(255, 255, 255, 0.86);
}

.pw-overlay.open { display: flex; }

.pw-panel {
  background: var(--bg);
  border: 3px solid var(--ink);
  padding: clamp(18px, 2.2vw, 28px);
  display: flex;
  flex-direction: column;
  gap: clamp(14px, 1.6vw, 20px);
  max-width: 100%;
  max-height: 100%;
  overflow: auto;
}

.pw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.pw-title, .pw-note, .pw-address {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}

.pw-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pw-address {
  max-width: 100%;
  height: auto;
  margin-bottom: 4px;
}

.pw-note { opacity: 0.9; }

.airdrop-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(10px, 1.4vw, 20px);
  margin: 0 0 clamp(10px, 1.2vw, 16px);
  line-height: 0;
}

.airdrop-line canvas {
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
