:root {
  --orange: #ff6b1a;
  --orange-2: #ff8a00;
  --orange-3: #ffb23f;
  --coral: #ff4d36;
  --red: #f43f5e;
  --blue: #2578f5;
  --blue-2: #2f8cff;
  --green: #1fc77a;
  --yellow: #ffc43d;
  --ink: #14213d;
  --text: #182642;
  --muted: #6a7891;
  --muted-2: #92a0b6;
  --cream: #fff8ee;
  --cream-2: #fff2df;
  --card: rgba(255, 250, 242, .95);
  --line: rgba(240, 151, 75, .22);
  --shadow: 0 30px 80px rgba(122, 57, 0, .20);
  --soft-shadow: 0 18px 40px rgba(122, 57, 0, .12);
  --radius-xl: 36px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #ffb13f 0%, #ff8a00 48%, #ff6b00 100%);
  overflow-x: hidden;
}
body.chat-active { overflow: hidden; }
button, input, select, textarea { font: inherit; }
a { color: inherit; }
button {
  border: 0;
  cursor: pointer;
  user-select: none;
  font-weight: 900;
  transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease, border-color .18s ease, background .18s ease;
}
button:hover { transform: translateY(-1px); }
button:active { transform: translateY(1px) scale(.99); }
button:disabled, button[aria-disabled="true"] { cursor: not-allowed; opacity: .72; }
button[aria-disabled="true"]:hover, button:disabled:hover { transform: none; }
input, select {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(239, 148, 63, .25);
  border-radius: 16px;
  padding: 0 15px;
  background: rgba(255,255,255,.82);
  color: var(--text);
  outline: 0;
  font-weight: 800;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
input:focus, select:focus {
  border-color: rgba(37, 120, 245, .65);
  box-shadow: 0 0 0 4px rgba(37, 120, 245, .12), inset 0 1px 0 rgba(255,255,255,.85);
}
.hidden { display: none !important; }
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  white-space: nowrap !important;
}

.app-shell { min-height: 100svh; position: relative; }
.orange-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.fixed-bg { position: fixed; }
.blob { position: absolute; border-radius: 999px; opacity: .45; filter: blur(.2px); }
.blob-a { width: 340px; height: 340px; left: -120px; bottom: -140px; background: rgba(255, 222, 120, .85); }
.blob-b { width: 120px; height: 120px; right: 34px; top: 26%; background: rgba(255, 204, 94, .42); }
.blob-c { width: 64px; height: 64px; left: 42px; top: 52%; background: rgba(255,255,255,.23); }
.dot-cloud { position: absolute; width: 118px; height: 118px; opacity: .42; background-image: radial-gradient(rgba(255,255,255,.65) 2px, transparent 2.5px); background-size: 18px 18px; }
.dot-left { left: 30px; top: 80px; }
.dot-right { right: 42px; bottom: 170px; }

