@import url("ds-couleurs.css");   /* jetons de couleur partagés, cf. ce fichier */
/* home-deck.css — Accueil « Nuit » (mutualisé WebContent ↔ web-preview).
   Tuiles de jeu en cartes prune à liseré de couleur, aperçu du jeu à la
   place de l'icône ronde ; pastilles sous le titre. Balisage : home-deck.js.
   Chargé APRÈS le <style> de index.html, landscape.css et seasonal-themes.css.
   Maquette validée le 27/10/2026. */

/* ── Tuile ──────────────────────────────────────────────────────────── */
.game-type-btn.gt-night {
  --c: var(--gt-c, #ff70c7);
  --c-lum: color-mix(in srgb, var(--c) 62%, #fff);
  background: linear-gradient(160deg, var(--surface-raised,#4c1b47), var(--surface-deep,#2a0a28));
  border: 0;
  border-radius: 16px;
  box-shadow:
    0 0 0 1.2px color-mix(in srgb, var(--c) 65%, transparent),
    0 0 22px color-mix(in srgb, var(--c) 24%, transparent),
    0 12px 26px rgba(0, 0, 0, .5);
  gap: .3rem;
}
.game-type-btn.gt-night:hover {
  box-shadow:
    0 0 0 1.5px color-mix(in srgb, var(--c) 80%, transparent),
    0 0 30px color-mix(in srgb, var(--c) 38%, transparent),
    0 14px 30px rgba(0, 0, 0, .55);
}
/* Saison : le liseré prend une part de la couleur du thème (--pink est
   l'accent de l'ambiance saisonnière), chaque jeu reste reconnaissable. */
body.theme-seasonal .game-type-btn.gt-night { --c: color-mix(in srgb, var(--gt-c, #ff70c7) 62%, var(--pink, #ff70c7)); }

.game-type-btn.gt-night > .hd-frame {
  position: absolute; inset: 6px; border-radius: 11px; pointer-events: none; z-index: 0;
  border: 1px solid color-mix(in srgb, var(--c) 55%, transparent);
}
.game-type-btn.gt-night > .gt-icon { display: none; }
.game-type-btn.gt-night > *:not(.hd-frame):not(.seasonal-group-wreath):not(.seasonal-cap):not(.seasonal-corner):not(.gt-badge) { position: relative; z-index: 1; }
.game-type-btn.gt-night .gt-label { font-family: 'Playfair Display', Georgia, serif; font-weight: 700; font-size: 1rem; color: #fbeff4; text-wrap: balance; }  /* passe à la ligne s'il le faut : « Willekeurige dobbelstenen » (NL) était coupé des deux côtés */
.game-type-btn.gt-night .gt-desc { color: rgba(240, 220, 232, .72); opacity: 1; }
.game-type-btn.gt-night .gt-badge {
  background: color-mix(in srgb, var(--c) 85%, #000 0%); box-shadow: 0 3px 10px color-mix(in srgb, var(--c) 45%, transparent);
}

/* ── Aperçus ────────────────────────────────────────────────────────── */
.hd-art {
  width: 100%; height: 50px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: var(--c-lum);
}
.hd-art svg { display: block; }
/* Dés */
.hd-cube {
  width: 36px; height: 36px; margin: 0 2px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--surface-high,#6a2058), var(--surface-mid,#3a0f31));
  box-shadow: 0 0 0 1.2px #ff5fa8, 0 6px 10px rgba(0, 0, 0, .5);
  color: #ffc2dc; transform: rotate(var(--r));
}
.hd-cube svg { width: 19px; height: 19px; }
/* Progressif */
.hd-bars { display: flex; align-items: flex-end; gap: 6px; height: 46px; }
.hd-bar {
  width: 14px; border-radius: 4px 4px 2px 2px;
  background: linear-gradient(180deg, #ffd27a, #ff7a2e 55%, #7a2058);
  box-shadow: 0 0 calc(4px + var(--i) * 3px) rgba(255, 140, 60, calc(.3 + var(--i) * .15));
}
/* Cartes */
.hd-fan { position: relative; width: 96px; height: 50px; }
.hd-mini {
  position: absolute; top: 2px; width: 30px; height: 42px; border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--surface-high,#5a2054), var(--surface-deep,#2a0a28));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 75%, transparent), 0 4px 8px rgba(0, 0, 0, .5);
  color: color-mix(in srgb, var(--c) 60%, #fff);
  transform: rotate(var(--r)); transform-origin: 50% 150%;
}
.hd-mini:nth-child(1) { left: 6px; } .hd-mini:nth-child(2) { left: 24px; }
.hd-mini:nth-child(3) { left: 42px; } .hd-mini:nth-child(4) { left: 60px; }
.hd-mini svg { width: 14px; height: 14px; }
/* Action ou Vérité */
.hd-back {
  position: relative; width: 36px; height: 50px; margin: 0 3px; border-radius: 6px; overflow: hidden;
  background: var(--surface-deep,#2b0c27); transform: rotate(var(--r));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--c) 70%, transparent), 0 6px 10px rgba(0, 0, 0, .5);
}
.hd-back i {
  position: absolute; inset: 3px; border-radius: 4px; border: 1px solid #c9a35a;
  background: repeating-linear-gradient(45deg, rgba(201,163,90,.22) 0 1px, transparent 1px 5px),
              repeating-linear-gradient(-45deg, rgba(201,163,90,.22) 0 1px, transparent 1px 5px);
}
.hd-back b {
  position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid color-mix(in srgb, var(--c) 70%, #c9a35a); background: var(--surface-mid,#3a0f31);
  color: color-mix(in srgb, var(--c) 60%, #fff);
}
.hd-back b svg { width: 12px; height: 12px; }
/* Mode Histoire : vignette d'une illustration */
.hd-scene {
  position: relative; display: block; width: min(100%, 120px); height: 50px; border-radius: 8px; overflow: hidden;
  box-shadow: 0 0 0 1px rgba(201, 163, 90, .6), 0 6px 12px rgba(0, 0, 0, .45);
}
.hd-scene svg { width: 100%; height: 100%; }
.hd-scene--repli { background: linear-gradient(180deg, #1b1450, #5b2a6e 60%, #e0708a); }
.hd-scene--repli i { position: absolute; bottom: 0; background: #160d30; }
.hd-scene--repli .b1 { left: 12%; width: 22%; height: 55%; }
.hd-scene--repli .b2 { left: 38%; width: 16%; height: 72%; background: #1d1238; }
.hd-scene--repli .b3 { left: 60%; width: 26%; height: 46%; }
.hd-scene--repli .lune { left: auto; right: 12%; top: 12%; bottom: auto; width: 12px; height: 12px; border-radius: 50%; background: #ffe6b0; box-shadow: 0 0 10px #ffd27a; }
/* Défi du jour : date et semaine en braises */
.hd-date { display: flex; flex-direction: column; align-items: center; line-height: 1; color: #ffb27a; }
.hd-date b { font: 800 1.5rem 'Playfair Display', Georgia, serif; }
.hd-date small { margin: 2px 0 6px; font: 800 .5rem Inter, system-ui, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.hd-week { display: flex; gap: 3px; }
.hd-ember { display: inline-block; width: 8px; height: 11px; border-radius: 50% 50% 45% 45%; background: rgba(255,255,255,.14); }
.hd-ember.on { background: radial-gradient(circle at 50% 70%, #ffd27a, #ff7a2e 55%, #a8300f); box-shadow: 0 0 7px rgba(255,140,60,.8); }
/* La tuile Défi porte aussi le rappel : aperçu un peu plus bas */
.game-type-btn.gt-night[data-game="defi"] .hd-art { height: 50px; }
.game-type-btn.gt-night[data-game="defi"] .gt-desc { display: none; }   /* la date et la semaine disent déjà « chaque jour » */

/* ── Pastilles sous le titre ────────────────────────────────────────── */
.hd-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: .2rem auto .35rem; max-width: 520px; }
.hd-pills[hidden] { display: none; }
.hd-pill {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px; border-radius: 999px;
  font: 700 .64rem Inter, system-ui, sans-serif; color: #ffd2a8; white-space: nowrap;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.12);
}
.hd-pill--dernier { color: #f3e3ee; }
button.hd-pill { position: relative; cursor: pointer; -webkit-tap-highlight-color: transparent; }
/* Pastille basse : zone de toucher agrandie en hauteur, sans empiéter sur sa voisine. */
button.hd-pill::after { content: ''; position: absolute; left: 0; right: 0; top: -10px; bottom: -10px; }
button.hd-pill:active { transform: scale(.96); }
.hd-pill--saison { color: var(--text, #fff); border-color: color-mix(in srgb, var(--pink, #ff70c7) 55%, transparent); background: color-mix(in srgb, var(--pink, #ff70c7) 14%, transparent); }

/* Téléphone en portrait : l'accueil tient sans défiler, comme avant */
@media (max-width: 699px) {
  #stepGames .game-type-row { grid-auto-rows: minmax(140px, auto) !important; }
  .game-type-btn.gt-night { min-height: 140px; padding: .75rem .6rem; gap: .22rem; }
  .game-type-btn.gt-night .gt-desc { font-size: .72rem; }
  #stepGames .games-welcome { margin-bottom: 0; }
  #stepGames .games-title { margin-top: .35rem; }
}
/* Grand écran (iPad, Mac, web) : tuiles plus grandes, aperçus agrandis */
@media (min-width: 700px) {
  .game-type-btn.gt-night .hd-art { height: 76px; transform: scale(1.4); margin: 8px 0 10px; }
  .game-type-btn.gt-night .gt-label { font-size: 1.15rem; }
  /* Défi : date + semaine sur deux lignes, déjà hautes — agrandies moins */
  .game-type-btn.gt-night[data-game="defi"] .hd-art { height: 64px; transform: scale(1.15); margin: 4px 0 6px; }
}
/* Saison : la guirlande tendue d'un coin à l'autre passe DERRIÈRE l'aperçu
   (z-index 0, l'aperçu est à 1) au lieu de le barrer. */
body.theme-seasonal .game-type-btn.gt-night > .seasonal-group-wreath { z-index: 0; }

/* ── Étape « Qui joue ce soir ? » : cartes-prénoms ─────────────────────
   Balisage : home-deck.js (habilleJoueurs). Les !important ne visent que les
   tailles que landscape.css impose aux .gender-btn (ronds de 70 px).
   Finition « premium » des fenêtres (ds-couleurs.css, jetons --fen-*) : matière
   des dés (dégradé « Nuit »), liseré métallique, or du thème. La couleur du
   joueur (--pc, rose / orange) ne garde que ce qui l'identifie : initiale,
   index, trait sous le prénom, Il / Elle choisi, et un halo discret. */
#stepPlayers .player-card.pd-night {
  --pc: var(--accent-light,#ff70c7);
  position: relative; min-height: 196px; padding: 16px 14px 14px; gap: 10px;
  justify-content: flex-end; align-items: stretch;
  border: 1.6px solid transparent; border-radius: 16px; backdrop-filter: none; -webkit-backdrop-filter: none;
  background:
    radial-gradient(120% 45% at 50% 0%, color-mix(in srgb, var(--fen-or-hi, #fff4dc) 8%, transparent), transparent 70%) padding-box,
    linear-gradient(160deg, var(--night-top, #3d1236), var(--night-mid, #220920) 55%, var(--night-deep, #14040f)) padding-box,
    linear-gradient(135deg, var(--fen-metal-hi, #f8e4b4), var(--fen-metal-lo, #8e5e2a) 45%, var(--fen-metal-hi, #f8e4b4) 70%, var(--fen-metal-lo, #8e5e2a)) border-box;
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .12),
              0 0 22px color-mix(in srgb, var(--pc) 18%, transparent),
              0 14px 26px rgba(0, 0, 0, .5);
  rotate: -3deg;
}
#stepPlayers .players-row .player-card.pd-night:last-child { rotate: 3deg; }
#stepPlayers .player-card.pd-night:focus-within {
  box-shadow: inset 0 1.5px 0 rgba(255, 255, 255, .12), 0 0 30px color-mix(in srgb, var(--pc) 42%, transparent), 0 14px 26px rgba(0, 0, 0, .5);
}
.pd-frame { position: absolute; inset: 6px; border-radius: 11px; border: 1px solid color-mix(in srgb, var(--fen-or, #f3d08c) 28%, transparent); pointer-events: none; }
.pd-ix { position: absolute; left: 13px; top: 10px; font: 800 .72rem 'Playfair Display', Georgia, serif; color: color-mix(in srgb, var(--pc) 60%, #fff); }
.pd-mono {
  flex: 1; display: flex; align-items: center; justify-content: center; min-height: 64px;
  font: 700 3.2rem/1 'Playfair Display', Georgia, serif;
  color: color-mix(in srgb, var(--pc) 55%, #fff);
  text-shadow: 0 0 18px color-mix(in srgb, var(--pc) 60%, transparent);
  animation: pdMono .35s cubic-bezier(.34, 1.56, .64, 1);
}
.pd-mono.is-empty { color: rgba(255, 255, 255, .12); text-shadow: none; font-style: italic; }
@keyframes pdMono { from { transform: scale(.7); opacity: .3; } to { transform: none; opacity: 1; } }
#stepPlayers .player-card.pd-night .name-input {
  position: relative; z-index: 1; padding: 4px 6px 6px; text-align: center;
  background: none; border: 0; border-radius: 0; box-shadow: none; backdrop-filter: none;
  border-bottom: 1px solid color-mix(in srgb, var(--pc) 60%, transparent);
  font-size: 16px; font-weight: 600; color: #fff;
}
/* Prénom écrit à la main (poseEncre, home-deck.js) : la copie et le champ ont
   exactement la même typographie, sans crénage ni ligature, pour que le curseur
   tombe au bout de la dernière lettre. Snell Roundhand : repli système sur iOS. */
.pd-name { --pd-taille: 30px; position: relative; display: block; width: 100%; }
.pd-ink, #stepPlayers .player-card.pd-night .name-input {
  font-family: 'Dancing Script', 'Snell Roundhand', 'Brush Script MT', cursive !important;
  font-size: var(--pd-taille) !important; font-weight: 600; line-height: 42px !important;
  font-kerning: none; font-variant-ligatures: none; font-feature-settings: "kern" 0, "liga" 0, "calt" 0; letter-spacing: 0;
}
#stepPlayers .player-card.pd-night .name-input {
  display: block; width: 100%; height: 52px; box-sizing: border-box; padding: 4px 6px 6px !important;
  color: transparent; caret-color: var(--pc); -webkit-text-fill-color: transparent;
}
.pd-ink {
  position: absolute; inset: 0; z-index: 0; box-sizing: border-box; padding: 4px 6px 6px;
  white-space: pre; text-align: center; color: #fff; pointer-events: none; transform-origin: 6px 50%;
}
.pd-ink span { display: inline-block; }
.pd-ink .pd-l { animation: pdEcrit .32s ease-out both; }
@keyframes pdEcrit {
  0% { clip-path: inset(-40% 100% -40% -40%); transform: translateY(1px); color: var(--fen-or-hi, #fff4dc); }
  70% { color: var(--fen-or, #f3d08c); }
  100% { clip-path: inset(-40% -40% -40% -40%); transform: none; color: #fff; }
}
@media (prefers-reduced-motion: reduce) { .pd-ink .pd-l { animation: none; } }
#stepPlayers .player-card.pd-night .name-input:focus { border-bottom: 1.5px solid var(--pc); box-shadow: 0 8px 12px -10px var(--pc); }
#stepPlayers .player-card.pd-night .name-input::placeholder { color: rgba(232, 210, 230, .38); -webkit-text-fill-color: rgba(232, 210, 230, .38); font: 500 16px/42px Inter, system-ui, sans-serif; }
#stepPlayers .player-card.pd-night .gender-row {
  position: relative; z-index: 1; display: flex; gap: 0; padding: 2px; border-radius: 999px;
  background: rgba(0, 0, 0, .28); border: 1px solid rgba(255, 255, 255, .1);
}
#stepPlayers .player-card.pd-night .gender-btn {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
  width: auto !important; height: 30px !important; padding: 0 !important;
  font: 700 .74rem/1 Inter, system-ui, sans-serif !important; line-height: 1 !important;
  border: 0; border-radius: 999px; background: none; color: rgba(232, 210, 230, .55);
  box-shadow: none; transform: none !important; animation: none !important;
}
#stepPlayers .player-card.pd-night .gender-btn.selected {
  background: color-mix(in srgb, var(--pc) 70%, var(--surface-deep,#2a0a28)); color: #fff;
  box-shadow: 0 0 10px color-mix(in srgb, var(--pc) 50%, transparent);
}
#stepPlayers .player-card.pd-night .pd-g-sym { width: 13px; height: 13px; flex: 0 0 auto; }
#stepPlayers .players-amp.pd-amp {
  position: relative; z-index: 2; align-self: center; flex: 0 0 auto; margin: 0 -14px;
  width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: italic 700 1.15rem 'Playfair Display', Georgia, serif; opacity: 1;
  border: 1.4px solid transparent;
  background:
    linear-gradient(160deg, var(--night-top, #3d1236), var(--night-deep, #14040f)) padding-box,
    linear-gradient(135deg, var(--fen-metal-hi, #f8e4b4), var(--fen-metal-lo, #8e5e2a) 50%, var(--fen-metal-hi, #f8e4b4)) border-box;
  -webkit-background-clip: padding-box, border-box; background-clip: padding-box, border-box;
  color: var(--fen-or, #f3d08c); -webkit-text-fill-color: var(--fen-or, #f3d08c);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14), 0 0 14px color-mix(in srgb, var(--fen-or, #f3d08c) 40%, transparent);
}
.pd-example {
  margin: 16px 2px 0; padding: 10px 14px; border-radius: 12px; text-align: center;
  background: linear-gradient(160deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .015));
  border: 1px solid color-mix(in srgb, var(--fen-or, #f3d08c) 28%, transparent);
  font: italic 600 .9rem/1.45 'Playfair Display', Georgia, serif; color: #f3e3ee;
}
.pd-example small { display: block; margin-bottom: 4px; font: 800 .56rem Inter, system-ui, sans-serif; font-style: normal; letter-spacing: .2em; text-transform: uppercase; color: color-mix(in srgb, var(--fen-or, #f3d08c) 75%, transparent); }
.pd-example b { color: #ff9a4c; font-style: normal; }
.pd-example i { color: var(--accent-light,#ff70c7); font-style: normal; font-weight: 700; }
.pd-example.is-default { opacity: .75; }
@media (prefers-reduced-motion: reduce) { .pd-mono { animation: none; } }

/* Grands écrans en portrait : les trois rangées de jeux remplissent la hauteur,
   au lieu de s'arrêter à mi-écran avec leur taille d'iPhone. */
@media (orientation: portrait) and (min-width: 700px) and (min-height: 900px) {
  html #stepGames:not([hidden]) { --gt-z: 1.2; height: calc(100dvh - 192px) !important; min-height: 0 !important; display: flex !important; flex-direction: column !important; }
  html #stepGames > .section { flex: 1 1 auto !important; display: flex !important; flex-direction: column !important; min-height: 0 !important; }
  html #stepGames .game-type-row { flex: 1 1 auto !important; grid-auto-rows: 1fr !important; gap: 20px !important; min-height: 0 !important; }
  html #stepGames .game-type-btn { justify-content: center !important; }
  html #stepGames .game-type-btn > * { zoom: var(--gt-z); }
  html #gamesWelcome { zoom: calc(var(--gt-z) * .97); margin-bottom: 6px !important; }
}
@media (orientation: portrait) and (min-width: 900px) and (min-height: 1100px) {
  html #stepGames:not([hidden]) { --gt-z: 1.45; }
}
