/* ============================================================
   Joey Demo Emulator
   Extends css/styles.css. Two voices: playful phone, quiet rail.
   ============================================================ */

/* ---------- Dashboard cards ---------- */
.story-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.6rem;
  margin-top: 2.5rem;
}

.story-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 1.8rem 1.6rem 1.6rem;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.story-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.story-num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 0.85rem;
  color: #fff;
  background: var(--peri);
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 0.9rem;
}

.story-flag {
  position: absolute;
  top: 1.2rem; right: 1.2rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.72rem;
  background: var(--yellow);
  color: var(--navy);
  padding: 0.25rem 0.8rem;
  border-radius: 999px;
}

.story-card .story-emoji { font-size: 2rem; margin-bottom: 0.5rem; }
.story-card h3 { margin-bottom: 0.4rem; }
.story-card p { font-size: 0.92rem; margin-bottom: 1rem; flex: 1; }

.story-chips { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-bottom: 1.2rem; }
.story-chips .chip { font-size: 0.72rem; padding: 0.25rem 0.8rem; }

.honesty-note {
  font-size: 0.85rem;
  color: #9a97b8;
  text-align: center;
  margin-top: 2.2rem;
}

.facil-strip {
  background: var(--lav-wash);
  border-radius: var(--radius);
  padding: 1.2rem 1.6rem;
  margin-top: 2.6rem;
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 2rem;
  justify-content: center;
  color: var(--ink);
}
.facil-strip strong { color: var(--navy); }
.facil-strip kbd {
  font-family: var(--font-body);
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--peri-light);
  border-radius: 6px;
  padding: 0.05rem 0.45rem;
  font-size: 0.8rem;
}

/* ---------- Player stage ---------- */
.stage-wrap { padding: 2.2rem 0 3.5rem; min-height: 70vh; }

.stage {
  display: grid;
  grid-template-columns: 190px minmax(0, 340px) 300px;
  gap: 2.4rem;
  justify-content: center;
  align-items: start;
}
.stage.no-notes { grid-template-columns: 190px minmax(0, 340px); }

/* Left rail: flat reference chrome */
.rail-left { font-size: 0.9rem; }
.rail-left h1 { font-size: 1.45rem; margin-bottom: 0.3rem; }
.rail-left .scenario { color: #9a97b8; font-size: 0.85rem; margin-bottom: 1.2rem; }
.step-count {
  font-family: var(--font-head);
  font-weight: 700;
  color: var(--navy);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}
.dots { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 1.4rem; }
.dots span {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--peri-light);
}
.dots span.done { background: var(--mint); }
.dots span.now { background: var(--coral); }

.tap-cue {
  font-size: 0.85rem;
  color: var(--ink);
  background: var(--yellow-soft);
  border-radius: 12px;
  padding: 0.55rem 0.8rem;
  margin-bottom: 1.4rem;
}

