/* Plouf Pop! — interface en verre dépoli, univers sous-marin unique (pas de thème clair/sombre). */

@font-face { font-family: 'FredokaLocal'; src: url('../fonts/fredoka-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'FredokaLocal'; src: url('../fonts/fredoka-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'FredokaLocal'; src: url('../fonts/fredoka-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: swap; }

:root {
  /* Aquarium : verre nacré sur eau turquoise, accent pêche-corail au soleil */
  --deep: #0F5F86;
  --ink: #2A2F57;
  --text: #FFFFFF;
  --glass: rgba(10, 52, 90, 0.46);
  --glass-strong: rgba(255, 255, 255, 0.3);
  --line: rgba(255, 255, 255, 0.45);
  --peach-a: #FFF1CC;
  --peach-b: #FFC3A0;
  --rose: #FF9EB4;
  --gold: #FFE08A;
  --violet: #B9A4FF;
  --coral: #FF9C8A;
  --shadow: 0 6px 14px rgba(6, 32, 64, 0.3); /* ombre courte : les grandes ombres floues créent des images fantômes sur Android */
  --font: 'FredokaLocal', 'Fredoka', ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, sans-serif;
  --safe-t: max(env(safe-area-inset-top, 0px), var(--safe-area-inset-top, 0px));
  --safe-b: max(env(safe-area-inset-bottom, 0px), var(--safe-area-inset-bottom, 0px));
  --safe-l: max(env(safe-area-inset-left, 0px), var(--safe-area-inset-left, 0px));
  --safe-r: max(env(safe-area-inset-right, 0px), var(--safe-area-inset-right, 0px));
  color-scheme: dark;
}

html, body {
  height: 100%;
  margin: 0;
  background: linear-gradient(180deg, #B4F5EA, #46C6CC 45%, var(--deep)) fixed;
  color: var(--text);
  font-family: var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

#cv { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#ui { position: fixed; inset: 0; pointer-events: none; }
#ui button, #ui .card, #ui .pearls { pointer-events: auto; }

button { font-family: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.85); outline-offset: 3px; }
svg { display: block; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: 600 17px/1 var(--font);
  color: var(--text);
  padding: 13px 20px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(10, 40, 80, 0.35);
  transition: transform 0.18s cubic-bezier(.3, 1.6, .5, 1), background 0.2s;
}
.btn svg { width: 20px; height: 20px; }
.btn:active, .iconbtn:active, .tool:active { transform: scale(0.92); }
.btn.primary {
  color: #5B2C40;
  text-shadow: none;
  background: linear-gradient(180deg, var(--peach-a), var(--peach-b) 58%, var(--rose));
  border-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 12px 30px rgba(255, 130, 150, 0.38), inset 0 2px 0 rgba(255, 255, 255, 0.85), inset 0 -3px 0 rgba(200, 80, 110, 0.18);
}
.btn.big { flex-direction: column; gap: 4px; font-size: 28px; padding: 16px 60px 14px; }
.btn.big small { font-size: 14px; font-weight: 500; opacity: 0.8; }
.btn.wide { width: 100%; }
.breathe { animation: breathe 4.5s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.045); } }

.iconbtn {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 50%;
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s cubic-bezier(.3, 1.6, .5, 1);
  padding: 0;
}
.iconbtn svg { width: 22px; height: 22px; }

/* ---------- Écran titre ---------- */
.screen[hidden] { display: none !important; }
#title { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; align-items: center; text-align: center;
  padding-top: calc(var(--safe-t) + 9vh); padding-bottom: calc(var(--safe-b) + 6vh);
  padding-left: max(16px, var(--safe-l)); padding-right: max(16px, var(--safe-r)); }
.title-top, .title-bottom { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.title-bottom { gap: 16px; }
.logo { margin: 0; display: flex; flex-direction: column; align-items: center; line-height: 0.9; font-weight: 700; }
.logo-line { display: flex; font-size: clamp(64px, 20vw, 118px); letter-spacing: -0.01em; }
.logo-line span {
  display: inline-block;
  color: #FFFFFF;
  text-shadow: 0 3px 0 rgba(60, 150, 190, 0.55), 0 8px 24px rgba(0, 60, 110, 0.35), 0 0 40px rgba(200, 255, 250, 0.45);
  animation: bob 3.6s ease-in-out infinite;
}
.logo-line span:nth-child(2) { animation-delay: -0.4s; }
.logo-line span:nth-child(3) { animation-delay: -0.8s; }
.logo-line span:nth-child(4) { animation-delay: -1.2s; }
.logo-line span:nth-child(5) { animation-delay: -1.6s; }
@keyframes bob { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }
.logo-pop {
  margin-top: 6px;
  font-size: clamp(34px, 10vw, 56px);
  padding: 4px 22px 8px;
  border-radius: 999px;
  color: #5B2C40;
  background: linear-gradient(180deg, var(--peach-a), var(--peach-b) 60%, var(--rose));
  box-shadow: 0 10px 28px rgba(255, 130, 150, 0.4), inset 0 2px 0 rgba(255, 255, 255, 0.9);
  transform: rotate(-4deg);
  animation: popTilt 5s ease-in-out infinite;
}
@keyframes popTilt { 0%, 100% { transform: rotate(-4deg) scale(1); } 50% { transform: rotate(3deg) scale(1.05); } }
.tagline { margin: 6px 0 0; font-size: 17px; font-weight: 500; opacity: 0.92; text-shadow: 0 1px 6px rgba(10, 50, 90, 0.4); max-width: 30ch; text-wrap: balance; }
.world { margin: 0; font-size: 14px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.85; text-shadow: 0 1px 6px rgba(10, 50, 90, 0.5); }
.row { display: flex; gap: 10px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* ---------- HUD ---------- */
.hud-top {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(var(--safe-t) + 10px) max(14px, var(--safe-r)) 0 max(14px, var(--safe-l));
}
.lvl { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.lvl-num { font-size: 22px; font-weight: 700; text-shadow: 0 1px 2px rgba(5, 35, 70, 0.6), 0 2px 10px rgba(5, 35, 70, 0.55); white-space: nowrap; }
.tier { font-size: 11px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--glass); }
.tier.hard { background: rgba(255, 140, 120, 0.4); }
.tier.boss { background: rgba(150, 120, 255, 0.45); }
.tier.easy { background: rgba(140, 255, 210, 0.3); }
.pearls {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 14px 7px 8px; border-radius: 999px;
  font-size: 19px; font-weight: 700; font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 2px rgba(5, 35, 70, 0.5);
  border: 1px solid var(--line); background: var(--glass);
  box-shadow: var(--shadow);
}
.pearls.bump { animation: bump 0.35s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes bump { 50% { transform: scale(1.18); } }
.pearl {
  display: inline-block; width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, #FFFFFF 0 14%, #FFF0F5 30%, #F0D2E4 62%, #C9A6CC 100%);
  box-shadow: 0 2px 6px rgba(80, 40, 90, 0.35), inset 0 -2px 3px rgba(150, 100, 160, 0.35);
}
.pearl.sm { width: 11px; height: 11px; }
.hud-sub {
  position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--safe-t) + 66px);
  padding: 4px 14px; border-radius: 999px; background: var(--glass); white-space: nowrap;
  display: flex; justify-content: center; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 500; text-shadow: 0 1px 6px rgba(10, 50, 90, 0.5);
}
.mini-stars { display: flex; gap: 2px; }
.mini-stars svg { width: 15px; height: 15px; transition: opacity 0.4s, transform 0.4s; }
.mini-stars svg.off { opacity: 0.3; transform: scale(0.8); }
.hud-bottom {
  position: fixed; left: 0; right: 0; bottom: 0;
  display: flex; justify-content: center; gap: 12px;
  padding: 0 max(14px, var(--safe-r)) calc(var(--safe-b) + 14px) max(14px, var(--safe-l));
}
.tool {
  position: relative;
  width: 72px; height: 66px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text);
  font-size: 11px; font-weight: 600;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--glass);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: transform 0.18s cubic-bezier(.3, 1.6, .5, 1), opacity 0.2s;
  padding: 0;
}
.tool svg { width: 26px; height: 26px; }
.tool[disabled] > :not(.cost) { opacity: 0.4; }
.tool[disabled] .cost { filter: saturate(0.7); }
.cost {
  position: absolute; top: -7px; right: -6px;
  display: flex; align-items: center; gap: 3px;
  font-style: normal; font-size: 11px; font-weight: 700;
  padding: 2px 7px 2px 4px; border-radius: 999px;
  color: #5B2C40;
  background: linear-gradient(180deg, var(--peach-a), var(--peach-b));
  box-shadow: 0 3px 8px rgba(120, 50, 80, 0.3);
}
.cost.free { background: linear-gradient(180deg, #E4FFF6, #A8F0DA); color: #1E5A4A; }

/* ---------- Bulles d'info ---------- */
#tip {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 96px);
  transform: translateX(-50%);
  width: max-content; max-width: min(340px, calc(100vw - 32px));
  padding: 11px 18px; border-radius: 20px;
  font-size: 16px; font-weight: 500; text-align: center; line-height: 1.35; text-wrap: balance;
  border: 1px solid var(--line); background: rgba(40, 110, 140, 0.55);
  box-shadow: var(--shadow);
  text-shadow: 0 1px 3px rgba(10, 50, 90, 0.35);
  animation: tipIn 0.5s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes tipIn { from { opacity: 0; transform: translate(-50%, -10px) scale(0.92); } }
#banner { position: fixed; left: 0; right: 0; top: 36%; display: flex; justify-content: center; padding: 0 16px; z-index: 55; pointer-events: none; }
.banner-inner {
  padding: 14px 30px 16px; border-radius: 26px; text-align: center;
  border: 1px solid var(--line); background: rgba(40, 110, 140, 0.5);
  box-shadow: var(--shadow);
  animation: bannerIn 2.8s ease forwards;
}
.banner-inner h3 { margin: 0; font-size: 28px; font-weight: 700; text-shadow: 0 2px 10px rgba(10, 50, 90, 0.4); }
.banner-inner p { margin: 4px 0 0; font-size: 15px; font-weight: 500; opacity: 0.9; }
@keyframes bannerIn { 0% { opacity: 0; transform: scale(0.85) translateY(10px); } 14% { opacity: 1; transform: scale(1); } 78% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.04) translateY(-8px); } }
#toast {
  position: fixed; left: 50%; bottom: calc(var(--safe-b) + 100px); transform: translateX(-50%);
  width: max-content; max-width: min(340px, calc(100vw - 32px));
  padding: 10px 18px; border-radius: 18px; text-align: center;
  font-size: 15px; font-weight: 500; line-height: 1.35;
  border: 1px solid var(--line); background: rgba(20, 60, 100, 0.7);
  animation: tipIn 0.4s cubic-bezier(.2, 1.4, .4, 1);
  z-index: 60; pointer-events: none; /* toujours visible, même par-dessus une fenêtre */
}

