/* =========================================================================
   achievement.css — Change #23: the Shareable Achievement card (js/achievement.js)
   ========================================================================= */
.ach {
  position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 12px var(--gutter) max(16px, var(--kido-sa-bottom)); box-sizing: border-box; overflow-y: auto;
  background: radial-gradient(ellipse at 50% 35%, rgba(255, 233, 160, .55), rgba(43, 31, 107, .82) 70%);
}
.ach__frame {
  width: min(100%, 420px, calc((100dvh - 230px) * .8)); min-width: 200px; aspect-ratio: 1080 / 1350; border-radius: 22px; overflow: hidden;
  background: linear-gradient(180deg, #2B1F6B, #5B3CC4 45%, #F2A93B);
  box-shadow: 0 18px 44px rgba(20, 10, 60, .45), 0 0 0 4px rgba(255, 216, 107, .9);
  transform: scale(.6) rotate(-4deg); opacity: 0; transition: transform .7s cubic-bezier(.34, 1.56, .64, 1), opacity .4s ease;
}
.ach.is-ready .ach__frame { transform: none; opacity: 1; }
body.in-gameplay .ach { padding-top: calc(var(--hud-h, 64px) + 4px); }   /* Change #28: below the floating HUD */
.ach.is-calm .ach__frame { transition: opacity .3s ease; transform: none; }
.ach__img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ach__actions { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }
.ach__go { min-width: 200px; }
.ach__share { min-height: 48px; font-size: 17px; padding: 0 18px; }
.ach__share svg { width: 20px; height: 20px; }
@media (orientation: landscape) and (max-height: 520px) {
  .ach { flex-direction: row; gap: 20px; }
  .ach__frame { width: auto; height: calc(100% - 24px); min-width: 0; }
  .ach__actions { flex-direction: column; }
}

/* grown-up share panel (inside the parent modal layer) */
.ach-share { max-width: 420px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.ach-share__title { margin: 0; font-family: var(--font-display); font-size: 22px; color: var(--ink); }
.ach-share__img { display: block; width: min(100%, 220px); margin: 0 auto; border-radius: 14px; box-shadow: var(--shadow-sm); }
.ach-share__note { margin: 0; font-size: 14px; color: var(--ink-soft); }
.ach-share__msg { margin: 0; min-height: 1.2em; font-size: 14px; color: var(--grape-deep); }
/* Change #23A: on shorter screens the preview shrinks with the height, so the panel (max 88vh) never needs to scroll */
@media (max-height: 849px) {
  .ach-share__img { width: auto; max-width: 100%; height: clamp(96px, calc(88vh - 372px), 275px); }
}
@media (max-height: 520px) {
  .ach-share { gap: 6px; padding-top: 14px; padding-bottom: 14px; }
  .ach-share__title { font-size: 19px; }
  .ach-share__img { height: clamp(80px, calc(88vh - 300px), 160px); }
  .ach-share .btn { min-height: 44px; font-size: 17px; }
}
@media (max-height: 520px) and (orientation: landscape) {   /* phones sideways: the preview beside the actions */
  .ach-share { display: grid; grid-template-columns: 150px minmax(0, 1fr); column-gap: 16px; align-items: center; max-width: 580px; }
  .ach-share > * { grid-column: 2; }
  .ach-share > .ach-share__img { grid-column: 1; grid-row: 1 / span 7; width: 150px; height: auto; align-self: center; }
}
