/* Crush of Roses — tame code build. Mock-style phone-app UI.
   Dark rose theme, mobile-first (max-width 480px app shell centred on
   desktop), bottom tab bar, fuller portraits, crystal-rose logo.
   No framework. Art is referenced only — add .webp under assets/. */
:root {
  --bg: #140a16; --bg2: #1a0f1e; --card: #2a1830; --card2: #3a2140;
  --text: #f5e9f0; --muted: #c9a8bd; --rose: #e75480; --rose-deep: #c2255c;
  --gold: #e8b64c; --line: #4a2a4a; --shadow: #120a14;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #0b060d; color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.45;
}
button {
  background: var(--rose); color: #fff; border: 0; border-radius: 12px;
  padding: 9px 13px; cursor: pointer; font-size: 14px; font-weight: 600;
}
button:hover { filter: brightness(1.15); }
button.active { background: var(--gold); color: #221; }
button.ghost { background: var(--card2); }
button:disabled { opacity: .5; cursor: default; }
input[type=text], input[type=search] {
  background: var(--card); color: var(--text); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; font-size: 14px; width: 100%;
}
main {
  max-width: 480px; margin: 0 auto; padding: 14px 14px 110px;
  background: linear-gradient(180deg, var(--bg2), var(--bg));
  min-height: 100vh;
}
.muted { color: var(--muted); }
.intro { font-size: 13px; margin: 4px 0 14px; }
.tag {
  background: var(--gold); color: #221; border-radius: 6px;
  padding: 1px 6px; font-size: 11px; font-weight: 700; white-space: nowrap;
}
.tag.warn { background: #c0392b; color: #fff; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px; margin-bottom: 12px;
}
.card.shadow { background: var(--shadow); border-style: dashed; }
.card h3 { margin: 0 0 6px; }
.card p { margin: 6px 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.spacer { flex: 1; }

/* --- Brand header (mock home brand row) --- */
.appHeader {
  position: sticky; top: 0; z-index: 5;
  background: linear-gradient(180deg, #2b1226, #241026);
  border-bottom: 1px solid var(--line);
  padding: 10px 14px 8px;
}
.appHeader .brandRow, .appHeader .headerRow {
  max-width: 480px; margin: 0 auto; display: flex; gap: 10px; align-items: center;
}
.brandLogo { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex: none; }
.brandWord { font-size: 22px; margin: 0; line-height: 1.1; letter-spacing: .2px; }
.brandBy { color: var(--muted); font-size: 11px; margin: 2px 0 0; }
.headerRow { margin-top: 8px !important; font-size: 13px; color: var(--muted); }
.headerRow button { padding: 6px 10px; font-size: 12px; }
.wallet {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--card2); border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 11px; font-weight: 700; font-size: 14px;
}
.roseIco { width: 18px; height: 18px; border-radius: 50%; object-fit: cover; vertical-align: -4px; }
#slots { font-size: 13px; }

/* --- Age gate (mock-style) --- */
.gate {
  position: fixed; inset: 0; z-index: 50; display: flex; align-items: center;
  justify-content: center; padding: 20px;
  background: radial-gradient(120% 100% at 50% 0%, #3a1430 0%, #140a16 70%);
}
.gate[hidden] { display: none; }
.gate-card { text-align: center; max-width: 360px; }
.gateLogo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; }
.gate-card .brandWord { font-size: 32px; margin-top: 12px; }
.gate-card .brandBy { font-size: 13px; }
.gateTag { color: var(--muted); margin: 12px 0 4px; }
.gateAge { margin: 4px 0 16px; }
.gateRow { justify-content: center; }
.gateNote { font-size: 12px; margin-top: 16px; }

/* --- Picker: mascot hero + fuller portrait cards (mock-style) --- */
#hero { margin-bottom: 14px; }
.heroCard {
  position: relative; overflow: hidden; border-radius: 18px;
  border: 1px solid var(--line); background: var(--card);
}
.heroCard .portrait { height: 380px; border-radius: 0; }
.heroCard .heroText {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 14px 12px;
  background: linear-gradient(180deg, transparent, #000c);
}
.heroCard h2 { margin: 0 0 2px; font-size: 24px; }
.heroCard p { margin: 2px 0 8px; color: #f0d9e8; }
#search { margin-bottom: 8px; }
#picker { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
#picker .card { margin-bottom: 0; padding: 10px; }
#picker .card h3 { font-size: 16px; }
#picker .card p { font-size: 13px; }
#picker .row button { flex: 1; padding: 8px 6px; font-size: 13px; }
.portrait {
  position: relative; height: 320px; border-radius: 12px;
  background: linear-gradient(160deg, #5b2a4a, #2a1830);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; cursor: pointer;
}
.portrait img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%;
  position: absolute; inset: 0;
}
.portrait-fallback { font-size: 96px; color: #ffffff55; }
.portrait .eye {
  position: absolute; bottom: 8px; right: 8px; background: #000a;
  border-radius: 8px; padding: 4px 8px; font-size: 12px; color: #fff;
}
.portrait .lvl {
  position: absolute; top: 8px; left: 8px; background: #000a;
  border-radius: 8px; padding: 3px 8px; font-size: 12px; color: #fff;
}

/* --- Full-screen portrait lightbox (mock picker eye pill) --- */
.lightbox { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; }
.lightbox[hidden] { display: none; }
.pvBackdrop { position: absolute; inset: 0; background: #000d; backdrop-filter: blur(6px); }
.pvCard { position: relative; width: min(92vw, 420px); text-align: center; }
.pvCard img {
  width: 100%; max-height: 62vh; object-fit: contain; border-radius: 16px;
  background: linear-gradient(160deg, #5b2a4a, #2a1830);
}
.pvFallback {
  display: none; width: 100%; height: 300px; border-radius: 16px;
  background: linear-gradient(160deg, #5b2a4a, #2a1830);
  align-items: center; justify-content: center; font-size: 120px; color: #ffffff55;
}
.pvCard h2 { margin: 10px 0 2px; }
.pvCard .row { justify-content: center; margin-top: 10px; }

/* --- Chat: full-screen art behind chat, hide-chat eye + hamburger --- */
.chatHead { position: relative; margin-bottom: 10px; }
#chatArt {
  width: 100%; max-height: 340px; object-fit: cover; object-position: 50% 8%;
  border-radius: 16px; display: block;
  background: linear-gradient(160deg, #5b2a4a, #2a1830);
}
.chatHeadText {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 30px 12px 8px;
  background: linear-gradient(180deg, transparent, #000c); border-radius: 0 0 16px 16px;
}
.chatHeadText h2 { margin: 0; font-size: 22px; }
.chatHeadText p { margin: 2px 0 0; font-size: 12px; color: #e8cfe0; }
.iconBtn {
  position: absolute; top: 8px; width: 36px; height: 36px; padding: 0;
  background: #000a; border-radius: 10px; font-size: 17px;
}
#hideChat { right: 52px; }
#menuBtn { right: 8px; }
.chatMenu {
  display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px;
}
.chatMenu[hidden] { display: none; }
#messages { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; min-height: 120px; }
#messages[hidden], .chatbar[hidden] { display: none; }
.msg { max-width: 85%; padding: 10px 12px; border-radius: 14px; line-height: 1.45; }
.msg.you { align-self: flex-end; background: var(--rose); }
.msg.her { align-self: flex-start; background: var(--card2); }
.msg.sys { align-self: center; background: transparent; color: var(--gold); font-size: 13px; text-align: center; }
.chatbar { display: flex; gap: 8px; position: sticky; bottom: 76px; }
.chatbar input { flex: 1; }

/* --- Story / outfits --- */
.cliff { border-left: 3px solid var(--gold); padding-left: 10px; color: var(--gold); }
.comicArt {
  width: 100%; max-height: 300px; object-fit: contain; border-radius: 12px;
  background: var(--shadow); display: block; margin: 8px 0;
}
.lookArt {
  position: relative; height: 200px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(160deg, #5b2a4a, #2a1830);
  display: flex; align-items: center; justify-content: center; margin-bottom: 8px;
}
.lookArt img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 8%; position: absolute; inset: 0; }
.lookArt .shadowMark { font-size: 44px; color: #ffffff33; }
.lookArt .shadowTag {
  position: absolute; bottom: 8px; left: 8px; background: #000a; color: #fff;
  border-radius: 8px; padding: 3px 8px; font-size: 12px;
}
#quests { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0 0 14px; }
#quests > h3 { grid-column: 1 / -1; margin: 0 0 2px; }
#quests .card { margin-bottom: 0; }
#quests .card h3 { font-size: 14px; }

/* --- Bottom tab bar (mock-style) --- */
nav.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; gap: 2px; padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
  background: #1f0d1ecc; backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
nav.tabs button {
  flex: 1; min-width: 0; background: transparent; color: var(--muted);
  border-radius: 10px; padding: 9px 2px; font-size: 11px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
nav.tabs button.active { background: var(--rose); color: #fff; }

footer {
  max-width: 480px; margin: 0 auto; text-align: center; color: var(--muted);
  font-size: 11px; padding: 8px 14px 110px; background: var(--bg);
}

/* --- Desktop: keep the phone shell centred, wider picker grid --- */
@media (min-width: 560px) {
  #picker { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  nav.tabs { max-width: 480px; margin: 0 auto; border-radius: 16px 16px 0 0; }
  .chatbar { bottom: 80px; }
}
@media (max-width: 380px) {
  .portrait { height: 260px; }
  .heroCard .portrait { height: 320px; }
  nav.tabs button { font-size: 10px; }
}