/* ---------- Fenêtres ---------- */
#modal {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  padding: calc(var(--safe-t) + 16px) max(16px, var(--safe-r)) calc(var(--safe-b) + 16px) max(16px, var(--safe-l));
  background: rgba(8, 34, 66, 0.38);
  pointer-events: auto;
  animation: fadeIn 0.3s ease;
}
#modal[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } }
.card {
  width: min(420px, 100%);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  box-sizing: border-box;
  padding: 24px 20px 20px;
  border-radius: 32px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.14));
  -webkit-backdrop-filter: blur(20px) saturate(1.4); backdrop-filter: blur(20px) saturate(1.4);
  box-shadow: 0 26px 60px rgba(4, 24, 50, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  animation: cardIn 0.5s cubic-bezier(.2, 1.35, .4, 1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(24px) scale(0.9); } }
.card h2 { margin: 2px 0 6px; font-size: 30px; font-weight: 700; text-wrap: balance; text-shadow: 0 2px 10px rgba(10, 50, 90, 0.35); }
.card p { margin: 6px auto; font-size: 16px; font-weight: 500; line-height: 1.45; max-width: 34ch; opacity: 0.95; text-wrap: balance; }
.card a { color: #FFFFFF; text-decoration-color: rgba(255, 255, 255, 0.6); text-underline-offset: 3px; }
.card .eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; opacity: 0.8; margin: 0; }
.card .actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.card .actions .row { flex-wrap: nowrap; }
.card .actions .row .btn { flex: 1; }
.card canvas { margin: 4px auto; display: block; }
.stars { display: flex; justify-content: center; align-items: flex-end; gap: 6px; margin: 10px 0 4px; }
.stars svg { width: 58px; height: 58px; opacity: 0.25; transform: scale(0.6); }
.stars svg:nth-child(2) { width: 70px; height: 70px; }
.stars svg.on { animation: starIn 0.55s cubic-bezier(.2, 1.7, .4, 1) forwards; filter: drop-shadow(0 0 12px rgba(255, 220, 120, 0.85)); }
@keyframes starIn { from { opacity: 0.25; transform: scale(0.4) rotate(-30deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
.reward { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 600; padding: 6px 16px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); margin-top: 6px; }
.meta { font-size: 14px; opacity: 0.85; font-weight: 500; font-variant-numeric: tabular-nums; }

.grid { display: grid; gap: 10px; margin-top: 14px; }
.dex { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dex button {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 4px 10px; border-radius: 20px;
  color: var(--text); font-size: 12px; font-weight: 600; line-height: 1.2;
  border: 1px solid rgba(255, 255, 255, 0.35); background: rgba(255, 255, 255, 0.13);
}
.dex button.locked { opacity: 0.75; font-weight: 500; }
.levels { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.levels button {
  aspect-ratio: 1; max-width: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border-radius: 50%;
  color: var(--text); font-size: 17px; font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.15);
  padding: 0;
}
.levels button.hard { box-shadow: inset 0 0 0 2px rgba(255, 150, 130, 0.8); }
.levels button.boss { box-shadow: inset 0 0 0 2px rgba(185, 164, 255, 0.95); background: rgba(150, 120, 255, 0.22); }
.levels button.current { background: linear-gradient(180deg, var(--peach-a), var(--peach-b)); color: #5B2C40; }
.levels button[disabled] { opacity: 0.32; }
.levels .st { font-size: 9px; letter-spacing: 1px; color: var(--gold); line-height: 1; min-height: 9px; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 6px; border-bottom: 1px solid rgba(255, 255, 255, 0.18); font-size: 17px; font-weight: 500; }
.toggle input { appearance: none; -webkit-appearance: none; width: 52px; height: 30px; border-radius: 999px; background: rgba(255, 255, 255, 0.22); border: 1px solid var(--line); position: relative; transition: background 0.25s; cursor: pointer; margin: 0; flex: none; }
.toggle input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 0.25s cubic-bezier(.3, 1.5, .5, 1); }
.toggle input:checked { background: linear-gradient(180deg, #A8F5DE, #5ED6C0); }
.toggle input:checked::after { transform: translateX(22px); }
.toggle input:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.85); outline-offset: 2px; }
.small { font-size: 13px; opacity: 0.8; }

/* Voile de changement de page : l'eau du monde affiché (--f1..3, posées par transition()),
   traversée de bulles qui montent. */
#fade {
  position: fixed; inset: 0; overflow: hidden; opacity: 0; pointer-events: none; transition: opacity 0.4s ease;
  background: linear-gradient(180deg, var(--f1, #B4F5EA), var(--f2, #46C6CC) 52%, var(--f3, #0F5F86));
}
#fade.on { opacity: 1; transition-duration: 0.3s; }
/* Petites bulles séparées (--x, --y, --s, --d dans index.html) : un seul grand calque
   de bulles figeait l'affichage près d'une seconde sur Android. */
#fade i {
  position: absolute; left: var(--x); top: var(--y); width: var(--s); height: var(--s);
  box-sizing: border-box; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.62); background: rgba(255, 255, 255, 0.16);
}
#fade.rise i { animation: fadeRise 1.2s cubic-bezier(.25, .6, .35, 1) var(--d) both; }
@keyframes fadeRise { to { transform: translateY(-70vh); } }
@media (prefers-reduced-motion: reduce) { #fade.rise i { animation: none; } }

@media (prefers-reduced-motion: reduce) {
  .breathe, .logo-line span, .logo-pop { animation: none; }
  .card, #tip, .banner-inner { animation-duration: 0.01s; }
}

/* ---------- Menu principal ---------- */
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(360px, 100%); }
.tile {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px;
  min-height: 74px; padding: 10px 6px;
  border-radius: 22px; border: 1px solid var(--line); background: var(--glass);
  color: var(--text); font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.35);
  text-shadow: 0 1px 2px rgba(5, 35, 70, 0.4);
  transition: transform 0.18s cubic-bezier(.3, 1.6, .5, 1);
}
.tile:active { transform: scale(0.93); }
.tile svg { width: 24px; height: 24px; }
.tile em {
  position: absolute; top: -8px; right: -4px;
  font-style: normal; font-size: 10px; font-weight: 700; white-space: nowrap;
  padding: 2px 7px; border-radius: 999px; color: #5B2C40;
  background: linear-gradient(180deg, var(--peach-a), var(--peach-b));
  box-shadow: 0 3px 8px rgba(120, 50, 80, 0.3); text-shadow: none;
}
#btnDaily.done em { background: linear-gradient(180deg, #E4FFF6, #A8F0DA); color: #1E5A4A; }

/* ---------- Barre des écrans carte / aquarium ---------- */
#screenbar {
  position: fixed; top: 0; left: 0; right: 0;
  display: flex; align-items: center; gap: 10px;
  padding: calc(var(--safe-t) + 10px) max(14px, var(--safe-r)) 0 max(14px, var(--safe-l));
}
#screenbar[hidden] { display: none; }
.sb-title { flex: 1; min-width: 0; font-size: 18px; font-weight: 700; text-shadow: 0 1px 2px rgba(5, 35, 70, 0.6), 0 2px 10px rgba(5, 35, 70, 0.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-actions { display: flex; gap: 8px; }
.small-btn { padding: 9px 12px; font-size: 13px; }

/* ---------- Trophée débloqué ---------- */
#trophy {
  position: fixed; left: 50%; top: calc(var(--safe-t) + 14px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: min(360px, calc(100vw - 32px));
  padding: 10px 18px 10px 10px; border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 241, 204, 0.97), rgba(255, 195, 160, 0.97));
  color: #5B2C40; box-shadow: 0 14px 34px rgba(120, 50, 60, 0.35);
  z-index: 40; animation: trophyIn 3.2s ease forwards;
}
#trophy[hidden] { display: none; }
.tr-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 50%; background: #FFFFFF; color: #E0A23A; }
.tr-icon svg { width: 26px; height: 26px; }
.tr-k { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.75; }
.tr-n { margin: 1px 0; font-size: 17px; font-weight: 700; }
.tr-r { margin: 0; font-size: 12px; font-weight: 500; opacity: 0.85; }
@keyframes trophyIn { 0% { opacity: 0; transform: translate(-50%, -30px) scale(0.9); } 10% { opacity: 1; transform: translate(-50%, 0) scale(1); } 85% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; transform: translate(-50%, -16px); } }

