/* Phone mock styles
   ---------------------------------------------------------------------------
   All internal sizes are driven by CSS custom properties on `.phone-mock`,
   so the whole component scales as one unit at each breakpoint without
   ever using `transform: scale` (which would shrink real hit-target sizes).
   --------------------------------------------------------------------------- */

.phone-mock {
  /* Default = desktop tier (≥1024px) */
  --phone-w: 320px;
  --phone-h: 660px;
  --frame-radius: 50px;
  --frame-pad: 12px;
  --screen-radius: 38px;
  --screen-pad-x: 16px;
  --screen-pad-top: 14px;
  --screen-pad-bottom: 18px;
  --notch-w: 110px;
  --notch-h: 28px;
  --grid-max-w: 240px;
  --grid-gap: 3px;
  --cell-radius: 6px;
  --cell-font: 16px;
  --vowel-gap: 8px;
  --vowel-min-h: 56px;
  --vowel-font: 22px;
  --vowel-radius: 14px;
  --vowel-badge: 20px;
  --vowel-badge-font: 11px;
  --header-gap: 8px;
  --header-icon: 28px;
  --header-icon-sm: 24px;
  --header-icon-glyph: 13px;
  --header-title-font: 15px;
  --header-eyebrow-font: 10px;
  --header-timer-font: 11px;

  position: relative;
  display: flex;
  justify-content: center;
  filter: drop-shadow(0 24px 32px rgba(15, 23, 42, 0.16)) drop-shadow(0 48px 60px rgba(37, 99, 235, 0.14));
  transform: rotate(-6deg) translateY(0);
  transition: transform .8s var(--vp-ease-smooth);
  z-index: 2;
}
.phone-mock:hover { transform: rotate(-3deg) translateY(-6px); }

.phone-mock__frame {
  width: var(--phone-w);
  height: var(--phone-h);
  background: #0F172A;
  border-radius: var(--frame-radius);
  padding: var(--frame-pad);
  position: relative;
  box-shadow:
    inset 0 0 0 2px #1E293B,
    inset 0 0 0 6px #334155;
}

.phone-mock__notch {
  position: absolute;
  top: calc(var(--frame-pad) + 2px);
  left: 50%;
  transform: translateX(-50%);
  width: var(--notch-w);
  height: var(--notch-h);
  background: #0F172A;
  border-radius: 999px;
  z-index: 2;
}

.phone-mock__screen {
  width: 100%;
  height: 100%;
  background: #fff;
  border-radius: var(--screen-radius);
  padding: var(--screen-pad-top) var(--screen-pad-x) var(--screen-pad-bottom);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.phone-mock__status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #0F172A;
  padding: 4px 10px 6px;
  margin-top: 6px;
  font-variant-numeric: tabular-nums;
}
.phone-mock__status-icons { display: flex; gap: 5px; align-items: center; }
.phone-mock__signal,
.phone-mock__wifi,
.phone-mock__battery {
  height: 11px;
  width: auto;
  display: block;
}
.phone-mock__signal  { width: 16px; }
.phone-mock__wifi    { width: 14px; }
.phone-mock__battery { width: 26px; }

.phone-mock__app-header {
  display: flex;
  align-items: center;
  gap: var(--header-gap);
  padding: 10px 4px 6px;
}