.rail-btns { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.rail-btns .btn { padding: 0.45rem 1.2rem; font-size: 0.85rem; }

/* Right rail: annotations */
.rail-notes { font-size: 0.92rem; }
.note-label {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #9a97b8;
  margin-bottom: 0.4rem;
}
.note-what {
  color: var(--ink);
  font-size: 0.95rem;
  margin-bottom: 1.1rem;
  line-height: 1.55;
}
.note-why {
  background: var(--navy);
  color: #e8e6f7;
  border-left: 5px solid var(--yellow);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  font-size: 0.88rem;
  line-height: 1.55;
}
.note-why .note-label { color: var(--yellow); margin-bottom: 0.3rem; }

/* Under-phone chrome */
.phone-col { display: flex; flex-direction: column; align-items: center; }
.under-phone {
  display: flex;
  gap: 0.7rem;
  align-items: center;
  margin-top: 1.1rem;
}
.under-phone .btn { padding: 0.45rem 1.3rem; font-size: 0.85rem; }
.coach {
  font-size: 0.85rem;
  color: #9a97b8;
  margin-top: 0.7rem;
  text-align: center;
}
.player-foot {
  font-size: 0.78rem;
  color: #b3b0cc;
  text-align: center;
  margin-top: 1.6rem;
}

/* ---------- Player phone ---------- */
.phone--player { width: 320px; flex-shrink: 0; }
.phone--player .p-screen {
  height: 560px;
  overflow-y: auto;
  padding: 0.9rem 0.9rem 1.1rem;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
}
.phone--player .p-screen::-webkit-scrollbar { width: 0; }

/* Blocks animate in on forward steps */
.blk-new { animation: blk-in 0.22s ease; }
@keyframes blk-in {
  from { opacity: 0; transform: translateY(7px); }
  to { opacity: 1; transform: none; }
}

/* Tap target ring: yellow pulse with navy stroke so it survives
   any background */
.p-tap {
  cursor: pointer;
  border: none;
  font: inherit;
  position: relative;
  min-height: 44px;
  box-shadow: 0 0 0 2px var(--navy), 0 0 0 5px var(--yellow);
  animation: tap-pulse 1.6s ease-in-out infinite;
}
@keyframes tap-pulse {
  0%, 100% { box-shadow: 0 0 0 2px var(--navy), 0 0 0 5px var(--yellow); }
  50% { box-shadow: 0 0 0 2px var(--navy), 0 0 0 10px rgba(255, 212, 105, 0.35); }
}
@media (prefers-reduced-motion: reduce) {
  .p-tap { animation: none; }
  .blk-new { animation: none; }
}

/* In-phone buttons */
.p-btn {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 0.55rem 1.3rem;
  border-radius: 999px;
  background: var(--mint);
  color: var(--navy);
  margin: 0.2rem auto 0.6rem;
  text-align: center;
}
.p-btn.coral { background: var(--coral); color: #fff; }

/* Chat screen reuses .msg/.event-card from styles.css; floor sizes */
.phone--player .msg { font-size: 0.85rem; }
.phone--player .event-card { font-size: 0.82rem; }

/* Family group chat: partner bubbles + sender labels */
.msg-p2 {
  background: var(--pink-soft);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.msg-who {
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--coral-dark);
  margin-bottom: 0.15rem;
}
.msg-who.who-joey { color: var(--peri); }

/* Checklist / plan card */
.p-card-list { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.p-card-list li {
  display: flex; gap: 0.5rem; align-items: flex-start;
  padding: 0.25rem 0; font-size: 0.8rem; color: var(--ink);
}
.p-card-list li::before { content: none; }
.p-card-list .li-ico { flex-shrink: 0; }

/* Paper invite card (photo in chat) */
.p-invite {
  background: var(--cream);
  border: 2px dashed #e5c99a;
  border-radius: 6px;
  padding: 0.8rem 0.9rem;
  font-size: 0.78rem;
  color: #6b5b45;
  margin-bottom: 0.6rem;
  transform: rotate(-1.2deg);
  font-family: 'Comic Sans MS', var(--font-body);
  line-height: 1.5;
  max-width: 88%;
}
.p-invite .inv-head { font-weight: 800; font-size: 0.95rem; color: #b0413e; }

/* ---------- OS-chrome screens (outside the chat) ---------- */
.scr-os {
  background: #eceef3;
  margin: -0.9rem -0.9rem -1.1rem;
  padding: 0.9rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Lock screen notification */
.scr-notif { justify-content: flex-start; text-align: center; }
.scr-notif .os-time {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 2.4rem;
  color: #565a6e;
  margin: 1.6rem 0 0.2rem;
}
.scr-notif .os-date { font-size: 0.85rem; color: #8a8fa3; margin-bottom: 1.8rem; }
.notif-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 4px 14px rgba(40, 44, 63, 0.12);
  padding: 0.8rem 0.95rem;
  text-align: left;
  font-size: 0.8rem;
  color: #454a5e;
  width: 100%;
}
.notif-card .n-app {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: #8a8fa3; margin-bottom: 0.35rem;
}
.notif-card .n-title { font-weight: 800; margin-bottom: 0.15rem; color: #2e3247; }

/* Document / notice view */
.scr-doc .doc-head {
  font-size: 0.72rem; color: #8a8fa3; margin-bottom: 0.6rem;
  display: flex; justify-content: space-between; align-items: center;
}
.scr-doc .doc-body {
  background: #fff;
  border-radius: 10px;
  padding: 0.9rem;
  font-size: 0.75rem;
  color: #454a5e;
  line-height: 1.6;
  flex: 1;
  overflow: hidden;
}
.scr-doc .doc-body h5 {
  font-size: 0.82rem; color: #2e3247; margin-bottom: 0.5rem;
  font-family: var(--font-body); font-weight: 800;
}
.scr-doc .doc-body p { margin-bottom: 0.55rem; }

/* Camera */
.scr-camera { background: #23253a; justify-content: space-between; text-align: center; }
.scr-camera .cam-hint { color: #b8bce5; font-size: 0.8rem; margin-top: 0.7rem; }
.cam-frame {
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  margin: 0.8rem 0.4rem;
  padding: 1rem 0.8rem;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
}
.cam-shutter {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: #fff;
  border: 4px solid #9fa4c4;
  margin: 0.6rem auto 1rem;
  display: block;
}

/* Choice screen (setup) */
.scr-choice { background: var(--lav-wash); }
.scr-choice .ch-title {
  font-family: var(--font-head); font-weight: 700; color: var(--navy);
  font-size: 1rem; text-align: center; margin: 0.8rem 0 0.2rem;
}
.scr-choice .ch-sub { font-size: 0.78rem; color: var(--ink); text-align: center; margin-bottom: 1rem; }
.choice-card {
  background: #fff;
  border: 2px solid var(--peri-light);
  border-radius: 16px;
  padding: 0.9rem;
  margin-bottom: 0.9rem;
  font-size: 0.78rem;
  color: var(--ink);
  text-align: left;
  width: 100%;
  font-family: var(--font-body);
}
.choice-card .ch-ico { font-size: 1.3rem; }
.choice-card .ch-name {
  font-family: var(--font-head); font-weight: 700; color: var(--navy);
  font-size: 0.9rem; margin: 0.25rem 0 0.2rem;
}

/* Group chat */
.scr-group { background: #ece5dd; margin: -0.9rem -0.9rem -1.1rem; padding: 0.7rem 0.7rem 1rem; flex: 1; }
.g-head {
  background: #f7f4ef;
  margin: -0.7rem -0.7rem 0.7rem;
  padding: 0.6rem 0.9rem;
  font-size: 0.8rem;
  border-bottom: 1px solid #e0d9cf;
}
.g-head .g-name { font-weight: 800; color: #2e3247; }
.g-head .g-sub { font-size: 0.68rem; color: #8a8fa3; }
.g-msg {
  background: #fff;
  border-radius: 10px;
  border-top-left-radius: 2px;
  padding: 0.45rem 0.65rem;
  font-size: 0.75rem;
  color: #3b3f52;
  margin-bottom: 0.45rem;
  max-width: 88%;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.06);
}
.g-msg .g-who { font-size: 0.66rem; font-weight: 800; margin-bottom: 0.1rem; }
.g-msg .g-time { font-size: 0.6rem; color: #a9adc0; text-align: right; margin-top: 0.1rem; }
.g-more {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: #6b708a;
  background: #f7f4ef;
  border-radius: 999px;
  padding: 0.3rem 0.9rem;
  margin: 0.5rem auto;
  width: fit-content;
}

/* Payoff */
.scr-payoff {
  background: linear-gradient(160deg, var(--lav-wash), var(--mint-light));
  margin: -0.9rem -0.9rem -1.1rem;
  padding: 1.4rem 1rem;
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  text-align: center;
}
.payoff-tick {
  width: 62px; height: 62px;
  border-radius: 50%;
  background: var(--mint);
  color: var(--navy);
  font-size: 1.9rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0.8rem 0 0.9rem;
  animation: tick-in 0.35s ease;
}
@keyframes tick-in { from { transform: scale(0.4); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .payoff-tick { animation: none; } }
.scr-payoff h4 {
  font-size: 1.35rem;
  margin-bottom: 0.9rem;
}
.payoff-stats { display: flex; gap: 1rem; justify-content: center; margin-bottom: 1rem; }
.payoff-stats .ps {
  background: #fff;
  border-radius: 14px;
  padding: 0.6rem 0.9rem;
  box-shadow: var(--shadow-soft);
}
.payoff-stats .ps b {
  display: block;
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--coral);
  line-height: 1.1;
}
.payoff-stats .ps span { font-size: 0.68rem; color: var(--ink); }
.scr-payoff ul { list-style: none; padding: 0; font-size: 0.78rem; color: var(--ink); text-align: left; margin-bottom: 1rem; }
.scr-payoff ul li { padding: 0.18rem 0; }

/* ---------- Responsive ---------- */
@media (max-width: 1050px) {
  .stage, .stage.no-notes {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.4rem;
  }
  .rail-left { order: -1; text-align: center; width: 100%; }
  .rail-left .rail-btns { flex-direction: row; justify-content: center; }
  .dots { justify-content: center; }
  .rail-notes { max-width: 340px; }
}