/* ---------- Listes ---------- */
.trophy-list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; text-align: left; }
.trophy-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 18px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.25); }
.trophy-row.got { background: rgba(255, 224, 138, 0.25); border-color: rgba(255, 224, 138, 0.6); }
.tr-badge { width: 34px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 50%; background: rgba(255, 255, 255, 0.18); color: #FFE08A; font-size: 20px; }
.trophy-row.got .tr-badge { background: #FFFFFF; }
.tr-body { flex: 1; min-width: 0; }
.tr-name { margin: 0; font-size: 15px; font-weight: 600; }
.tr-desc { margin: 2px 0 0; font-size: 12px; opacity: 0.85; }
.tr-rew { font-size: 13px; font-weight: 700; color: var(--gold); white-space: nowrap; }
.bar { height: 6px; margin-top: 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #A8F5DE, #5ED6C0); }
.locked-row { opacity: 0.6; }
/* Téléphones : pas de flou derrière les fenêtres (très coûteux pour le processeur graphique),
   un fond presque opaque à la place, tout aussi lisible. */
@media (pointer: coarse) {
  .card { -webkit-backdrop-filter: none; backdrop-filter: none; background: linear-gradient(180deg, rgba(52, 128, 168, 0.96), rgba(26, 78, 124, 0.97)); --more-fade: rgba(26, 78, 124, 0.97); }
}
/* Indice « suite plus bas » : collé au bord bas du cadre tant que du contenu est caché. */
/* bottom négatif = marge basse du cadre : le collage se fait sinon au-dessus de cette marge. */
.more-hint { position: sticky; bottom: -20px; height: 0; margin: 0 -20px; z-index: 2; pointer-events: none; opacity: 0; transition: opacity 0.25s ease; }
.card.more .more-hint { opacity: 1; }
.more-hint::before { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 88px; border-radius: 0 0 31px 31px; background: linear-gradient(180deg, transparent, var(--more-fade, rgba(14, 70, 110, 0.55)) 72%); }
#card .more-hint button {
  position: absolute; left: 0; right: 0; bottom: 10px; width: max-content; margin: 0 auto;
  display: flex; align-items: center; gap: 6px; padding: 7px 15px 7px 11px;
  border: 0; border-radius: 999px; background: #FFFFFF; color: #1A4E7C;
  font-size: 14px; font-weight: 700; box-shadow: 0 4px 10px rgba(6, 32, 64, 0.3);
  pointer-events: none; animation: moreBob 1.8s ease-in-out infinite;
}
#card.more .more-hint button { pointer-events: auto; }
#card .more-hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
@keyframes moreBob { 50% { transform: translateY(4px); } }
@media (prefers-reduced-motion: reduce) { #card .more-hint button { animation: none; } }
.cost[hidden] { display: none !important; }
.chest-btn {
  position: absolute; top: calc(var(--safe-t) + 12px); right: max(12px, var(--safe-r)); display: grid; place-items: center;
  width: 48px; height: 48px; padding: 0; border-radius: 50%; border: 1px solid var(--line); background: var(--glass); color: var(--text);
  font: inherit; box-shadow: var(--shadow); cursor: pointer;
}
.chest-btn svg { width: 30px; height: 30px; }
.chest-btn span {
  position: absolute; bottom: -9px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; color: #5B2C40;
  background: linear-gradient(180deg, var(--peach-a), var(--peach-b)); box-shadow: 0 3px 8px rgba(120, 50, 80, 0.3);
}
.chest-btn.full { border-color: rgba(255, 220, 130, 0.9); box-shadow: 0 0 22px rgba(255, 210, 110, 0.7); animation: evGlow 1.8s ease-in-out infinite; }
.chest-bar { max-width: 240px; margin: 8px auto; height: 10px; }
.chest-bar i { background: linear-gradient(90deg, #FFE38A, #F2B53A); }
.shop-tabs { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.shop-list { display: flex; flex-direction: column; gap: 8px; text-align: left; }
.shop-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(255, 255, 255, 0.25); }
.shop-row.on { background: rgba(255, 224, 138, 0.25); border-color: rgba(255, 214, 110, 0.75); }
.shop-row .pv { flex: none; width: 56px; height: 56px; display: grid; place-items: center; }
.shop-row .nm { flex: 1; font-size: 15px; font-weight: 600; }
.shop-row .btn { padding: 8px 12px; font-size: 13px; }
.card.letter { background: linear-gradient(180deg, #FFF8E8, #F4E2BF); color: #5A3B22; text-shadow: none; }
.card.letter h2 { color: #6B4126; text-shadow: none; }
.card.letter .eyebrow { color: #9A6A3A; }
.letter-body { text-align: left !important; white-space: pre-line; font-size: 15px !important; line-height: 1.6 !important; max-width: none !important; font-style: italic; text-wrap: wrap !important; }
.letter-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%; padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.12); color: inherit; font: inherit; font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; }
.letter-row.locked { opacity: 0.5; cursor: default; }
.letter-row { box-sizing: border-box; }
.letter-row span { flex: 1; min-width: 0; }
.letter-row small { flex: none; white-space: nowrap; font-size: 12px; opacity: 0.85; }
.letter-row .dot { width: 10px; height: 10px; border-radius: 50%; background: #FFB36B; box-shadow: 0 0 8px #FFB36B; }
.otter-name { width: 100%; max-width: 240px; padding: 10px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.15); color: inherit; font: inherit; font-size: 16px; font-weight: 600; text-align: center; }
.hat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.hat-grid button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.1); color: inherit; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer; }
.hat-grid button.on { background: rgba(255, 224, 138, 0.3); border-color: rgba(255, 214, 110, 0.8); }
.hat-grid button.locked { opacity: 0.55; }
@media (max-height: 760px) {
  #title { padding-top: calc(var(--safe-t) + 5vh); padding-bottom: calc(var(--safe-b) + 3vh); }
  .logo-line { font-size: clamp(54px, 16vw, 96px); }
  .title-bottom { gap: 10px; }
  .menu-grid { gap: 8px; }
  .tile { min-height: 58px; padding: 6px 4px; gap: 3px; font-size: 12px; }
  .tile svg { width: 20px; height: 20px; }
  .btn.big { padding: 12px 54px 10px; font-size: 24px; }
}
.chip-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 6px 0 4px; }
.chip-btn { padding: 7px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.12); color: inherit; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip-btn.on { background: #FFFFFF; color: #23506E; }
.chip-btn:disabled { opacity: 0.45; cursor: default; }
.vlist { display: flex; flex-direction: column; gap: 6px; margin: 8px 0 4px; text-align: left; }
.vrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 10px; border-radius: 14px; background: rgba(255, 255, 255, 0.1); font-size: 14px; font-weight: 600; }
.vdots { display: flex; gap: 5px; }
.vdot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--c); background: transparent; opacity: 0.55; }
.vdot.got { background: var(--c); opacity: 1; box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8); }
.event-btn {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 auto 10px; padding: 7px 8px 7px 10px;
  border: 1px solid rgba(255, 200, 140, 0.7); border-radius: 999px; color: #FFF6E8; font: inherit; font-size: 15px; font-weight: 700;
  background: linear-gradient(90deg, rgba(92, 60, 160, 0.85), rgba(225, 110, 60, 0.85));
  box-shadow: 0 0 22px rgba(255, 150, 70, 0.45); cursor: pointer; animation: evGlow 2.6s ease-in-out infinite;
}
.event-btn[hidden] { display: none; }
.pill-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 2px; }
.pill-row .event-btn { margin: 0; font-size: 14px; }
.tide-btn { background: linear-gradient(90deg, rgba(30, 110, 170, 0.85), rgba(40, 170, 180, 0.85)); border-color: rgba(160, 240, 255, 0.7); box-shadow: 0 0 20px rgba(80, 200, 255, 0.4); animation: none; }
.tide-btn em { color: #145A78; }
.banc-badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; background: rgba(255, 255, 255, 0.15); border: 1px solid var(--bc, #FFF); }
.banc-badge i { width: 10px; height: 10px; border-radius: 50%; background: var(--bc); }
.banc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0; }
.banc-grid button { padding: 10px 8px; border-radius: 16px; border: 2px solid transparent; background: rgba(255, 255, 255, 0.12); color: inherit; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; text-align: center; }
.banc-grid button small { display: block; font-weight: 500; font-size: 11px; opacity: 0.85; margin-top: 3px; }
.banc-grid button.on { border-color: var(--bc); background: rgba(255, 255, 255, 0.24); }
.banc-grid button i { display: block; width: 18px; height: 18px; margin: 0 auto 4px; border-radius: 50%; background: var(--bc); box-shadow: 0 0 10px var(--bc); }
.tide-reward { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; padding: 8px 10px; border-radius: 16px; background: rgba(255, 255, 255, 0.12); border: 1px solid rgba(160, 240, 255, 0.5); text-align: left; font-size: 14px; }
.tide-reward .pv { flex: none; width: 56px; height: 56px; }
.tide-bar { height: 14px; margin: 8px auto 4px; max-width: 300px; }
.tide-bar i { background: linear-gradient(90deg, #7FE3FF, #2FD0C0); }
.banc-bars { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; text-align: left; }
.banc-bars div { display: grid; grid-template-columns: 1fr auto; gap: 2px 8px; font-size: 13px; font-weight: 600; }
.banc-bars .bar { grid-column: 1 / -1; margin: 0; height: 7px; }
.banc-bars .bar i { background: var(--bc); }
.msg-list { display: flex; flex-direction: column; gap: 6px; text-align: left; max-height: 46vh; overflow-y: auto; }
.msg-list button:disabled { opacity: 0.45; cursor: default; }
.msg-list button { padding: 10px 12px; border-radius: 14px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.12); color: inherit; font: inherit; font-size: 14px; font-weight: 600; text-align: left; cursor: pointer; }
.bottle-msg { font-size: 19px !important; font-weight: 700 !important; font-style: italic; margin: 10px auto !important; }
.transfer-code { font-size: 40px !important; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; user-select: all; -webkit-user-select: all; margin: 10px 0 !important; }
#trCode { text-transform: uppercase; letter-spacing: 0.12em; font-size: 20px; margin: 4px auto 8px; display: block; }
.comm-section { margin-top: 14px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.event-btn svg { width: 24px; height: 24px; }
.event-btn em { font-style: normal; min-width: 28px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #8A3B12; font-size: 14px; }
@keyframes evGlow { 50% { box-shadow: 0 0 32px rgba(255, 170, 80, 0.7); } }
.ev-count { font-size: 26px !important; font-weight: 700 !important; color: #FFD38A; margin: 4px auto 2px !important; }
.ev-bar { max-width: 260px; margin: 6px auto 2px; height: 10px; }
.ev-bar i { background: linear-gradient(90deg, #B9A6FF, #FFA45C); }
.ev-badge { color: #FFFFFF !important; opacity: 1 !important; font-size: 14px !important; font-weight: 700; background: rgba(140, 110, 230, 0.55) !important; }
.ev-row.got .ev-badge { background: #F2B53A !important; }
.tr-cat { margin: 14px 4px 2px; font-size: 15px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; opacity: 0.9; display: flex; justify-content: space-between; }
.tr-cat span { opacity: 0.7; font-weight: 600; }
.trophy-row p { text-align: left; max-width: none; line-height: 1.3; }
.trophy-row .tr-name { margin: 0; font-size: 15px; font-weight: 600; }
.trophy-row .tr-desc { margin: 2px 0 0; font-size: 12px; font-weight: 500; }
.pips { display: inline-flex; gap: 3px; margin-left: 6px; vertical-align: 1px; }
.pip { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--medal); opacity: 0.6; }
.pip.on { background: var(--medal); opacity: 1; }
.tr-rew { display: inline-flex; align-items: center; gap: 3px; }
.tr-rew.done { color: #F2B53A; font-size: 18px; }
.tr-help { margin: 6px auto 0 !important; }
.medal-none { --medal: rgba(255, 255, 255, 0.6); }
.trophy-row .tr-count { margin: 3px 0 0; font-size: 11px; opacity: 0.75; }
.tr-badge svg, .tr-icon svg, .medal-sum svg { width: 70%; height: 70%; }
.medal-or { --medal: #F2B53A; } .medal-argent { --medal: #9DB3C9; } .medal-bronze { --medal: #D08A55; }
.trophy-row .tr-badge { color: var(--medal); opacity: 0.45; font-weight: 700; font-size: 18px; }
.trophy-row.got .tr-badge { opacity: 1; }
.trophy-row.got.medal-or { background: rgba(255, 224, 138, 0.28); border-color: rgba(255, 214, 110, 0.75); }
.trophy-row.got.medal-argent { background: rgba(220, 235, 250, 0.22); border-color: rgba(200, 222, 245, 0.7); }
.trophy-row.got.medal-bronze { background: rgba(240, 180, 140, 0.22); border-color: rgba(235, 170, 125, 0.65); }
#trophy .tr-icon { color: var(--medal, #E0A23A); }
.medal-sum { display: flex; justify-content: center; gap: 14px; margin: 6px 0 2px; font-size: 14px; font-weight: 600; }
.medal-sum span { display: inline-flex; align-items: center; gap: 4px; }
.medal-sum i { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #FFFFFF; color: var(--medal); }
.need { font-size: 14px; font-weight: 700; color: var(--gold); }
.gold-badge { display: inline-block; font-size: 10px; padding: 1px 6px; border-radius: 999px; background: #FFD24A; color: #5B3A00; vertical-align: 1px; }
.ice-demo { width: 74px; height: 96px; margin: 8px auto; border-radius: 10px 10px 34px 34px; background: linear-gradient(135deg, rgba(240, 252, 255, 0.9), rgba(190, 230, 255, 0.6)); border: 2px solid rgba(255, 255, 255, 0.9); display: grid; place-items: center; font-weight: 700; font-size: 30px; color: #3C7CC4; }

/* ---------- Panel de testeurs ---------- */
.panel-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.panel-row[hidden] { display: none; }
.panel-row .btn { display: inline-flex; align-items: center; gap: 7px; }
.panel-row svg { width: 18px; height: 18px; }
.fb { text-align: left; margin-top: 8px; }
.fb .fb-q { display: block; margin: 14px 0 6px; font-size: 14px; font-weight: 600; opacity: 0.9; max-width: none; }
.fb-stars { display: flex; gap: 6px; justify-content: center; }
.fb-star { font-size: 32px; line-height: 1; padding: 2px 4px; color: rgba(255, 255, 255, 0.35); background: none; border: 0; cursor: pointer; transition: transform 0.15s, color 0.15s; }
.fb-star.on { color: #FFE08A; text-shadow: 0 2px 10px rgba(255, 200, 80, 0.5); }
.fb-star:active { transform: scale(0.85); }
.fb-seg { display: flex; gap: 6px; }
.fb-opt { flex: 1; padding: 9px 4px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.12); color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.fb-opt.on { background: linear-gradient(180deg, var(--peach-a), var(--peach-b)); color: #5B2C40; border-color: transparent; }
.fb textarea { width: 100%; box-sizing: border-box; resize: vertical; min-height: 54px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: rgba(8, 34, 66, 0.28); color: var(--text); font: inherit; font-size: 15px; }
.fb textarea::placeholder { color: rgba(255, 255, 255, 0.55); }
.fb-err { color: #FFE1C8; font-size: 14px; font-weight: 600; text-align: center; }
.card.wide { width: min(720px, 100%); text-align: left; }
.card.wide h2, .card.wide .eyebrow { text-align: center; }
.dash h3 { margin: 18px 0 6px; font-size: 18px; }
.dash .small, .dash p { max-width: none; margin: 4px 0; }
.dash-me { font-size: 15px; }
.dash-sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 10px 0 6px; }
.dash-sum .kpi { background: rgba(8, 34, 66, 0.28); border-radius: 14px; padding: 8px 6px; text-align: center; }
.dash-sum b { display: block; font-size: 18px; }
.dash-sum span { font-size: 12px; opacity: 0.8; }
.dash-table { overflow-x: auto; border-radius: 12px; background: rgba(8, 34, 66, 0.22); }
.dash table { border-collapse: collapse; width: 100%; font-size: 13px; white-space: nowrap; }
.dash th, .dash td { padding: 6px 8px; text-align: right; border-bottom: 1px solid rgba(255, 255, 255, 0.1); }
.dash th:first-child, .dash td:first-child { text-align: left; }
.dash th { font-weight: 600; opacity: 0.8; }
.dash tr.hot td { background: rgba(255, 110, 120, 0.22); }
.dash-fb { background: rgba(8, 34, 66, 0.25); border-radius: 14px; padding: 8px 12px; margin: 8px 0; }
.dash-fb .meta { font-size: 12px; opacity: 0.8; }
.dash-fb p { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 420px) { .dash-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