.phone-mock__icon-btn {
  width: var(--header-icon);
  height: var(--header-icon);
  border-radius: 999px;
  background: var(--vp-brand-blue-wash);
  color: var(--vp-brand-blue-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.phone-mock__icon-btn svg { width: var(--header-icon-glyph); height: var(--header-icon-glyph); }
.phone-mock__icon-btn--back {
  background: #F2F2F7;
  color: var(--vp-brand-blue);
}
.phone-mock__icon-btn--sm {
  width: var(--header-icon-sm);
  height: var(--header-icon-sm);
  background: #F2F2F7;
  color: var(--vp-brand-blue);
}
.phone-mock__app-icons {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.phone-mock__app-title {
  flex: 1;
  min-width: 0;        /* allow shrinking inside flex */
  text-align: center;
}

.phone-mock__app-title-eyebrow {
  font-size: var(--header-eyebrow-font);
  font-weight: 600;
  color: var(--vp-text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.phone-mock__app-title-main {
  font-size: var(--header-title-font);
  font-weight: 800;
  color: #0F172A;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
  letter-spacing: -0.01em;
}

.phone-mock__timer {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--vp-brand-blue-wash);
  color: var(--vp-brand-blue-deep);
  padding: 5px 12px;
  border-radius: 999px;
  font-family: var(--vp-font-mono);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin: 4px auto 16px;
  align-self: center;
}

.phone-mock__timer--inline {
  margin: 0;
  align-self: auto;
  padding: 4px 8px;
  font-size: var(--header-timer-font);
  background: transparent;
  color: var(--vp-text-primary);
  font-weight: 800;
  white-space: nowrap;
  flex-shrink: 0;
}

.phone-mock__playspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  position: relative;
}

.phone-mock__grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 0 8px;
  margin-bottom: 18px;
}
.phone-mock__grid--puzzle {
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: var(--grid-gap);
  padding: 0;
  margin: 0 auto;
  width: 100%;
  max-width: var(--grid-max-w);
  align-self: center;
}

.phone-mock__grid--puzzle .phone-cell {
  aspect-ratio: 1 / 1;
  border-radius: var(--cell-radius);
  font-size: var(--cell-font);
  min-width: 0;
}
.phone-mock__grid--puzzle .phone-cell--slot {
  border-width: 2.5px;
}
.phone-mock__grid--puzzle .phone-cell--placed,
.phone-mock__grid--puzzle .phone-cell--solved {
  border-width: 2px;
}

.phone-mock__solved {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.phone-mock__solved[hidden] { display: none; }
.phone-mock__solved span {
  background: var(--vp-success-fill);
  color: var(--vp-success-ink);
  border: 2px solid var(--vp-success-green);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  box-shadow: 0 8px 18px rgba(16, 185, 129, 0.25);
  animation: solvedPop 0.5s var(--vp-ease-tile);
}
@keyframes solvedPop {
  0% { opacity: 0; transform: scale(0.6); }
  60% { transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}

.phone-cell {
  aspect-ratio: 1;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 16px;
  font-family: var(--vp-font-rounded);
  user-select: none;
}
.phone-cell--empty { background: transparent; }
.phone-cell--block { background: transparent; }
.phone-cell--letter {
  background: var(--vp-brand-blue);
  color: #fff;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.15);
}
.phone-cell--slot {
  background: #fff;
  color: transparent;
  border: 2.5px dashed var(--vp-brand-yellow);
  cursor: pointer;
  transition: transform .2s var(--vp-ease-tile), background .15s linear;
}
.phone-cell--slot:hover {
  background: var(--vp-amber-fill-soft);
  transform: scale(1.05);
}
.phone-cell--slot.is-armed {
  background: var(--vp-amber-fill);
  border-style: solid;
  transform: scale(1.05);
}
.phone-cell--placed {
  background: var(--vp-placed-fill);
  color: var(--vp-placed-text);
  border: 2px solid var(--vp-brand-blue);
  cursor: pointer;
  animation: tileFlip 0.45s var(--vp-ease-flip);
}
.phone-cell--solved {
  background: var(--vp-success-fill);
  color: var(--vp-success-ink);
  border: 2px solid var(--vp-success-green);
  animation: tileFlip 0.5s var(--vp-ease-flip);
}

.phone-mock__hint {
  text-align: center;
  font-size: 11px;
  color: var(--vp-text-secondary);
  font-weight: 500;
  margin-bottom: 8px;
}

.phone-mock__vowels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--vowel-gap);
  padding: 0 6px;
  margin-top: auto;
  margin-bottom: 14px;
}

/* The vowel rack tiles — match the real VowelPlay app:
   white interior, thick blue rounded border, big blue letter,
   a small filled-blue badge poking out of the top-right corner. */
.phone-vowel {
  background: #fff;
  color: var(--vp-brand-blue);
  border: 3px solid var(--vp-brand-blue);
  border-radius: var(--vowel-radius);
  padding: 12px 0 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: var(--vowel-min-h);
  box-shadow: none;
  font-family: inherit;
  cursor: pointer;
  transition: transform .15s var(--vp-ease-tile), background .15s linear, color .15s linear;
}
.phone-vowel:hover { transform: translateY(-2px); }
.phone-vowel__letter {
  font-size: var(--vowel-font);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.01em;
}
/* Legacy inline-count style retained for any non-rack usage */
.phone-vowel__count {
  display: none;
}

.phone-vowel--selected {
  background: var(--vp-brand-blue);
  color: #fff;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.35);
  transform: scale(1.04);
}

.phone-vowel__count--badge {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--vp-brand-blue);
  color: #fff;
  border-radius: 999px;
  width: var(--vowel-badge);
  height: var(--vowel-badge);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--vowel-badge-font);
  font-weight: 800;
  margin-top: 0;
  padding: 0;
  border: 2px solid #fff;
  box-sizing: content-box;
}
.phone-vowel--selected .phone-vowel__count--badge {
  background: #fff;
  color: var(--vp-brand-blue);
  border-color: var(--vp-brand-blue);
}

