/* BAD APPLE · Bowl-app shell · pinkcore default, weirdcore intrusions */

:root {
  /* pinkcore palette */
  --bowl-peach: #ffd2c4;
  --bowl-cream: #fff5ee;
  --bowl-pink: #ff7a8a;
  --bowl-rose: #f15e7c;
  --bowl-warm: #ff9a6a;
  --bowl-yellow: #ffd966;
  --bowl-coral: #ff6a5e;

  --ink: #1c1417;
  --ink-soft: #6b5a5f;
  --ink-faint: #b29ba1;
  --line: #f1d8d3;
  --line-soft: #fbe8e3;

  /* surfaces */
  --bg: var(--bowl-cream);
  --card: #ffffff;
  --bubble-self: var(--bowl-pink);
  --bubble-other: #ffe2d6;

  /* weirdcore (used by .glitch class once L4+) */
  --glitch-cyan: #5ad6e0;
  --glitch-mag: #ff37c7;

  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 6px 20px rgba(241, 94, 124, 0.08);
  --shadow-lift: 0 12px 32px rgba(241, 94, 124, 0.14);

  --font-display: "Instrument Serif", "Cormorant Garamond", Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "PingFang SC", sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
}

/* Phone-frame layout — the entire site lives inside Apple's phone */
.phone {
  max-width: 430px;
  margin: 24px auto;
  background: var(--card);
  min-height: calc(100vh - 48px);
  border-radius: 36px;
  box-shadow: var(--shadow-lift);
  overflow: hidden;
  position: relative;
}
@media (max-width: 480px) {
  .phone { margin: 0; min-height: 100vh; border-radius: 0; }
}

.phone__status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px 6px;
  font-size: 13px; font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}
.phone__status .battery::before { content: "🔋"; margin-right: 4px; }

.phone__nav {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px 12px;
  border-bottom: 1px solid var(--line-soft);
  position: sticky; top: 0; background: var(--card); z-index: 5;
}
.phone__nav .back {
  background: none; border: none; color: var(--bowl-rose);
  font-size: 22px; line-height: 1; padding: 4px 8px; cursor: pointer;
}
.phone__nav .title {
  flex: 1; font-family: var(--font-display); font-size: 22px; font-weight: 500;
  text-align: center;
}
.phone__nav .meta {
  font-size: 11px; color: var(--ink-faint); text-align: center;
}

/* Top brand bar — fictional Bowl app */
.bowl-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  font-family: var(--font-display);
  font-size: 26px;
  background: linear-gradient(135deg, var(--bowl-peach), var(--bowl-yellow));
}
.bowl-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bowl-rose); }
.bowl-bar .name { font-weight: 600; }
.bowl-bar .tag { font-size: 11px; color: var(--ink-soft); margin-left: auto; font-family: var(--font-ui); }

/* Cards / blocks */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin: 12px 16px;
  box-shadow: var(--shadow);
}
.card h3 { font-family: var(--font-display); margin: 0 0 6px; font-size: 19px; font-weight: 500; }
.card .meta { font-size: 12px; color: var(--ink-soft); }

/* iMessage-style bubbles for chat */
.thread { padding: 12px 14px 90px; background: var(--bowl-cream); }
.bubble {
  max-width: 78%;
  padding: 9px 13px;
  border-radius: 18px;
  margin: 4px 0;
  font-size: 15px;
  line-height: 1.35;
  word-wrap: break-word;
  position: relative;
}
.bubble--self {
  background: var(--bubble-self); color: #fff;
  margin-left: auto; border-bottom-right-radius: 6px;
}
.bubble--other {
  background: var(--bubble-other); color: var(--ink);
  margin-right: auto; border-bottom-left-radius: 6px;
}
.bubble--system {
  background: transparent; color: var(--ink-faint);
  text-align: center; font-size: 12px;
  margin: 8px auto; max-width: 90%;
}
.bubble--system small { text-transform: uppercase; letter-spacing: 0.08em; }
.bubble__time { font-size: 10px; color: var(--ink-faint); text-align: center; margin: 8px 0; }

.typing { color: var(--ink-faint); font-style: italic; font-size: 13px; padding: 4px 14px; }
.typing::after { content: "..."; animation: dots 1s steps(3) infinite; }
@keyframes dots {
  0% { content: "."; }
  33% { content: ".."; }
  66% { content: "..."; }
}

/* Notification banner */
.banner {
  margin: 10px 14px; padding: 10px 12px;
  background: linear-gradient(135deg, #fff, var(--bowl-peach));
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--bowl-rose);
  font-size: 13px;
}
.banner strong { font-weight: 600; }
.banner .ago { color: var(--ink-faint); font-size: 11px; }

/* Bowl-native UI: story rings */
.stories { display: flex; gap: 12px; padding: 12px 16px; overflow-x: auto; }
.story {
  flex: 0 0 auto; text-align: center; width: 64px;
}
.story__ring {
  width: 64px; height: 64px; border-radius: 50%;
  background: conic-gradient(from 0deg, var(--bowl-rose), var(--bowl-yellow), var(--bowl-rose));
  padding: 3px;
}
.story__avatar {
  width: 100%; height: 100%; border-radius: 50%; background: var(--bowl-peach);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-size: 22px;
}
.story__handle { font-size: 11px; margin-top: 4px; color: var(--ink-soft); }

