/* =========================================================
   Peer Pressure — Bonfire Night
   Dark-mode messaging UI + static teenage bedroom scene
   ========================================================= */

:root {
  --bg-deep: #050505;
  --wall: #12100e;
  --wall-mid: #1a1612;
  --wood: #2a1a0e;
  --wood-light: #3d2818;
  --lamp: #ff8c1a;
  --lamp-glow: rgba(255, 120, 20, 0.5);
  --moon: #f5d9a8;
  --street: #ff9a2e;

  --phone-bezel: #0a0a0a;
  --phone-edge: #2a2018;
  --screen: #0a0a0a;
  --chat-bg: #0c0c0c;

  --header: #111111;
  --bubble-jay: #3a2818;
  --bubble-callum: #2a2218;
  --bubble-chloe: #4a2a14;
  --bubble-alex: #c45a00;
  --bubble-mum: #5a3018;
  --bubble-dad: #3a2414;
  --bubble-text: #f5ebe0;
  --muted: #9a8a78;
  --accent: #ff7a18;
  --danger: #ff4d2e;
  --warn: #ff9a2e;
  --online: #ff7a18;

  --font-ui: "Segoe UI", "SF Pro Text", system-ui, -apple-system, sans-serif;
  --font-display: "Segoe UI Semibold", "Segoe UI", system-ui, sans-serif;

  --phone-w: min(390px, 92vw);
  --phone-h: min(780px, 94vh);
  --radius-bubble: 16px;
  --decision-h: 210px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-ui);
  background: var(--bg-deep);
  color: var(--bubble-text);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* =========================================================
   BEDROOM — static CSS scene
   ========================================================= */

.bedroom {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: linear-gradient(180deg, #0a0806 0%, #14100c 45%, #080605 100%);
}

.bedroom__wall {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35) 0%, transparent 8%, transparent 92%, rgba(0, 0, 0, 0.35) 100%),
    repeating-linear-gradient(
      90deg,
      transparent,
      transparent 48px,
      rgba(255, 140, 40, 0.02) 48px,
      rgba(255, 140, 40, 0.02) 49px
    ),
    linear-gradient(180deg, var(--wall-mid) 0%, var(--wall) 70%);
}

.bedroom__floor {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 28%;
  background:
    repeating-linear-gradient(
      90deg,
      #1c1410 0px,
      #241a14 18px,
      #1a120e 20px
    );
  box-shadow: inset 0 40px 60px rgba(0, 0, 0, 0.55);
  transform: perspective(400px) rotateX(8deg);
  transform-origin: bottom center;
}

/* Window */
.bedroom__window {
  position: absolute;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  width: min(420px, 55vw);
  height: min(280px, 32vh);
  z-index: 1;
}

.bedroom__window-frame {
  position: absolute;
  inset: 0;
  border: 10px solid #2a1e14;
  border-radius: 4px;
  box-shadow:
    0 0 0 4px #141008,
    inset 0 0 40px rgba(0, 0, 0, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  background: #0a0806;
}

.bedroom__sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 70% 20%, rgba(80, 40, 10, 0.55) 0%, transparent 50%),
    linear-gradient(180deg, #08060a 0%, #120c08 40%, #1a1008 70%, #1e140c 100%);
}

.bedroom__moon {
  position: absolute;
  top: 12%;
  right: 18%;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #fff8e0, var(--moon) 60%, #c8b888);
  box-shadow: 0 0 24px rgba(240, 230, 200, 0.55), 0 0 60px rgba(240, 230, 200, 0.2);
}