.phone-vowel--empty {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.phone-vowel--empty .phone-vowel__count--badge {
  background: var(--vp-text-tertiary);
}

.phone-vowel--outline { /* legacy no-op */ }

/* Decorative floating tiles around the phone — desktop and tablet only.
   These are siblings of `.phone-mock` (not children), so they can't read
   the phone's custom properties. Sized directly here. */
.float-tile {
  position: absolute;
  width: 56px;
  height: 56px;
  border-radius: 12px;
  background: var(--vp-brand-blue);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 26px;
  font-family: var(--vp-font-rounded);
  box-shadow: var(--vp-shadow-tile), 0 12px 24px rgba(37,99,235,0.18);
  z-index: 1;
  animation: floatBob 4s ease-in-out infinite;
}
@media (min-width: 640px) and (max-width: 1023px) {
  .float-tile { width: 48px; height: 48px; font-size: 22px; }
}
.float-tile--yellow {
  background: #fff;
  color: var(--vp-amber-deep);
  border: 3px dashed var(--vp-brand-yellow);
}
.float-tile--green {
  background: var(--vp-success-fill);
  color: var(--vp-success-ink);
  border: 3px solid var(--vp-success-green);
}

@keyframes floatBob {
  0%, 100% { transform: translateY(0) rotate(var(--rot, -8deg)); }
  50% { transform: translateY(-12px) rotate(calc(var(--rot, -8deg) + 4deg)); }
}

/* ===========================================================================
   BREAKPOINTS — mobile-first.
   Default styles target <640px. Tablet adds at ≥640px. Desktop at ≥1024px.
   Sizes are scaled via custom properties so all interior elements stay in
   proportion to the phone frame.
   =========================================================================== */

/* MOBILE (default, <640px) — phone is small and visual-only */
@media (max-width: 639px) {
  .phone-mock {
    --phone-w: 240px;
    --phone-h: 470px;
    --frame-radius: 38px;
    --frame-pad: 9px;
    --screen-radius: 30px;
    --screen-pad-x: 10px;
    --screen-pad-top: 10px;
    --screen-pad-bottom: 12px;
    --notch-w: 78px;
    --notch-h: 20px;
    --grid-max-w: 184px;
    --grid-gap: 2px;
    --cell-radius: 4px;
    --cell-font: 12px;
    --vowel-gap: 5px;
    --vowel-min-h: 40px;
    --vowel-font: 16px;
    --vowel-radius: 10px;
    --vowel-badge: 14px;
    --vowel-badge-font: 9px;
    --header-gap: 4px;
    --header-icon: 22px;
    --header-icon-sm: 20px;
    --header-icon-glyph: 11px;
    --header-title-font: 13px;
    --header-eyebrow-font: 9px;
    --header-timer-font: 10px;
  }
  /* Hide decorative float tiles on mobile — they crowd narrow widths. */
  .float-tile { display: none; }
}

/* TABLET (≥640px and <1024px) */
@media (min-width: 640px) and (max-width: 1023px) {
  .phone-mock {
    --phone-w: 300px;
    --phone-h: 620px;
    --grid-max-w: 224px;
    --vowel-min-h: 50px;
    --vowel-font: 20px;
  }
}
