/* Session 6: sizes (mobile blocks 130% taller, desktop 170% x 120%), 2x
   spilling emoji, triangle suggestion, presets, language, profile groups,
   extras, share icons. Loaded after app.css and overrides it. */
:root {
  --ky: 1.3;           /* block height vs. the session-5 mobile blocks */
  --kf: 1.12;          /* fonts and controls inside blocks */
  --ev-icon: 28px;     /* editor event icons (read by ui/graph.js) */
  --text-h: 25px;      /* one-line note height (read by ui/graph.js) */
  --text-line: 15px;
  --col: 480px;        /* app column width */
}

/* ---- blocks: taller, bigger icons ---------------------------------- */
#app { max-width: var(--col); }
#graph { gap: calc(4px * var(--ky)); }
.year-group { gap: calc(3px * var(--ky)); }
.block {
  --emo: calc(36px * var(--kf)); --lab: calc(34px * var(--kf)); --sub: calc(40px * var(--kf));
  --div: calc(24px * var(--kf)); --bar-h: calc(22px * var(--ky));
  row-gap: calc(4px * var(--ky));
  padding: calc(3px * var(--ky)) 6px calc(4px * var(--ky)) 4px;
  isolation: isolate; /* later blocks paint over earlier ones, so a spilling emoji stays on top */
}
.month-grid { gap: calc(3px * var(--ky)) calc(4px * var(--kf)); }
.ylabel b { font-size: calc(14px * var(--kf)); }
.mtag { font-size: calc(11.5px * var(--kf)); }
.candle { font-size: calc(12px * var(--kf)); }
.hblock { height: calc(22px * var(--ky) * 2 / 3); } /* a hidden block: easy to tap */
.fill { font-size: calc(10.5px * var(--kf)); }
.track { border-radius: 8px; }
.divide, .eye { width: calc(24px * var(--kf)); height: calc(24px * var(--kf)); }
.divide svg, .eye svg { width: calc(11px * var(--kf)); height: calc(11px * var(--kf)); }
.eye svg { width: calc(13px * var(--kf)); height: calc(13px * var(--kf)); }
.events, .lvl-1 .events { height: calc(var(--ev-icon) - 2px); }
.text textarea {
  height: var(--text-h); min-height: var(--text-h); max-height: none;
  padding: 4px 8px; font: 400 calc(11.5px * var(--kf)) / var(--text-line) var(--font);
}
.text .count { font-size: calc(9px * var(--kf)); top: auto; bottom: 3px; transform: none; }

/* ---- the expression emoji: twice as big, spilling out of the top ------ */
.emoji {
  font-size: 38px; height: var(--bar-h);
  display: flex; align-items: flex-end; justify-content: center;
  overflow: visible; position: relative; z-index: 2;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
}
.emoji.pop { transform-origin: 50% 90%; }

/* ---- suggestion: a rounded yellow triangle centered on the track ----- */
.suggest {
  top: 50%; width: 15px; height: 13px; margin: -6.5px 0 0 -7.5px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 15 13'%3E%3Cpath d='M2.2 2.2h10.6L7.5 10.8z' fill='%23ffe600' stroke='%230d0d0f' stroke-width='3.4' stroke-linejoin='round'/%3E%3Cpath d='M2.2 2.2h10.6L7.5 10.8z' fill='%23ffe600' stroke='%23ffe600' stroke-width='1.4' stroke-linejoin='round'/%3E%3C/svg%3E");
  transform-origin: 50% 50%;
}

/* ---- top bar: presets + language ------------------------------------ */
.topbar { gap: 8px; }
.top-actions { gap: 6px; }
.pre-btn, .lang-btn {
  height: 36px; padding: 0 8px; gap: 4px; border: 1.5px solid var(--line);
  font-size: 14px; font-weight: 600; color: var(--text);
}
.pre-btn .pre-label { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: none; }
.pre-btn.viewing { border-color: rgba(255, 230, 0, 0.6); box-shadow: 0 0 12px rgba(255, 230, 0, 0.25); }
.pre-btn.viewing .pre-label { display: inline; max-width: 64px; }
.caret { font-size: 10px; color: var(--muted); }
.xi { display: inline-block; object-fit: contain; flex: none; vertical-align: middle; user-select: none; -webkit-user-drag: none; }
.xi-emoji { font-family: var(--emoji-font); line-height: 1; text-align: center; }
.flag { display: inline-block; flex: none; background-repeat: no-repeat; border-radius: 2px; vertical-align: middle; }
.flag-txt { font-size: 10px; font-weight: 700; color: var(--accent); }

