@font-face {
  font-family: 'Fredoka';
  src: url('assets/fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Nunito';
  src: url('assets/fonts/nunito-latin.woff2') format('woff2');
  font-weight: 200 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  --cream: #fff7ea;
  --cream-deep: #f6e7d1;
  --paper: #fffaf1;
  --espresso: #3b241d;
  --coffee: #5a3a2e;
  --muted: #7c6053;
  --terracotta: #c95d43;
  --terracotta-dark: #a7442f;
  --terracotta-soft: #f8e3dc;
  --caramel: #eda44a;
  --caramel-dark: #a96917;
  --caramel-soft: #faeed7;
  --sage: #7a9b7e;
  --sage-dark: #4f7357;
  --sage-soft: #e7f0e7;
  --pink: #f1c6bd;
  --chalk: #223f34;
  --gold: #f4c95d;
  --danger: #a93f2c;
  --border: rgba(59, 36, 29, 0.12);
  --shadow-sm: 0 6px 18px rgba(59, 36, 29, 0.08);
  --shadow-md: 0 18px 45px rgba(59, 36, 29, 0.12);
  --shadow-lg: 0 30px 80px rgba(59, 36, 29, 0.2);
  --font-display: 'Fredoka', 'Trebuchet MS', sans-serif;
  --font-body: 'Nunito', 'Segoe UI', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--espresso);
  font-family: var(--font-body);
  background-color: var(--cream);
  background-image:
    radial-gradient(ellipse at 8% -10%, rgba(237, 164, 74, 0.18), transparent 40rem),
    radial-gradient(ellipse at 100% 0%, rgba(201, 93, 67, 0.12), transparent 34rem),
    radial-gradient(ellipse at 50% 110%, rgba(122, 155, 126, 0.15), transparent 40rem);
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.5;
  background-image: radial-gradient(rgba(59, 36, 29, 0.14) 0.7px, transparent 0.7px);
  background-size: 18px 18px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 65%);
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.35), transparent 65%);
}

body.has-modal {
  overflow: hidden;
}

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

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

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

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.05;
}

svg {
  display: block;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid #34708a;
  outline-offset: 3px;
}

#app {
  position: relative;
  z-index: 1;
}

.screen {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 calc(48px + env(safe-area-inset-bottom));
  min-height: 100dvh;
  animation: screen-in 0.35s ease both;
}

.game-screen {
  width: min(860px, calc(100% - 28px));
  padding-top: 16px;
}

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

/* --------------------------------------------------------------------------
   Typographie et boutons
   -------------------------------------------------------------------------- */

.eyebrow {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--terracotta-dark);
}

.lead {
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.65;
  color: var(--coffee);
  max-width: 52ch;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 0.95rem;
  font-weight: 900;
  line-height: 1.1;
  text-decoration: none;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex: none;
}

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

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--espresso);
  color: var(--cream);
  box-shadow: 0 8px 20px rgba(59, 36, 29, 0.18);
}

.btn-primary:hover {
  background: #503028;
  box-shadow: 0 12px 25px rgba(59, 36, 29, 0.22);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.55);
  border-color: var(--border);
  color: var(--espresso);
}

.btn-ghost:hover {
  background: #fff;
  border-color: rgba(59, 36, 29, 0.2);
}

.btn-cream {
  background: var(--cream);
  color: var(--espresso);
}

.btn-cream:hover {
  background: #fff;
}

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

.btn-danger:hover {
  background: #8e3323;
}

.btn-danger-ghost {
  background: transparent;
  border-color: rgba(169, 63, 44, 0.3);
  color: var(--danger);
}

.btn-danger-ghost:hover {
  background: rgba(169, 63, 44, 0.07);
  border-color: rgba(169, 63, 44, 0.5);
}

.btn-lg {
  padding: 15px 24px;
  border-radius: 18px;
  font-size: 1.02rem;
}

.btn-sm {
  padding: 8px 14px;
  font-size: 0.8rem;
}

.btn:disabled,
button:disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.icon-btn {
  width: 44px;
  height: 44px;
  flex: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.62);
  color: var(--espresso);
  display: grid;
  place-items: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

.icon-btn:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Barre supérieure et marque
   -------------------------------------------------------------------------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.topbar-actions {
  display: flex;
  gap: 8px;
  flex: none;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 50%;
  background: var(--espresso);
  color: var(--cream);
  display: grid;
  place-items: center;
  box-shadow: 0 5px 14px rgba(59, 36, 29, 0.17);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-word {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Accueil
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(260px, 0.78fr);
  gap: 20px;
  align-items: center;
  padding: clamp(28px, 5vw, 56px);
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-radius: clamp(26px, 4vw, 40px);
  background: linear-gradient(135deg, #fffaf1 0%, #f9ead4 100%);
  box-shadow: var(--shadow-md);
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 12px;
  background: repeating-linear-gradient(90deg, var(--terracotta) 0 36px, var(--cream) 36px 72px);
  opacity: 0.85;
  z-index: 2;
}

.hero::after {
  content: '';
  position: absolute;
  right: -100px;
  top: -140px;
  z-index: -1;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(237, 164, 74, 0.28), transparent 68%);
}

.hero-copy {
  min-width: 0;
  padding-top: 12px;
}

.hero h1 {
  max-width: 680px;
  margin: 12px 0 18px;
  color: var(--espresso);
  font-size: clamp(2.55rem, 5.2vw, 4.4rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.025em;
}

.hero h1 span {
  position: relative;
  color: var(--terracotta);
  white-space: nowrap;
}

.hero h1 span::after {
  content: '';
  position: absolute;
  z-index: -1;
  left: 1%;
  right: 0;
  bottom: 0.04em;
  height: 0.18em;
  border-radius: 999px;
  background: var(--caramel);
  opacity: 0.55;
  transform: rotate(-1deg);
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.hero-chips span {
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--coffee);
  font-size: 0.74rem;
  font-weight: 800;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 26px;
}

.hero-note {
  color: var(--muted);
  font-size: 0.83rem;
}

.hero-art {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 300px;
}

.hero-art-inner {
  width: min(100%, 380px);
  animation: hero-float 7s ease-in-out infinite;
}

.hero-cup {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 22px 30px rgba(59, 36, 29, 0.13));
}

.hero-cup .steam {
  transform-origin: center;
  animation: steam 3.8s ease-in-out infinite;
}

/* --------------------------------------------------------------------------
   Cartes, sections, profils
   -------------------------------------------------------------------------- */

.card {
  background: var(--paper);
  border: 1.5px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow-sm);
}

.onboarding {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 28px;
  padding: 26px 30px;
}

.onboarding-icon {
  width: 70px;
  height: 70px;
  flex: none;
  border-radius: 50%;
  background: var(--terracotta-soft);
  display: grid;
  place-items: center;
  font-size: 34px;
}

.onboarding-copy {
  flex: 1;
  min-width: 220px;
}

.onboarding h2 {
  margin: 4px 0 8px;
  font-size: clamp(1.6rem, 3vw, 2rem);
}

.onboarding p {
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.section-block {
  margin-top: 44px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 16px;
}

.section-head h2 {
  margin-top: 3px;
  font-size: clamp(1.6rem, 3vw, 2.15rem);
}

.section-head--tight {
  margin-bottom: 12px;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
  gap: 14px;
}

.profile-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 96px;
  padding: 16px;
  text-align: left;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.profile-card:hover {
  transform: translateY(-3px) rotate(-0.2deg);
  border-color: rgba(201, 93, 67, 0.3);
  box-shadow: var(--shadow-md);
}

.profile-card.is-current {
  border-color: rgba(201, 93, 67, 0.5);
  box-shadow: 0 0 0 3px rgba(201, 93, 67, 0.1), var(--shadow-sm);
}

.profile-avatar {
  width: 56px;
  height: 56px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #f9e8d2, #f2ddc1);
  display: grid;
  place-items: center;
  font-size: 31px;
}

.profile-info {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.profile-name {
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.level-pill {
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-dark);
  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-meta {
  color: var(--muted);
  font-size: 0.76rem;
}

.profile-arrow {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--muted);
  transition: transform 0.18s ease, color 0.18s ease;
}

.profile-arrow svg {
  width: 100%;
  height: 100%;
}

.profile-card:hover .profile-arrow {
  color: var(--terracotta);
  transform: translateX(3px);
}

.add-profile {
  justify-content: center;
  gap: 10px;
  border-style: dashed;
  background: rgba(255, 255, 255, 0.35);
  color: var(--coffee);
}

.add-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--cream-deep);
  color: var(--terracotta-dark);
  display: grid;
  place-items: center;
}

.add-icon svg {
  width: 18px;
  height: 18px;
}

.add-label {
  font-size: 0.9rem;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Tableau du café
   -------------------------------------------------------------------------- */

.board {
  position: relative;
  overflow: hidden;
  margin-top: 44px;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  background:
    radial-gradient(circle at 20% 10%, rgba(255, 255, 255, 0.06), transparent 24rem),
    var(--chalk);
  color: var(--cream);
  box-shadow: var(--shadow-md);
}

.board::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  pointer-events: none;
}

.board-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.board .eyebrow {
  color: var(--caramel);
}

.board h2 {
  margin-top: 4px;
  color: var(--cream);
  font-size: clamp(1.7rem, 3vw, 2.2rem);
}

.btn-board {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  color: var(--cream);
}

.btn-board:hover {
  background: rgba(255, 255, 255, 0.18);
}

.board-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.board-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.065);
}

.board-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 3px;
  border-radius: 12px;
  background: rgba(237, 164, 74, 0.15);
  color: var(--caramel);
  display: grid;
  place-items: center;
}

.board-icon svg {
  width: 22px;
  height: 22px;
}

.board-mode {
  color: #fff6e9;
  font-family: var(--font-display);
  font-size: 1.1rem;
}

.board-item strong {
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1.45rem;
  font-weight: 600;
}

.board-player {
  color: rgba(255, 247, 234, 0.65);
  font-size: 0.78rem;
}

.board-empty,
.board-desc {
  color: rgba(255, 247, 234, 0.6);
  font-size: 0.82rem;
  line-height: 1.45;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.77rem;
}

/* --------------------------------------------------------------------------
   Menu et modes
   -------------------------------------------------------------------------- */

.player-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  padding: 20px 24px;
  border: 1.5px solid var(--border);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.player-main {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.player-avatar {
  width: 66px;
  height: 66px;
  flex: none;
  border: 1.5px solid rgba(59, 36, 29, 0.08);
  border-radius: 50%;
  background: linear-gradient(145deg, #f9e8d2, #f2ddc1);
  display: grid;
  place-items: center;
  font-size: 36px;
}

.player-main h1 {
  margin: 2px 0 5px;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  line-height: 1;
}

.player-subtitle {
  color: var(--muted);
  font-size: 0.83rem;
}

.player-tools {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.player-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-selector {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--cream-deep);
}

.level-selector button {
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--coffee);
  font-size: 0.77rem;
  font-weight: 900;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.level-selector button.is-active {
  background: var(--espresso);
  color: var(--cream);
  box-shadow: 0 3px 8px rgba(59, 36, 29, 0.16);
}

.page-heading {
  max-width: 700px;
  margin: 12px 0 26px;
}

.page-heading h1,
.page-heading h2 {
  margin-top: 4px;
  font-size: clamp(2rem, 4vw, 3rem);
}

.page-heading p:not(.eyebrow) {
  margin-top: 10px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
}

.menu-heading {
  max-width: 720px;
  margin-top: 34px;
}

.menu-heading h2 {
  font-size: clamp(1.9rem, 3.5vw, 2.6rem);
}

.menu-heading p:not(.eyebrow) {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.6;
}

.mode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.mode-card {
  --accent: var(--terracotta);
  --accent-dark: var(--terracotta-dark);
  --accent-soft: var(--terracotta-soft);
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-height: 300px;
  overflow: hidden;
  padding: 24px;
  text-align: left;
  border: 1.5px solid var(--border);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mode-card--rush {
  --accent: var(--sage);
  --accent-dark: var(--sage-dark);
  --accent-soft: var(--sage-soft);
}

.mode-card--atelier {
  --accent: var(--caramel);
  --accent-dark: var(--caramel-dark);
  --accent-soft: var(--caramel-soft);
}

.mode-card::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: var(--accent);
}

.mode-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
}

.mode-icon {
  width: 58px;
  height: 58px;
  margin: 8px 0 22px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  display: grid;
  place-items: center;
}

.mode-icon svg {
  width: 31px;
  height: 31px;
}

.mode-kicker {
  display: block;
  color: var(--accent-dark);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mode-title {
  display: block;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.05;
}

.mode-description {
  display: block;
  flex: 1;
  margin-top: 9px;
  color: var(--coffee);
  font-size: 0.92rem;
  line-height: 1.55;
}

.mode-foot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.mode-best {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.mode-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--accent-dark);
  font-size: 0.9rem;
  font-weight: 900;
}

.mode-cta svg {
  width: 18px;
  height: 18px;
  transition: transform 0.18s ease;
}

.mode-card:hover .mode-cta svg {
  transform: translateX(4px);
}

.menu-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.menu-note {
  color: var(--muted);
  font-size: 0.78rem;
}

/* --------------------------------------------------------------------------
   Atelier
   -------------------------------------------------------------------------- */

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 26px;
}