/* Feed post */
.post { background: var(--card); margin: 12px 16px; border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.post__header { display: flex; align-items: center; gap: 8px; padding: 10px 12px; font-size: 13px; }
.post__avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--bowl-yellow); display: grid; place-items: center; font-family: var(--font-display); font-size: 14px; }
.post__handle { font-weight: 600; }
.post__location { color: var(--ink-soft); font-size: 11px; margin-top: 1px; }
.post__media { aspect-ratio: 4/5; background: linear-gradient(135deg, var(--bowl-peach), var(--bowl-pink)); display: grid; place-items: center; }
.post__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post__actions { padding: 8px 12px; display: flex; gap: 12px; }
.post__caption { padding: 0 12px 12px; font-size: 13px; }
.post__caption .handle { font-weight: 600; }
.post__meta { padding: 0 12px 10px; font-size: 11px; color: var(--ink-faint); }

/* Receipt-style data lists (Tabs, Venmo, Spots) */
.receipt { margin: 12px 16px; background: var(--card); border-radius: var(--radius); padding: 12px 14px; border: 1px solid var(--line); font-family: var(--font-mono); font-size: 12px; }
.receipt__row { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.receipt__row:last-child { border-bottom: none; }
.receipt__row strong { font-weight: 600; }
.receipt__row .amount { color: var(--bowl-rose); }

/* Glitch class — applied at L4+ via JS */
.glitch {
  position: relative;
  animation: shake 0.6s infinite alternate;
}
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute; inset: 0;
  pointer-events: none;
}
.glitch::before { color: var(--glitch-cyan); transform: translate(2px, 0); mix-blend-mode: screen; }
.glitch::after { color: var(--glitch-mag); transform: translate(-2px, 0); mix-blend-mode: screen; }
@keyframes shake {
  0% { transform: translate(0, 0); }
  100% { transform: translate(0.5px, -0.5px); }
}

/* Decision page */
.decision {
  padding: 28px 22px; text-align: center;
}
.decision h1 { font-family: var(--font-display); font-weight: 400; font-size: 36px; margin: 8px 0 6px; }
.decision .sub { color: var(--ink-soft); margin-bottom: 28px; }
.decision__choice {
  display: block; width: 100%; padding: 18px 16px; margin: 14px 0;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  text-align: left; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  text-decoration: none; color: inherit;
}
.decision__choice:hover { transform: translateY(-2px); box-shadow: var(--shadow-lift); }
.decision__choice .label { font-family: var(--font-display); font-size: 22px; }
.decision__choice .blurb { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.decision__choice[data-end="confront"] { border-left: 4px solid var(--bowl-rose); }
.decision__choice[data-end="forgive"] { border-left: 4px solid var(--bowl-warm); }
.decision__choice[data-end="leak"] { border-left: 4px solid var(--ink); }

/* Composer */
.composer {
  position: sticky; bottom: 0;
  display: flex; gap: 8px; padding: 10px 14px;
  background: var(--card); border-top: 1px solid var(--line);
}
.composer input {
  flex: 1; padding: 11px 14px; border-radius: 22px;
  border: 1px solid var(--line); font-size: 15px; outline: none;
  font-family: var(--font-ui);
}
.composer input:focus { border-color: var(--bowl-pink); }
.composer button {
  width: 44px; height: 44px; border-radius: 50%; border: none;
  background: var(--bowl-rose); color: #fff; font-size: 18px; cursor: pointer;
}
.composer button:disabled { background: var(--ink-faint); }

/* Investigation board — slide-up panel on chat */
.board {
  position: fixed; right: max(16px, calc((100vw - 430px) / 2 + 8px));
  top: 24px; width: 260px; max-height: calc(100vh - 48px);
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow-lift); padding: 14px;
  overflow-y: auto;
  font-size: 13px;
  display: none;
}
@media (min-width: 1024px) { .board { display: block; } }
.board h4 { font-family: var(--font-display); font-size: 16px; margin: 4px 0 10px; }
.board__section { margin-bottom: 14px; }
.board__item { padding: 6px 0; border-bottom: 1px dashed var(--line-soft); }
.board__item:last-child { border-bottom: none; }
.board__pill { display: inline-block; padding: 1px 6px; border-radius: 10px; font-size: 10px; background: var(--bowl-peach); color: var(--ink); margin-right: 4px; }

/* small utilities */
.muted { color: var(--ink-soft); }
.hidden { display: none !important; }
a { color: var(--bowl-rose); }

/* Late-game weirdcore body class */
body.act-iv { --bg: #f4e8e4; }
body.act-iv .bowl-bar { background: linear-gradient(135deg, #d8c2bd, var(--bowl-peach)); }
body.act-v { --bg: #1d171a; color: #f4e8e4; }
body.act-v .phone { background: #2a2024; }
body.act-v .card { background: #2a2024; border-color: #3d2f34; color: #f4e8e4; }
body.act-v .bowl-bar { background: linear-gradient(135deg, #3d2f34, #2a2024); color: #f4e8e4; }