.pre-panel {
  position: fixed; z-index: 60; width: 300px; max-height: min(70dvh, 460px);
  display: flex; flex-direction: column; gap: 8px; padding: 10px;
  background: #19191e; border: 1px solid var(--line); border-radius: 18px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55); animation: pop-in 0.18s var(--ease-bounce);
}
.pre-panel .search input { height: 38px; }
.pre-list { overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
.pre-item { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 12px; text-align: left; }
.pre-item.active { background: var(--surface3); }
.pre-item.current { background: var(--yellow-soft); }
.pre-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface2); flex: none; }
.pre-avatar.sex-f { box-shadow: inset 0 0 0 1.5px rgba(255, 111, 174, 0.55); }
.pre-avatar.sex-m { box-shadow: inset 0 0 0 1.5px rgba(90, 169, 255, 0.55); }
.pre-txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pre-name { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 15px; }
.pre-txt small { color: var(--muted); font-size: 12px; }
.pre-badge { display: inline-flex; }
.pre-check { color: var(--yellow); font-weight: 700; }
.pre-none { color: var(--muted); font-size: 14px; padding: 12px 6px; text-align: center; }
.preset-banner {
  margin: 8px 0 0; padding: 6px 6px 6px 10px; border-radius: 12px;
  display: flex; align-items: center; gap: 8px;
  background: linear-gradient(90deg, rgba(255, 230, 0, 0.14), rgba(255, 230, 0, 0.04));
  border: 1px solid rgba(255, 230, 0, 0.35); font-size: 13px;
}
.preset-banner .pb-txt { flex: 1; min-width: 0; }
.preset-banner .pb-back { height: 30px; font-size: 13px; padding: 0 10px; white-space: nowrap; }
.lang-menu, .extras-menu { min-width: 200px; }
.lang-menu .flag { margin-right: 2px; }
.menu .mi-txt { flex: 1; }
.menu .mi-check { color: var(--yellow); font-weight: 700; }
.menu button.on, .menu button.has { background: rgba(255, 255, 255, 0.04); }
.menu button:hover { background: var(--surface3); }

