:root {
  --cream: #fff8e7;
  --egg: #ffc93c;
  --egg-deep: #f5a800;
  --tomato: #ff6b4a;
  --ink: #2b2118;
  --ink-soft: #6b5a4a;
  --card: #ffffff;
  --line: #f0e3c4;
  --green: #3ecf8e;
  --radius: 20px;
  --shadow: 0 10px 30px rgba(120, 80, 10, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body { height: 100%; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* ---------- Landing ---------- */
.landing {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 24px clamp(16px, 4vw, 48px);
  background: radial-gradient(circle at 20% 0%, #fff1c2 0%, var(--cream) 55%);
}
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; z-index: 0; }
.blob-1 { width: 380px; height: 380px; background: var(--egg); top: -120px; right: -80px; }
.blob-2 { width: 300px; height: 300px; background: #ff9f7a; bottom: -100px; left: -80px; }

.topbar, .hero, .foot { position: relative; z-index: 1; }
.topbar { display: flex; justify-content: space-between; align-items: center; }

.logo {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.5px;
  display: flex; align-items: center; gap: 8px;
}
.logo.small { font-size: 22px; }
.logo-egg { display: inline-block; animation: wiggle 3s ease-in-out infinite; }
@keyframes wiggle { 0%, 100% { transform: rotate(-6deg); } 50% { transform: rotate(8deg); } }

.online-pill {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(62, 207, 142, .2); }

.hero {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 0;
}
.hero h1 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 700;
  font-size: clamp(36px, 7vw, 68px);
  line-height: 1.05;
  letter-spacing: -1.5px;
}
.highlight {
  background: linear-gradient(transparent 58%, var(--egg) 58%);
  padding: 0 6px;
}
.sub { margin-top: 18px; font-size: clamp(16px, 2vw, 19px); color: var(--ink-soft); max-width: 520px; line-height: 1.5; }

.cards { display: flex; gap: 18px; margin-top: 38px; flex-wrap: wrap; justify-content: center; width: 100%; }
.card {
  flex: 1 1 260px; max-width: 320px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 24px;
  padding: 28px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-5px); border-color: var(--egg); box-shadow: 0 16px 36px rgba(245, 168, 0, .25); }
.card:active { transform: translateY(-1px); }
.card-icon { font-size: 42px; }
.card-title { font-family: 'Fredoka', sans-serif; font-size: 24px; font-weight: 600; }
.card-text { font-size: 14px; color: var(--ink-soft); }

.agree {
  margin-top: 28px; display: flex; gap: 10px; align-items: flex-start; text-align: left;
  font-size: 14px; color: var(--ink-soft); max-width: 460px; cursor: pointer;
}
.agree input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--tomato); flex-shrink: 0; }
.agree a { color: var(--tomato); }
.warn { color: var(--tomato); font-size: 14px; margin-top: 10px; font-weight: 500; }
.foot { text-align: center; font-size: 13px; color: var(--ink-soft); }

