/* ------------------------------------------------------------------ bases */

@font-face {
  font-family: 'Quicksand';
  src: url('../fonts/quicksand.woff2') format('woff2');
  font-weight: 300 700;
  font-display: swap;
}

@font-face {
  font-family: 'Caveat';
  src: url('../fonts/caveat.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --plum: #4b2545;
  --plum-soft: #84607a;
  --pink: #ff6f96;
  --pink-pale: #ffe3ea;
  --peach: #ff9a7b;
  --cream: #fff8f4;
  --line: #f0dde3;
  --danger: #d6455d;
  --ok: #2f9e6f;
  --shadow: 0 14px 40px rgba(75, 37, 69, 0.2);
  --gradient: linear-gradient(135deg, var(--pink), var(--peach));
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: 'Quicksand', ui-rounded, 'Segoe UI', system-ui, sans-serif;
  font-weight: 500;
  color: var(--plum);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

[hidden] {
  display: none !important;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.screen {
  min-height: 100vh;
  min-height: 100dvh; /* hauteur réelle sur téléphone, barre d'adresse comprise */
}

.muted {
  color: var(--plum-soft);
}

.small {
  font-size: 0.85rem;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.row.end {
  justify-content: flex-end;
}

/* ------------------------------------------------------------------ boutons et champs */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border: 2px solid transparent;
  border-radius: 999px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
}

.btn.primary {
  background: var(--gradient);
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 111, 150, 0.35);
}

.btn.ghost {
  background: #fff;
  border-color: var(--line);
}

.btn.ghost:hover {
  border-color: #e3c3cf;
}

.btn.danger {
  color: var(--danger);
}

.btn.dashed {
  width: 100%;
  padding: 14px;
  background: transparent;
  border: 2px dashed #e6c4d0;
  color: var(--plum-soft);
}

.btn.link {
  padding: 4px 8px;
  background: none;
  color: var(--plum-soft);
  text-decoration: underline;
  font-weight: 600;
}

.btn.big {
  width: 100%;
  padding: 14px 22px;
  font-size: 1.05rem;
}

.btn.small {
  padding: 6px 13px;
  font-size: 0.87rem;
}

.icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #f8ecef;
  color: var(--plum-soft);
  font-weight: 700;
  cursor: pointer;
}

.icon-btn:hover:not(:disabled) {
  background: #f1dbe2;
  color: var(--plum);
}

.icon-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.field {
  display: grid;
  gap: 6px;
}

.field > span {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--plum-soft);
}

input[type='text'],
input[type='password'],
input[type='time'],
textarea,
select {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 1rem; /* 16 px : en dessous, iOS zoome sur le champ */
  font-weight: 600;
  outline: none;
  transition: border-color 0.12s;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--pink);
}

textarea {
  resize: vertical;
  line-height: 1.4;
}

.form-error {
  color: var(--danger);
  font-weight: 700;
  font-size: 0.9rem;
}

.notice {
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff4dc;
  color: #7a5310;
  font-weight: 600;
  font-size: 0.9rem;
}

/* ------------------------------------------------------------------ écrans « coucher de soleil » (chargement, connexion) */

.sunset {
  position: relative;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 45% at 50% 104%, rgba(255, 240, 200, 0.95), transparent 70%),
    linear-gradient(180deg, #4d4690 0%, #8f69b8 26%, #ec7d9e 58%, #fda289 82%, #fbc49c 100%);
}

.hearts-bg {
  position: absolute;
  inset: -10%;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 22%, rgba(255, 255, 255, 0.28) 0 1.6%, transparent 2%),
    radial-gradient(circle at 82% 14%, rgba(255, 255, 255, 0.2) 0 1.1%, transparent 1.5%),
    radial-gradient(circle at 68% 40%, rgba(255, 255, 255, 0.16) 0 2.4%, transparent 2.9%),
    radial-gradient(circle at 28% 62%, rgba(255, 255, 255, 0.18) 0 1.3%, transparent 1.7%),
    radial-gradient(circle at 90% 70%, rgba(255, 255, 255, 0.22) 0 1.8%, transparent 2.2%),
    radial-gradient(circle at 8% 84%, rgba(255, 255, 255, 0.2) 0 2.2%, transparent 2.7%),
    radial-gradient(circle at 48% 10%, rgba(255, 255, 255, 0.14) 0 0.9%, transparent 1.3%);
  animation: drift 18s ease-in-out infinite alternate;
}

@keyframes drift {
  to {
    transform: translate3d(2.5%, -3%, 0);
  }
}

.card {
  position: relative;
  width: min(100%, 380px);
  padding: 30px 26px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.93);
  box-shadow: var(--shadow);
}

.login-card {
  display: grid;
  gap: 14px;
  text-align: center;
}