.category-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  text-align: left;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.category-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.category-card.is-selected {
  border-color: var(--terracotta);
  background: #fffdf8;
  box-shadow: 0 0 0 3px rgba(201, 93, 67, 0.12), var(--shadow-sm);
}

.category-glyph {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 16px;
  background: var(--cream-deep);
  color: var(--terracotta-dark);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 600;
}

.category-card:nth-child(2) .category-glyph {
  background: var(--sage-soft);
  color: var(--sage-dark);
}

.category-card:nth-child(3) .category-glyph {
  background: var(--caramel-soft);
  color: var(--caramel-dark);
}

.category-card:nth-child(4) .category-glyph {
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
}

.category-card:nth-child(5) .category-glyph {
  background: var(--sage-soft);
  color: var(--sage-dark);
}

.category-card:nth-child(6) .category-glyph {
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
}

.category-card--custom {
  border-color: rgba(201, 93, 67, 0.3);
  background: linear-gradient(145deg, #fffaf1, #fbede3);
}

.category-card--custom .category-check {
  border-color: rgba(201, 93, 67, 0.2);
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
}

.category-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.category-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
}

.category-description {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.4;
}

.category-check {
  width: 24px;
  height: 24px;
  flex: none;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  color: transparent;
  display: grid;
  place-items: center;
}

.category-check svg {
  width: 14px;
  height: 14px;
}

.category-card.is-selected .category-check {
  border-color: var(--terracotta);
  background: var(--terracotta);
  color: #fff;
}

.atelier-start {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  margin-top: 26px;
  padding: 20px 24px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.atelier-summary {
  display: flex;
  align-items: center;
  gap: 14px;
}

.atelier-summary-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--cream-deep);
  color: var(--terracotta-dark);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
}

.atelier-summary strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.atelier-summary div > span {
  color: var(--muted);
  font-size: 0.8rem;
}

/* --------------------------------------------------------------------------
   Atelier sur mesure
   -------------------------------------------------------------------------- */

.custom-screen {
  max-width: 980px;
}

.custom-builder {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 26px;
}

.custom-section {
  padding: 24px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.custom-section-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.custom-step {
  width: 32px;
  height: 32px;
  flex: none;
  border-radius: 50%;
  background: var(--espresso);
  color: var(--cream);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
}

.custom-section-head h2 {
  margin: 1px 0 4px;
  font-size: clamp(1.25rem, 2.4vw, 1.55rem);
}

.custom-section-head p {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.operation-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.op-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 56px;
  padding: 10px;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--coffee);
  font-size: 0.85rem;
  font-weight: 900;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.op-chip:hover {
  transform: translateY(-2px);
  background: #fff;
  border-color: rgba(59, 36, 29, 0.22);
}

.op-chip.is-selected {
  border-color: var(--espresso);
  background: var(--espresso);
  color: var(--cream);
}

.op-symbol {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  background: var(--cream-deep);
  color: var(--espresso);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
}

.op-chip.is-selected .op-symbol {
  background: rgba(255, 255, 255, 0.16);
  color: var(--cream);
}

.custom-mode-switch {
  width: min(100%, 420px);
  margin-bottom: 16px;
}

.custom-section .segment {
  font-size: 0.8rem;
}

.custom-panel {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.42);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-chip,
.division-chip {
  padding: 8px 13px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--coffee);
  font-size: 0.79rem;
  font-weight: 900;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.preset-chip:hover,
.division-chip:hover {
  transform: translateY(-1px);
  background: #fff;
}

.preset-chip.is-selected,
.division-chip.is-selected {
  border-color: var(--caramel);
  background: var(--caramel-soft);
  color: var(--caramel-dark);
}

.range-fields {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.range-fields label {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--coffee);
  font-size: 0.82rem;
  font-weight: 800;
}

.range-fields input,
.number-add-row input {
  width: 104px;
  padding: 10px 11px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--espresso);
  font-size: 0.95rem;
  font-weight: 800;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.range-fields input:focus,
.number-add-row input:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(201, 93, 67, 0.12);
}

.range-sep {
  padding-bottom: 11px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.custom-hint {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.number-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  margin-bottom: 14px;
}

.number-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 5px 6px 5px 11px;
  border: 1px solid rgba(169, 105, 23, 0.18);
  border-radius: 999px;
  background: var(--caramel-soft);
  color: #7c4a0d;
  font-size: 0.85rem;
  font-weight: 900;
}

.number-chip button {
  width: 21px;
  height: 21px;
  border-radius: 50%;
  color: #7c4a0d;
  display: grid;
  place-items: center;
  transition: background 0.15s ease;
}

.number-chip button:hover {
  background: rgba(169, 105, 23, 0.14);
}

.number-chip svg {
  width: 12px;
  height: 12px;
}

.number-empty {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

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

.number-add-row .btn {
  min-height: 42px;
}

.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(46px, 1fr));
  gap: 8px;
}

.table-chip {
  min-height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  color: var(--coffee);
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.table-chip:hover {
  transform: translateY(-2px);
  background: #fff;
}

.table-chip.is-selected {
  border-color: var(--terracotta);
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
}

.table-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.mini-action {
  padding: 6px 10px;
  border-radius: 999px;
  background: transparent;
  color: var(--terracotta-dark);
  font-size: 0.74rem;
  font-weight: 900;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.division-options {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px dashed var(--border);
}

.division-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.division-heading h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
}

.division-heading span {
  color: var(--muted);
  font-size: 0.73rem;
}

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

.custom-finish {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 16px;
}

.custom-preview-card,
.custom-start-card {
  padding: 24px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.custom-preview-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 90% 0%, rgba(237, 164, 74, 0.16), transparent 12rem),
    var(--paper);
}

.custom-preview-body {
  min-height: 86px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 6px;
}

.custom-preview-tag {
  padding: 4px 8px;
  border: 1px solid rgba(201, 93, 67, 0.18);
  border-radius: 999px;
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.custom-preview-question {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.7vw, 1.8rem);
  font-weight: 600;
  line-height: 1.25;
}

.custom-preview-empty {
  color: var(--muted);
  font-size: 0.86rem;
  font-style: italic;
  line-height: 1.5;
}

.custom-summary-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: 8px 0 0;
  padding: 0;
  list-style: none;
  color: var(--coffee);
  font-size: 0.84rem;
  line-height: 1.5;
}

.custom-summary-list li {
  position: relative;
  padding-left: 13px;
}

.custom-summary-list li::before {
  content: '·';
  position: absolute;
  left: 1px;
  color: var(--terracotta);
  font-weight: 900;
}

.custom-error {
  min-height: 0;
  margin-top: 8px;
  color: var(--danger);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.4;
}

.custom-start-card .btn {
  width: 100%;
  margin-top: 14px;
}

.custom-start-card .tiny {
  text-align: center;
}

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

.game-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.game-hud {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.hearts {
  display: flex;
  align-items: center;
  gap: 4px;
}

.heart {
  width: 27px;
  height: 27px;
  color: var(--terracotta);
  filter: drop-shadow(0 2px 2px rgba(59, 36, 29, 0.08));
  transition: color 0.2s ease, transform 0.2s ease;
}

.heart svg {
  width: 100%;
  height: 100%;
}

.heart.is-empty {
  color: rgba(59, 36, 29, 0.16);
  filter: none;
}

.timer-hud {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--espresso);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.timer-hud svg {
  width: 21px;
  height: 21px;
  color: var(--terracotta);
}

.mode-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.82rem;
  font-weight: 800;
}

.mode-badge svg {
  width: 18px;
  height: 18px;
  color: var(--sage-dark);
}

.score-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 84px;
  flex: none;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--espresso);
  color: var(--cream);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 16px rgba(59, 36, 29, 0.18);
}

.score-pill svg {
  width: 16px;
  height: 16px;
  color: var(--gold);
}

.score-pill.is-bumped {
  animation: score-bump 0.3s ease;
}

.points-float {
  position: absolute;
  right: 12px;
  top: -6px;
  color: var(--terracotta-dark);
  font-size: 0.95rem;
  font-weight: 900;
  pointer-events: none;
  animation: points-float 0.9s ease-out forwards;
}

.timer-track {
  height: 10px;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid rgba(59, 36, 29, 0.04);
  border-radius: 999px;
  background: rgba(59, 36, 29, 0.09);
}

.timer-fill {
  width: 0;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--caramel), var(--terracotta));
  transition: width 0.2s linear;
}

.mode-mission .timer-fill {
  background: linear-gradient(90deg, var(--sage), var(--sage-dark));
}

.mode-atelier .timer-fill {
  background: linear-gradient(90deg, var(--caramel), var(--caramel-dark));
}

