/* « Le plateau vivant » (lot C, docs/LOVELY_PARTY.md): the chests on the board and in the sheet, their prize, the shield
 * and the golden die kept on the chips, the stake of a bet, the golden die thrown, the shooting star. Only new classes:
 * nothing here touches a game without the living board (static/js/espace/espace.js, partyPage, its block « Le plateau
 * vivant »). */

/* ---- A chest on its piece of the board: on the top left (the ×2 of the last straight stands on the right); it calls
   now and then with a little shake, and stays half open once opened. ---- */
.lp-chest {
  position: absolute;
  top: -2px;
  left: -4px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fbf8ef;
  box-shadow: 0 0 0 2.5px #e5b75c, 0 3px 0 rgba(122, 74, 8, .4), 0 0 14px rgba(255, 210, 110, .6);
  font-style: normal;
  animation: lp-chest-call 3.2s ease-in-out infinite;
}

.lp-chest svg {
  width: 22px;
  height: 20px;
  overflow: visible;
}

.lp-chest__lid {
  transform-box: fill-box;
  transform-origin: 90% 100%;
  transition: transform .5s cubic-bezier(.2, 1.4, .4, 1);
}

.lp-chest.is-open {
  box-shadow: 0 0 0 2px rgba(229, 183, 92, .5), 0 3px 0 rgba(122, 74, 8, .2);
  opacity: .6;
  animation: none;
}

.lp-chest.is-open .lp-chest__lid {
  transform: translate(-1px, -3px) rotate(-26deg);
}

@keyframes lp-chest-call {
  0%, 72%, 100% { transform: rotate(0) scale(1); }
  77% { transform: rotate(-10deg) scale(1.08); }
  83% { transform: rotate(9deg) scale(1.08); }
  89% { transform: rotate(-5deg) scale(1.03); }
  95% { transform: rotate(3deg) scale(1); }
}

/* ---- The chest of the sheet: each knock shakes it and lights it a little more; the third one blows its lid off in
   the light of its rarity. ---- */