.login-card .field {
  text-align: left;
}

.login-card h1 {
  font-family: 'Caveat', cursive;
  font-size: 2.6rem;
  line-height: 1;
}

.login-emoji {
  font-size: 2.8rem;
  line-height: 1;
}

.loader {
  font-size: 3rem;
  animation: beat 0.9s ease-in-out infinite;
}

@keyframes beat {
  50% {
    transform: scale(1.25);
  }
}

/* ------------------------------------------------------------------ messages éphémères */

#toasts {
  position: fixed;
  top: 14px;
  left: 50%;
  z-index: 100;
  width: min(92vw, 420px);
  display: grid;
  gap: 8px;
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border-radius: 16px;
  background: var(--plum);
  color: #fff;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s, transform 0.25s;
}

.toast.show {
  opacity: 1;
  transform: none;
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--ok);
}

.toast.love {
  background: var(--gradient);
}

/* ------------------------------------------------------------------ espace créateur */

.creator {
  padding-bottom: 110px;
}

.c-header {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(255, 248, 244, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.c-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.15rem;
}

.c-main {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px;
  display: grid;
  gap: 16px;
}

.status-card {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
}

.status-card.done {
  border-color: #ffc4d5;
  background: linear-gradient(135deg, #fff0f4, #fff5ea);
}

.status-card.fresh {
  box-shadow: 0 0 0 4px rgba(255, 111, 150, 0.22);
}

.status-icon {
  font-size: 2.1rem;
  line-height: 1;
}

.status-text h2 {
  font-size: 1.12rem;
}

.status-text p {
  margin-top: 3px;
  color: var(--plum-soft);
  font-size: 0.93rem;
}

.badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gradient);
  color: #fff;
  font-size: 0.72rem;
  vertical-align: middle;
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #f7e8ec;
}

.tabs button {
  flex: 1;
  padding: 9px 4px;
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--plum-soft);
  font-weight: 700;
  cursor: pointer;
}

.tabs button.active {
  background: #fff;
  color: var(--plum);
  box-shadow: 0 1px 5px rgba(75, 37, 69, 0.14);
}

.c-panel,
.answers,
.questions,
.settings {
  display: grid;
  gap: 14px;
}

.empty {
  padding: 28px 16px;
  text-align: center;
  color: var(--plum-soft);
}

.panel-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
}

.q-num {
  flex: none;
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: var(--pink-pale);
  color: var(--pink);
  font-weight: 700;
  font-size: 0.9rem;
}

/* réponses */

.answer-card {
  display: grid;
  gap: 8px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.answer-card.answered {
  border-color: #ffc9d8;
}

.answer-q {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--plum-soft);
  font-weight: 600;
  font-size: 0.93rem;
}

.answer-value {
  padding-left: 38px;
  font-size: 1.3rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.answer-value.text {
  font-family: 'Caveat', cursive;
  font-size: 1.6rem;
  line-height: 1.2;
  white-space: pre-wrap;
}

.answer-value.none {
  font-size: 0.95rem;
  font-weight: 600;
  color: #c9b3bd;
}

.answer-value small {
  font-size: 0.85rem;
  color: var(--plum-soft);
}

.answer-card time {
  padding-left: 38px;
}

/* éditeur de questions */

.q-card,
.set-card {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}

.q-card {
  scroll-margin: 84px 0 110px; /* ne pas finir caché sous l'en-tête ni sous la barre d'enregistrement */
}

.q-card.invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(214, 69, 93, 0.14);
}

.q-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.q-type {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 0.93rem;
}

.q-tools {
  display: flex;
  gap: 4px;
}

.q-title {
  font-size: 1.08rem;
  font-weight: 700;
  resize: none;
  overflow: hidden;
}

.options {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.option-block {
  width: 100%;
  display: grid;
  gap: 6px;
}

.option-row {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
}

.option-row input[type='text'],
.option-row input[type='password'] {
  flex: 1;
  min-width: 0;
}

.option-row input[type='time'] {
  width: 150px;
}

.flee-toggle {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 11px;
  border: 2px solid var(--line);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--plum-soft);
  cursor: pointer;
  user-select: none;
}

.flee-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.flee-toggle:has(input:checked) {
  border-color: var(--pink);
  background: var(--pink-pale);
  color: var(--plum);
}

.flee-toggle:has(input:focus-visible) {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}

.emoji-btn {
  flex: none;
  width: 46px;
  height: 46px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
  font-size: 1.4rem;
  cursor: pointer;
}

.emoji-pop {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  border-radius: 14px;
  background: #fbf0f3;
}

.emoji-pop button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 1.3rem;
  cursor: pointer;
}

.emoji-pop button:hover {
  background: #fff;
}