/* Landing page */
.start-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(32px, var(--safe-top)) 22px max(30px, var(--safe-bottom));
  position: relative;
}
.landing-card, .chat-app-card {
  position: relative;
  z-index: 1;
  width: min(1710px, calc(100vw - 40px));
  background: linear-gradient(135deg, rgba(255, 253, 248, .97), rgba(255, 245, 231, .95));
  border: 1px solid rgba(255,255,255,.62);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  overflow: hidden;
  isolation: isolate;
}
.landing-card::before, .chat-app-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 26%, rgba(255, 119, 40, .12), transparent 34%),
    radial-gradient(circle at 24% 100%, rgba(255, 194, 64, .14), transparent 34%);
  z-index: -1;
}
.landing-nav, .chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 92px;
  padding: 22px clamp(22px, 5vw, 72px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  text-decoration: none;
  color: var(--ink);
  min-width: fit-content;
}
.brand-icon {
  width: 52px;
  height: 52px;
  border-radius: 18px 18px 18px 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #ff6c2d, #ff8e36 58%, #ffb44c);
  color: #fff;
  box-shadow: 0 12px 26px rgba(255, 94, 29, .30);
  position: relative;
  transform: rotate(-4deg);
}
.brand-icon::after {
  content: "";
  position: absolute;
  width: 19px;
  height: 17px;
  left: -6px;
  bottom: -5px;
  border-radius: 999px 0 999px 999px;
  background: var(--blue);
  z-index: -1;
}
.brand-icon span { font-size: 30px; line-height: 1; transform: rotate(4deg); }
.brand-text { font-size: clamp(28px, 3vw, 42px); font-weight: 1000; letter-spacing: -.055em; line-height: 1; }
.brand-text b { color: var(--ink); }
.brand-text em { color: var(--orange); font-style: normal; }
.landing-links, .chat-nav { display: flex; align-items: center; justify-content: center; gap: clamp(18px, 3vw, 48px); }
.landing-links a, .chat-nav-link {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  border-radius: 999px;
  padding: 10px 3px;
  font-weight: 950;
  font-size: 16px;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.landing-links a.active, .chat-nav-link.active { color: var(--orange); }
.landing-links a.active::after, .chat-nav-link.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 32px;
  height: 4px;
  border-radius: 999px;
  background: var(--orange);
  transform: translateX(-50%);
}
.login-pill, .soft-chip {
  min-height: 50px;
  border-radius: 999px;
  padding: 0 22px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(241, 144, 67, .22);
  color: var(--ink);
  box-shadow: 0 10px 26px rgba(122, 57, 0, .08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hero-layout {
  min-height: 660px;
  display: grid;
  grid-template-columns: minmax(0, .96fr) minmax(420px, .9fr);
  gap: 26px;
  align-items: center;
  padding: 34px clamp(26px, 6vw, 92px) 34px;
}
.hero-copy { max-width: 790px; }
.spark-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 20px;
  color: var(--orange);
  background: rgba(255, 119, 40, .10);
  font-weight: 950;
  font-size: 18px;
}
h1 {
  margin: 28px 0 0;
  font-size: clamp(54px, 6vw, 92px);
  letter-spacing: -.075em;
  line-height: .98;
  color: var(--ink);
}
h1 span { color: var(--orange); }
.hero-lead {
  max-width: 640px;
  margin: 28px 0 0;
  color: #68758d;
  font-size: clamp(18px, 1.7vw, 24px);
  line-height: 1.55;
  font-weight: 730;
}
.mode-actions { display: flex; flex-wrap: wrap; gap: 18px; margin: 34px 0 22px; }
.primary-cta, .secondary-cta {
  min-height: 72px;
  border-radius: 18px;
  padding: 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 21px;
}
.primary-cta {
  color: #fff;
  background: linear-gradient(180deg, #ff7b2f, #ff4f1f);
  box-shadow: 0 18px 30px rgba(255, 84, 31, .25), inset 0 1px 0 rgba(255,255,255,.26);
}
.secondary-cta {
  color: #60718c;
  background: rgba(255,255,255,.45);
  border: 1px solid rgba(238, 153, 76, .28);
  box-shadow: none;
}
.alert {
  border-radius: 18px;
  padding: 13px 15px;
  margin: 12px 0 16px;
  font-weight: 800;
  line-height: 1.45;
}
.alert.error { color: #b4233b; background: rgba(244, 63, 94, .12); border: 1px solid rgba(244, 63, 94, .24); }
.start-form { display: grid; gap: 16px; }
.field-label { display: grid; gap: 8px; color: var(--ink); font-weight: 950; }
.compact-field { max-width: 360px; }
.preference-grid { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(280px, 1.45fr); gap: 18px; }
.choice-card {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  min-height: 92px;
  border-radius: 20px;
  background: rgba(255,255,255,.56);
  border: 1px solid rgba(239, 148, 63, .18);
  box-shadow: var(--soft-shadow);
}
.choice-title { width: 100%; color: var(--ink); font-weight: 950; font-size: 14px; }
.choice-card label { display: inline-flex; align-items: center; gap: 0; cursor: pointer; }
.choice-card input { position: absolute; opacity: 0; pointer-events: none; }
.choice-card label span {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid rgba(41, 54, 86, .12);
  background: rgba(255,255,255,.65);
  font-weight: 900;
  color: var(--ink);
}
.choice-card input:checked + span {
  border-color: rgba(255, 107, 26, .85);
  background: #fff6eb;
  box-shadow: 0 6px 18px rgba(255, 107, 26, .12);
}
.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 10px;
  color: #66748e;
  font-weight: 800;
  line-height: 1.4;
  font-size: 14px;
}
.check-row input { width: 18px; min-height: 18px; margin-top: 2px; accent-color: var(--blue); }
.check-row a { color: var(--blue); font-weight: 950; }
.start-button {
  width: min(380px, 100%);
  min-height: 62px;
  border-radius: 18px;
  color: #fff;
  background: linear-gradient(180deg, #ff7b2f, #ff4f1f);
  box-shadow: 0 18px 34px rgba(255, 84, 31, .24), inset 0 1px 0 rgba(255,255,255,.25);
  font-size: 20px;
}
.hero-art { position: relative; min-height: 560px; display: grid; place-items: center; }
.hero-art::before {
  content: "";
  position: absolute;
  width: min(560px, 88%);
  height: min(560px, 88%);
  border-radius: 44% 56% 50% 50%;
  background: rgba(255, 125, 64, .10);
  transform: rotate(-8deg);
}
.paper-plane, .heart { position: absolute; z-index: 4; }
.paper-plane { right: 18%; top: 16%; color: #ff7a22; font-size: 82px; transform: rotate(-32deg); text-shadow: 0 16px 26px rgba(255, 107, 26, .22); }
.heart { color: #ff6246; filter: drop-shadow(0 10px 16px rgba(255, 98, 70, .2)); }
.heart-a { left: 19%; top: 20%; font-size: 54px; transform: rotate(-18deg); }
.heart-b { right: 9%; top: 52%; font-size: 26px; }
.chat-illustration { position: relative; width: min(590px, 94%); aspect-ratio: 1.05; display: grid; place-items: center; }
.big-bubble {
  position: absolute;
  width: 350px;
  height: 280px;
  border-radius: 88px 88px 88px 40px;
  background: linear-gradient(145deg, #ff6e41, #ff4e35);
  box-shadow: 0 24px 60px rgba(255, 88, 48, .28), inset 0 10px 18px rgba(255,255,255,.14);
}
.big-bubble::after {
  content: "";
  position: absolute;
  right: 74px;
  bottom: -28px;
  width: 58px;
  height: 58px;
  background: #ff5238;
  border-radius: 0 0 56px 0;
  transform: rotate(45deg);
}
.big-bubble i {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  width: 166px;
  height: 126px;
  border-radius: 44px 44px 44px 20px;
  display: grid;
  place-items: center;
  background: #fff8ee;
  color: #ff6240;
  font-style: normal;
  font-size: 70px;
  line-height: 1;
  box-shadow: inset 0 -8px 18px rgba(255, 149, 61, .10);
}
.big-bubble b, .big-bubble b::before, .big-bubble b::after {
  position: absolute;
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff7ef;
  content: "";
  bottom: 52px;
  left: 138px;
}
.big-bubble b::before { left: 42px; bottom: 0; }
.big-bubble b::after { left: 84px; bottom: 0; }
.blue-bubble {
  position: absolute;
  right: 18px;
  bottom: 72px;
  width: 190px;
  height: 120px;
  border-radius: 42px 42px 42px 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  background: linear-gradient(145deg, #2d8cff, #1f6fed);
  box-shadow: 0 20px 42px rgba(37, 120, 245, .28);
}
.blue-bubble i { width: 16px; height: 16px; border-radius: 50%; background: #fff; opacity: .9; }
.leaf { position: absolute; bottom: 55px; border-radius: 50px 50px 8px 50px; background: #27b989; }
.leaf-a { left: 66px; width: 60px; height: 120px; transform: rotate(-28deg); }
.leaf-b { left: 128px; width: 46px; height: 90px; transform: rotate(32deg); background: #13a978; }
.play-orb {
  position: absolute;
  right: 86px;
  bottom: 18px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, #2d8cff, #1f6fed);
  border: 6px solid rgba(255,255,255,.78);
  box-shadow: 0 18px 42px rgba(37,120,245,.32);
  font-size: 32px;
  padding-left: 5px;
}
.landing-status {
  display: grid;
  grid-template-columns: minmax(280px, .9fr) minmax(340px, 1fr);
  gap: 24px;
  align-items: center;
  margin: 0 clamp(26px, 6vw, 82px) 38px;
  padding: 24px 34px;
  border-radius: 22px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(239,148,63,.16);
  box-shadow: var(--soft-shadow);
}
.online-chip { display: flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 950; }
.online-chip strong { color: var(--orange); }
.online-dot { width: 11px; height: 11px; border-radius: 999px; background: var(--green); box-shadow: 0 0 0 7px rgba(31, 199, 122, .12); flex: 0 0 auto; }
.safety-chip { display: flex; gap: 15px; align-items: center; color: #66748e; font-weight: 760; line-height: 1.35; }
.safety-chip > span { width: 58px; height: 58px; flex: 0 0 auto; border-radius: 50%; background: rgba(31,199,122,.12); display:grid; place-items:center; font-size: 29px; }
.safety-chip p { margin: 0; }
.safety-chip strong { color: var(--ink); }

/* Chat interface */
.chat-screen {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: max(22px, var(--safe-top)) 20px max(22px, var(--safe-bottom));
  position: relative;
}
.chat-app-card {
  min-height: calc(100svh - 44px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
}
.chat-topbar {
  min-height: 88px;
  border-bottom: 1px solid rgba(239, 148, 63, .18);
  padding: 18px clamp(18px, 3vw, 40px);
}
.brand.compact .brand-icon { width: 46px; height: 46px; border-radius: 16px 16px 16px 7px; }
.brand.compact .brand-icon span { font-size: 27px; }
.brand.compact .brand-text { font-size: 30px; }
.chat-nav { flex: 1; gap: 22px; justify-content: flex-start; margin-left: 22px; }
.chat-nav-link { font-size: 15px; padding: 10px 8px; white-space: nowrap; }
.chat-top-actions { display: flex; align-items: center; gap: 12px; }
.soft-chip { min-height: 48px; padding: 0 18px; color: var(--ink); font-size: 15px; white-space: nowrap; }
.video-later { background: #eaf3ff; color: #336aa8; border-color: rgba(37,120,245,.16); }
.danger-chip { background: var(--red); color: #fff; border-color: transparent; box-shadow: 0 12px 24px rgba(244,63,94,.20); }
.profile-dot {
  width: 52px;
  height: 52px;
  min-height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding: 0;
  color: #fff;
  background: linear-gradient(145deg, #ff7a1a, #ff9500);
  box-shadow: 0 10px 22px rgba(255, 122, 26, .25);
  font-size: 18px;
}
.chat-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(420px, 1fr) minmax(260px, 400px);
  gap: 24px;
  padding: 24px clamp(18px, 3vw, 32px);
}
.side-panel, .chat-main {
  min-height: 0;
  border-radius: 24px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(239, 148, 63, .16);
  box-shadow: var(--soft-shadow);
}
.side-panel { padding: 24px; overflow: auto; }
.panel-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.panel-title > span { font-size: 26px; }
.panel-title h3 { margin: 0; color: var(--ink); font-size: 22px; letter-spacing: -.03em; }
.panel-title p { margin: 3px 0 0; color: var(--muted); font-weight: 760; }
.daily-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  align-items: center;
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255,247,237,.9), rgba(255,235,211,.82));
  border: 1px solid rgba(239,148,63,.18);
  margin-bottom: 22px;
}
.trophy { font-size: 76px; filter: drop-shadow(0 14px 20px rgba(255, 181, 44, .25)); }
.daily-card strong { color: #d63a1d; font-size: 17px; }
.daily-card p { margin: 7px 0 12px; color: var(--muted); font-weight: 740; line-height: 1.35; }
.mini-orange {
  min-height: 42px;
  padding: 0 18px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(180deg, #ff7b2f, #ff4f1f);
  box-shadow: 0 10px 22px rgba(255, 84, 31, .20);
}
.quick-games { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.game-card {
  min-height: 122px;
  display: grid;
  place-items: center;
  gap: 5px;
  text-align: center;
  border-radius: 18px;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(239,148,63,.16);
  color: var(--ink);
  box-shadow: none;
}
.game-card span { font-size: 32px; }
.game-card small { color: var(--muted); font-weight: 750; }
.leaderboard {
  width: 100%;
  margin-top: 20px;
  min-height: 52px;
  border-radius: 16px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #596a86;
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(239,148,63,.16);
  box-shadow: none;
}
.chat-main {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px 20px 0;
  background:
    radial-gradient(circle at 50% -10%, rgba(255, 107, 26, .10), transparent 35%),
    rgba(255,255,255,.55);
}
.chat-mascot {
  margin: 0 auto 12px;
  width: 74px;
  height: 58px;
  border-radius: 26px 26px 26px 11px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 35px;
  background: linear-gradient(145deg, #ff6e41, #ff4e35);
  box-shadow: 0 16px 30px rgba(255, 88, 48, .22);
}
.connection-pill {
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  background: rgba(255, 246, 234, .95);
  border: 1px solid rgba(239,148,63,.20);
  color: var(--ink);
  font-weight: 950;
  box-shadow: 0 8px 20px rgba(122, 57, 0, .08);
  text-align: center;
}
.status-sub { margin: 12px 0 6px; text-align: center; color: var(--muted); font-weight: 750; }
.messages {
  flex: 1;
  min-height: 320px;
  overflow-y: auto;
  padding: 18px 10px 112px;
  scroll-behavior: smooth;
}
.messages::-webkit-scrollbar, .side-panel::-webkit-scrollbar { width: 10px; }
.messages::-webkit-scrollbar-thumb, .side-panel::-webkit-scrollbar-thumb { background: rgba(239, 148, 63, .25); border-radius: 999px; }
.waiting-panel {
  position: absolute;
  left: 50%;
  top: 55%;
  width: min(430px, calc(100% - 40px));
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
  padding: 28px;
  border-radius: 24px;
  color: var(--muted);
  background: rgba(255,255,255,.76);
  border: 1px solid rgba(239,148,63,.16);
  box-shadow: 0 20px 48px rgba(122, 57, 0, .12);
  font-weight: 800;
}
.spinner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 6px solid rgba(255, 107, 26, .14);
  border-top-color: var(--orange);
  animation: spin .85s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.waiting-actions { display:flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.msg { max-width: min(74%, 620px); margin: 12px 0; display: grid; gap: 5px; animation: msgIn .18s ease-out; }
@keyframes msgIn { from { opacity:0; transform:translateY(6px); } to { opacity:1; transform:translateY(0); } }
.msg.mine { margin-left: auto; justify-items: end; }
.msg.theirs { margin-right: auto; justify-items: start; }
.msg-meta { color: var(--muted-2); font-size: 12px; font-weight: 950; padding-inline: 8px; }
.msg-body {
  padding: 14px 17px;
  border-radius: 21px;
  line-height: 1.46;
  overflow-wrap: anywhere;
  font-weight: 760;
  box-shadow: 0 8px 20px rgba(122,57,0,.08);
}
.msg.mine .msg-body { background: #fff1df; color: var(--text); border-bottom-right-radius: 7px; border: 1px solid rgba(239,148,63,.18); }
.msg.theirs .msg-body { background: #fff; color: var(--text); border-bottom-left-radius: 7px; border: 1px solid rgba(41,54,86,.08); }
.right-panel { display: grid; grid-template-rows: minmax(260px, 1fr) auto auto; gap: 18px; }
.stickers-card { min-height: 0; display: flex; flex-direction: column; }
.sticker-tabs { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid rgba(239,148,63,.18); margin: -6px -6px 20px; }
.tab {
  min-height: 52px;
  background: transparent;
  color: #63748e;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 3px solid transparent;
}
.tab.active { color: var(--orange); border-bottom-color: var(--orange); }
.stickers-card p { color: var(--muted); margin: 0 0 18px; font-weight: 760; }
.sticker-grid { display:grid; grid-template-columns: repeat(3, minmax(58px, 1fr)); gap: 14px; }
.emoji-btn {
  min-height: 74px;
  border-radius: 20px;
  background: rgba(255,255,255,.58);
  border: 1px solid rgba(239,148,63,.14);
  box-shadow: none;
  font-size: 32px;
}
.vibe-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: rgba(255,255,255,.52);
  border: 1px solid rgba(239,148,63,.16);
}
.vibe-card > span { font-size: 32px; }
.vibe-card p { margin: 0; color: var(--muted); font-weight: 760; line-height: 1.4; }
.vibe-card strong { color: var(--ink); }
.chat-actions { display: grid; grid-template-columns: 1fr; gap: 12px; }
.control-card {
  min-height: 74px;
  border-radius: 16px;
  color: #fff;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 12px;
  text-align: left;
  padding: 12px 20px;
  box-shadow: inset 0 -7px 0 rgba(0,0,0,.14), 0 12px 24px rgba(122,57,0,.13);
}
.control-card > span { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.22); }
.control-card strong { font-size: 21px; line-height: 1; }
.control-card small { grid-column: 2; opacity: .96; font-weight: 760; margin-top: -12px; }
.end-card { background: linear-gradient(180deg, #ff6a35, #f04f27); }
.skip-card { background: linear-gradient(180deg, #2f8cff, #1f70ee); }
.small-action {
  min-height: 46px;
  border-radius: 999px;
  padding: 10px 16px;
  background: rgba(255,255,255,.56);
  color: #51627d;
  border: 1px solid rgba(239,148,63,.18);
  box-shadow: none;
  font-size: 14px;
}
.danger-soft { background: rgba(244,63,94,.10); color: #d82a48; border-color: rgba(244,63,94,.2); }
.next-soft { background: rgba(37,120,245,.10); color: #1e65cd; border-color: rgba(37,120,245,.2); }
.block { width:100%; }
.message-form {
  width: 100%;
  padding: 0 clamp(18px, 3vw, 32px) 24px;
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 72px;
  gap: 14px;
  align-items: center;
}
.mobile-next, .send-button {
  height: 66px;
  min-height: 66px;
  border-radius: 18px;
  color: #fff;
  padding: 0;
  font-size: 28px;
}
.mobile-next { background: linear-gradient(180deg, #ff526e, #ef3154); box-shadow: 0 12px 24px rgba(244,63,94,.20); }
.send-button { background: linear-gradient(180deg, #2f8cff, #1f70ee); box-shadow: 0 12px 24px rgba(37,120,245,.20); }
.input-wrap {
  height: 66px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  background: rgba(255,255,255,.78);
  border: 1px solid rgba(239,148,63,.18);
  border-radius: 18px;
  padding: 0 11px 0 14px;
  box-shadow: 0 10px 24px rgba(122,57,0,.08);
}
.input-wrap:focus-within { border-color: rgba(37,120,245,.55); box-shadow: 0 0 0 4px rgba(37,120,245,.10), 0 10px 24px rgba(122,57,0,.08); }
.input-wrap input {
  min-height: 0;
  height: 58px;
  border: 0;
  box-shadow: none;
  background: transparent;
  padding: 0;
  font-size: 17px;
}
.input-icon {
  width: 44px;
  min-height: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  color: #8a98ae;
  font-size: 25px;
}
.mobile-action-row { display: none; padding: 0 18px 16px; justify-content: center; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 33, 61, .48);
  backdrop-filter: blur(10px);
}
.modal-card {
  width: min(460px, 100%);
  padding: 26px;
  border-radius: 24px;
  background: var(--cream);
  border: 1px solid rgba(239,148,63,.24);
  box-shadow: var(--shadow);
}
.modal-card h3 { margin: 0 0 8px; font-size: 28px; letter-spacing: -.04em; color: var(--ink); }
.modal-card p { color: var(--muted); font-weight: 760; }
.modal-actions { display:grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.modal-actions button { min-height: 50px; border-radius: 16px; color: #fff; background: var(--orange); }
.ghost { background: rgba(20,33,61,.09) !important; color: var(--ink) !important; border: 1px solid rgba(20,33,61,.10); box-shadow: none; }

/* Setup / Admin / Policy pages */
.setup-body { display:grid; place-items:center; min-height:100svh; padding:20px; background: linear-gradient(135deg, #ffb13f, #ff7a00); }
.setup-card, .policy-card {
  width: min(900px, 100%);
  background: rgba(255, 250, 242, .95);
  border: 1px solid rgba(255,255,255,.62);
  border-radius: 24px;
  padding: 28px;
  color: var(--text);
  box-shadow: var(--shadow);
}
.setup-form { display:grid; gap:14px; }
.table-wrap { overflow:auto; }
table { width:100%; border-collapse:collapse; }
th, td { padding:10px; border-bottom:1px solid var(--line); text-align:left; }
.stat-grid { display:grid; grid-template-columns: repeat(3, 1fr); gap:12px; }
.stat-card { background: rgba(255,255,255,.55); border-radius:18px; padding:18px; }
.inline-form { display:flex; gap:10px; flex-wrap:wrap; }

@media (max-width: 1440px) {
  .landing-card, .chat-app-card { width: min(1500px, calc(100vw - 28px)); }
  .hero-layout { grid-template-columns: minmax(0,.95fr) minmax(360px,.8fr); }
  h1 { font-size: clamp(48px, 5vw, 78px); }
  .chat-grid { grid-template-columns: minmax(240px, 350px) minmax(380px, 1fr) minmax(260px, 350px); gap: 18px; }
  .soft-chip.video-later { max-width: 230px; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 1180px) {
  .landing-links { gap: 22px; }
  .hero-layout { grid-template-columns: 1fr; min-height: auto; padding-top: 28px; }
  .hero-copy { max-width: none; }
  .hero-art { min-height: 430px; }
  .chat-illustration { width: min(520px, 100%); }
  .landing-status { grid-template-columns: 1fr; }
  .chat-grid { grid-template-columns: minmax(360px, 1fr) minmax(250px, 330px); }
  .left-panel { display: none; }
  .chat-nav { display: none; }
}

@media (max-width: 900px) {
  body.chat-active { overflow: hidden; }
  .start-screen { align-items: stretch; padding: 10px; }
  .landing-card { width: 100%; min-height: calc(100svh - 20px); border-radius: 28px; }
  .landing-nav { min-height: 76px; padding: 18px; }
  .landing-links { display: none; }
  .brand-icon { width: 46px; height: 46px; border-radius: 16px 16px 16px 7px; }
  .brand-icon span { font-size: 27px; }
  .brand-text { font-size: 30px; }
  .login-pill { min-height: 44px; padding-inline: 14px; }
  .hero-layout { padding: 22px 18px 12px; gap: 8px; }
  .spark-pill { min-height: 38px; padding-inline: 14px; font-size: 15px; }
  h1 { margin-top: 18px; font-size: clamp(41px, 12vw, 60px); }
  .hero-lead { font-size: 16px; margin-top: 16px; }
  .mode-actions { gap: 12px; margin-top: 22px; }
  .primary-cta, .secondary-cta { width: 100%; min-height: 58px; font-size: 17px; border-radius: 16px; }
  .preference-grid { grid-template-columns: 1fr; gap: 12px; }
  .choice-card { padding: 14px; min-height: auto; }
  .choice-card label span { min-height: 40px; padding-inline: 13px; font-size: 14px; }
  .start-button { width: 100%; min-height: 58px; }
  .hero-art { min-height: 290px; order: -1; }
  .hero-art::before { width: 260px; height: 260px; }
  .paper-plane { font-size: 44px; right: 18%; top: 9%; }
  .heart-a { font-size: 30px; left: 22%; top: 13%; }
  .big-bubble { width: 200px; height: 160px; border-radius: 56px 56px 56px 24px; }
  .big-bubble::after { width: 34px; height: 34px; right: 40px; bottom: -15px; }
  .big-bubble i { width: 96px; height: 72px; border-radius: 26px 26px 26px 12px; font-size: 40px; }
  .big-bubble b { width: 9px; height: 9px; left: 75px; bottom: 29px; }
  .big-bubble b::before { left: 24px; }
  .big-bubble b::after { left: 48px; }
  .blue-bubble { width: 110px; height: 70px; right: 42px; bottom: 55px; border-radius: 25px 25px 25px 12px; gap: 9px; }
  .blue-bubble i { width: 9px; height: 9px; }
  .leaf-a { left: 88px; bottom: 44px; width: 34px; height: 70px; }
  .leaf-b { left: 120px; bottom: 42px; width: 27px; height: 52px; }
  .play-orb { width: 58px; height: 58px; right: 82px; bottom: 24px; border-width: 4px; font-size: 20px; }
  .landing-status { margin: 12px 18px 22px; padding: 18px; }
  .safety-chip > span { width: 46px; height: 46px; font-size: 24px; }

  .chat-screen { place-items: stretch; height: 100svh; min-height: 100svh; padding: 0; }
  .chat-app-card {
    width: 100%;
    height: 100svh;
    min-height: 100svh;
    border-radius: 0;
    border: 0;
    grid-template-rows: auto minmax(0, 1fr) auto auto;
  }
  .chat-topbar { min-height: calc(82px + var(--safe-top)); padding: calc(14px + var(--safe-top)) 16px 12px; }
  .brand.compact .brand-icon { width: 44px; height: 44px; }
  .brand.compact .brand-text { font-size: 29px; }
  .chat-top-actions { gap: 8px; }
  .soft-chip:not(.danger-chip) { display: none; }
  .danger-chip { min-height: 48px; padding: 0 18px; border-radius: 999px; font-size: 15px; }
  .profile-dot { width: 48px; height: 48px; min-height: 48px; }
  .chat-grid { display: block; padding: 0 14px 10px; min-height: 0; overflow: hidden; }
  .right-panel { display: none; }
  .chat-main { height: 100%; border-radius: 24px; padding: 14px 10px 0; }
  .chat-mascot { display: none; }
  .connection-pill { min-height: 36px; padding-inline: 14px; font-size: 14px; max-width: calc(100% - 14px); }
  .status-sub { font-size: 13px; margin: 8px 4px 2px; }
  .messages { min-height: 0; padding: 12px 4px 86px; }
  .waiting-panel { top: 52%; width: min(340px, calc(100% - 28px)); padding: 22px; }
  .msg { max-width: 88%; }
  .message-form { padding: 0 14px 10px; grid-template-columns: 72px minmax(0, 1fr) 62px; gap: 10px; }
  .mobile-next, .send-button { height: 60px; min-height: 60px; border-radius: 17px; font-size: 24px; }
  .input-wrap { height: 60px; border-radius: 17px; padding-left: 10px; }
  .input-wrap input { height: 52px; font-size: 18px; }
  .input-icon { width: 38px; height: 38px; min-height: 38px; font-size: 23px; }
  .mobile-action-row { display: flex; padding-bottom: calc(10px + var(--safe-bottom)); }
}

@media (max-width: 560px) {
  .start-screen { padding: 0; }
  .landing-card { min-height: 100svh; border-radius: 0; }
  .landing-nav { padding: 16px 14px; }
  .login-pill { display: none; }
  .hero-layout { padding: 16px 14px 10px; }
  .hero-art { min-height: 235px; }
  h1 { font-size: clamp(38px, 13vw, 54px); }
  .choice-card label span { padding-inline: 11px; }
  .landing-status { margin: 10px 14px 18px; padding: 15px; }
  .online-chip, .safety-chip { align-items: flex-start; font-size: 14px; }
  .brand.compact .brand-text { font-size: 25px; }
  .brand.compact .brand-icon { width: 40px; height: 40px; }
  .danger-chip { padding-inline: 13px; min-height: 44px; }
  .profile-dot { width: 44px; min-height: 44px; height: 44px; }
  .message-form { grid-template-columns: 60px minmax(0, 1fr) 56px; gap: 8px; padding-left: 10px; padding-right: 10px; }
  .mobile-next, .send-button { height: 56px; min-height: 56px; border-radius: 16px; }
  .send-button { font-size: 22px; }
  .mobile-next { font-size: 21px; }
  .input-wrap { height: 56px; }
  .input-wrap input { font-size: 16px; }
  .game-toggle { display: none; }
  .msg { max-width: 92%; }
  .msg-body { padding: 12px 14px; }
}

@media (max-width: 380px) {
  .brand.compact .brand-text { display: none; }
  .chat-topbar { min-height: calc(76px + var(--safe-top)); }
  .message-form { grid-template-columns: 54px minmax(0, 1fr) 52px; }
  .mobile-next, .send-button { height: 52px; min-height: 52px; }
  .input-wrap { height: 52px; padding-right: 8px; }
  .input-icon { width: 34px; height: 34px; min-height: 34px; }
}

@media (max-height: 760px) and (max-width: 900px) {
  .hero-art { display: none; }
  .landing-status { display: none; }
  .landing-card { overflow-y: auto; }
  .chat-topbar { min-height: calc(70px + var(--safe-top)); }
  .profile-dot { width: 40px; height: 40px; min-height: 40px; }
  .danger-chip { min-height: 40px; }
  .message-form { padding-bottom: 8px; }
  .mobile-action-row { display:none; }
}
