/* public/css/try/vowel-pop.css
   Forked from public/css/minigames/vowel-pop.css for the /try demo.
   Same game styling; appends the /try layout chrome (.try-brand,
   .try-cta, .try-modal, .try-container, .try-main) so the /try/vowel-pop
   page can run standalone without loading any minigame bundle.
*/

.ui-sheet.mg-vp {
  padding-top: 10px;
}

/* ============================================================
   Top header
============================================================ */

.mg-vp__head {
  display: grid;
  gap: 8px;
}

.mg-vp__headRow1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

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

.mg-vp__title {
  margin: 0;
  min-width: 0;
  font-size: 20px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-vp__back {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 14px;
  display: grid;
  place-items: center;
}

.mg-vp__meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: nowrap;
}

.mg-vp__pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;

  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;

  background: var(--surface-2);
  border: 1px solid var(--border);
  white-space: nowrap;
  opacity: 0.9;
}

/* ============================================================
   Body layout
============================================================ */

.mg-vp__body {
  margin-top: 10px;
  display: grid;
  gap: 10px;
}

.mg-vp__cardHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 2px 0 10px;
  min-width: 0;
}

.mg-vp__cardTitle {
  margin: 0;
  font-weight: 950;
  font-size: 13px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mg-vp__statusText {
  font-size: 13px;
  font-weight: 800;
  opacity: 0.7;
  white-space: nowrap;
  padding-right: 10px;
}

.mg-vp__statusText[data-kind="good"],
.mg-vp__statusText[data-kind="bad"] {
  opacity: 1;
}

.mg-vp__statusText--card {
  font-weight: 900;
  opacity: 0.75;
}

.mg-vp__progressRow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: -2px 0 6px;
  padding-top: 2px;
}

.mg-vp__hint {
  font-size: 12px;
  opacity: 0.85;
  white-space: nowrap;
}

.mg-vp__bar {
  flex: 1;
  height: 12px;
  min-width: 120px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
  border: 1px solid var(--border);
}

.mg-vp__barFill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--_toggle-rainbow, var(--rainbow));
  transition: width 180ms ease;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

.mg-vp__timer {
  font-size: 12px;
  font-weight: 900;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  white-space: nowrap;
}

/* ============================================================
   Sizing guards
============================================================ */

.mg-vp__board,
.mg-vp__tray,
.mg-vp__zones,
.mg-vp__zone,
.mg-vp__slot,
.mg-vp__vowel,
.mg-vp__letter {
  box-sizing: border-box;
}

/* ============================================================
   Board layout
============================================================ */

.mg-vp__board {
  display: grid;
  gap: 14px;
}