.emoji-pop input {
  flex: 1 1 140px;
  padding: 6px 10px;
  font-size: 0.9rem;
}

/* mini-calendrier */

.datepick {
  display: grid;
  gap: 10px;
}

.cal {
  width: min(100%, 320px);
  padding: 10px;
  border: 2px solid var(--line);
  border-radius: 18px;
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 8px;
  text-transform: capitalize;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

.dow {
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--plum-soft);
}

.day {
  aspect-ratio: 1;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
}

.day:hover:not(:disabled) {
  background: var(--pink-pale);
}

.day:disabled {
  color: #d9c8cf;
  cursor: default;
}

.day.out {
  visibility: hidden;
}

.day.on {
  background: var(--gradient);
  color: #fff;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px 5px 12px;
  border-radius: 999px;
  background: var(--pink-pale);
  font-size: 0.86rem;
  font-weight: 700;
}

.chip.past {
  background: #f1e9ec;
  color: var(--plum-soft);
  text-decoration: line-through;
}

.chip button {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(75, 37, 69, 0.12);
  font-size: 0.62rem;
  cursor: pointer;
}

/* ajout d'une question */

.add-question {
  display: grid;
  gap: 12px;
}

.type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.type-btn {
  display: grid;
  gap: 3px;
  padding: 14px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.type-btn:hover {
  border-color: var(--pink);
}

.type-icon {
  font-size: 1.5rem;
}

.type-btn small {
  color: var(--plum-soft);
}

/* réglages */

.set-card h3 {
  font-size: 1.05rem;
}

.grid2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--line);
  cursor: pointer;
}

.swatch.on {
  box-shadow: 0 0 0 3px var(--pink);
}

.share {
  display: grid;
  gap: 10px;
}

.share-text {
  margin: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: #fbf0f3;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.save-bar {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 10;
  width: min(calc(100% - 24px), 600px);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px 10px 20px;
  border-radius: 26px;
  background: var(--plum);
  color: #fff;
  font-weight: 700;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
}

.save-bar .btn.ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

/* ------------------------------------------------------------------ jeu */

#screen-game {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #f6b9a4;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
}

.game-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  outline: none;
}

/* étiquettes des réponses, accrochées aux objets de la scène */

.hud-labels {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hud-label {
  position: absolute;
  top: 0;
  left: 0;
  will-change: transform;
}

.pill {
  display: block;
  max-width: 44vw;
  padding: 5px 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 3px 10px rgba(75, 37, 69, 0.24);
  font-weight: 700;
  font-size: 1rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  transform-origin: 50% 100%;
  transition: transform 0.18s, background 0.18s, color 0.18s, opacity 0.3s;
}

.hud-label.wide .pill {
  max-width: 92vw;
}

.hud-label.active .pill {
  background: var(--pink);
  color: #fff;
  transform: scale(1.15);
}

.hud-label.dim .pill {
  opacity: 0.3;
}

/* question, progression, astuce */

.hud {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: max(10px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom));
  pointer-events: none;
}

.hud-top {
  width: 100%;
  display: grid;
  gap: 8px;
  justify-items: center;
}

.hud-bar {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}

.hud-bar > :first-child {
  justify-self: start;
}

.hud-bar > :last-child {
  justify-self: end;
}

.hud-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 3px 10px rgba(75, 37, 69, 0.18);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  pointer-events: auto;
}

.hud-btn.wide {
  padding: 0 16px;
  font-size: 0.9rem;
}

.hud-progress {
  display: flex;
  gap: 5px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
}

.dot {
  color: #ecd3dc;
  font-size: 1rem;
  line-height: 1;
  transition: color 0.3s, transform 0.3s;
}

.dot.current {
  color: #ffb1c6;
  transform: scale(1.3);
}

.dot.done {
  color: var(--pink);
}

.hud-question {
  max-width: min(640px, 100%);
  padding: 12px 22px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 6px 20px rgba(75, 37, 69, 0.2);
  font-weight: 700;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.25;
  text-align: center;
  animation: pop 0.45s cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.92);
  }
}

.hud.quiet .hud-question {
  display: none;
}

.hud.quiet .hud-progress {
  visibility: hidden; /* garde sa place : le bouton du son reste à droite */
}

.hud-hint {
  max-width: 100%;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(75, 37, 69, 0.74);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  text-align: center;
  opacity: 0;
  transition: opacity 0.25s;
}

.hud-hint.show {
  opacity: 1;
}

/* joystick tactile : il apparaît là où le doigt se pose */

.stick {
  position: absolute;
  width: 124px;
  height: 124px;
  margin: -62px 0 0 -62px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.15s;
}

.stick.on {
  opacity: 1;
}

.knob {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 3px 10px rgba(75, 37, 69, 0.25);
  transform: translate(-50%, -50%);
}