/* ---------- Chat ---------- */
.chat { height: 100vh; height: 100dvh; display: flex; flex-direction: column; background: var(--cream); }
.chat-top {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(12px, 3vw, 28px);
  background: var(--card); border-bottom: 1px solid var(--line);
}
.status { font-weight: 600; font-size: 14px; color: var(--ink-soft); text-align: center; flex: 1; }
.status.live { color: #1e9d66; }

.chat-body {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px;
  padding: 16px clamp(12px, 3vw, 28px);
}
.chat-body.text-only { grid-template-columns: 1fr; max-width: 760px; width: 100%; margin: 0 auto; }
.chat-body.text-only .video-panel { display: none; }

.video-panel { position: relative; min-height: 0; }
.video-box {
  position: relative; overflow: hidden; background: #1e1610; border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.video-box video { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-box.remote { width: 100%; height: 100%; }
.video-box.local {
  position: absolute; right: 14px; bottom: 14px;
  width: 28%; max-width: 200px; min-width: 110px; aspect-ratio: 4 / 3;
  border: 3px solid #fff; border-radius: 14px;
}
.video-box.local video { transform: scaleX(-1); }
.tag {
  position: absolute; left: 10px; top: 10px;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 999px; backdrop-filter: blur(6px);
}
.video-box.local .tag { left: 6px; top: 6px; font-size: 11px; padding: 2px 8px; }
.video-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  color: #ffeab0; background: radial-gradient(circle at 50% 40%, #3a2a1c, #1e1610);
  font-weight: 500;
}
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid rgba(255, 201, 60, .25); border-top-color: var(--egg);
  animation: spin 0.9s linear infinite;
}
.spinner.done { animation: none; border-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.message-panel {
  display: flex; flex-direction: column; min-height: 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
}
.messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.msg { max-width: 82%; padding: 9px 14px; border-radius: 18px; font-size: 15px; line-height: 1.4; word-wrap: break-word; overflow-wrap: anywhere; animation: pop .16s ease; }
@keyframes pop { from { transform: scale(.94); opacity: 0; } to { transform: none; opacity: 1; } }
.msg.me { align-self: flex-end; background: var(--egg); border-bottom-right-radius: 5px; }
.msg.them { align-self: flex-start; background: #f6efe0; border-bottom-left-radius: 5px; }
.msg.sys { align-self: center; max-width: 100%; background: none; font-size: 13px; color: var(--ink-soft); padding: 4px 0; text-align: center; }
.typing { padding: 0 18px 8px; font-size: 13px; color: var(--ink-soft); font-style: italic; }

.composer { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.composer input {
  flex: 1; border: 2px solid var(--line); border-radius: 999px; padding: 11px 18px; font: inherit; outline: none; background: #fffdf7;
  transition: border-color .15s;
}
.composer input:focus { border-color: var(--egg); }
.composer button {
  width: 46px; height: 46px; border-radius: 50%; background: var(--tomato); color: #fff; font-size: 18px;
  transition: transform .15s, opacity .15s;
}
.composer button:hover:not(:disabled) { transform: scale(1.08); }
.composer button:disabled, .composer input:disabled { opacity: .5; cursor: not-allowed; }

.controls {
  display: flex; gap: 10px; justify-content: center; align-items: center; flex-wrap: wrap;
  padding: 12px clamp(12px, 3vw, 28px) 16px;
  background: var(--card); border-top: 1px solid var(--line);
}
.btn {
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 15px;
  transition: transform .15s, background .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-2px); }
.btn.ghost { background: #f6efe0; }
.btn.ghost:hover { background: #efe3c8; }
.btn.icon { padding: 12px 16px; }
.btn.off { background: #ffd9d0; }
.btn.primary { background: var(--tomato); color: #fff; padding: 12px 34px; box-shadow: 0 8px 20px rgba(255, 107, 74, .35); }
.btn.primary:hover { background: #ff5532; }

.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 20px; border-radius: 999px; font-size: 14px; z-index: 50;
  box-shadow: var(--shadow);
}

/* ---------- Mobile ---------- */
@media (max-width: 800px) {
  .chat-body { grid-template-columns: 1fr; grid-template-rows: 45% 1fr; }
  .chat-body.text-only { grid-template-rows: 1fr; }
  .btn { padding: 10px 16px; font-size: 14px; }
  .btn.primary { padding: 10px 26px; }
}

/* ---------- In-app browser notice + tap-to-play ---------- */
.inapp-banner {
  position: relative; z-index: 60; background: var(--ink); color: #fff; font-size: 13px; line-height: 1.4;
  padding: 10px 14px; text-align: center;
}
.inapp-banner button {
  margin-left: 6px; background: var(--egg); color: var(--ink); font-weight: 600;
  padding: 3px 12px; border-radius: 999px; font-size: 12px;
}

/* ---------- SEO / info section ---------- */
.info { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 24px 0 40px; width: 100%; }
.info h2 { font-family: 'Fredoka', sans-serif; font-size: clamp(24px, 4vw, 32px); margin: 36px 0 16px; letter-spacing: -0.5px; }
.info h3 { font-family: 'Fredoka', sans-serif; font-size: 18px; margin: 10px 0 6px; }
.info p, .info li { color: var(--ink-soft); line-height: 1.6; font-size: 15px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.info-grid > div { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); }
.num { display: inline-flex; width: 32px; height: 32px; border-radius: 50%; background: var(--egg); font-weight: 700; align-items: center; justify-content: center; }
.safety { padding-left: 20px; display: grid; gap: 6px; }
.info details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 10px; }
.info summary { cursor: pointer; font-weight: 600; }
.info details p { margin-top: 8px; }
