/* ===========================================================
   Game Hub — design system
   Direction : "party comic" — Jackbox × Exploding Kittens × Gartic.
   Crème chaud, contours encre arrondis, palette festive multicolore,
   typo grasse (Bricolage Grotesque) + doodles manuscrits.
   =========================================================== */

:root {
  --cream: #fcefd6;
  --cream-2: #f8e3bd;
  --surface: #fffdf6;
  --ink: #201d16;
  --ink-2: #6f6858;

  /* palette festive */
  --tomato: #ff5a4d;
  --sun: #ffc133;
  --grass: #2fc06b;
  --sky: #38a8ef;
  --grape: #8a5cff;
  --bubble: #ff77bd;

  --accent: var(--tomato);

  /* alias hérités → chaque écran d'un jeu peut piocher une couleur festive */
  --coral: var(--tomato);
  --mint: var(--grass);
  --cobalt: var(--sky);
  --lime: var(--grass);
  --yellow: var(--sun);
  --pink: var(--bubble);

  --radius: 22px;
  --radius-sm: 15px;

  /* ombre douce + léger halo coloré, jamais dure/arcade */
  --sh: 0 10px 22px -12px rgba(32, 29, 22, 0.5);
  --sh-sm: 0 6px 14px -8px rgba(32, 29, 22, 0.45);
  --bord: 2.5px solid var(--ink);

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* évite le délai/zoom double-tap sur mobile → taps fiables */
button,
.btn,
.step,
.vote-chip,
.pick-card,
.game-card,
.back {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--cream);
  /* semis d'étoiles/points très léger = texture festive faite main */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140' viewBox='0 0 140 140'%3E%3Cg fill='%23201d16' fill-opacity='0.045'%3E%3Ccircle cx='20' cy='30' r='2.5'/%3E%3Cpath d='M104 18l2.2 5.6 5.8.3-4.5 3.7 1.5 5.7-5-3.2-5 3.2 1.5-5.7-4.5-3.7 5.8-.3z'/%3E%3Ccircle cx='125' cy='96' r='2.5'/%3E%3Cpath d='M44 104l1.8 4.6 4.9.2-3.8 3.1 1.3 4.8-4.2-2.7-4.2 2.7 1.3-4.8-3.8-3.1 4.9-.2z'/%3E%3C/g%3E%3C/svg%3E");
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

.wrap {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 26px 20px calc(44px + env(safe-area-inset-bottom));
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--ink);
}

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

.muted {
  color: var(--ink-2);
}
.faint {
  color: var(--ink-2);
  opacity: 0.75;
}

/* ---------- Étiquettes ---------- */
.tag,
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 12.5px;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--ink);
  border-radius: 999px;
  padding: 3px 10px;
}

/* ---------- Boutons ---------- */
.btn {
  appearance: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--ink);
  border: var(--bord);
  border-radius: var(--radius-sm);
  padding: 15px 20px;
  width: 100%;
  box-shadow: var(--sh);
  transition: transform 0.1s ease, box-shadow 0.15s ease, filter 0.15s;
}
.btn:hover {
  transform: translateY(-1px) rotate(-0.4deg);
}
.btn:active {
  transform: translateY(2px);
  box-shadow: var(--sh-sm);
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.btn.accent {
  background: var(--btn-accent, var(--accent));
  color: var(--ink);
}
.btn.secondary {
  background: var(--surface);
  color: var(--ink);
}
.btn.danger {
  background: var(--tomato);
  color: var(--ink);
}
.btn.ghost {
  background: transparent;
  color: var(--ink-2);
  border: 2px solid var(--ink);
  box-shadow: none;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 14px;
}
.btn.ghost:hover {
  transform: none;
  background: var(--surface);
}
.btn.small {
  width: auto;
  padding: 10px 16px;
  font-size: 15px;
}

.btn-row {
  display: flex;
  gap: 12px;
}
.btn-row .btn {
  width: auto;
  flex: 1;
}

/* ---------- Champs ---------- */
input[type="text"],
input[type="number"] {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: var(--bord);
  border-radius: var(--radius-sm);
  padding: 12px 15px;
  outline: none;
  transition: transform 0.12s, box-shadow 0.15s;
}
input::placeholder {
  color: var(--ink-2);
  opacity: 0.6;
  font-weight: 500;
}
input:focus {
  transform: translateY(-1px);
  box-shadow: var(--sh-sm);
}

/* ---------- Cartes ---------- */
.card {
  background: var(--surface);
  border: var(--bord);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--sh);
}

/* ---------- Barre du haut ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}
.topbar .back {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: none;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  color: var(--ink);
  background: var(--sun);
  border: var(--bord);
  border-radius: 50%;
  box-shadow: var(--sh-sm);
  transform: rotate(-4deg);
  transition: transform 0.12s;
}
.topbar .back:hover {
  transform: rotate(-4deg) scale(1.05);
}
.topbar .back:active {
  transform: rotate(-4deg) scale(0.92);
}

/* ---------- Utilitaires ---------- */
.stack > * + * {
  margin-top: 15px;
}
.center {
  text-align: center;
}
.hidden {
  display: none !important;
}

@keyframes pop-in {
  0% { transform: scale(0.9) translateY(8px); opacity: 0; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.pop {
  animation: pop-in 0.34s cubic-bezier(0.34, 1.56, 0.5, 1) both;
}

/* ---------- Doodles manuscrits ---------- */
.doodle-underline {
  display: block;
  width: 190px;
  max-width: 70%;
  height: 16px;
  margin-top: 4px;
  color: var(--tomato);
}
.sticker {
  display: inline-block;
  transform: rotate(-3deg);
}

/* ===========================================================
   Hub
   =========================================================== */
.hub-head {
  margin-bottom: 26px;
}
.hub-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--ink);
  background: var(--grass);
  border: var(--bord);
  border-radius: 999px;
  padding: 5px 13px;
  box-shadow: var(--sh-sm);
  transform: rotate(-2deg);
}
.hub-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(52px, 17vw, 76px);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 16px 0 6px;
}
.hub-title .out {
  color: var(--tomato);
  display: inline-block;
  transform: rotate(-2deg);
}
.hub-sub {
  font-family: var(--font-body);
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink-2);
  max-width: 32ch;
  margin: 14px 0 0;
}

.game-card {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--surface);
  border: var(--bord);
  border-radius: var(--radius);
  padding: 15px;
  box-shadow: var(--sh);
  transition: transform 0.14s cubic-bezier(0.34, 1.56, 0.5, 1), box-shadow 0.2s;
}
.game-card:hover {
  transform: translateY(-3px) rotate(-0.5deg);
  box-shadow: 0 16px 30px -14px rgba(32, 29, 22, 0.55);
}
.game-card:active {
  transform: translateY(0) scale(0.99);
}
.game-card.soon {
  opacity: 0.6;
}
.game-emoji {
  width: 62px;
  height: 62px;
  flex: none;
  display: grid;
  place-items: center;
  font-size: 30px;
  border-radius: 18px;
  background: var(--card-accent, var(--tomato));
  border: var(--bord);
  transform: rotate(-4deg);
}
.game-body {
  flex: 1;
  min-width: 0;
}
.game-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.game-title-row h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
}
.game-body p {
  margin: 2px 0 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.game-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
  color: var(--ink-2);
}
.game-meta .modes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.game-go {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  color: var(--ink);
  background: var(--card-accent, var(--tomato));
  border: var(--bord);
  border-radius: 50%;
}