.game-screen.is-urgent .timer-fill {
  background: linear-gradient(90deg, #e8844f, var(--terracotta-dark));
}

.game-screen.is-urgent .timer-hud {
  border-color: rgba(169, 63, 44, 0.3);
  color: var(--danger);
  animation: urgent-pulse 1s infinite;
}

.game-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.streak-pill {
  padding: 3px 9px;
  border: 1px solid rgba(169, 105, 23, 0.16);
  border-radius: 999px;
  background: var(--caramel-soft);
  color: #8a4d11;
  font-size: 0.74rem;
  font-weight: 900;
  animation: pop 0.25s ease;
}

.game-stage {
  margin-top: 18px;
}

.game-hint {
  margin-top: 14px;
  text-align: center;
  color: var(--muted);
  font-size: 0.77rem;
}

.kbd-hint {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.7rem;
  font-weight: 800;
}

.game-mode-note {
  margin-top: 5px;
  color: rgba(138, 111, 97, 0.72);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

/* Carte de commande */

.order-card {
  position: relative;
  overflow: hidden;
  border: 1.5px solid rgba(59, 36, 29, 0.13);
  border-radius: 28px;
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

.order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 1px dashed rgba(59, 36, 29, 0.16);
  background: linear-gradient(180deg, #fffdf9, #fff8ec);
}

.customer {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.customer-avatar {
  width: 52px;
  height: 52px;
  flex: none;
  border: 1.5px solid rgba(59, 36, 29, 0.08);
  border-radius: 50%;
  background: linear-gradient(145deg, var(--sage-soft), #dbe8db);
  display: grid;
  place-items: center;
  font-size: 28px;
}

.customer-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.customer-name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
}

.customer-tagline {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.71rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topic-tag {
  flex: none;
  padding: 5px 9px;
  border: 1px solid rgba(201, 93, 67, 0.18);
  border-radius: 999px;
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-body {
  padding: 26px 26px 24px;
}

.question-visual {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.pie {
  width: 150px;
  height: 150px;
  filter: drop-shadow(0 8px 15px rgba(59, 36, 29, 0.1));
}

.question-text {
  max-width: 640px;
  margin: 0 auto;
  color: var(--espresso);
  font-size: clamp(1.22rem, 3vw, 1.55rem);
  font-weight: 800;
  line-height: 1.4;
  text-align: center;
  text-wrap: balance;
}

.answers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.answer-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 78px;
  padding: 14px 20px;
  border: 2px solid rgba(59, 36, 29, 0.11);
  border-radius: 18px;
  background: #fff;
  color: var(--espresso);
  font-size: clamp(1.3rem, 3.2vw, 1.65rem);
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  touch-action: manipulation;
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, opacity 0.18s ease;
}

.answer-btn:hover:not(:disabled) {
  border-color: rgba(59, 36, 29, 0.3);
  background: #fffdf8;
  transform: translateY(-2px);
}

.answer-btn:active:not(:disabled) {
  transform: scale(0.985);
}

.answer-btn:disabled {
  pointer-events: none;
}

.answer-key {
  position: absolute;
  left: 10px;
  top: 9px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--cream-deep);
  color: var(--coffee);
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  font-weight: 900;
}

.answer-value {
  line-height: 1.15;
}

.answer-btn.is-correct {
  border-color: #4f8a61;
  background: #e8f3e9;
  color: #245b37;
  animation: pop 0.25s ease;
}

.answer-btn.is-wrong {
  border-color: var(--terracotta);
  background: #fbe7e0;
  color: #8a3222;
  animation: shake 0.3s ease;
}

.answer-btn.is-correct::after {
  content: '✓';
  position: absolute;
  right: 12px;
  top: 50%;
  color: #3f7d58;
  font-size: 1.05rem;
  transform: translateY(-54%);
}

.answer-btn.is-wrong::after {
  content: '✕';
  position: absolute;
  right: 12px;
  top: 50%;
  color: var(--terracotta-dark);
  font-size: 0.95rem;
  transform: translateY(-54%);
}

.answers.is-locked .answer-btn:not(.is-correct):not(.is-wrong) {
  opacity: 0.5;
}

.order-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 22px;
  border-top: 1px dashed rgba(59, 36, 29, 0.14);
  background: rgba(255, 248, 236, 0.6);
  color: var(--muted);
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.celebration-stamp {
  position: absolute;
  right: 26px;
  top: 36%;
  z-index: 3;
  display: none;
  padding: 4px 12px;
  border: 3px solid var(--sage-dark);
  border-radius: 10px;
  background: rgba(255, 250, 241, 0.92);
  color: var(--sage-dark);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  opacity: 0.9;
  pointer-events: none;
  transform: rotate(-9deg);
}

.order-card.is-served .celebration-stamp {
  display: block;
  animation: stamp 0.35s cubic-bezier(0.2, 0.8, 0.3, 1.2) both;
}

/* Fractions */

.frac {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0.12em;
  font-size: 0.92em;
  line-height: 1;
  vertical-align: -0.48em;
}

.frac-n {
  padding: 0 0.16em 0.03em;
  border-bottom: 0.09em solid currentColor;
  line-height: 1.05;
}

.frac-d {
  padding: 0.03em 0.16em 0;
  line-height: 1.05;
}

.question-text .frac {
  font-size: 1em;
}

.answer-value .frac {
  font-size: 1.15em;
  vertical-align: -0.42em;
}

/* Retour d'erreur */

.feedback-sheet {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 70;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: min(760px, calc(100% - 24px));
  padding: 18px 20px;
  border-radius: 22px;
  background: var(--espresso);
  color: var(--cream);
  box-shadow: var(--shadow-lg);
  transform: translateX(-50%);
  animation: feedback-in 0.28s ease both;
}

.feedback-symbol {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  background: var(--terracotta);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.feedback-copy {
  flex: 1;
  min-width: 0;
}

.feedback-title {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
}

.feedback-title strong {
  color: var(--gold);
  font-size: 1.1em;
}

.feedback-explanation {
  margin-top: 3px;
  color: rgba(255, 247, 234, 0.78);
  font-size: 0.84rem;
  line-height: 1.55;
}

.feedback-explanation .frac {
  color: var(--cream);
}

.feedback-continue {
  flex: none;
  align-self: center;
  padding: 10px 16px;
  font-size: 0.85rem;
}

.feedback-continue svg {
  width: 16px;
  height: 16px;
}

.feedback-auto {
  flex: none;
  align-self: center;
  color: rgba(255, 247, 234, 0.55);
  font-size: 0.72rem;
  font-weight: 800;
}

/* --------------------------------------------------------------------------
   Résultats
   -------------------------------------------------------------------------- */

.results-screen {
  max-width: 900px;
}

.results-hero {
  position: relative;
  overflow: hidden;
  padding: 34px 24px 30px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 32px;
  background: linear-gradient(160deg, #fffaf1, #f8e8d0);
  box-shadow: var(--shadow-md);
}

.results-hero::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 10px;
  background: repeating-linear-gradient(90deg, var(--terracotta) 0 32px, var(--cream) 32px 64px);
  opacity: 0.75;
}

.result-stars {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 10px 0 4px;
}

.result-star {
  width: 34px;
  height: 34px;
  color: rgba(59, 36, 29, 0.13);
}

.result-star svg {
  width: 100%;
  height: 100%;
}

.result-star.is-filled {
  color: var(--gold);
  filter: drop-shadow(0 3px 4px rgba(169, 105, 23, 0.22));
}

.results-hero h1 {
  max-width: 700px;
  margin: 8px auto 0;
  font-size: clamp(2rem, 4.5vw, 3rem);
}

.results-hero h1[tabindex="-1"]:focus {
  outline: none;
}

.results-subtitle {
  max-width: 560px;
  margin: 10px auto 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.result-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-top: 20px;
}

.result-score strong {
  color: var(--terracotta-dark);
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4rem);
  font-weight: 600;
  line-height: 1;
}

.result-score span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.record-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 7px 14px;
  border: 1px solid rgba(79, 115, 87, 0.18);
  border-radius: 999px;
  background: var(--sage-soft);
  color: var(--sage-dark);
  font-size: 0.8rem;
  font-weight: 900;
}

.record-note svg {
  width: 17px;
  height: 17px;
}

.record-note--cafe {
  border-color: rgba(169, 105, 23, 0.2);
  background: var(--caramel-soft);
  color: var(--caramel-dark);
}

.record-note--soft {
  background: rgba(255, 255, 255, 0.6);
  color: var(--coffee);
}

.result-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 17px 12px;
  text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.stat-value {
  color: var(--espresso);
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 600;
  line-height: 1;
}

.stat-label {
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.earned-badges {
  margin-top: 34px;
}

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

.earned-badge {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1.5px solid rgba(169, 105, 23, 0.18);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--caramel-soft), #fffaf1);
  box-shadow: var(--shadow-sm);
}

.earned-icon {
  width: 48px;
  height: 48px;
  flex: none;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 25px;
  box-shadow: 0 4px 10px rgba(59, 36, 29, 0.08);
}

.earned-badge div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.earned-badge strong {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 600;
}

.earned-badge span {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.review-card {
  margin-top: 24px;
  overflow: hidden;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.review-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  list-style: none;
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 900;
}

.review-card summary::-webkit-details-marker {
  display: none;
}

.review-count {
  display: inline-grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--terracotta-soft);
  color: var(--terracotta-dark);
  font-size: 0.72rem;
}

.review-chevron {
  color: var(--muted);
  font-size: 1.2rem;
  transition: transform 0.2s ease;
}

.review-card[open] .review-chevron {
  transform: rotate(45deg);
}

.review-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 20px 20px;
  border-top: 1px dashed var(--border);
}

.review-item {
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}

.review-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.review-topic {
  color: var(--terracotta-dark);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.review-question {
  margin-top: 4px;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.45;
}

.review-answer {
  margin-top: 4px;
  color: var(--sage-dark);
  font-size: 0.84rem;
}

.review-explanation {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.review-more {
  color: var(--muted);
  font-size: 0.8rem;
  font-style: italic;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

/* --------------------------------------------------------------------------
   Carnet et badges
   -------------------------------------------------------------------------- */

.notebook-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px;
  padding: 22px 24px;
  border: 1.5px solid var(--border);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.notebook-avatar {
  width: 82px;
  height: 82px;
  flex: none;
  border-radius: 50%;
  background: linear-gradient(145deg, #f9e8d2, #f2ddc1);
  display: grid;
  place-items: center;
  font-size: 44px;
}

.notebook-title {
  flex: 1;
  min-width: 150px;
}

.notebook-title h1 {
  margin: 2px 0 7px;
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  line-height: 1;
}

.notebook-head .btn {
  margin-left: auto;
}

.notebook-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.notebook-section {
  margin-top: 32px;
}

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

.best-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.best-icon {
  width: 34px;
  height: 34px;
  margin-bottom: 4px;
  border-radius: 10px;
  background: var(--cream-deep);
  color: var(--terracotta-dark);
  display: grid;
  place-items: center;
}

.best-icon svg {
  width: 20px;
  height: 20px;
}

.best-mode {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.best-card strong {
  font-size: 0.98rem;
  font-weight: 900;
}

.badge-count {
  margin-left: 4px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 800;
  vertical-align: middle;
}

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

.badge-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border: 1.5px solid var(--border);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: var(--shadow-sm);
}

.badge-card.is-locked {
  opacity: 0.62;
  background: rgba(255, 250, 241, 0.55);
  box-shadow: none;
}

.badge-icon {
  width: 44px;
  height: 44px;
  flex: none;
  border-radius: 50%;
  background: var(--cream-deep);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.badge-card.is-unlocked .badge-icon {
  background: var(--caramel-soft);
}

.badge-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.badge-copy strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
}

.badge-copy span {
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.35;
}

.badge-check {
  width: 20px;
  height: 20px;
  flex: none;
  margin-left: auto;
  border-radius: 50%;
  background: var(--sage);
  color: #fff;
  display: grid;
  place-items: center;
}

.badge-check svg {
  width: 12px;
  height: 12px;
}

.notebook-actions {
  display: flex;
  justify-content: center;
  margin-top: 32px;
}

/* --------------------------------------------------------------------------
   Records
   -------------------------------------------------------------------------- */

.records-board {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  background: var(--chalk);
  box-shadow: var(--shadow-md);
}

.records-board::after {
  content: '';
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  pointer-events: none;
}

.record-columns {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.record-column-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}

.record-mode-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: rgba(237, 164, 74, 0.14);
  color: var(--caramel);
  display: grid;
  place-items: center;
}

.record-mode-icon svg {
  width: 19px;
  height: 19px;
}

.record-column h2 {
  color: var(--cream);
  font-size: 1.2rem;
  font-weight: 600;
}

.record-row {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.record-rank {
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 247, 234, 0.7);
  display: grid;
  place-items: center;
  font-size: 0.7rem;
  font-weight: 900;
}

.record-rank.rank-1 {
  background: var(--gold);
  color: #5b3b00;
}

.record-rank.rank-2 {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.record-rank.rank-3 {
  background: rgba(237, 164, 74, 0.28);
  color: #ffd99c;
}

.record-avatar {
  flex: none;
  font-size: 22px;
}

.record-who {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.record-who strong {
  overflow: hidden;
  color: #fff6e9;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.record-who small {
  color: rgba(255, 247, 234, 0.55);
  font-size: 0.65rem;
}

.record-score {
  display: flex;
  align-items: baseline;
  gap: 2px;
  color: var(--gold);
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  white-space: nowrap;
}

.record-score small {
  color: rgba(255, 247, 234, 0.5);
  font-family: var(--font-body);
  font-size: 0.58rem;
  font-weight: 700;
}

.record-empty {
  padding: 12px 0;
  color: rgba(255, 247, 234, 0.5);
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.6;
}

.records-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

/* --------------------------------------------------------------------------
   Modales
   -------------------------------------------------------------------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(40, 24, 18, 0.58);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  animation: fade-in 0.2s ease;
}

.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 28px;
  background: var(--cream);
  box-shadow: var(--shadow-lg);
  animation: modal-in 0.26s cubic-bezier(0.2, 0.8, 0.3, 1.1);
}

.modal-close {
  position: absolute;
  right: 14px;
  top: 14px;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.5);
}

.modal h2 {
  margin: 4px 0 8px;
  padding-right: 28px;
  font-size: clamp(1.7rem, 4vw, 2.1rem);
}

.modal-intro {
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.field {
  margin: 0 0 18px;
  padding: 0;
  border: 0;
}

.field > span,
.field legend {
  display: block;
  margin-bottom: 7px;
  padding: 0;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.field input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 14px;
  background: #fff;
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input[type="text"]:focus {
  border-color: var(--terracotta);
  box-shadow: 0 0 0 3px rgba(201, 93, 67, 0.12);
}

.avatar-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.avatar-choice {
  aspect-ratio: 1;
  border: 1.5px solid transparent;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  font-size: 24px;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.avatar-choice:hover {
  background: #fff;
  transform: translateY(-2px);
}

.avatar-choice.is-selected {
  border-color: var(--terracotta);
  background: var(--terracotta-soft);
  box-shadow: 0 0 0 3px rgba(201, 93, 67, 0.1);
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--cream-deep);
}

.segment {
  flex: 1;
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--coffee);
  font-size: 0.83rem;
  font-weight: 900;
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.segment.is-selected {
  background: var(--espresso);
  color: var(--cream);
  box-shadow: 0 3px 8px rgba(59, 36, 29, 0.16);
}

.modal-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.modal-actions--end {
  justify-content: flex-end;
}

.spacer {
  flex: 1;
}

.modal-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.5;
  text-align: center;
}

.settings-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 14px;
  text-align: left;
  border: 1.5px solid var(--border);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.55);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.settings-row:hover {
  background: #fff;
  border-color: rgba(59, 36, 29, 0.2);
}

.settings-row-icon {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 12px;
  background: var(--cream-deep);
  color: var(--espresso);
  display: grid;
  place-items: center;
}

.settings-row-icon svg {
  width: 20px;
  height: 20px;
}

.settings-row-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1px;
}

.settings-row-copy strong {
  font-size: 0.9rem;
  font-weight: 900;
}

.settings-row-copy small {
  color: var(--muted);
  font-size: 0.72rem;
}

.switch {
  position: relative;
  width: 44px;
  height: 25px;
  flex: none;
  border-radius: 999px;
  background: rgba(59, 36, 29, 0.16);
  transition: background 0.2s ease;
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(59, 36, 29, 0.2);
  transition: transform 0.2s ease;
}

.settings-row[aria-pressed="true"] .switch {
  background: var(--sage);
}

.settings-row[aria-pressed="true"] .switch::after {
  transform: translateX(19px);
}

.settings-note {
  margin-top: 16px;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
}

.settings-danger {
  margin-top: 24px;
  padding: 16px;
  border: 1.5px dashed rgba(169, 63, 44, 0.3);
  border-radius: 16px;
  background: rgba(169, 63, 44, 0.04);
}

.settings-danger h3 {
  margin-bottom: 4px;
  font-family: var(--font-display);
  font-size: 1.05rem;
}

.settings-danger p {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.pause-modal {
  text-align: center;
}

.pause-badge {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--caramel-soft);
  display: grid;
  place-items: center;
  font-size: 32px;
}

.pause-modal h2 {
  padding: 0;
  font-size: 1.9rem;
}

.pause-modal .modal-intro {
  max-width: 340px;
  margin-right: auto;
  margin-left: auto;
}

.pause-score {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 18px;
  margin: 18px 0;
  padding: 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
  color: var(--coffee);
  font-size: 0.85rem;
  font-weight: 900;
}

.pause-score span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.pause-score svg {
  width: 17px;
  height: 17px;
  color: var(--caramel-dark);
}

.pause-modal .settings-row {
  margin-top: 10px;
  text-align: left;
}

.pause-resume {
  width: 100%;
}

.pause-quit {
  width: 100%;
  margin-top: 10px;
}

.tiny {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.68rem;
}

/* ==========================================================================
   Café Calico — ambiance pastel, décor de café et boutique
   ========================================================================== */

:root {
  --calico-ink: #4b302a;
  --calico-pink: #ffd6e0;
  --calico-pink-deep: #e86f92;
  --calico-berry: #c94d6d;
  --calico-peach: #ffe3cf;
  --calico-butter: #fff1b8;
  --calico-mint: #cfeee0;
  --calico-sky: #d6edfa;
  --calico-lavender: #e7dcfb;
  --calico-cream: #fff8ee;
  --calico-outline: rgba(75, 48, 42, 0.17);
  --calico-shadow: 0 6px 0 rgba(75, 48, 42, 0.08);
  --cafe-wall-soft: #fff6ea;
  --cafe-wall-mid: #f6e3ca;
  --cafe-wall-deep: #e8c9a7;
  --cafe-cat: #f4d3a3;
  --cafe-cat-ear: #f6b9c8;
}

body {
  background-color: var(--cafe-wall-soft, var(--cream));
  background-image:
    radial-gradient(ellipse at 8% -10%, rgba(255, 192, 209, 0.42), transparent 36rem),
    radial-gradient(ellipse at 100% 0%, rgba(255, 235, 168, 0.34), transparent 34rem),
    radial-gradient(ellipse at 50% 112%, rgba(184, 226, 205, 0.42), transparent 42rem),
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.18) 0 20px, transparent 20px 44px);
}

/* Décor fixe du café */

#cafe-world {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.cafe-world-awning {
  position: absolute;
  inset: 0 0 auto;
  height: 16px;
  border-bottom: 2px solid rgba(75, 48, 42, 0.2);
  background: repeating-linear-gradient(90deg, #f291ac 0 28px, #fff8ee 28px 56px);
  opacity: 0.8;
}

.cafe-world-awning::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 11px;
  background: radial-gradient(circle at 14px -2px, #f291ac 0 13px, transparent 13.6px) 0 0 / 28px 11px repeat-x;
  opacity: 0.55;
}

.cafe-world-garland {
  position: absolute;
  top: 34px;
  left: 8%;
  right: 8%;
  display: flex;
  justify-content: space-between;
  opacity: 0.38;
}

.cafe-world-garland::before {
  content: '';
  position: absolute;
  left: -2%;
  right: -2%;
  top: 3px;
  border-top: 2px dashed rgba(75, 48, 42, 0.3);
  border-radius: 50%;
}

.cafe-world-garland span {
  width: 8px;
  height: 10px;
  margin-top: 4px;
  border-radius: 50% 50% 60% 60%;
  background: var(--calico-pink-deep);
  box-shadow: 0 0 0 3px rgba(255, 214, 224, 0.55);
  animation: cafe-bulb 3.4s ease-in-out infinite;
}

.cafe-world-garland span:nth-child(2n) {
  margin-top: 12px;
  background: #e9b84a;
  box-shadow: 0 0 0 3px rgba(255, 241, 184, 0.6);
  animation-delay: 0.5s;
}

.cafe-world-garland span:nth-child(3n) {
  background: #7dbfa1;
  box-shadow: 0 0 0 3px rgba(207, 238, 224, 0.7);
  animation-delay: 1.1s;
}

.cafe-world-paws {
  position: absolute;
  inset: auto 0 5% 0;
  display: flex;
  justify-content: space-between;
  padding: 0 2.5%;
  color: rgba(75, 48, 42, 0.1);
  font-size: 2.4rem;
}

.cafe-world-paws span:nth-child(1) {
  transform: rotate(-24deg);
}

.cafe-world-paws span:nth-child(2) {
  align-self: flex-end;
  font-size: 1.5rem;
  transform: rotate(14deg);
}

.cafe-world-paws span:nth-child(3) {
  transform: rotate(28deg);
}

.cafe-world-steam {
  position: absolute;
  right: 4%;
  bottom: 6%;
  display: flex;
  gap: 12px;
  opacity: 0.2;
}

.cafe-world-steam span {
  width: 22px;
  height: 70px;
  border-radius: 50%;
  border-left: 6px solid rgba(255, 255, 255, 0.9);
  animation: cafe-steam-drift 6s ease-in-out infinite;
}

.cafe-world-steam span:nth-child(2) {
  margin-top: -22px;
  animation-delay: 1.2s;
}

.cafe-world-steam span:nth-child(3) {
  animation-delay: 2.4s;
}

/* Typographie et contrôles */

.eyebrow {
  color: var(--calico-berry);
}

h1,
h2,
h3 {
  color: var(--calico-ink);
}

.brand-mark {
  border: 2px solid var(--calico-ink);
  background: linear-gradient(145deg, #f891ab, #e56083);
  color: #fffaf4;
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.18);
}

.brand-word {
  color: var(--calico-ink);
}

.btn {
  border-width: 2px;
  border-color: transparent;
}

.btn-primary {
  border-color: #c24a68;
  background: linear-gradient(160deg, #f891ab, #e56083);
  color: #fffaf6;
  box-shadow: 0 5px 0 #c24a68, 0 12px 22px rgba(201, 77, 109, 0.18);
}

.btn-primary:hover {
  background: linear-gradient(160deg, #fa9db4, #e86f92);
  box-shadow: 0 7px 0 #c24a68, 0 15px 26px rgba(201, 77, 109, 0.22);
}

.btn-ghost {
  border-color: var(--calico-outline);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 3px 0 rgba(75, 48, 42, 0.06);
}

.btn-ghost:hover {
  border-color: rgba(201, 77, 109, 0.42);
  background: #fff;
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.08);
}

.btn-cream {
  border-color: rgba(75, 48, 42, 0.14);
  background: var(--calico-cream);
}

.icon-btn {
  border-width: 2px;
  border-color: var(--calico-outline);
  background: rgba(255, 253, 248, 0.88);
  box-shadow: 0 3px 0 rgba(75, 48, 42, 0.06);
}

.icon-btn:hover {
  border-color: rgba(201, 77, 109, 0.4);
  background: #fff;
}

.level-selector,
.segmented {
  border-width: 1.5px;
  border-color: var(--calico-outline);
  background: var(--calico-cream);
}

.level-selector button.is-active,
.segment.is-selected {
  background: linear-gradient(160deg, #f891ab, #e56083);
  color: #fff;
  box-shadow: 0 3px 0 #c24a68;
}

/* Accueil */

.hero {
  border: 2.5px solid var(--calico-ink);
  border-radius: clamp(30px, 4vw, 44px);
  background:
    radial-gradient(circle at 84% 14%, rgba(255, 255, 255, 0.55) 0 7rem, transparent 7.1rem),
    radial-gradient(circle at 10% 96%, rgba(255, 241, 184, 0.58) 0 9rem, transparent 9.1rem),
    linear-gradient(135deg, #fffaf1 0%, #ffe9e0 52%, #ffd9e3 100%);
  box-shadow: 0 10px 0 rgba(75, 48, 42, 0.09), var(--shadow-md);
}

.hero::before {
  height: 18px;
  border-bottom: 2px solid rgba(75, 48, 42, 0.22);
  background: repeating-linear-gradient(90deg, #f291ac 0 30px, #fff8ee 30px 60px);
  opacity: 1;
}

.hero::after {
  right: -90px;
  top: -120px;
  width: 430px;
  height: 430px;
  background: radial-gradient(circle, rgba(255, 211, 160, 0.58), transparent 68%);
}

.hero h1 span {
  color: var(--calico-berry);
}

.hero h1 span::after {
  height: 0.2em;
  background: var(--calico-butter);
  opacity: 0.95;
}

.hero-chips span {
  border: 1.5px solid rgba(75, 48, 42, 0.14);
  background: #fffdf8;
  box-shadow: 0 2px 0 rgba(75, 48, 42, 0.05);
}

.hero-chips span:nth-child(2n) {
  background: var(--calico-mint);
}

.hero-chips span:nth-child(3n) {
  background: var(--calico-butter);
}

.hero-art-inner {
  position: relative;
  padding-bottom: 12px;
}

.hero-moka {
  position: absolute;
  right: -6px;
  bottom: -10px;
  width: 116px;
  filter: drop-shadow(0 10px 14px rgba(75, 48, 42, 0.15));
  animation: moka-bob 4.4s ease-in-out infinite;
}

.hero-moka .moka {
  width: 100%;
}

.hero-moka-bubble {
  position: absolute;
  right: 82px;
  top: -8px;
  padding: 4px 9px;
  border: 2px solid var(--calico-ink);
  border-radius: 12px 12px 3px 12px;
  background: #fffdf8;
  color: var(--calico-berry);
  font-size: 0.68rem;
  font-weight: 900;
  white-space: nowrap;
  transform: rotate(-4deg);
  box-shadow: 0 3px 0 rgba(75, 48, 42, 0.1);
}

.onboarding {
  border: 2px solid var(--calico-outline);
  border-radius: 28px;
  background:
    radial-gradient(circle at 90% 10%, rgba(255, 214, 224, 0.5) 0 5rem, transparent 5.1rem),
    #fffdf8;
  box-shadow: var(--calico-shadow);
}

.onboarding-icon {
  border: 2px solid var(--calico-ink);
  background: var(--calico-peach);
}

.profile-card {
  border: 2px solid var(--calico-outline);
  border-radius: 24px;
  background: #fffdf8;
  box-shadow: 0 5px 0 rgba(75, 48, 42, 0.07);
}

.profile-card:nth-child(4n + 1) {
  background: linear-gradient(145deg, #fffdf8, #ffe9ef);
}

.profile-card:nth-child(4n + 2) {
  background: linear-gradient(145deg, #fffdf8, #e6f7ee);
}

.profile-card:nth-child(4n + 3) {
  background: linear-gradient(145deg, #fffdf8, #fff5d6);
}

.profile-card:nth-child(4n + 4) {
  background: linear-gradient(145deg, #fffdf8, #efe7fd);
}

.profile-card:hover {
  border-color: rgba(201, 77, 109, 0.5);
  box-shadow: 0 8px 0 rgba(75, 48, 42, 0.08), var(--shadow-md);
  transform: translateY(-3px) rotate(-0.35deg);
}

.profile-card.is-current {
  border-color: var(--calico-pink-deep);
  box-shadow: 0 0 0 4px rgba(255, 214, 224, 0.8), 0 5px 0 rgba(75, 48, 42, 0.07);
}

.profile-avatar,
.player-avatar,
.notebook-avatar {
  border: 2px solid var(--calico-ink);
  background: linear-gradient(145deg, #ffe9ef, #ffd3de);
  box-shadow: inset 0 -4px 0 rgba(75, 48, 42, 0.06);
}

.add-profile {
  border: 2px dashed rgba(75, 48, 42, 0.2);
  background: rgba(255, 253, 248, 0.6);
}

.add-icon {
  background: var(--calico-pink);
  color: var(--calico-berry);
}

.level-pill {
  border: 1.5px solid rgba(75, 48, 42, 0.14);
  background: var(--calico-mint);
  color: #3f6f58;
}

.board {
  border: 2px solid rgba(75, 48, 42, 0.55);
  border-radius: 34px;
  background:
    radial-gradient(circle at 16% 8%, rgba(255, 214, 224, 0.12), transparent 20rem),
    radial-gradient(circle at 90% 100%, rgba(207, 238, 224, 0.12), transparent 18rem),
    #2d4a3d;
  box-shadow: 0 8px 0 rgba(75, 48, 42, 0.16), var(--shadow-md);
}

.board-item {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.075);
}

.board-icon {
  background: rgba(255, 214, 224, 0.16);
  color: var(--calico-pink);
}

/* Menu */

.player-strip {
  border: 2.5px solid var(--calico-ink);
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 214, 224, 0.8) 0 5.5rem, transparent 5.6rem),
    linear-gradient(135deg, #fffdf8, #fff0e4);
  box-shadow: 0 7px 0 rgba(75, 48, 42, 0.08), var(--shadow-sm);
}

.player-main h1 {
  color: var(--calico-ink);
}

.player-tools {
  justify-content: flex-end;
}

.mode-card {
  border: 2px solid rgba(75, 48, 42, 0.24);
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 84%, rgba(255, 255, 255, 0.6) 0 4.5rem, transparent 4.6rem),
    linear-gradient(155deg, #fff8f1, #ffe1e8);
  box-shadow: 0 7px 0 rgba(75, 48, 42, 0.09);
}

.mode-card--rush {
  background:
    radial-gradient(circle at 88% 84%, rgba(255, 255, 255, 0.6) 0 4.5rem, transparent 4.6rem),
    linear-gradient(155deg, #f9fffb, #d9f2e6);
}

.mode-card--atelier {
  background:
    radial-gradient(circle at 88% 84%, rgba(255, 255, 255, 0.6) 0 4.5rem, transparent 4.6rem),
    linear-gradient(155deg, #fffdf4, #ffedb8);
}

.mode-card::before {
  height: 9px;
  border-bottom: 1px solid rgba(75, 48, 42, 0.12);
  background: var(--accent);
}

.mode-card:hover {
  border-color: var(--accent);
  box-shadow: 0 10px 0 rgba(75, 48, 42, 0.09), var(--shadow-md);
}

.mode-icon {
  border: 2px solid rgba(75, 48, 42, 0.2);
  background: #fffdf8;
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.08);
  transform: rotate(-4deg);
}

.mode-foot {
  border-top-color: rgba(75, 48, 42, 0.14);
}

.menu-links .btn {
  background: rgba(255, 253, 248, 0.82);
}

/* Moka la mascotte */

.moka {
  display: inline-block;
  width: 96px;
  line-height: 0;
  vertical-align: middle;
}

.moka-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.moka-tail {
  transform-box: fill-box;
  transform-origin: 8% 90%;
  animation: moka-wag 3.2s ease-in-out infinite;
}

.moka-eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: moka-blink 5.4s infinite;
}

.moka-says {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 18px;
}

.moka-says-cat {
  width: 86px;
  flex: none;
  margin-bottom: -4px;
}

.moka-says-cat .moka {
  width: 100%;
}

.moka-says-bubble {
  position: relative;
  max-width: 560px;
  margin-bottom: 10px;
  padding: 12px 16px;
  border: 2px solid var(--calico-ink);
  border-radius: 18px 18px 18px 5px;
  background: #fffdf8;
  color: var(--coffee);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.45;
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.08);
}

.moka-says-bubble::before {
  content: '';
  position: absolute;
  left: -9px;
  bottom: 11px;
  width: 14px;
  height: 14px;
  border-left: 2px solid var(--calico-ink);
  border-bottom: 2px solid var(--calico-ink);
  background: #fffdf8;
  transform: rotate(45deg);
}

.moka-says--menu {
  margin: 18px 0 0;
}

.moka-says--results {
  margin: 24px auto 0;
  max-width: 680px;
}

/* Jeu */

.score-pill {
  border: 2px solid var(--calico-ink);
  background: linear-gradient(160deg, #f891ab, #e56083);
  box-shadow: 0 4px 0 #c24a68;
}

.timer-hud,
.mode-badge {
  border: 1.5px solid var(--calico-outline);
  background: rgba(255, 253, 248, 0.82);
}

.timer-track {
  border: 1.5px solid rgba(75, 48, 42, 0.12);
  background: rgba(255, 253, 248, 0.75);
}

.order-card {
  border: 2.5px solid var(--calico-ink);
  border-radius: 30px;
  background: #fffdf8;
  box-shadow: 0 8px 0 rgba(75, 48, 42, 0.09), var(--shadow-md);
}

.order-head {
  border-bottom-color: rgba(75, 48, 42, 0.16);
  background:
    radial-gradient(circle at 96% 0%, rgba(255, 214, 224, 0.65) 0 5rem, transparent 5.1rem),
    linear-gradient(180deg, #fffdf9, #fff3e6);
}

.customer-avatar {
  border: 2px solid var(--calico-ink);
  background: linear-gradient(145deg, var(--calico-mint), #e8f7ef);
}

.topic-tag {
  border: 1.5px solid rgba(201, 77, 109, 0.22);
  background: var(--calico-pink);
  color: #9c3753;
}

.answer-btn {
  border: 2px solid rgba(75, 48, 42, 0.16);
  background: #fff;
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.07);
  transition: transform 0.12s ease, border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease, opacity 0.18s ease;
}

.answer-btn:nth-child(4n + 1) .answer-key {
  background: var(--calico-pink);
  color: #9c3753;
}

.answer-btn:nth-child(4n + 2) .answer-key {
  background: var(--calico-mint);
  color: #3f6f58;
}

.answer-btn:nth-child(4n + 3) .answer-key {
  background: var(--calico-butter);
  color: #8a6512;
}

.answer-btn:nth-child(4n + 4) .answer-key {
  background: var(--calico-lavender);
  color: #6d559b;
}

.answer-btn:hover:not(:disabled) {
  border-color: rgba(201, 77, 109, 0.42);
  background: #fffdf8;
  box-shadow: 0 6px 0 rgba(75, 48, 42, 0.08);
}

.answer-btn.is-correct {
  border-color: #4f8a61;
  background: #e8f3e9;
  box-shadow: 0 4px 0 rgba(79, 138, 97, 0.18);
}

.answer-btn.is-wrong {
  border-color: var(--terracotta);
  background: #fbe7e0;
  box-shadow: 0 4px 0 rgba(201, 93, 67, 0.16);
}

.order-foot {
  border-top-color: rgba(75, 48, 42, 0.14);
  background: rgba(255, 245, 232, 0.7);
}

.game-hint {
  color: var(--muted);
}

/* Résultats */

.results-hero {
  border: 2.5px solid var(--calico-ink);
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 18%, rgba(255, 255, 255, 0.6) 0 5rem, transparent 5.1rem),
    radial-gradient(circle at 88% 86%, rgba(207, 238, 224, 0.55) 0 6rem, transparent 6.1rem),
    linear-gradient(160deg, #fffaf1, #ffe6ea);
  box-shadow: 0 8px 0 rgba(75, 48, 42, 0.09), var(--shadow-md);
}

.results-hero::before {
  height: 12px;
  border-bottom: 1px solid rgba(75, 48, 42, 0.12);
  background: repeating-linear-gradient(90deg, #f291ac 0 28px, #fff8ee 28px 56px);
  opacity: 1;
}

.result-star.is-filled {
  color: #f0b429;
  filter: drop-shadow(0 4px 0 rgba(169, 105, 23, 0.18));
}

.result-score strong {
  color: var(--calico-berry);
}

.result-tips-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tips-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border: 1.5px solid rgba(75, 48, 42, 0.16);
  border-radius: 999px;
  background: var(--calico-butter);
  color: #7c5a10;
  font-size: 0.76rem;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 2px 0 rgba(75, 48, 42, 0.06);
}

.tips-pill svg {
  width: 16px;
  height: 16px;
}

.tips-pill--earned {
  border-color: rgba(201, 77, 109, 0.28);
  background: var(--calico-pink);
  color: #9c3753;
  animation: tips-in 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.stat-card {
  border: 2px solid var(--calico-outline);
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.06);
}

.stat-card:nth-child(4n + 1) {
  background: linear-gradient(150deg, #fffdf8, #ffe9ef);
}

.stat-card:nth-child(4n + 2) {
  background: linear-gradient(150deg, #fffdf8, #e9f8f1);
}

.stat-card:nth-child(4n + 3) {
  background: linear-gradient(150deg, #fffdf8, #fff5d8);
}

.stat-card:nth-child(4n + 4) {
  background: linear-gradient(150deg, #fffdf8, #f0e9fd);
}

/* Carnet, badges et records */

.notebook-head {
  border: 2.5px solid var(--calico-ink);
  border-radius: 30px;
  background:
    radial-gradient(circle at 92% 14%, rgba(255, 241, 184, 0.8) 0 5rem, transparent 5.1rem),
    linear-gradient(135deg, #fffdf8, #ffeaf0);
  box-shadow: 0 7px 0 rgba(75, 48, 42, 0.08);
}

.best-card {
  border: 2px solid var(--calico-outline);
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.06);
}

.best-card:nth-child(1) {
  background: linear-gradient(150deg, #fffdf8, #ffe9ef);
}

.best-card:nth-child(2) {
  background: linear-gradient(150deg, #fffdf8, #e9f8f1);
}

.best-card:nth-child(3) {
  background: linear-gradient(150deg, #fffdf8, #fff5d8);
}

.best-icon {
  border: 1.5px solid rgba(75, 48, 42, 0.14);
  background: #fffdf8;
}

.badge-card {
  border: 2px solid var(--calico-outline);
  border-radius: 20px;
  background: #fffdf8;
  box-shadow: 0 4px 0 rgba(75, 48, 42, 0.06);
}

.badge-card.is-unlocked {
  background: linear-gradient(150deg, #fffdf8, #fff4cf);
}

.badge-card.is-locked {
  border-style: dashed;
  background: rgba(255, 253, 248, 0.5);
}

.badge-icon {
  border: 1.5px solid rgba(75, 48, 42, 0.12);
  background: #fff;
}

.records-board {
  border: 2px solid rgba(75, 48, 42, 0.55);
  border-radius: 34px;
  background:
    radial-gradient(circle at 12% 6%, rgba(255, 214, 224, 0.14), transparent 18rem),
    radial-gradient(circle at 92% 96%, rgba(207, 238, 224, 0.12), transparent 18rem),
    #2d4a3d;
  box-shadow: 0 8px 0 rgba(75, 48, 42, 0.16), var(--shadow-md);
}

.record-rank.rank-1 {
  background: var(--calico-butter);
  color: #704d00;
}

/* Modales et réglages */

.modal-backdrop {
  background: rgba(53, 31, 27, 0.55);
}

.modal {
  border: 2.5px solid var(--calico-ink);
  border-radius: 30px;
  background:
    radial-gradient(circle at 96% 4%, rgba(255, 214, 224, 0.5) 0 7rem, transparent 7.1rem),
    var(--calico-cream);
  box-shadow: 0 10px 0 rgba(75, 48, 42, 0.18), var(--shadow-lg);
}

.settings-modal {
  width: min(620px, 100%);
}

.settings-row {
  border: 1.5px solid var(--calico-outline);
  background: rgba(255, 253, 248, 0.78);
}

.settings-row:hover {
  background: #fff;
  border-color: rgba(201, 77, 109, 0.32);
}

.settings-row-icon {
  border: 1.5px solid rgba(75, 48, 42, 0.12);
  background: var(--calico-peach);
}

.switch {
  border: 1px solid rgba(75, 48, 42, 0.12);
  background: rgba(75, 48, 42, 0.16);
}

.settings-row[aria-pressed="true"] .switch {
  background: #7dbfa1;
}

.settings-celebration {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1.5px dashed rgba(75, 48, 42, 0.16);
}

.settings-subhead h3 {
  margin: 3px 0 6px;
  font-size: 1.35rem;
}

.settings-subhead > p:not(.eyebrow) {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.celebration-options {
  display: grid;
  gap: 8px;
  margin-top: 13px;
}

.celebration-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  text-align: left;
  border: 1.5px solid var(--calico-outline);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.72);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.celebration-option:hover {
  border-color: rgba(201, 77, 109, 0.38);
  background: #fff;
  transform: translateY(-1px);
}

.celebration-option.is-selected {
  border-color: var(--calico-pink-deep);
  background: linear-gradient(145deg, #fffdf8, #ffe4eb);
  box-shadow: 0 0 0 3px rgba(255, 214, 224, 0.65);
}

.celebration-option-icon {
  width: 36px;
  height: 36px;
  flex: none;
  border: 1.5px solid rgba(75, 48, 42, 0.12);
  border-radius: 12px;
  background: var(--calico-butter);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}

.celebration-option:nth-child(2n) .celebration-option-icon {
  background: var(--calico-mint);
}

.celebration-option:nth-child(3n) .celebration-option-icon {
  background: var(--calico-lavender);
}

.celebration-option:nth-child(4n) .celebration-option-icon {
  background: var(--calico-pink);
}

.celebration-option-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.celebration-option-copy strong {
  font-size: 0.84rem;
  font-weight: 900;
}

.celebration-option-copy small {
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.35;
}

.option-dot {
  width: 20px;
  height: 20px;
  flex: none;
  border: 1.5px solid rgba(75, 48, 42, 0.18);
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  color: transparent;
  font-size: 0.65rem;
  font-weight: 900;
}

.celebration-option.is-selected .option-dot {
  border-color: #c24a68;
  background: linear-gradient(160deg, #f891ab, #e56083);
  color: #fff;
}

.celebration-option.is-selected .option-dot::after {
  content: '✓';
}

.confetti-setting {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1.5px dashed rgba(75, 48, 42, 0.16);
  border-radius: 16px;
  background: rgba(255, 253, 248, 0.55);
}

.confetti-setting > div:first-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.confetti-setting strong {
  font-size: 0.84rem;
  font-weight: 900;
}

.confetti-setting small {
  color: var(--muted);
  font-size: 0.69rem;
}

.confetti-segments {
  flex: 1;
  min-width: 230px;
}

.confetti-segments .segment {
  padding: 7px 8px;
  font-size: 0.72rem;
}

.celebration-test {
  width: 100%;
  margin-top: 12px;
  border-color: rgba(75, 48, 42, 0.2);
  background: var(--calico-butter);
  color: #745410;
}

.celebration-test:hover {
  background: #fff3b9;
}

.settings-danger {
  border-color: rgba(169, 63, 44, 0.32);
  background: rgba(169, 63, 44, 0.045);
}

/* Boutique et café */

.cafe-screen {
  max-width: 1080px;
}

.cafe-hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(300px, 1.08fr);
  align-items: center;
  gap: clamp(20px, 4vw, 36px);
  padding: clamp(22px, 4vw, 38px);
  overflow: hidden;
  border: 2.5px solid var(--calico-ink);
  border-radius: 36px;
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 241, 184, 0.8) 0 6rem, transparent 6.1rem),
    radial-gradient(circle at 92% 90%, rgba(207, 238, 224, 0.65) 0 7rem, transparent 7.1rem),
    linear-gradient(135deg, #fffaf1, #ffe9e4 60%, #ffdce5);
  box-shadow: 0 9px 0 rgba(75, 48, 42, 0.09), var(--shadow-md);
}

.cafe-hero-copy h1 {
  margin: 6px 0 12px;
  font-size: clamp(2.3rem, 5vw, 3.6rem);
  line-height: 0.98;
}

.cafe-hero-copy > p:not(.eyebrow) {
  max-width: 46ch;
  color: var(--coffee);
  font-size: 0.95rem;
  line-height: 1.6;
}

.cafe-hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.cafe-hero-art {
  min-width: 0;
}

.cafe-hero-art .cafe-room {
  transform: rotate(-1deg);
}

.shop-section {
  margin-top: 32px;
}

.shop-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 16px;
}

.shop-heading h2 {
  margin-top: 3px;
  font-size: clamp(1.7rem, 3.2vw, 2.3rem);
}

.shop-heading > p {
  max-width: 42ch;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.shop-tabs {
  display: flex;
  gap: 8px;
  margin: 0 -4px 18px;
  padding: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.shop-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  padding: 8px 13px;
  border: 1.5px solid var(--calico-outline);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.8);
  color: var(--coffee);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.shop-tab:hover {
  background: #fff;
  border-color: rgba(201, 77, 109, 0.35);
  transform: translateY(-1px);
}

.shop-tab.is-selected {
  border-color: var(--calico-ink);
  background: linear-gradient(160deg, #f891ab, #e56083);
  color: #fff;
  box-shadow: 0 3px 0 #c24a68;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

.shop-item {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--calico-outline);
  border-radius: 24px;
  background: #fffdf8;
  box-shadow: 0 5px 0 rgba(75, 48, 42, 0.07);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.shop-item:hover {
  transform: translateY(-3px);
  border-color: rgba(201, 77, 109, 0.34);
  box-shadow: 0 8px 0 rgba(75, 48, 42, 0.08), var(--shadow-sm);
}

.shop-item.is-owned {
  border-color: rgba(125, 191, 161, 0.45);
}

.shop-item.is-equipped {
  border-color: var(--calico-pink-deep);
  background: linear-gradient(160deg, #fffdf8, #fff2f5);
  box-shadow: 0 0 0 3px rgba(255, 214, 224, 0.55), 0 5px 0 rgba(75, 48, 42, 0.07);
}

.shop-item-preview {
  height: 118px;
  margin: 10px 10px 0;
  overflow: hidden;
  border: 1.5px solid rgba(75, 48, 42, 0.12);
  border-radius: 17px;
  background: #fff6ec;
}

.shop-preview {
  display: block;
  width: 100%;
  height: 100%;
}

.shop-preview--emoji {
  display: grid;
  place-items: center;
  font-size: 3.1rem;
  background:
    radial-gradient(circle at 24% 26%, rgba(255, 255, 255, 0.8) 0 2.2rem, transparent 2.3rem),
    linear-gradient(145deg, #fff8f0, #ffe6ee);
}

.shop-preview--cat {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 78% 22%, rgba(255, 255, 255, 0.85) 0 2.4rem, transparent 2.5rem),
    linear-gradient(145deg, #fffaf1, #e2f5eb);
}

.shop-preview--cat .moka {
  width: 88px;
}

.shop-preview--wallpaper {
  box-shadow: inset 0 0 0 7px #fffaf1;
}

.shop-preview--surface {
  box-shadow: inset 0 0 0 7px #fffaf1;
}

.shop-preview--surface.counter-bois,
.shop-preview--surface.counter-damier,
.shop-preview--surface.counter-marbre {
  height: 68%;
  margin-top: 18%;
  border-top: 4px solid rgba(75, 48, 42, 0.35);
  border-bottom: 4px solid rgba(75, 48, 42, 0.2);
}

.shop-item-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px 6px;
}

.shop-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.shop-item-title h3 {
  font-size: 1.12rem;
}

.shop-equipped-mark {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: #7dbfa1;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 900;
  display: grid;
  place-items: center;
}

.shop-item-copy p {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.shop-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 14px 14px;
}

.shop-item-foot .btn {
  flex: 1;
}

.shop-item-foot .btn-primary:disabled {
  opacity: 0.82;
  border-color: #efb6c4;
  background: #fbe3e9;
  color: #9c3753;
  box-shadow: none;
}

.shop-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border: 1px solid rgba(125, 191, 161, 0.45);
  border-radius: 999px;
  background: var(--calico-mint);
  color: #3f6f58;
  font-size: 0.72rem;
  font-weight: 900;
}

.shop-state::before {
  content: '✓';
}

.shop-missing {
  width: 100%;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  text-align: center;
}

/* Décor intérieur du café */

.cafe-room {
  position: relative;
  width: 100%;
  aspect-ratio: 1.28;
  overflow: hidden;
  border: 3px solid var(--calico-ink);
  border-radius: 26px;
  background-color: #fff6ea;
  box-shadow: 0 8px 0 rgba(75, 48, 42, 0.12), var(--shadow-md);
}

.cafe-room--compact {
  aspect-ratio: 1.5;
}

.cafe-room-awning {
  position: absolute;
  inset: 0 0 auto;
  z-index: 5;
  height: 34px;
  border-bottom: 2px solid rgba(75, 48, 42, 0.35);
  background: repeating-linear-gradient(90deg, #f291ac 0 28px, #fff8ee 28px 56px);
}

.cafe-room-awning::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 13px;
  background: radial-gradient(circle at 14px -2px, #f291ac 0 13px, transparent 13.6px) 0 0 / 28px 13px repeat-x;
}

.cafe-room-sign {
  position: absolute;
  left: 50%;
  top: 46px;
  z-index: 6;
  padding: 4px 13px;
  border: 2px solid var(--calico-ink);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--calico-berry);
  font-family: var(--font-display);
  font-size: clamp(0.62rem, 1.4vw, 0.82rem);
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
  box-shadow: 0 3px 0 rgba(75, 48, 42, 0.12);
  transform: translateX(-50%) rotate(-1.5deg);
}

.cafe-room-window {
  position: absolute;
  right: 5%;
  top: 20%;
  width: 33%;
  height: 37%;
  overflow: hidden;
  border: 5px solid #fff8ee;
  border-radius: 12px;
  background: linear-gradient(#dff2fb, #b6dff0);
  box-shadow: 0 0 0 2px rgba(75, 48, 42, 0.32), inset 0 0 22px rgba(255, 255, 255, 0.55);
}

.cafe-window-sky {
  position: absolute;
  right: 12%;
  top: 13%;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #ffe9a2;
  box-shadow: 0 0 0 7px rgba(255, 233, 162, 0.3);
}

.cafe-window-city {
  position: absolute;
  inset: auto 0 0;
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 58%;
  padding: 0 6px;
}

.cafe-window-city span {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: #b7cfd9;
  box-shadow: inset 4px 4px 0 rgba(255, 255, 255, 0.24);
}

.cafe-window-city span:nth-child(1) {
  height: 58%;
  background: #c7b9d6;
}

.cafe-window-city span:nth-child(2) {
  height: 88%;
  background: #a9c4d1;
}

.cafe-window-city span:nth-child(3) {
  height: 42%;
  background: #d4b7bd;
}

.cafe-window-city span:nth-child(4) {
  height: 72%;
  background: #b3c9bd;
}

.cafe-window-sill {
  position: absolute;
  inset: auto -6px -6px;
  height: 7px;
  border: 2px solid rgba(75, 48, 42, 0.35);
  border-radius: 4px;
  background: #fff8ee;
}

.cafe-room-shelf {
  position: absolute;
  left: 5%;
  top: 23%;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  z-index: 4;
  font-size: clamp(0.9rem, 2vw, 1.35rem);
}

.cafe-room-shelf::after {
  content: '';
  position: absolute;
  left: -6px;
  right: -6px;
  bottom: -7px;
  height: 6px;
  border: 1.5px solid rgba(75, 48, 42, 0.4);
  border-radius: 3px;
  background: #d6a97c;
}

.cafe-room-lights {
  position: absolute;
  left: 4%;
  right: 4%;
  top: 58px;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  height: 22px;
}

.cafe-room-lights::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 12px;
  border-top: 2px solid rgba(75, 48, 42, 0.4);
  border-radius: 50%;
}

.cafe-room-lights span {
  width: 7px;
  height: 9px;
  margin-top: 9px;
  border-radius: 50% 50% 55% 55%;
  background: #e9b84a;
  box-shadow: 0 0 7px rgba(233, 184, 74, 0.9);
  animation: cafe-bulb 2.8s ease-in-out infinite;
}

.cafe-room-lights span:nth-child(2n) {
  background: #f291ac;
  box-shadow: 0 0 7px rgba(242, 145, 172, 0.9);
  animation-delay: 0.4s;
}

.cafe-room-lights span:nth-child(3n) {
  background: #7dbfa1;
  box-shadow: 0 0 7px rgba(125, 191, 161, 0.9);
  animation-delay: 0.8s;
}

.cafe-room-lights.lights-lanternes span {
  width: 13px;
  height: 17px;
  margin-top: 6px;
  border: 1.5px solid rgba(75, 48, 42, 0.35);
  border-radius: 50% 50% 45% 45%;
  background: #ffd6e0;
  box-shadow: 0 0 9px rgba(255, 214, 224, 0.9);
}

.cafe-room-lights.lights-lanternes span:nth-child(2n) {
  background: #fff1b8;
}

.cafe-room-lights.lights-lanternes span:nth-child(3n) {
  background: #d6edfa;
}

.cafe-room-floor {
  position: absolute;
  inset: auto 0 0;
  height: 24%;
  border-top: 2px solid rgba(75, 48, 42, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), transparent 40%),
    repeating-linear-gradient(90deg, #e8c9a7 0 40px, #ddb992 40px 80px);
}

.cafe-room-counter {
  position: absolute;
  right: 4%;
  bottom: 17%;
  z-index: 5;
  width: 55%;
  height: 24%;
  border: 2.5px solid var(--calico-ink);
  border-radius: 9px 9px 6px 6px;
  box-shadow: 0 7px 0 rgba(75, 48, 42, 0.18);
}

.cafe-room-counter::before {
  content: '';
  position: absolute;
  inset: -6px -6px auto;
  height: 11px;
  border: 2px solid var(--calico-ink);
  border-radius: 5px;
  background: #fff6e8;
}

.cafe-espresso {
  position: absolute;
  left: 12%;
  bottom: 22%;
  font-size: clamp(1rem, 2.4vw, 1.7rem);
  filter: drop-shadow(0 2px 1px rgba(75, 48, 42, 0.18));
}

.cafe-pastry-case {
  position: absolute;
  right: 8%;
  bottom: 10%;
  display: flex;
  gap: 4px;
  padding: 3px 6px;
  border: 1.5px solid rgba(75, 48, 42, 0.35);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.45);
  font-size: clamp(0.72rem, 1.8vw, 1.15rem);
}

.cafe-room-table {
  position: absolute;
  left: 14%;
  bottom: 8%;
  z-index: 4;
  width: 31%;
  height: 19%;
  border: 2.5px solid var(--calico-ink);
  border-radius: 50% 50% 9px 9px;
  background-color: #fff3df;
  box-shadow: 0 6px 0 rgba(75, 48, 42, 0.16);
}

.cafe-room-table::after {
  content: '';
  position: absolute;
  left: 42%;
  bottom: -20%;
  width: 16%;
  height: 20%;
  border: 2px solid var(--calico-ink);
  border-top: 0;
  background: #d6a97c;
}

.cafe-table-cup,
.cafe-table-plate {
  position: absolute;
  z-index: 2;
  font-size: clamp(0.8rem, 2vw, 1.25rem);
  filter: drop-shadow(0 1px 0 rgba(75, 48, 42, 0.2));
}

.cafe-table-cup {
  left: 24%;
  top: 14%;
}

.cafe-table-plate {
  right: 22%;
  top: 30%;
}

.cafe-room-plant {
  position: absolute;
  left: 4%;
  bottom: 20%;
  z-index: 5;
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  filter: drop-shadow(0 4px 2px rgba(75, 48, 42, 0.15));
}

.cafe-room-cat {
  position: absolute;
  left: 47%;
  bottom: 5%;
  z-index: 7;
  width: 82px;
  text-align: center;
}

.cafe-room-cat .moka {
  width: 100%;
  filter: drop-shadow(0 5px 3px rgba(75, 48, 42, 0.16));
}

.cafe-cat-name {
  display: inline-block;
  margin-top: -6px;
  padding: 2px 8px;
  border: 1.5px solid rgba(75, 48, 42, 0.3);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--calico-berry);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.03em;
}

/* Papiers peints de la boutique */

.wallpaper-vanille {
  background-color: #fff6ea;
  background-image:
    radial-gradient(#ecd7bd 1.4px, transparent 1.5px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.4), transparent 50%);
  background-size: 20px 20px, 100% 100%;
}

.wallpaper-menthe {
  background-color: #e1f5ea;
  background-image:
    repeating-linear-gradient(90deg, rgba(111, 168, 143, 0.2) 0 13px, transparent 13px 26px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 60%);
}

.wallpaper-fraise {
  background-color: #ffe5eb;
  background-image:
    radial-gradient(circle at 30% 30%, #f7b7c7 0 3px, transparent 3.5px),
    radial-gradient(circle at 75% 72%, #f7b7c7 0 3px, transparent 3.5px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 60%);
  background-size: 32px 32px, 32px 32px, 100% 100%;
}

.wallpaper-lavande {
  background-color: #f1e9fc;
  background-image:
    radial-gradient(circle at 50% 50%, #cdb9ea 0 2px, transparent 2.5px),
    radial-gradient(circle at 0 0, #cdb9ea 0 1.5px, transparent 2px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.45), transparent 60%);
  background-size: 30px 30px, 30px 30px, 100% 100%;
}

.wallpaper-ciel {
  background-color: #e7f4fb;
  background-image:
    radial-gradient(ellipse at 22% 22%, #fff 0 14%, transparent 15%),
    radial-gradient(ellipse at 43% 18%, #fff 0 10%, transparent 11%),
    radial-gradient(ellipse at 82% 34%, #fff 0 11%, transparent 12%),
    linear-gradient(180deg, #e7f4fb, #b5def1);
  background-size: 100% 100%, 100% 100%, 100% 100%, 100% 100%;
}

/* Comptoirs et tables de la boutique */

.counter-bois {
  background-color: #e8c69e;
  background-image:
    repeating-linear-gradient(90deg, rgba(150, 106, 69, 0.25) 0 2px, transparent 2px 15px),
    linear-gradient(180deg, #f0d4b2, #d6a97c);
}

.counter-damier {
  background-color: #fff0e2;
  background-image:
    linear-gradient(45deg, #f6b7c5 25%, transparent 25%, transparent 75%, #f6b7c5 75%),
    linear-gradient(45deg, #f6b7c5 25%, transparent 25%, transparent 75%, #f6b7c5 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}

.counter-marbre {
  background-color: #f8f1e6;
  background-image:
    repeating-linear-gradient(118deg, transparent 0 17px, rgba(201, 162, 93, 0.32) 18px 20px, transparent 21px 38px),
    linear-gradient(145deg, #fffaf2, #ded3c5);
}

.table-creme {
  background-color: #fff3df;
}

.table-pois {
  background-color: #b8e2cd;
  background-image: radial-gradient(#fffdf8 2px, transparent 2.5px);
  background-size: 12px 12px;
}

.table-carreaux {
  background-color: #f5b4c2;
  background-image:
    linear-gradient(90deg, rgba(255, 244, 233, 0.75) 50%, transparent 50%),
    linear-gradient(rgba(255, 244, 233, 0.75) 50%, transparent 50%);
  background-size: 18px 18px;
}

/* Célébrations */

.celebration-layer {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: none;
  pointer-events: none;
}

.celebration-layer.is-active {
  display: block;
  pointer-events: auto;
  cursor: pointer;
  touch-action: manipulation;
}

.celebration-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
}

.celebration-scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(255, 248, 238, 0.2), transparent 26rem),
    linear-gradient(135deg, rgba(255, 214, 224, 0.82), rgba(255, 241, 184, 0.78));
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

.celebration-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: min(380px, 88vw);
  padding: 15px 18px 18px;
  border: 3px solid var(--calico-ink);
  border-radius: 30px;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 241, 184, 0.9) 0 4rem, transparent 4.1rem),
    #fffaf1;
  box-shadow: 0 12px 0 rgba(75, 48, 42, 0.17), var(--shadow-lg);
  transform: rotate(-2deg);
  animation: celebration-pop 0.42s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

.celebration-card img {
  width: 100%;
  max-height: 250px;
  object-fit: cover;
  border: 2px solid var(--calico-ink);
  border-radius: 19px;
  background: var(--calico-pink);
}

.celebration-card.is-fallback img {
  display: none;
}

.celebration-card.is-fallback::after {
  content: '🎉';
  display: grid;
  place-items: center;
  width: 100%;
  height: 150px;
  border: 2px solid var(--calico-ink);
  border-radius: 19px;
  background: linear-gradient(145deg, var(--calico-butter), var(--calico-pink));
  font-size: 4rem;
}

.celebration-card.is-fallback .celebration-word,
.celebration-layer.is-preview .celebration-word {
  display: inline-block;
}

.celebration-emoji {
  position: absolute;
  left: -16px;
  top: -20px;
  font-size: 2.2rem;
  filter: drop-shadow(0 3px 0 rgba(75, 48, 42, 0.12));
  transform: rotate(-9deg);
}

.celebration-word {
  display: none;
  padding: 5px 15px;
  border: 2px solid var(--calico-ink);
  border-radius: 999px;
  background: var(--calico-butter);
  color: var(--calico-berry);
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.1;
  transform: rotate(1deg);
  box-shadow: 0 3px 0 rgba(75, 48, 42, 0.1);
}

.celebration-hint {
  display: inline-block;
  padding: 4px 11px;
  border: 1.5px solid rgba(75, 48, 42, 0.14);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.8);
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  animation: hint-breathe 2.4s ease-in-out infinite;
}

.celebration-overlay--corner .celebration-hint {
  padding: 3px 8px;
  font-size: 0.58rem;
}

.celebration-overlay--fullscreen .celebration-hint {
  font-size: 0.72rem;
}

.celebration-overlay--corner {
  place-items: start end;
  padding: calc(74px + env(safe-area-inset-top)) 18px 18px;
}

.celebration-overlay--corner .celebration-card {
  width: min(235px, 64vw);
  gap: 7px;
  padding: 10px 11px 12px;
  border-radius: 22px;
  transform: rotate(2.5deg);
}

.celebration-overlay--corner .celebration-card img {
  max-height: 135px;
  border-radius: 14px;
}

.celebration-overlay--corner .celebration-word {
  padding: 3px 11px;
  font-size: 1.2rem;
}

.celebration-overlay--corner .celebration-emoji {
  left: -11px;
  top: -14px;
  font-size: 1.5rem;
}

.celebration-overlay--corner .celebration-card.is-fallback::after {
  height: 100px;
  font-size: 3rem;
}

.celebration-overlay--long .celebration-card {
  width: min(430px, 90vw);
  padding: 18px 20px 22px;
}

.celebration-overlay--long .celebration-card img {
  max-height: 290px;
}

.celebration-overlay--long .celebration-word {
  font-size: 2.1rem;
}

.celebration-overlay--fullscreen .celebration-card {
  width: min(580px, 91vw);
  padding: 22px 24px 26px;
  gap: 14px;
  transform: rotate(-1deg);
}

.celebration-overlay--fullscreen .celebration-card img {
  max-height: 330px;
}

.celebration-overlay--fullscreen .celebration-word {
  padding: 7px 22px;
  font-size: clamp(2rem, 6vw, 2.9rem);
}

.celebration-overlay--fullscreen .celebration-emoji {
  font-size: 2.8rem;
}

/* On garde le stamp « Bravo » lisible au-dessus du GIF */

.order-card.is-served .celebration-stamp {
  border-color: var(--calico-berry);
  background: rgba(255, 251, 244, 0.95);
  color: var(--calico-berry);
  box-shadow: 0 3px 0 rgba(75, 48, 42, 0.1);
}

/* Petites animations du thème */

@keyframes cafe-bulb {
  0%, 100% { opacity: 0.65; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(2px); }
}

@keyframes cafe-steam-drift {
  0%, 100% { transform: translateY(0) scaleY(1); opacity: 0.45; }
  50% { transform: translateY(-14px) scaleY(1.14); opacity: 0.9; }
}

@keyframes moka-wag {
  0%, 100% { transform: rotate(0deg); }
  35% { transform: rotate(-9deg); }
  70% { transform: rotate(5deg); }
}

@keyframes moka-blink {
  0%, 45%, 52%, 100% { transform: scaleY(1); }
  48%, 50% { transform: scaleY(0.12); }
}

@keyframes moka-bob {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-6px) rotate(1deg); }
}

@keyframes celebration-pop {
  0% { opacity: 0; transform: rotate(-2deg) scale(0.66); }
  62% { opacity: 1; transform: rotate(1deg) scale(1.04); }
  100% { opacity: 1; transform: rotate(-2deg) scale(1); }
}

@keyframes hint-breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

@keyframes tips-in {
  0% { opacity: 0; transform: translateY(7px) scale(0.85); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* --------------------------------------------------------------------------
   Toast et confettis
   -------------------------------------------------------------------------- */

#toast-root {
  position: fixed;
  left: 50%;
  top: calc(78px + env(safe-area-inset-top));
  z-index: 130;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transform: translateX(-50%);
}

.toast {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--espresso);
  color: var(--cream);
  box-shadow: var(--shadow-md);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
  animation: toast-in 0.25s ease both;
}

.toast.is-leaving {
  animation: toast-out 0.25s ease both;
}

#confetti-canvas {
  position: fixed;
  inset: 0;
  z-index: 120;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Animations
   -------------------------------------------------------------------------- */

@keyframes screen-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes hero-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-8px);
  }
}

@keyframes steam {
  0%,
  100% {
    opacity: 0.5;
    transform: translateY(2px);
  }
  50% {
    opacity: 0.95;
    transform: translateY(-4px);
  }
}

@keyframes pop {
  0% {
    transform: scale(0.97);
  }
  60% {
    transform: scale(1.015);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-4px);
  }
  50% {
    transform: translateX(4px);
  }
  75% {
    transform: translateX(-2px);
  }
}

@keyframes score-bump {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.08);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes points-float {
  0% {
    opacity: 1;
    transform: translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateY(-26px);
  }
}

@keyframes stamp {
  0% {
    opacity: 0;
    transform: scale(1.6) rotate(-9deg);
  }
  100% {
    opacity: 0.9;
    transform: scale(1) rotate(-9deg);
  }
}

@keyframes feedback-in {
  from {
    opacity: 0;
    transform: translate(-50%, 18px);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-8px);
  }
}

@keyframes urgent-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

/* --------------------------------------------------------------------------
   Adaptations
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    max-width: 700px;
  }

  .hero-art {
    min-height: 240px;
  }

  .hero-art-inner {
    width: min(100%, 330px);
  }

  .record-columns {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .record-column {
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .record-column:last-child {
    padding-bottom: 0;
    border-bottom: 0;
  }

  .record-row {
    max-width: 560px;
  }
}

@media (max-width: 760px) {
  .screen {
    width: calc(100% - 28px);
    padding-top: 18px;
  }

  .game-screen {
    width: calc(100% - 22px);
    padding-top: 12px;
  }

  .hero {
    padding: 28px 24px;
    border-radius: 28px;
  }

  .hero h1 {
    font-size: clamp(2.2rem, 8vw, 3rem);
  }

  .hero-art {
    min-height: 210px;
  }

  .board-grid {
    grid-template-columns: 1fr;
  }

  .board-item {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    column-gap: 12px;
  }

  .board-icon {
    grid-row: span 2;
    margin: 0;
  }

  .board-mode {
    grid-column: 2;
  }

  .board-item strong,
  .board-player,
  .board-empty,
  .board-desc {
    grid-column: 2;
  }

  .player-strip {
    align-items: flex-start;
  }

  .player-tools {
    width: 100%;
    justify-content: space-between;
  }

  .notebook-stats,
  .result-stats {
    grid-template-columns: 1fr 1fr;
  }

  .best-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: 1fr 1fr;
  }

  .category-card {
    align-items: flex-start;
  }

  .custom-section {
    padding: 20px;
  }

  .operation-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .custom-finish {
    grid-template-columns: 1fr;
  }

  .category-check {
    position: absolute;
    right: 12px;
    top: 12px;
  }

  .notebook-head .btn {
    margin-left: 0;
  }

  .feedback-sheet {
    flex-wrap: wrap;
    padding: 16px;
  }

  .feedback-continue {
    width: 100%;
    margin-top: 2px;
  }

  .feedback-auto {
    margin-left: auto;
  }

  .modal {
    padding: 24px 22px;
  }
}

@media (max-width: 560px) {
  .brand-word {
    font-size: 1rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .icon-btn {
    width: 41px;
    height: 41px;
  }

  .hero {
    padding: 26px 20px;
  }

  .hero-chips {
    gap: 6px;
  }

  .hero-chips span {
    font-size: 0.68rem;
    padding: 5px 9px;
  }

  .hero-actions {
    align-items: stretch;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .onboarding {
    padding: 22px;
  }

  .onboarding .btn {
    width: 100%;
  }

  .profile-grid {
    grid-template-columns: 1fr;
  }

  .mode-card {
    min-height: auto;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .atelier-start {
    align-items: stretch;
  }

  .atelier-start .btn {
    width: 100%;
  }

  .custom-section {
    padding: 18px;
  }

  .custom-section-head {
    gap: 10px;
  }

  .custom-step {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }

  .custom-mode-switch {
    width: 100%;
  }

  .custom-section .segment {
    padding: 8px 9px;
    font-size: 0.74rem;
  }

  .custom-panel {
    padding: 14px;
  }

  .range-fields input,
  .number-add-row input {
    width: 88px;
  }

  .number-add-row input {
    flex: 1;
    width: auto;
    min-width: 88px;
  }

  .table-grid {
    grid-template-columns: repeat(auto-fit, minmax(42px, 1fr));
  }

  .custom-preview-card,
  .custom-start-card {
    padding: 20px;
  }

  .custom-start-card .btn {
    font-size: 0.92rem;
  }

  .game-topbar {
    gap: 8px;
  }

  .hearts {
    gap: 2px;
  }

  .heart {
    width: 23px;
    height: 23px;
  }

  .timer-hud {
    padding: 6px 12px;
    font-size: 1.25rem;
  }

  .timer-hud svg {
    width: 18px;
    height: 18px;
  }

  .score-pill {
    min-width: 74px;
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .order-head {
    padding: 14px 16px;
  }

  .customer-avatar {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .customer-name {
    font-size: 1.02rem;
  }

  .customer-tagline {
    font-size: 0.66rem;
  }

  .topic-tag {
    font-size: 0.57rem;
    padding: 4px 7px;
  }

  .order-body {
    padding: 20px 16px 18px;
  }

  .question-text {
    font-size: clamp(1.1rem, 4.7vw, 1.35rem);
  }

  .pie {
    width: 126px;
    height: 126px;
  }

  .answers {
    gap: 8px;
    margin-top: 20px;
  }

  .answer-btn {
    min-height: 68px;
    padding: 12px 12px;
    border-radius: 15px;
    font-size: clamp(1.1rem, 5vw, 1.4rem);
  }

  .answer-key {
    left: 7px;
    top: 7px;
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
  }

  .order-foot {
    padding: 10px 16px;
    font-size: 0.56rem;
  }

  .celebration-stamp {
    right: 16px;
    font-size: 1.25rem;
  }

  .results-hero {
    padding: 30px 18px 26px;
  }

  .result-stats {
    gap: 8px;
  }

  .stat-card {
    padding: 14px 8px;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .stat-label {
    font-size: 0.6rem;
  }

  .result-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .result-actions .btn {
    width: 100%;
  }

  .best-grid {
    grid-template-columns: 1fr;
  }

  .badge-grid {
    grid-template-columns: 1fr;
  }

  .records-actions .btn,
  .notebook-actions .btn {
    width: 100%;
  }

  .modal-actions .spacer {
    display: none;
  }

  .modal-actions .btn {
    flex: 1;
  }

  .modal-actions .btn-danger-ghost {
    flex-basis: 100%;
  }

  .avatar-grid {
    gap: 6px;
  }

  .avatar-choice {
    font-size: 21px;
  }

  .pause-modal {
    padding: 24px 20px;
  }

  .profile-modal .modal-actions .btn {
    padding: 11px 12px;
    font-size: 0.84rem;
  }
}

@media (max-width: 390px) {
  .screen {
    width: calc(100% - 20px);
  }

  .brand-word {
    font-size: 0.92rem;
  }

  .brand {
    gap: 7px;
  }

  .topbar {
    gap: 8px;
  }

  .topbar-left {
    gap: 8px;
  }

  .topbar-actions {
    gap: 5px;
  }

  .hero h1 {
    font-size: 2.05rem;
  }

  .hero-art {
    min-height: 180px;
  }

  .game-screen {
    width: calc(100% - 16px);
  }

  .score-pill {
    min-width: 64px;
    font-size: 0.82rem;
    gap: 4px;
    padding: 7px 10px;
  }

  .score-pill svg {
    width: 14px;
    height: 14px;
  }

  .hearts {
    gap: 1px;
  }

  .heart {
    width: 20px;
    height: 20px;
  }

  .timer-hud {
    font-size: 1.1rem;
    padding: 6px 10px;
  }

  .order-head {
    gap: 8px;
  }

  .customer {
    gap: 8px;
  }

  .customer-tagline {
    max-width: 110px;
  }

  .answer-btn {
    min-height: 62px;
    font-size: 1.12rem;
  }

  .answer-btn.is-correct::after,
  .answer-btn.is-wrong::after {
    right: 7px;
  }

  .game-meta {
    font-size: 0.68rem;
  }

  .feedback-sheet {
    width: calc(100% - 16px);
    bottom: calc(8px + env(safe-area-inset-bottom));
  }

  .results-hero h1 {
    font-size: 1.8rem;
  }

  .result-score strong {
    font-size: 2.6rem;
  }

  .modal {
    padding: 22px 18px;
  }

  .op-chip {
    gap: 5px;
    padding: 8px 6px;
    font-size: 0.76rem;
  }

  .op-symbol {
    width: 22px;
    height: 22px;
    font-size: 0.98rem;
  }

  .custom-hint {
    font-size: 0.7rem;
  }
}

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

/* --------------------------------------------------------------------------
   Café Calico — adaptations mobiles
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .cafe-hero {
    grid-template-columns: 1fr;
  }

  .cafe-hero-copy {
    max-width: 640px;
  }

  .cafe-hero-art {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
  }

  .shop-grid {
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  }
}

@media (max-width: 760px) {
  .hero-moka {
    width: 100px;
  }

  .hero-moka-bubble {
    right: 70px;
    font-size: 0.62rem;
  }

  .moka-says-cat {
    width: 72px;
  }

  .moka-says-bubble {
    padding: 10px 13px;
    font-size: 0.84rem;
  }

  .cafe-room-cat {
    width: 72px;
  }

  .cafe-room-awning {
    height: 29px;
  }

  .cafe-room-awning::after {
    height: 11px;
    background-size: 24px 11px;
  }

  .cafe-room-sign {
    top: 40px;
  }

  .cafe-room-lights {
    top: 49px;
  }

  .shop-item-preview {
    height: 108px;
  }

  .celebration-overlay--fullscreen .celebration-card {
    width: min(520px, 92vw);
  }
}

@media (max-width: 560px) {
  .cafe-world-garland,
  .cafe-world-steam {
    display: none;
  }

  .cafe-world-paws {
    font-size: 1.8rem;
  }

  .hero {
    padding-bottom: 34px;
  }

  .hero-moka {
    right: 0;
    bottom: -18px;
    width: 88px;
  }

  .hero-moka-bubble {
    right: 62px;
    top: -12px;
    padding: 3px 7px;
    font-size: 0.58rem;
  }

  .player-strip {
    padding: 17px 16px;
  }

  .player-avatar {
    width: 56px;
    height: 56px;
    font-size: 30px;
  }

  .player-tools {
    flex-direction: column;
    align-items: flex-start;
  }

  .player-actions {
    width: 100%;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .player-actions .btn-sm {
    flex: none;
    padding: 7px 9px;
    font-size: 0.72rem;
    white-space: nowrap;
  }

  .player-actions .icon-btn {
    width: 36px;
    height: 36px;
  }

  .player-actions .tips-pill {
    padding: 6px 9px;
    font-size: 0.68rem;
  }

  .site-footer {
    flex-direction: column;
    gap: 3px;
  }

  .moka-says {
    gap: 5px;
  }

  .moka-says-cat {
    width: 62px;
  }

  .moka-says-bubble {
    margin-bottom: 4px;
    padding: 9px 11px;
    font-size: 0.79rem;
  }

  .moka-says-bubble::before {
    left: -8px;
    width: 11px;
    height: 11px;
  }

  .tips-pill {
    padding: 6px 10px;
    font-size: 0.7rem;
  }

  .cafe-hero {
    padding: 20px 16px 24px;
    border-radius: 28px;
  }

  .cafe-hero-copy h1 {
    font-size: 2.3rem;
  }

  .cafe-room {
    aspect-ratio: 1.16;
    border-radius: 21px;
  }

  .cafe-room-cat {
    left: 46%;
    width: 64px;
  }

  .cafe-room-sign {
    top: 34px;
    padding: 3px 9px;
    font-size: 0.56rem;
  }

  .cafe-room-awning {
    height: 25px;
  }

  .cafe-room-lights {
    top: 42px;
    height: 18px;
  }

  .cafe-room-lights span {
    width: 5px;
    height: 7px;
  }

  .cafe-room-window {
    border-width: 4px;
  }

  .cafe-room-counter {
    bottom: 15%;
  }

  .cafe-room-table {
    left: 10%;
    width: 34%;
  }

  .cafe-room-plant {
    left: 2%;
    font-size: 1.9rem;
  }

  .shop-heading > p {
    font-size: 0.78rem;
  }

  .shop-tabs {
    flex-wrap: wrap;
    overflow-x: visible;
  }

  .shop-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .shop-item {
    border-radius: 20px;
  }

  .shop-item-preview {
    height: 92px;
    margin: 8px 8px 0;
  }

  .shop-item-copy {
    padding: 10px 11px 5px;
  }

  .shop-item-title h3 {
    font-size: 0.98rem;
  }

  .shop-item-copy p {
    font-size: 0.69rem;
  }

  .shop-item-foot {
    padding: 8px 10px 11px;
  }

  .shop-item-foot .btn {
    padding: 7px 9px;
    font-size: 0.7rem;
  }

  .shop-preview--emoji {
    font-size: 2.5rem;
  }

  .shop-preview--cat .moka {
    width: 68px;
  }

  .settings-modal {
    width: 100%;
  }

  .celebration-option {
    gap: 9px;
    padding: 9px 10px;
  }

  .celebration-option-icon {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .celebration-option-copy small {
    font-size: 0.65rem;
  }

  .confetti-segments {
    min-width: 100%;
  }

  .celebration-card {
    width: min(330px, 90vw);
    padding: 12px 13px 15px;
    border-radius: 24px;
  }

  .celebration-card img {
    max-height: 200px;
  }

  .celebration-word {
    font-size: 1.5rem;
  }

  .celebration-overlay--corner {
    padding-top: calc(64px + env(safe-area-inset-top));
    padding-right: 10px;
  }

  .celebration-overlay--corner .celebration-card {
    width: min(190px, 58vw);
  }

  .celebration-overlay--corner .celebration-card img {
    max-height: 105px;
  }

  .celebration-overlay--corner .celebration-word {
    font-size: 1rem;
  }

  .celebration-overlay--fullscreen {
    padding: 12px;
  }

  .celebration-overlay--fullscreen .celebration-card {
    width: 94vw;
    padding: 16px 16px 20px;
  }

  .celebration-overlay--fullscreen .celebration-card img {
    max-height: 230px;
  }

  .celebration-overlay--fullscreen .celebration-word {
    font-size: 1.9rem;
  }
}

@media (max-width: 390px) {
  .player-actions {
    gap: 4px;
  }

  .player-actions .btn-sm {
    padding: 6px 7px;
    font-size: 0.68rem;
  }

  .player-actions .icon-btn {
    width: 32px;
    height: 32px;
  }

  .player-actions [data-action="open-profile-edit"] {
    display: none;
  }

  .player-actions .tips-pill {
    gap: 4px;
    padding: 5px 7px;
    font-size: 0.62rem;
  }

  .player-actions .tips-pill svg {
    width: 13px;
    height: 13px;
  }

  .hero-moka {
    width: 78px;
  }

  .hero-moka-bubble {
    display: none;
  }

  .cafe-hero-copy h1 {
    font-size: 2rem;
  }

  .cafe-room {
    aspect-ratio: 1.06;
  }

  .cafe-room-cat {
    left: 44%;
    width: 58px;
  }

  .cafe-room-sign {
    top: 31px;
    font-size: 0.5rem;
  }

  .cafe-room-shelf {
    font-size: 0.82rem;
  }

  .cafe-pastry-case {
    font-size: 0.66rem;
  }

  .cafe-room-table {
    width: 38%;
  }

  .shop-grid {
    grid-template-columns: 1fr;
  }

  .shop-item-preview {
    height: 112px;
  }

  .shop-item-title h3 {
    font-size: 1.05rem;
  }

  .celebration-option-copy small {
    display: none;
  }

  .celebration-word {
    font-size: 1.3rem;
  }

  .celebration-overlay--fullscreen .celebration-word {
    font-size: 1.6rem;
  }

  .celebration-overlay--fullscreen .celebration-card img {
    max-height: 190px;
  }
}

/* PIN de profil et records partagés */

.pin-error {
  margin: 4px 0 0;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 800;
}

.records-shared-toggle {
  margin-top: 14px;
}
