/* BAD APPLE · found-phone 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 Banana's unlocked 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;
}

.app-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 14px;
  background: var(--card);
  border-bottom: 1px solid var(--line-soft);
  position: sticky;
  top: 54px;
  z-index: 4;
}
.app-switcher button,
.app-switcher a {
  border: 1px solid var(--line);
  background: var(--bowl-cream);
  color: var(--ink-soft);
  border-radius: 10px;
  padding: 8px 10px;
  font: 600 13px/1.1 var(--font-ui);
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.app-switcher .is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.app-view[hidden] {
  display: none !important;
}
.phone-home,
.bowl-home {
  padding: 12px 14px 88px;
  background: var(--bowl-cream);
  min-height: calc(100vh - 160px);
}
.phone-home__hero,
.bowl-home__hero {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff, var(--bowl-peach));
  padding: 14px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.phone-home__eyebrow,
.bowl-home__eyebrow {
  color: var(--ink-faint);
  font-size: 11px;
  text-transform: uppercase;
}
.phone-home__title,
.bowl-home__title {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 1.05;
  margin-top: 2px;
}
.phone-home__sub,
.bowl-home__sub {
  color: var(--ink-soft);
  font-size: 13px;
  margin-top: 6px;
}
.phone-search {
  position: sticky;
  top: 104px;
  z-index: 3;
  padding-bottom: 10px;
  background: var(--bowl-cream);
}
.phone-search input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  padding: 12px 14px;
  color: var(--ink);
  font: 500 15px/1.2 var(--font-ui);
  outline: none;
}
.phone-search input:focus {
  border-color: var(--bowl-rose);
  box-shadow: 0 0 0 3px rgba(241, 94, 124, 0.12);
}
.phone-search-chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 0 0 10px;
  scrollbar-width: none;
}
.phone-search-chips::-webkit-scrollbar {
  display: none;
}
.phone-search-chip {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink-soft);
  padding: 7px 10px;
  font: 700 12px/1 var(--font-ui);
  cursor: pointer;
}
.phone-search-chip:hover {
  border-color: var(--bowl-rose);
  color: var(--bowl-rose);
}
.search-results {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.search-result,
.result-empty {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.result-empty {
  display: block;
  color: var(--ink-soft);
  font-size: 13px;
}
.phone-apps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px 10px;
  padding: 2px 0 12px;
}
.phone-app {
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  font: 500 11px/1.2 var(--font-ui);
}
.phone-app__icon,
.search-result__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 5px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--bowl-peach), var(--bowl-yellow));
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 26px;
  box-shadow: 0 6px 14px rgba(241, 94, 124, 0.14);
}
.search-result__icon {
  width: 42px;
  height: 42px;
  margin: 0;
  border-radius: 12px;
  font-size: 22px;
}
.search-result__title {
  display: block;
  font-weight: 700;
  font-size: 14px;
}
.search-result__meta {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 2px;
}
.search-result__tag {
  color: var(--bowl-rose);
  font-size: 11px;
  font-weight: 700;
}
.phone-home__grid,
.bowl-home__grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.lemon-brief {
  display: grid;
  grid-template-columns: 102px 1fr;
  gap: 12px;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  box-shadow: var(--shadow);
}
.lemon-brief__image {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 8px;
  background: var(--bowl-peach);
}
.lemon-brief__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.lemon-brief__copy {
  min-width: 0;
  align-self: center;
}
.lemon-brief__kicker {
  color: var(--bowl-rose);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.lemon-brief h2 {
  margin: 2px 0 5px;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  line-height: 1;
}
.lemon-brief p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.35;
}
.clue-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.clue-card {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: #fff;
  background: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}
.clue-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0.86;
}
.clue-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(28, 20, 23, 0) 35%, rgba(28, 20, 23, 0.82) 100%);
}
.clue-card span {
  position: absolute;
  left: 7px;
  right: 7px;
  bottom: 7px;
  z-index: 1;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.05;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}
.bowl-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.bowl-card__icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--bowl-peach), var(--bowl-yellow));
  font-family: var(--font-display);
  font-size: 22px;
}
.bowl-card__title {
  display: block;
  font-weight: 700;
  font-size: 14px;
}
.bowl-card__meta {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  margin-top: 2px;
}
.bowl-card > span:nth-child(2) {
  min-width: 0;
}
.bowl-card__status {
  color: var(--bowl-rose);
  font-size: 11px;
  font-weight: 700;
}
.npc-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 14px 4px;
  background: var(--bowl-cream);
}
.npc-chip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
}
.npc-chip.is-active {
  border-color: var(--bowl-rose);
  box-shadow: 0 0 0 2px rgba(241, 94, 124, 0.12);
}
.npc-chip__avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--bowl-peach);
  font-family: var(--font-display);
  font-size: 13px;
}

/* 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;
  color: inherit;
  text-decoration: none;
}
.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 — fixed panel beside the phone on desktop.
   Phone is max-width 430px, centered. Board sits to the right with 16px gap.
   left = 50vw + 215px (half-phone) + 16px gap = 50vw + 231px.
   Breakpoint set high enough that board (260px wide) + right margin fits:
   viewport >= 2*(231+260+16) = 1014px → use 1080px for safe margin. */
.board {
  position: fixed;
  left: calc(50vw + 231px);
  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 !important;
}
@media (min-width: 1080px) {
  .board {
    display: none !important;
  }
}
.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;
}