.lp-sheet.is-chest .lp-sheet__tag {
  background: linear-gradient(135deg, #fff3cf 0%, #e5b75c 45%, #c9963f 100%);
  color: #7a4a08;
}

.lp-chestbox {
  --glow: 0;
  position: relative;
  display: block;
  width: 172px;
  height: 150px;
  margin: 2px auto 0;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.lp-chestbox:disabled {
  cursor: default;
}

.lp-chestbox:focus-visible {
  outline: 3px solid #f3c6d6;
  outline-offset: 4px;
}

.lp-chestbox__art {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 calc(var(--glow) * 20px) rgba(255, 210, 110, .95));
  transition: filter .3s ease;
}

.lp-chestbox__light {
  opacity: calc(var(--glow) * .55);
  transition: opacity .3s ease;
}

.lp-chestbox__lid {
  transform-box: fill-box;
  transform-origin: 92% 100%;
}

.lp-chestbox.is-knock .lp-chestbox__art {
  animation: lp-knock .36s cubic-bezier(.3, 1.6, .5, 1);
}

@keyframes lp-knock {
  0% { transform: scale(1) rotate(0); }
  30% { transform: scale(1.07, .93) rotate(-4deg); }
  62% { transform: scale(.97, 1.04) rotate(3deg); }
  100% { transform: scale(1) rotate(0); }
}

.lp-chestbox.is-opening .lp-chestbox__lid {
  animation: lp-lid .62s cubic-bezier(.2, 1.5, .4, 1) .1s forwards;
}

.lp-chestbox.is-opening .lp-chestbox__light {
  opacity: 1;
}

.lp-chestbox[data-r="commune"] .lp-chestbox__art {
  filter: drop-shadow(0 0 22px rgba(255, 156, 194, .95));
}

.lp-chestbox[data-r="rare"] .lp-chestbox__art {
  filter: drop-shadow(0 0 24px rgba(214, 204, 236, 1));
}

.lp-chestbox[data-r="legendaire"] .lp-chestbox__art {
  filter: drop-shadow(0 0 30px rgba(255, 210, 110, 1));
}

@keyframes lp-lid {
  0% { transform: translate(0, 0) rotate(0); }
  100% { transform: translate(-6px, -28px) rotate(-30deg); }
}

/* ---- The prize: in the glow of its rarity. ---- */
.lp-loot {
  display: grid;
  place-items: center;
  width: 118px;
  height: 118px;
  margin: 4px auto 0;
  border-radius: 50%;
  animation: lp-loot-in .6s cubic-bezier(.2, 1.5, .4, 1) both;
}

.lp-loot[data-r="commune"] {
  background: radial-gradient(circle at 50% 46%, rgba(255, 156, 194, .6), rgba(255, 156, 194, 0) 70%);
}

.lp-loot[data-r="rare"] {
  background: radial-gradient(circle at 50% 46%, rgba(206, 196, 222, .95), rgba(206, 196, 222, 0) 70%);
}

.lp-loot[data-r="legendaire"] {
  background: radial-gradient(circle at 50% 46%, rgba(255, 210, 110, .95), rgba(255, 210, 110, 0) 70%);
}

.lp-loot svg {
  width: 68px;
  height: 68px;
  filter: drop-shadow(0 4px 0 rgba(69, 23, 74, .22));
}

.lp-loot[data-r="commune"] svg {
  width: 82px;
  height: 68px;
}

@keyframes lp-loot-in {
  0% { opacity: 0; transform: scale(.4) rotate(-12deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}

/* ---- What a player keeps, on the corner of their chip. ---- */
.lp-items {
  position: absolute;
  top: -9px;
  left: 24px;
  display: flex;
  gap: 2px;
  pointer-events: none;
}

.lp-item {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fbf8ef;
  box-shadow: 0 0 0 1.5px rgba(91, 63, 134, .35), 0 2px 0 rgba(69, 23, 74, .2);
  font-style: normal;
  animation: lp-item-in .5s cubic-bezier(.2, 1.6, .4, 1) both;
}

.lp-item svg {
  width: 16px;
  height: 16px;
}

.lp-item--de {
  box-shadow: 0 0 0 1.5px #e5b75c, 0 0 10px rgba(255, 210, 110, .8);
}

@keyframes lp-item-in {
  0% { transform: scale(0) rotate(-30deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ---- The bet of Tu préfères: the dilemma read first (its two halves wait), the stakes in gold, then the stake kept
   above the halves until the answer. ---- */
.lp-half.is-waiting {
  cursor: default;
}

.lp-btn--gold {
  background: linear-gradient(135deg, #fff3cf 0%, #e5b75c 40%, #fff6db 62%, #c9963f 100%);
  box-shadow: 0 4px 0 rgba(122, 74, 8, .45);
  color: #4a0e2e;
}

.lp-pot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 12px;
  padding: 6px 14px 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff3cf 0%, #e5b75c 45%, #c9963f 100%);
  box-shadow: 0 3px 0 rgba(122, 74, 8, .35);
  color: #4a0e2e;
  font-size: 14px;
  font-weight: 900;
  animation: lp-loot-in .45s cubic-bezier(.2, 1.5, .4, 1) both;
}

/* ---- The golden die: its second throw, in gold. ---- */
.lp-die.is-gold .lp-cube__face {
  background: radial-gradient(circle at 30% 24%, #fff3cf, #e5b75c 58%, #b8862f);
}

.lp-die.is-gold .lp-cube__face circle {
  fill: #702a71;
}

/* ---- The shooting star: it crosses the night from the right, a few seconds, its words on top of the screen. ---- */
.lp-comet {
  position: fixed;
  z-index: 75;
  top: 16%;
  left: 100%;
  width: 150px;
  height: 56px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: lp-comet-fly 4.2s linear forwards;
}

.lp-comet::before {
  content: "";
  position: absolute;
  inset: -18px -10px;
}

.lp-comet svg {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 0 10px rgba(255, 226, 154, .95));
}

.lp-comet__star {
  transform-box: fill-box;
  transform-origin: center;
  animation: lp-twinkle .45s ease-in-out infinite alternate;
}

@keyframes lp-comet-fly {
  0% { transform: translate(0, 0) rotate(-12deg); }
  100% { transform: translate(calc(-100vw - 170px), 34vh) rotate(-12deg); }
}

@keyframes lp-twinkle {
  0% { transform: scale(1); }
  100% { transform: scale(1.2); }
}

.lp-comet.is-still {
  top: 38%;
  left: 50%;
  margin-left: -75px;
  animation: lp-comet-still 4s ease forwards;
}

@keyframes lp-comet-still {
  0% { opacity: 0; }
  12%, 86% { opacity: 1; }
  100% { opacity: 0; }
}

.lp-comet-tag {
  position: fixed;
  z-index: 75;
  top: calc(env(safe-area-inset-top, 0px) + 96px);
  left: 50%;
  max-width: calc(100vw - 32px);
  margin: 0;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(26, 6, 40, .55);
  color: #ffe29a;
  font-size: 15px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  pointer-events: none;
  animation: lp-comet-tag 4.2s ease forwards;
}

@keyframes lp-comet-tag {
  0% { opacity: 0; transform: translate(-50%, -8px); }
  10%, 84% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .lp-chest,
  .lp-chestbox.is-knock .lp-chestbox__art,
  .lp-loot,
  .lp-item,
  .lp-pot,
  .lp-comet__star {
    animation: none;
  }

  .lp-chestbox.is-opening .lp-chestbox__lid {
    animation: none;
    transform: translate(-6px, -28px) rotate(-30deg);
  }
}

/* ---- The choice of the board on the start (2026-11-10, his mockup B): Classique or Déjanté, chosen like the length;
   Déjanté in gold. ---- */
.lp-plateaux {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.lp-plateau {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 116px;
  padding: 10px 8px;
  border: 0;
  border-radius: 18px;
  background: rgba(255, 255, 255, .14);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .35);
  color: #ffffff;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.lp-plateau:focus-visible {
  outline: 3px solid #ffd6e4;
  outline-offset: 2px;
}

.lp-plateau--dejante {
  background: rgba(255, 243, 207, .12);
  box-shadow: inset 0 0 0 1.5px rgba(255, 226, 154, .6), 0 0 18px rgba(255, 210, 110, .2);
}

.lp-plateau[aria-checked="true"] {
  background: #fbf8ef;
  box-shadow: 0 4px 0 rgba(51, 11, 134, .35), inset 0 0 0 2.5px #c4285b;
  color: #702a71;
  transform: translateY(-2px);
}

.lp-plateau--dejante[aria-checked="true"] {
  box-shadow: 0 4px 0 rgba(51, 11, 134, .35), inset 0 0 0 2.5px #e5b75c, 0 0 22px rgba(255, 210, 110, .45);
}

.lp-plateau__art {
  display: block;
  max-width: 100%;
  height: auto;
}

.lp-plateau__path {
  stroke: rgba(251, 248, 239, .6);
}

.lp-plateau[aria-checked="true"] .lp-plateau__path {
  stroke: #d9a7c4;
}

.lp-plateau__tail {
  fill: rgba(255, 243, 207, .75);
}

.lp-plateau[aria-checked="true"] .lp-plateau__tail {
  fill: rgba(229, 183, 92, .6);
}

.lp-plateau__name {
  font-size: 15px;
  font-weight: 900;
}

.lp-plateau__line {
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  opacity: .85;
}