/* cartes par-dessus la scène : accueil, petit mot, fin */

.game-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  padding: 14px;
  overflow: auto;
  touch-action: pan-y;
}

.game-overlay.side {
  align-items: flex-end;
  justify-content: center;
}

.game-overlay.center {
  align-items: center;
  justify-content: center;
  background: rgba(75, 37, 69, 0.38);
}

@media (min-aspect-ratio: 1/1) {
  .game-overlay.side {
    align-items: center;
    justify-content: flex-end;
    padding-right: clamp(14px, 7vw, 130px);
  }
}

.g-card {
  position: relative;
  width: min(100%, 410px);
  max-height: 100%;
  display: grid;
  gap: 12px;
  padding: 22px;
  overflow: auto;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  user-select: text;
  -webkit-user-select: text;
  animation: rise 0.5s cubic-bezier(0.2, 1.2, 0.4, 1);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
}

.g-card h2 {
  font-size: 1.5rem;
}

.g-card h3 {
  padding-right: 34px;
  font-size: 1.15rem;
}

.handwritten {
  font-family: 'Caveat', cursive;
  font-size: 1.55rem;
  line-height: 1.2;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.signature {
  display: block;
  margin-top: 4px;
  text-align: right;
  color: var(--pink);
}

.preview-note {
  justify-self: start;
  padding: 3px 12px;
  border-radius: 999px;
  background: #fff4dc;
  color: #7a5310;
  font-size: 0.8rem;
  font-weight: 700;
}

.look {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fdf1f4;
}

.look-title {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--plum-soft);
}

.look-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.look-row > span {
  width: 68px;
  font-size: 0.9rem;
  font-weight: 700;
}

.look .swatch {
  width: 30px;
  height: 30px;
}

.controls-tip {
  font-size: 0.82rem;
  color: var(--plum-soft);
  text-align: center;
}

.g-card .close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f8ecef;
  font-weight: 700;
  cursor: pointer;
}

.recap {
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  list-style: none;
}

.recap li {
  display: grid;
  gap: 1px;
  padding: 8px 14px;
  border-radius: 14px;
  background: #fdf1f4;
}

.recap span {
  font-size: 0.8rem;
  color: var(--plum-soft);
}

.recap strong {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.send-status {
  font-weight: 700;
  text-align: center;
}

.g-card.final .btn {
  justify-self: center;
}

/* fondu entre deux questions */

.game-fade {
  position: absolute;
  inset: 0;
  background: #ffe3ea;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.38s ease;
}

.game-fade.on {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 520px) {
  .c-header .btn {
    padding: 8px 13px;
    font-size: 0.9rem;
  }

  .tabs button {
    font-size: 0.9rem;
  }

  .hud-question {
    padding: 10px 16px;
  }

  .hud-hint {
    font-size: 0.84rem;
  }

  .g-card {
    gap: 10px;
    padding: 18px;
  }

  .g-card h2 {
    font-size: 1.35rem;
  }

  .handwritten {
    font-size: 1.4rem;
  }

  .look .swatch {
    width: 26px;
    height: 26px;
  }

  .look .swatches {
    gap: 6px;
  }

  .look-row > span {
    width: 62px;
  }
}

/* En portrait, la carte d'accueil ou de fin reste dans la moitié basse : le personnage reste visible au-dessus. */
@media (max-aspect-ratio: 1/1) {
  .game-overlay.side .g-card {
    max-height: 60%;
  }
}

/* Téléphone tenu à l'horizontale : peu de hauteur, tout doit rester visible sans faire défiler. */
@media (max-height: 480px) {
  /* La question monte dans la barre du haut, entre les deux boutons : elle ne cache plus les réponses du fond. */
  .hud-top {
    position: relative;
  }

  .hud-progress {
    visibility: hidden;
  }

  .hud-question {
    position: absolute;
    top: 0;
    left: 116px;
    right: 116px;
    width: fit-content;
    max-width: none;
    margin: 0 auto;
    padding: 8px 16px;
    font-size: 1rem;
  }

  .hud-hint {
    padding: 6px 14px;
    font-size: 0.8rem;
  }

  .g-card {
    width: min(100%, 440px);
    gap: 8px;
    padding: 14px 16px;
  }

  .g-card h2 {
    font-size: 1.15rem;
  }

  .handwritten {
    font-size: 1.2rem;
    line-height: 1.15;
  }

  .look {
    gap: 6px;
    padding: 8px 12px;
  }

  .look .swatch {
    width: 24px;
    height: 24px;
  }

  .btn.big {
    padding: 10px 18px;
    font-size: 1rem;
  }

  .controls-tip {
    display: none;
  }

  .recap li {
    padding: 5px 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hearts-bg,
  .loader,
  .hud-question,
  .g-card {
    animation: none;
  }
}