.bedroom__stars {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(1px 1px at 20% 30%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 40% 15%, #fff, transparent),
    radial-gradient(1px 1px at 60% 40%, #ffe, transparent),
    radial-gradient(1px 1px at 80% 25%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 15% 60%, #fff, transparent),
    radial-gradient(1px 1px at 55% 70%, #ffe, transparent),
    radial-gradient(1px 1px at 75% 55%, #fff, transparent),
    radial-gradient(1px 1px at 30% 80%, #fff, transparent);
  opacity: 0.7;
}

.bedroom__streetlight {
  position: absolute;
  bottom: 0;
  width: 8px;
  height: 45%;
  background: linear-gradient(180deg, transparent, #3a3428);
}

.bedroom__streetlight::after {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 50px;
  background: radial-gradient(ellipse, var(--street) 0%, rgba(255, 200, 80, 0.3) 40%, transparent 70%);
  filter: blur(4px);
}

.bedroom__streetlight--1 {
  left: 22%;
}

.bedroom__streetlight--2 {
  left: 68%;
}

.bedroom__streetlight--2::after {
  width: 50px;
  height: 60px;
}

.bedroom__window-grid {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent 49%, rgba(42, 30, 18, 0.95) 49%, rgba(42, 30, 18, 0.95) 51%, transparent 51%),
    linear-gradient(180deg, transparent 49%, rgba(42, 30, 18, 0.95) 49%, rgba(42, 30, 18, 0.95) 51%, transparent 51%);
  pointer-events: none;
}

.bedroom__curtains {
  position: absolute;
  inset: -4% -6%;
  background:
    linear-gradient(90deg, rgba(50, 24, 10, 0.9) 0%, rgba(50, 24, 10, 0.25) 12%, transparent 18%, transparent 82%, rgba(50, 24, 10, 0.25) 88%, rgba(50, 24, 10, 0.9) 100%);
  pointer-events: none;
}

/* Posters */
.bedroom__poster {
  position: absolute;
  z-index: 2;
  border: 3px solid #141008;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}

.bedroom__poster--1 {
  top: 14%;
  left: 6%;
  width: 90px;
  height: 120px;
  background:
    linear-gradient(145deg, #e85a10 20%, #8a3008 50%, #2a1004 100%);
  transform: rotate(-3deg);
}

/* Desk + lamp */
.bedroom__desk {
  position: absolute;
  bottom: 22%;
  right: 4%;
  width: min(220px, 28vw);
  height: 90px;
  z-index: 3;
  background: linear-gradient(180deg, var(--wood-light), var(--wood));
  border-radius: 4px 4px 0 0;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.bedroom__desk::before {
  content: "";
  position: absolute;
  bottom: -40%;
  left: 12%;
  width: 12px;
  height: 50%;
  background: var(--wood);
}

.bedroom__desk::after {
  content: "";
  position: absolute;
  bottom: -40%;
  right: 12%;
  width: 12px;
  height: 50%;
  background: var(--wood);
}

.bedroom__lamp {
  position: absolute;
  top: -70px;
  left: 30%;
  width: 20px;
  height: 50px;
  background: #4a4038;
  border-radius: 2px;
}

.bedroom__lamp-shade {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 36px;
  background: linear-gradient(180deg, #c47840, #8a5028);
  clip-path: polygon(15% 0%, 85% 0%, 100% 100%, 0% 100%);
  box-shadow: 0 0 20px var(--lamp-glow);
}

.bedroom__lamp-glow {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 180px;
  background: radial-gradient(ellipse, var(--lamp-glow) 0%, rgba(255, 179, 71, 0.12) 40%, transparent 70%);
  pointer-events: none;
  z-index: -1;
  animation: lampPulse 4s ease-in-out infinite;
}

@keyframes lampPulse {
  0%,
  100% {
    opacity: 0.85;
  }
  50% {
    opacity: 1;
  }
}

.bedroom__desk-items {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 48px;
  height: 32px;
  background: #1a1410;
  border-radius: 4px;
  box-shadow: inset 0 0 0 1px #3a2818;
}

.bedroom__desk-items::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 6px;
  right: 6px;
  bottom: 6px;
  background: linear-gradient(135deg, #2a1a10, #0a0806);
  border-radius: 2px;
}

/* Bed */
.bedroom__bed {
  position: absolute;
  bottom: 18%;
  left: 3%;
  width: min(280px, 36vw);
  height: 100px;
  z-index: 2;
  background: #1a1410;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}

.bedroom__pillow {
  position: absolute;
  top: 10px;
  left: 16px;
  width: 70px;
  height: 40px;
  background: #2a2218;
  border-radius: 10px;
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, 0.2);
}

.bedroom__blanket {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 55%;
  background:
    repeating-linear-gradient(
      90deg,
      #2a1810 0px,
      #2a1810 20px,
      #1e120c 20px,
      #1e120c 40px
    );
  border-radius: 0 0 4px 4px;
}

.bedroom__shelf {
  position: absolute;
  top: 48%;
  right: 8%;
  width: 100px;
  height: 8px;
  background: var(--wood);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  z-index: 2;
}

.bedroom__shelf::before {
  content: "";
  position: absolute;
  top: -28px;
  left: 10px;
  width: 18px;
  height: 28px;
  background: #4a3a28;
  border-radius: 2px 2px 0 0;
}

.bedroom__shelf::after {
  content: "";
  position: absolute;
  top: -22px;
  left: 36px;
  width: 14px;
  height: 22px;
  background: #3a4a58;
  border-radius: 2px 2px 0 0;
}

.bedroom__ambient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 75% 55%, rgba(255, 100, 20, 0.18) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 25%, rgba(255, 80, 10, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(0, 0, 0, 0.6) 0%, transparent 40%);
  z-index: 4;
  pointer-events: none;
}

/* =========================================================
   PHONE FRAME
   ========================================================= */

.stage {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  max-width: 100%;
}

.phone-shell {
  position: relative;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 24px 48px rgba(0, 0, 0, 0.85)) drop-shadow(0 0 80px rgba(255, 100, 20, 0.15));
}

.phone-shell--family {
  display: none;
}

body.is-duo .phone-shell--family {
  display: flex;
}

body.is-duo .phone {
  width: min(360px, 46vw);
  height: min(760px, 92vh);
}

body.is-duo .phone-shell.is-idle {
  opacity: 0.78;
}

body.is-duo .phone-shell.is-active .phone {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 0 2px rgba(255, 140, 40, 0.9);
}

.phone {
  width: var(--phone-w);
  height: var(--phone-h);
  background: var(--phone-bezel);
  border-radius: 44px;
  padding: 12px;
  border: 2px solid var(--phone-edge);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.phone__notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 28px;
  background: #000;
  border-radius: 0 0 18px 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.phone__speaker {
  width: 48px;
  height: 5px;
  background: #1a1a1c;
  border-radius: 3px;
}

.phone__camera {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2a1810;
  box-shadow: inset 0 0 0 1.5px #4a2810;
}

.phone__screen {
  flex: 1;
  background: var(--screen);
  border-radius: 34px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

.phone__home {
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  z-index: 30;
}

/* Status bar */
.status-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px 6px;
  background: var(--header);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 20;
  position: relative;
}

.status-bar__icons {
  display: flex;
  align-items: center;
  gap: 6px;
}

.status-bar__signal {
  display: flex;
  align-items: flex-end;
  gap: 1.5px;
  height: 10px;
}

.status-bar__signal i {
  display: block;
  width: 2.5px;
  background: #f5ebe0;
  border-radius: 1px;
}

.status-bar__signal i:nth-child(1) {
  height: 3px;
}
.status-bar__signal i:nth-child(2) {
  height: 5px;
}
.status-bar__signal i:nth-child(3) {
  height: 7px;
}
.status-bar__signal i:nth-child(4) {
  height: 10px;
}

.status-bar__wifi {
  width: 13px;
  height: 10px;
  background:
    radial-gradient(circle at 50% 100%, transparent 4px, #f5ebe0 4px, #f5ebe0 5.5px, transparent 5.5px),
    radial-gradient(circle at 50% 100%, transparent 1.5px, #f5ebe0 1.5px, #f5ebe0 3px, transparent 3px);
  background-size: 100% 100%;
  position: relative;
}

.status-bar__wifi::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 3px;
  height: 3px;
  background: #f5ebe0;
  border-radius: 50%;
}

.status-bar__battery {
  width: 22px;
  height: 10px;
  border: 1.5px solid rgba(245, 235, 224, 0.8);
  border-radius: 2.5px;
  padding: 1px;
  position: relative;
}

.status-bar__battery::after {
  content: "";
  position: absolute;
  right: -3px;
  top: 2px;
  width: 2px;
  height: 4px;
  background: rgba(245, 235, 224, 0.8);
  border-radius: 0 1px 1px 0;
}

.status-bar__battery-level {
  display: block;
  height: 100%;
  width: 72%;
  background: var(--accent);
  border-radius: 1px;
}

/* =========================================================
   SCREENS
   ========================================================= */

.screen {
  position: absolute;
  inset: 0;
  top: 36px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  background: var(--chat-bg);
}

.screen.is-active {
  display: flex;
}

.screen[hidden] {
  display: none !important;
}

/* Intro */
.screen--intro {
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #3a2818 transparent;
  position: absolute;
  flex-direction: column;
}

.intro {
  flex: 1;
  min-height: 100%;
  padding: 28px 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  animation: fadeUp 0.5s ease-out;
}

.intro__kicker {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: none;
  color: var(--accent);
  margin-bottom: 8px;
}

.intro__story {
  font-size: 14px;
  line-height: 1.45;
  color: #f3e6da;
}

.intro__task {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 122, 24, 0.28);
}

.intro__heading {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  color: #fff;
  margin-bottom: 0;
}

.intro__bars {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.intro__bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 14px;
  background: #14110e;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
}

.intro .btn--primary {
  margin-top: 0;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.intro__eyebrow {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  text-align: center;
}

.intro__title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  text-align: center;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, #fff5eb 0%, #ff9a40 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  line-height: 1.1;
}

.intro__tagline {
  text-align: center;
  font-size: 13px;
  color: var(--warn);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: -6px;
  margin-bottom: 4px;
}

.intro__block {
  background: rgba(255, 122, 24, 0.04);
  border: 1px solid rgba(255, 122, 24, 0.12);
  border-radius: 12px;
  padding: 12px 14px;
}

.intro__text {
  font-size: 14px;
  line-height: 1.45;
  color: #e0d0c0;
}

.intro__track {
  position: relative;
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.intro__fill {
  display: block;
  width: 62%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9a2e, #ff7a18);
}

.intro__mark {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 40%;
  width: 2px;
  border-radius: 2px;
  background: #f5ebe0;
}

.intro__note {
  font-size: 14px;
  line-height: 1.45;
  color: #e0d0c0;
}

.intro__rules {
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.intro__rules li {
  font-size: 11px;
  line-height: 1.35;
  color: #b0a090;
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.28);
}

.intro__rules li:last-child {
  grid-column: 1 / -1;
}

.intro__rules strong {
  display: block;
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 3px;
}

/* Chat header */
.chat-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  z-index: 5;
}

.chat-header__avatars {
  display: flex;
  margin-right: 2px;
}

.chat-header__avatars .avatar {
  margin-left: -8px;
  border: 2px solid var(--header);
}

.chat-header__avatars .avatar:first-child {
  margin-left: 0;
}

.chat-header__meta {
  flex: 1;
  min-width: 0;
}

.chat-header__title {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

.chat-header__status {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 1px;
}

.chat-header__status.is-left .online-dot {
  display: none;
}

.chat-header__score {
  flex-shrink: 0;
  min-width: 44px;
  height: 32px;
  padding: 0 8px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  line-height: 1;
  color: var(--accent);
  background: rgba(255, 122, 24, 0.18);
  border: 1px solid rgba(255, 122, 24, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.chat-header__score-label {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.12em;
  opacity: 0.75;
}

.chat-header__score-value {
  font-size: 13px;
  font-weight: 800;
}

.chat-header__score.is-neg {
  color: var(--danger);
  background: rgba(255, 77, 46, 0.18);
  border-color: rgba(255, 77, 46, 0.4);
}

.chat-header__score.is-pop {
  animation: scoreChipPop 0.55s ease;
}

.chat-header__score.is-pop.is-neg {
  animation-name: scoreChipPopBad;
}

@keyframes scoreChipPop {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.22);
    box-shadow: 0 0 16px rgba(255, 122, 24, 0.55);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes scoreChipPopBad {
  0% {
    transform: scale(1);
  }
  35% {
    transform: scale(1.22);
    box-shadow: 0 0 16px rgba(255, 77, 46, 0.55);
  }
  100% {
    transform: scale(1);
  }
}

.score-pop {
  position: absolute;
  inset: 0;
  z-index: 22;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.55);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.score-pop[hidden] {
  display: none;
}

.score-pop__card {
  width: min(100%, 260px);
  padding: 18px 16px 16px;
  border-radius: 18px;
  text-align: center;
  background: #16120f;
  border: 2px solid rgba(255, 122, 24, 0.55);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
  animation: scorePopIn 0.38s cubic-bezier(0.2, 1.2, 0.4, 1);
}

.score-pop__card--bad {
  border-color: rgba(255, 77, 46, 0.65);
}

.score-pop__title {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #f5ebe0;
}

.score-pop__delta {
  margin-top: 4px;
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 18px rgba(255, 122, 24, 0.45);
}

.score-pop__card--bad .score-pop__delta {
  color: var(--danger);
  text-shadow: 0 0 18px rgba(255, 77, 46, 0.45);
}

.score-pop__note {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.35;
  color: #e8d8c8;
}

.score-pop__note[hidden] {
  display: none;
}

.score-pop__card--bad .score-pop__note {
  color: #f0c8bc;
}

.score-pop__hint {
  margin-top: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

@keyframes scorePopIn {
  0% {
    opacity: 0;
    transform: scale(0.72) translateY(12px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.chat-notice {
  align-self: center;
  margin: 10px auto;
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.02em;
}

.online-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--online);
  box-shadow: 0 0 6px var(--online);
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.friend-meter {
  flex-shrink: 0;
  padding: 8px 14px 10px;
  background: #0e0e0e;
  border-bottom: 1px solid rgba(255, 122, 24, 0.15);
}

.friend-meter__label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-bottom: 6px;
}

.friend-meter__track {
  position: relative;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: visible;
}

.friend-meter__fill {
  height: 100%;
  width: 52%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9a2e, #ff7a18);
  transition: width 0.35s ease;
}

.friend-meter.is-low .friend-meter__fill {
  background: linear-gradient(90deg, #ff4d2e, #c42810);
}

.friend-meter__min {
  position: absolute;
  top: -3px;
  bottom: -3px;
  left: 40%;
  width: 2px;
  background: #f5ebe0;
  border-radius: 2px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.6);
}

.friend-meter__hint {
  margin-top: 5px;
  font-size: 10px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.friend-meter.is-low .friend-meter__hint {
  color: var(--danger);
}

/* Avatars */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.avatar--sm {
  width: 26px;
  height: 26px;
  font-size: 9px;
}

.avatar--jay {
  background: linear-gradient(135deg, #c46a20, #6a3810);
}

.avatar--callum {
  background: linear-gradient(135deg, #8a6020, #4a3010);
}

.avatar--chloe {
  background: linear-gradient(135deg, #e07030, #8a3810);
}

.avatar--alex {
  background: linear-gradient(135deg, #ff8c28, #c45000);
}

.avatar--mum {
  background: linear-gradient(135deg, #e09040, #8a4010);
}

.avatar--dad {
  background: linear-gradient(135deg, #a06030, #4a2810);
}

/* Chat thread */
.chat-thread {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #3a2818 transparent;
  background:
    radial-gradient(ellipse at 50% 0%, rgba(80, 40, 10, 0.35) 0%, transparent 50%),
    var(--chat-bg);
}

.message {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 92%;
  animation: msgIn 0.28s ease-out;
}

@keyframes msgIn {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message--outgoing {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message__bubble {
  padding: 8px 12px 6px;
  border-radius: var(--radius-bubble);
  position: relative;
  max-width: 100%;
}

.message--incoming .message__bubble {
  border-bottom-left-radius: 4px;
}

.message--outgoing .message__bubble {
  border-bottom-right-radius: 4px;
  background: var(--bubble-alex);
}

.message--jay .message__bubble {
  background: var(--bubble-jay);
}

.message--callum .message__bubble {
  background: var(--bubble-callum);
}

.message--chloe .message__bubble {
  background: var(--bubble-chloe);
}

.message--mum .message__bubble {
  background: var(--bubble-mum);
}

.message--dad .message__bubble {
  background: var(--bubble-dad);
}

.message__name {
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 3px;
  opacity: 0.85;
}

.message--jay .message__name {
  color: #ffb070;
}

.message--callum .message__name {
  color: #e0b070;
}

.message--chloe .message__name {
  color: #ffc090;
}

.message--mum .message__name {
  color: #ffd0a0;
}

.message--dad .message__name {
  color: #e8b080;
}

.message--outgoing .message__name {
  color: #ffd0a0;
  text-align: right;
}

.message__text {
  font-size: 14px;
  line-height: 1.4;
  color: var(--bubble-text);
  word-wrap: break-word;
}

.message__meta {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
}

.message__time {
  font-size: 10px;
  color: rgba(232, 238, 245, 0.45);
}

/* Typing indicator */
.typing {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 92%;
  animation: msgIn 0.2s ease-out;
}

.typing__bubble {
  background: #1a1410;
  padding: 12px 16px;
  border-radius: var(--radius-bubble);
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
  align-items: center;
}

.typing__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #c47830;
  animation: typingBounce 1.2s ease-in-out infinite;
}

.typing__dot:nth-child(2) {
  animation-delay: 0.15s;
}

.typing__dot:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes typingBounce {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.5;
  }
  30% {
    transform: translateY(-4px);
    opacity: 1;
  }
}

/* Decision bar */
.decision-bar {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 22px;
  background: linear-gradient(180deg, rgba(12, 12, 12, 0.95), #14100c);
  border-top: 1px solid rgba(255, 122, 24, 0.12);
  min-height: var(--decision-h);
  z-index: 5;
  animation: slideUpChoices 0.3s ease-out;
}

.decision-bar[hidden] {
  display: none !important;
}

.decision-timer {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.decision-timer__label {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.decision-timer__label span:last-child {
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}

.decision-timer.is-urgent .decision-timer__label span:last-child {
  color: var(--danger);
}

.decision-timer__track {
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.decision-timer__fill {
  height: 100%;
  width: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #ff9a2e);
  transform-origin: left center;
  transform: scaleX(1);
}

.decision-timer.is-running .decision-timer__fill {
  transition: transform linear;
}

.decision-timer.is-urgent .decision-timer__fill {
  background: linear-gradient(90deg, var(--danger), #ff7a18);
}

@keyframes slideUpChoices {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Buttons */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: transform 0.12s ease, filter 0.12s ease, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: linear-gradient(135deg, #ff8c28, #c45000);
  color: #0a0a0a;
  margin-top: 8px;
  box-shadow: 0 4px 16px rgba(196, 80, 0, 0.45);
}

.btn--primary:hover {
  filter: brightness(1.12);
}

.btn--choice {
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 600;
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  justify-content: flex-start;
  padding: 12px 14px;
  min-height: 44px;
  color: #f5ebe0;
  position: relative;
  background: rgba(255, 122, 24, 0.12);
  border: 1px solid rgba(255, 122, 24, 0.4);
}

.btn--choice:hover {
  background: rgba(255, 122, 24, 0.2);
}

.btn--choice:disabled {
  opacity: 0.5;
  pointer-events: none;
}

/* Ending screens */
.screen--ending {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #3a2818 transparent;
  flex-direction: column;
}

.ending {
  flex: 1;
  min-height: 100%;
  padding: 28px 18px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 22px;
  animation: fadeUp 0.45s ease-out;
}

.ending__top {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ending__kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.ending__title {
  font-size: 32px;
  font-weight: 800;
  text-align: left;
  letter-spacing: 0;
  line-height: 1.05;
  color: #fff;
}

.ending__score-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  align-self: center;
  gap: 6px;
  width: 118px;
  height: 118px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 122, 24, 0.14);
  border: 1px solid rgba(255, 122, 24, 0.4);
  text-align: center;
}

.ending__score-block.is-neg {
  background: rgba(255, 77, 46, 0.14);
  border-color: rgba(255, 77, 46, 0.45);
}

.ending__score-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.ending__score-big {
  font-size: 42px;
  font-weight: 900;
  line-height: 1;
  color: var(--accent);
  letter-spacing: -0.02em;
}

.ending__score-big--neg {
  color: var(--danger);
}

.ending__subtitle {
  text-align: left;
  font-size: 15px;
  line-height: 1.45;
  color: #f3e6da;
  padding: 0;
  font-weight: 400;
}

.ending__subtitle--bad {
  color: #f0c8bc;
}

.ending__summary {
  background: none;
  border: none;
  border-top: 1px solid rgba(255, 122, 24, 0.28);
  border-radius: 0;
  padding: 16px 0 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 0;
}

.ending__summary--inline {
  margin-top: 4px;
}

.ending__heading {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.ending__body {
  font-size: 14px;
  line-height: 1.45;
  color: #e0d0c0;
}

.ending__body--strong {
  color: #f5ebe0;
  font-weight: 700;
}

.ending__excuses {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.ending__excuses li {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 13px 14px;
  border-radius: 12px;
  background: #14110e;
  border: 1px solid rgba(255, 122, 24, 0.22);
}

.ending__excuses strong {
  font-size: 13px;
  line-height: 1.4;
  color: #f5ebe0;
  font-weight: 700;
}

.ending__excuses span {
  font-size: 12px;
  line-height: 1.4;
  color: #b0a090;
  font-weight: 500;
}

.ending .btn--primary {
  margin-top: 0;
}

/* Responsive tweaks */
@media (max-height: 700px) {
  :root {
    --phone-h: min(700px, 96vh);
    --decision-h: 210px;
  }

  .bedroom__poster--1,
  .bedroom__shelf {
    display: none;
  }
}

@media (max-width: 860px) {
  .stage {
    gap: 10px;
  }

  body.is-duo .phone {
    width: min(320px, 48vw);
    border-radius: 28px;
    padding: 8px;
  }
}

@media (max-width: 480px) {
  .bedroom__desk,
  .bedroom__bed {
    opacity: 0.35;
  }

  .phone {
    border-radius: 36px;
    padding: 8px;
  }

  .phone__screen {
    border-radius: 28px;
  }
}

.close-fallback {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  background: #000;
  text-align: center;
}

.close-fallback[hidden] {
  display: none !important;
}

.close-fallback__text {
  max-width: 320px;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  color: #f5ebe0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .chat-thread {
    scroll-behavior: auto;
  }
}