/* ---- profile: segregated groups -------------------------------------- */
.profile-card { gap: 4px; padding: 5px; border-radius: 12px; }
.prow-geo { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.prow-beliefs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
.pwell { position: relative; gap: 4px; padding: 4px 6px; min-height: 34px; border-radius: 9px; flex-wrap: nowrap; }
.pwell .pw-ico { width: 20px; height: 20px; }
.pw-cat {
  align-self: stretch; flex: none; display: grid; place-items: center;
  margin: -4px 3px -4px -6px; padding: 0 6px 0 8px;
  background: linear-gradient(var(--wt, transparent), var(--wt, transparent)), rgba(0, 0, 0, 0.32);
  border-right: 1px solid rgba(212, 246, 255, 0.16);
  box-shadow: inset 3px 0 0 var(--wc, transparent);
}
.pw-items { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; min-width: 0; }
.pw-country { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pw-res .pw-items { flex-wrap: nowrap; gap: 5px; }
.pw-empty { color: var(--muted); font-size: 12.5px; padding: 0 2px; }
.pw-f { --wc: rgba(255, 196, 92, 0.6); --wt: rgba(255, 196, 92, 0.12); }
.pw-i { --wc: rgba(120, 170, 255, 0.6); --wt: rgba(120, 170, 255, 0.12); }
.pw-d { --wc: rgba(214, 120, 255, 0.6); --wt: rgba(214, 120, 255, 0.12); }
.pw-res { --wc: rgba(90, 220, 150, 0.6); --wt: rgba(90, 220, 150, 0.12); }
.pw-anc { --wc: rgba(90, 200, 230, 0.6); --wt: rgba(90, 200, 230, 0.12); }
.prow-beliefs .pchip { font-size: 11px; padding: 0 5px; height: 20px; }
.prow-beliefs .pc-txt { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* the name: its own pill, bigger than the others */
.pname-in {
  height: 42px; padding: 0 14px; border-radius: 21px; font: 600 19px var(--font);
  background: rgba(255, 255, 255, 0.06); box-shadow: inset 0 0 0 1.4px rgba(212, 246, 255, 0.3);
}
.pname-in:focus { box-shadow: inset 0 0 0 1.6px rgba(255, 230, 0, 0.6); }
.prow-name .sex { border-radius: 12px; width: 38px; font-size: 19px; }
.extras-btn {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 10px; border-radius: 9px;
  background: linear-gradient(135deg, rgba(196, 140, 255, 0.22), rgba(255, 184, 77, 0.18));
  box-shadow: inset 0 0 0 1px rgba(214, 170, 255, 0.4); font-size: 13px; font-weight: 600; white-space: nowrap;
}
.extras-btn .eb-spark { font-family: var(--emoji-font); }
.extras-btn .eb-caret { font-size: 10px; opacity: 0.7; }
.chooser .ch-ico { display: grid; place-items: center; }

/* ---- extras blocks --------------------------------------------------- */
.xblocks { display: grid; grid-template-columns: 1fr; gap: 4px; }
.xblock {
  position: relative; border-radius: 12px; padding: 6px 8px 8px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  border: 1px solid rgba(255, 255, 255, 0.06);
}
.xblock.enter { animation: pop-in 0.3s var(--ease-bounce); }
.xb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; padding-bottom: 5px; border-bottom: 1px solid rgba(255, 255, 255, 0.07); }
.xb-cat { /* the extra's category icon in its own tinted section, like .pw-cat */
  flex: none; display: grid; place-items: center; width: 36px; height: 32px; border-radius: 9px;
  background: linear-gradient(var(--wt, transparent), var(--wt, transparent)), rgba(0, 0, 0, 0.32);
  box-shadow: inset 3px 0 0 var(--wc, transparent), inset 0 0 0 1px rgba(212, 246, 255, 0.1);
}
.xb-title { margin: 0; flex: 1; font-size: 13.5px; font-weight: 600; color: var(--text); }
.xb-x { width: 26px; height: 26px; border-radius: 50%; color: var(--muted); font-size: 18px; line-height: 1; }
.xb-x:hover { background: var(--surface3); color: var(--text); }
.xb-body { font-size: 13px; }
.seg2 { display: inline-flex; border-radius: 10px; background: rgba(0, 0, 0, 0.3); padding: 2px; gap: 2px; }
.seg2 button { display: inline-flex; align-items: center; gap: 4px; padding: 3px 7px; border-radius: 8px; color: var(--muted); }
.seg2 button.on { background: var(--surface3); color: var(--text); box-shadow: inset 0 0 0 1px rgba(212, 246, 255, 0.35); }
.mb-body { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mb-pairs { display: grid; grid-template-columns: repeat(4, auto); gap: 4px; }
.mb-pairs .seg2 { flex-direction: column; }
.mb-pairs .seg2 button { flex-direction: column; gap: 0; padding: 2px 6px; min-width: 52px; }
.mb-pairs .seg2 b { font-size: 15px; }
.mb-pairs .seg2 small { font-size: 9px; }
.mb-result { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 120px; }
.mb-result b { display: block; font-size: 20px; letter-spacing: 0.06em; color: var(--tc); text-shadow: 0 0 12px var(--tc); }
.mb-result span { color: var(--muted); font-size: 12px; }
.mb-result.empty { color: var(--muted); font-size: 12px; }
.b5-body { display: flex; flex-direction: column; gap: 3px; }
.b5-row { display: grid; grid-template-columns: 20px 112px 1fr 26px; align-items: center; gap: 6px; }
.b5-name { font-size: 12px; color: var(--soft, var(--muted)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b5-val { font-size: 12px; font-weight: 700; text-align: right; }
.b5-row input[type=range] {
  -webkit-appearance: none; appearance: none; height: 8px; border-radius: 4px; width: 100%;
  background: linear-gradient(90deg, var(--c) var(--p), rgba(255, 255, 255, 0.08) var(--p));
}
.b5-row input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 3px solid var(--c); }
.b5-row input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--c); }
.z-label { display: flex; align-items: baseline; gap: 6px; font-size: 12px; color: var(--muted); margin: 2px 0 3px; }
.z-label b { color: var(--text); font-size: 13px; }
.zgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; margin-bottom: 4px; }
.zgrid .z { position: relative; aspect-ratio: 1; border-radius: 8px; display: grid; place-items: center; opacity: 0.55; transition: transform 0.15s var(--ease-bounce), opacity 0.15s; }
.zgrid .z .xi { width: 85% !important; height: 85% !important; }
.zgrid .z.on { opacity: 1; background: rgba(212, 246, 255, 0.12); box-shadow: inset 0 0 0 1.5px rgba(212, 246, 255, 0.6); transform: scale(1.06); }
.zgrid .z.auto:not(.on)::after { content: ''; position: absolute; bottom: 1px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.zgrid .z:hover { opacity: 1; }
.pr-row { display: flex; align-items: center; gap: 8px; }
.pr-icon { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(0, 0, 0, 0.3); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08); }
.pr-col { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pr-cat { color: var(--muted); font-size: 11px; }
.pr-in, .nw-in {
  width: 100%; height: 32px; padding: 0 9px; border-radius: 8px; background: rgba(0, 0, 0, 0.3);
  border: 1px solid transparent; color: var(--text); font: 600 14px var(--font);
}
.pr-in:focus, .nw-in:focus { outline: none; border-color: rgba(255, 230, 0, 0.55); }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: 4px; margin-top: 6px; }
.pr-grid button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; border-radius: 10px; }
.pr-grid button small { font-size: 9.5px; color: var(--muted); text-align: center; line-height: 1.1; }
.pr-grid button.on { background: var(--yellow-soft); }
.nw-field { display: flex; align-items: center; gap: 6px; }
.nw-cur { font-weight: 700; color: var(--yellow); font-size: 13px; }
.nw-out { display: flex; align-items: center; gap: 8px; margin-top: 6px; min-height: 40px; }
.nw-out.empty { min-height: 0; }
.nw-txt { display: flex; flex-direction: column; min-width: 0; }
.nw-money { font-size: 17px; margin-right: 8px; }
.nw-top { font-weight: 700; color: var(--accent); text-shadow: 0 0 10px var(--accent-glow); }
.nw-out.debt .nw-top { color: #ff8a92; text-shadow: none; }
.nw-txt small { color: var(--muted); font-size: 11.5px; }
.nw-hint { color: var(--muted); font-size: 12px; }
.nw-src { margin: 4px 0 0; font-size: 10px; color: var(--faint); }
.fs-body { display: flex; flex-direction: column; gap: 6px; }
.fs-status { align-self: flex-start; }
.fs-steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; }
.stepper { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; border-radius: 10px; background: rgba(0, 0, 0, 0.22); }
.stepper small { font-size: 10px; color: var(--muted); text-align: center; line-height: 1.1; }
.st-ctl { display: flex; align-items: center; gap: 6px; }
.st-ctl button { width: 22px; height: 22px; border-radius: 50%; background: var(--surface3); font-weight: 700; line-height: 1; }
.st-n { min-width: 14px; text-align: center; }
.fs-sum { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fs-icons { display: flex; align-items: center; }
.fs-icons .fs-kid { margin-left: -5px; }
.fs-sentence { margin: 0; font-weight: 600; font-size: 13.5px; }

/* ---- share sheet: social icons ---------------------------------------- */
.social-wrap { margin-top: 12px; }
.social-title { font-size: 12px; color: var(--muted); margin-bottom: 6px; text-align: center; }
.social { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 0; }
.social .soc {
  width: 44px; height: 44px; border-radius: 50%; justify-self: center; flex: none; padding: 0;
  display: grid; place-items: center; text-decoration: none;
  background: var(--brand, var(--surface3)); color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.12);
  transition: transform 0.15s var(--ease-bounce);
}
.social .soc svg { width: 22px; height: 22px; fill: currentColor; }
.social .soc:hover { transform: translateY(-2px) scale(1.06); }
.social .soc:active { transform: scale(0.92); }
.social .soc-snapchat { color: #111; }
.social .soc-instagram { background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fd5949 45%, #d6249f 60%, #285aeb 90%); }
.social .soc-x, .social .soc-tiktok, .social .soc-threads { background: #000; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35), inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.social .soc-link { background: var(--surface3); font-family: var(--emoji-font); font-size: 20px; }

/* ---- desktop: wider, taller blocks; ads in side rails ----------------- */
.rail { display: none; }
/* The column and the block sizes grow smoothly with the window (main.js
   sets --ky, --kf, --ev-icon, --text-h and --text-line from --col), so there is
   no jump between the phone and the desktop layout. */
:root { --col: clamp(480px, calc(100vw - 24px), 816px); }
.emoji { font-size: calc(34px * var(--kf)); }
.menu { right: max(8px, calc(50vw - var(--col) / 2 + 12px)); }
@media (min-width: 840px) { /* the column is at full width */
  body { font-size: 16px; }
  .topbar { height: 62px; }
  .logo { font-size: 24px; }
  .sheet { max-width: 720px; }
  .pre-btn .pre-label { display: inline; }
  .pre-btn.viewing .pre-label { max-width: 160px; }
  .profile-card { padding: 8px; gap: 6px; }
  .intro-card { padding: 12px 16px; }
  .pwell { min-height: 40px; }
  .share-fab { height: 60px; font-size: 20px; }
}
@media (min-width: 1200px) { /* room for the ad rails beside the column */
  .slot-infeed, .slot-banner { display: none; }
  .rail { display: block; position: fixed; top: 80px; width: 160px; }
  .rail-l { left: calc(50% - var(--col) / 2 - 184px); }
  .rail-r { right: calc(50% - var(--col) / 2 - 184px); }
  .slot-sky { width: 160px; height: 600px; margin: 0; }
}

/* ---- narrow phones ------------------------------------------------------ */
.share-fab { white-space: nowrap; }
.pwell { overflow: hidden; }
.pchip { min-width: 0; }
@media (max-width: 420px) {
  .topbar { padding: 0 8px; gap: 6px; }
  .logo { font-size: 18px; }
  .top-actions { gap: 4px; }
  .pre-btn, .lang-btn { padding: 0 6px; }
  .pre-btn.viewing .pre-label { display: none; }
  .share-fab { font-size: 16px; padding: 0 20px 0 16px; }
  .prow-beliefs .pchip .pc-ico + .pc-txt { display: none; } /* icon is enough when space is tight */
}