.mg-vp__zones {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.mg-vp__tray {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  min-height: 48px;
  padding: 8px 0;
}

/* ============================================================
   Zone card
============================================================ */

.mg-vp__zone {
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 12px 16px;

  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;

  overflow: hidden;
}

.mg-vp__zoneLeft {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.mg-vp__zoneImg {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
}

.mg-vp__hintBtn {
  font-size: 11px;
  padding: 2px 8px;
}

.mg-vp__hintText {
  font-size: 12px;
  opacity: 0.7;
  line-height: 1.3;
  padding: 4px 0 0;
  width: 100%;
  flex-basis: 100%;
}

.mg-vp__wordRow {
  display: flex;
  align-items: center;
  gap: 3px;
  flex-wrap: wrap;
}

/* ============================================================
   Shared tile size — letters, slots, vowel pills
============================================================ */

.mg-vp__letter,
.mg-vp__slot,
.mg-vp__vowel {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;

  font-family: var(--font-kid);
  font-weight: 900;
  font-size: 22px;
  line-height: 1;
  color: var(--app-fg);
}

.mg-vp__letter {
  border-radius: 10px;
  border: 2px solid var(--border);
  background: var(--surface-2);
}

.mg-vp__slot {
  border-radius: 10px;
  border: 2px dashed var(--border-strong);
  background: var(--surface-2);

  transition: border-color 120ms ease, background 120ms ease;
}

.mg-vp__slot.is-hover {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.08);
}

.mg-vp__slot.is-pending {
  border: 2px dashed var(--tile-dash);
  background: radial-gradient(circle at 30% 20%, #fff7df, #ffe8b6);
  color: #0b1220;
}

.mg-vp__slot.is-filled.is-correct {
  border: 2px solid rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
  color: #16a34a;
}

@keyframes vpShake {
  0%   { transform: translateX(0); }
  25%  { transform: translateX(-3px); }
  55%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.mg-vp__slot.is-wrong {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.08);
  animation: vpShake 220ms ease-out;
}

.mg-vp__zone.is-correct {
  outline: 3px solid rgba(34, 197, 94, 0.38);
  background: rgba(34, 197, 94, 0.06);
}

/* ============================================================
   Vowel pill
============================================================ */

.mg-vp__vowel {
  border-radius: 12px;
  border: 2px dashed var(--tile-dash);
  background: radial-gradient(circle at 30% 20%, #fff7df, #ffe8b6);
  box-shadow: var(--shadow-md);

  color: #0b1220;

  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mg-vp__vowel.is-dragging {
  box-shadow: var(--shadow-md);
  transform: scale(1.08);
  border-color: var(--border-strong);
  opacity: 0.92;
}

/* ============================================================
   Drag-hint ghost — phantom vowel looping from tray to first blank
   slot so visitors see the mechanic. Positions computed by JS
   and passed via --hint-dx / --hint-dy. Dismissed on first pickup.
============================================================ */
.mg-vp__dragHint {
  pointer-events: none !important;
  user-select: none;
  -webkit-user-select: none;
  z-index: 20;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.18);
  filter: brightness(1.06);
  animation: mg-vp-dragHint 3.6s cubic-bezier(0.4, 0, 0.2, 1) 0.8s infinite;
  will-change: transform, opacity;
}

@keyframes mg-vp-dragHint {
  0%   { transform: translate(0, 0) scale(1);       opacity: 0; }
  8%   { transform: translate(0, 0) scale(1);       opacity: 1; }
  16%  { transform: translate(0, -5px) scale(1.12); opacity: 1; }
  52%  { transform: translate(var(--hint-dx, 0px), var(--hint-dy, 0px)) scale(1.12); opacity: 1; }
  62%  { transform: translate(var(--hint-dx, 0px), var(--hint-dy, 0px)) scale(1);    opacity: 1; }
  82%  { transform: translate(var(--hint-dx, 0px), var(--hint-dy, 0px)) scale(1);    opacity: 0.9; }
  95%  { transform: translate(var(--hint-dx, 0px), var(--hint-dy, 0px)) scale(0.85); opacity: 0; }
  100% { transform: translate(0, 0) scale(1);       opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .mg-vp__dragHint { display: none; }
}

/* ============================================================
   Grab affordance
============================================================ */

@media (hover: hover) and (pointer: fine) {
  .mg-vp__vowel { cursor: grab; }
  .mg-vp__slot { cursor: pointer; }
}

html.is-grabbing,
html.is-grabbing * {
  cursor: grabbing !important;
}

/* ============================================================
   Mobile
============================================================ */

@media (max-width: 400px) {
  .mg-vp__letter,
  .mg-vp__slot,
  .mg-vp__vowel {
    width: 36px;
    height: 36px;
    font-size: 18px;
  }

  .mg-vp__slot { border-radius: 8px; }
  .mg-vp__vowel { border-radius: 10px; }

  .mg-vp__zoneImg { width: 40px; height: 40px; }

  .mg-vp__zone { padding: 10px 12px; gap: 10px; }
  .mg-vp__wordRow { gap: 2px; }

  .mg-vp__progressRow { gap: 8px; margin: -2px 0 4px; }
  .mg-vp__bar { min-width: 90px; }
}

/* ============================================================
   /try layout chrome — duplicated from fracture.css so this page
   can render standalone without pulling in the fracture bundle.
   (Same selectors as fracture.css; loading both on the landing
   re-declares but renders identically.)
============================================================ */

.try-main {
  min-height: 100vh;
  padding: 16px 12px 24px;
  display: flex;
  justify-content: center;
}

.try-container {
  width: 100%;
  max-width: 560px;
}

.try-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}

.try-brand__logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.try-brand__name {
  font-family: "Baloo 2", system-ui, sans-serif;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0.2px;
}

.try-cta {
  white-space: nowrap;
}

/* ============================================================
   Demo completion modal
============================================================ */

html.try-modal-open,
html.try-modal-open body {
  overflow: hidden;
}

.try-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
}

.try-modal[hidden] {
  display: none;
}

.try-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}

.try-modal__card {
  position: relative;
  background: var(--surface, #fff);
  color: var(--app-fg, #111);
  border-radius: 18px;
  padding: 24px 22px 20px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: tryModalIn 220ms ease-out;
}

@keyframes tryModalIn {
  0%   { opacity: 0; transform: translateY(8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.try-modal__title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 900;
  line-height: 1.15;
}

.try-modal__body {
  margin: 0 0 18px;
  font-size: 15px;
  line-height: 1.45;
  opacity: 0.9;
}

.try-modal__actions {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.try-modal__cta {
  width: 100%;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
  padding: 12px 16px;
}

.try-modal__fine {
  margin: 0;
  font-size: 12px;
  opacity: 0.6;
}

@media (max-width: 420px) {
  .try-modal__card {
    padding: 20px 18px 16px;
  }
  .try-modal__title {
    font-size: 20px;
  }
}
