:root {
  color-scheme: dark;
  --bg: #090a0f;
  --surface: rgba(14, 14, 20, 0.94);
  --surface-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.32);
  --text: #f3f0ec;
  --soft: rgba(243, 240, 236, 0.66);
  --faint: rgba(243, 240, 236, 0.42);
  --gold: #ffd479;
  --mint: #5eead4;
  --safe-top: max(12px, env(safe-area-inset-top));
  --safe-right: max(14px, env(safe-area-inset-right));
  --safe-bottom: max(12px, env(safe-area-inset-bottom));
  --safe-left: max(14px, env(safe-area-inset-left));
}

* { box-sizing: border-box; }

html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
}

button, a { font: inherit; }
button { color: inherit; }

.home {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  isolation: isolate;
  overflow: hidden;
  background: #090a0f;
}

.home__portrait {
  position: absolute;
  inset: 0;
  z-index: -4;
  overflow: hidden;
  background: #101017;
}

.home__portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 16%;
}

.home__shade {
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(4, 5, 9, 0.9) 0%, rgba(4, 5, 9, 0.62) 24%, rgba(4, 5, 9, 0.08) 58%, rgba(4, 5, 9, 0.12) 100%),
    linear-gradient(180deg, rgba(4, 5, 9, 0.18), transparent 34%, rgba(4, 5, 9, 0.7));
  box-shadow: inset 0 -12vh 14vh rgba(4, 5, 9, 0.52);
  pointer-events: none;
}

.home__grid {
  position: absolute;
  inset: 0 44% 0 0;
  z-index: -2;
  opacity: 0.2;
  background-size: 72px 72px;
  background-image:
    linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
  pointer-events: none;
  mask-image: linear-gradient(90deg, #000 0 58%, transparent 100%);
}

.home::before {
  position: absolute;
  z-index: 1;
  left: max(22px, calc(var(--safe-left) + 8px));
  top: 26%;
  width: min(31vw, 430px);
  height: 1px;
  content: "";
  background: linear-gradient(90deg, rgba(255, 212, 121, 0.68), rgba(255, 255, 255, 0.12), transparent);
  box-shadow: 0 72px 0 rgba(255, 255, 255, 0.045);
  pointer-events: none;
}

.topbar {
  position: absolute;
  top: var(--safe-top);
  left: var(--safe-left);
  right: var(--safe-right);
  z-index: 5;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.entry-button {
  min-height: 46px;
  border: 1px solid var(--line);
  background: rgba(10, 10, 15, 0.7);
  color: var(--text);
  text-decoration: none;
  cursor: pointer;
  backdrop-filter: blur(14px);
  transition: border-color 160ms ease, background-color 160ms ease;
}

.entry-button:hover,
.entry-button:focus-visible { border-color: var(--gold); background: rgba(19, 17, 17, 0.88); outline: none; }

.profile-entry {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 12px 4px 4px;
  border-radius: 8px;
}

.profile-avatar {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 212, 121, 0.52);
  background: #252129;
  color: var(--gold);
  border-radius: 50%;
  font-weight: 700;
}

.profile-copy { display: grid; text-align: left; line-height: 1.15; }
.profile-copy strong { font-size: 15px; font-weight: 600; }
.profile-copy small { margin-top: 4px; color: var(--faint); font-size: 10px; }

.bond-entry {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  padding: 5px 13px;
  border-radius: 8px;
}

.bond-entry .entry-icon { grid-row: 1 / 3; color: var(--gold); font-size: 20px; }
.bond-entry > span:nth-child(2) { font-weight: 600; }
.bond-entry small { color: var(--faint); font-size: 10px; }

.companion-line {
  position: absolute;
  right: max(2.5vw, var(--safe-right));
  bottom: calc(var(--safe-bottom) + 74px);
  z-index: 4;
  width: min(400px, 40vw);
  min-height: 44px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 13px;
  border: 0;
  border-left: 2px solid var(--gold);
  background: linear-gradient(90deg, rgba(7, 8, 12, 0.86), rgba(7, 8, 12, 0.56));
  text-align: left;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.companion-name { color: var(--gold); font-size: 13px; white-space: nowrap; }
.companion-quote { color: rgba(255,255,255,0.86); font-size: 13px; line-height: 1.45; }
.quote-next { color: var(--faint); font-size: 22px; }

.bottom-actions {
  position: absolute;
  left: var(--safe-left);
  right: var(--safe-right);
  bottom: var(--safe-bottom);
  z-index: 6;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.bottom-actions::before {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  z-index: -1;
  height: 1px;
  content: "";
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), transparent 34%, transparent 70%, rgba(255, 212, 121, 0.28));
}

.heart-entry {
  min-width: 132px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 8px;
}
.heart-entry .entry-icon { color: var(--gold); font-size: 20px; }
.entry-label { display: grid; line-height: 1.1; }
.entry-label strong { font-size: 15px; }
.entry-label small { margin-top: 4px; color: var(--faint); font-size: 10px; }

.continue-button {
  width: min(300px, 32vw);
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px 8px 19px;
  border: 1px solid rgba(255, 212, 121, 0.78);
  border-radius: 8px;
  background: var(--gold);
  color: #17130d;
  cursor: pointer;
  box-shadow: 0 12px 36px rgba(0,0,0,0.28);
  transition: transform 160ms ease, background-color 160ms ease;
}
.continue-button:hover, .continue-button:focus-visible { transform: translateY(-2px); background: #ffe09a; outline: none; }
.continue-copy { display: grid; text-align: left; }
.continue-copy small { font: 9px/1.2 "DM Mono", ui-monospace, monospace; letter-spacing: 1.5px; opacity: 0.62; }
.continue-copy strong { margin-top: 4px; font-size: 21px; font-weight: 700; }
.continue-arrow { font: 27px/1 sans-serif; }

.unlock-toast {
  position: absolute;
  left: 50%;
  top: 17%;
  z-index: 10;
  min-width: 210px;
  padding: 10px 18px;
  border: 1px solid rgba(255,212,121,0.45);
  background: rgba(12,12,17,0.92);
  text-align: center;
  transform: translateX(-50%);
  opacity: 0;
  pointer-events: none;
}
.unlock-toast.show { animation: toast 2.8s ease both; }
.unlock-toast span, .unlock-toast small { display: block; }
.unlock-toast span { color: var(--gold); font-size: 14px; }
.unlock-toast small { margin-top: 4px; color: var(--soft); font-size: 11px; }

.modal { position: fixed; inset: 0; z-index: 50; display: none; place-items: center; padding: max(18px, env(safe-area-inset-top)) max(18px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left)); }
.modal.open { display: grid; }
.modal__backdrop { position: absolute; inset: 0; border: 0; background: rgba(4,4,8,0.74); backdrop-filter: blur(9px); cursor: pointer; }
.modal__panel { position: relative; width: min(720px, 92vw); max-height: min(650px, 86vh); overflow: auto; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); box-shadow: 0 24px 70px rgba(0,0,0,0.52); }
.modal.profile-mode .modal__panel { width: min(980px, 94vw); }
.modal.bond-mode .modal__panel { width: min(1080px, 95vw); }
.modal__close { position: absolute; top: 12px; right: 12px; z-index: 2; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.04); color: var(--soft); font: 25px/1 sans-serif; cursor: pointer; }
.modal__close:hover, .modal__close:focus-visible { color: var(--text); border-color: var(--gold); outline: none; }

.panel-content { padding: 30px; }
.panel-cap { margin: 0; color: var(--gold); font: 10px/1.2 "DM Mono", ui-monospace, monospace; letter-spacing: 3px; }
.panel-content h2 { margin: 10px 0 20px; font-size: 30px; font-weight: 600; }
.profile-mark { width: 112px; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid rgba(255,212,121,0.46); border-radius: 50%; background: rgba(255,255,255,0.04); color: var(--gold); font-size: 38px; }
.profile-heading { display: grid; grid-template-columns: 86px minmax(180px, 1fr) auto; gap: 18px; align-items: center; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.profile-heading .profile-mark { width: 86px; font-size: 30px; }
.profile-identity span { color: var(--gold); font: 10px/1.2 "DM Mono", ui-monospace, monospace; letter-spacing: 1.8px; }
.profile-identity h2 { margin: 6px 0 2px; font-size: 31px; }
.profile-identity p { margin: 0; color: var(--soft); font-size: 12px; }
.profile-status { display: grid; grid-template-columns: repeat(2, minmax(92px, 1fr)); gap: 8px; margin: 0; }
.profile-status div { padding: 10px 12px; border-left: 1px solid rgba(255,212,121,0.42); background: rgba(255,255,255,0.025); }
.profile-status dt { color: var(--faint); font-size: 9px; }
.profile-status dd { margin: 5px 0 0; font-size: 13px; }

.personality-section, .shine-section { padding-top: 18px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.section-heading > div { display: flex; align-items: baseline; gap: 12px; }
.section-heading span { color: var(--faint); font: 8px/1.2 "DM Mono", ui-monospace, monospace; letter-spacing: 2.4px; }
.section-heading h3 { margin: 0; font-size: 18px; font-weight: 600; }
.section-heading small { color: var(--faint); font-size: 10px; }
.concept-switch { display: flex !important; align-items: center !important; gap: 4px !important; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,0.025); }
.concept-switch button { min-height: 44px; padding: 5px 11px; border: 0; border-radius: 5px; background: transparent; color: var(--faint); font-size: 10px; cursor: pointer; }
.concept-switch button.is-active { background: rgba(255,212,121,0.13); color: var(--gold); }
.concept-view { min-height: 254px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.025); overflow: hidden; }
.concept-view[hidden] { display: none; }

.mirror-composition { display: grid; grid-template-columns: minmax(380px,1fr) 250px; gap: 16px; align-items: center; min-height: 254px; padding: 8px 18px 8px 8px; }
.heart-mirror { position: relative; width: 350px; height: 220px; margin: auto; filter: drop-shadow(0 14px 24px rgba(0,0,0,0.28)); }
.mirror-facet { position: absolute; width: 122px; height: 58px; display: grid; place-content: center; gap: 3px; border: 0; clip-path: polygon(16% 0, 84% 0, 100% 50%, 84% 100%, 16% 100%, 0 50%); background: linear-gradient(135deg, rgba(255,212,121,0.2), rgba(255,255,255,0.045)); color: var(--text); cursor: pointer; transition: filter 160ms ease, transform 160ms ease, background 160ms ease; }
.mirror-facet::after { position: absolute; inset: 2px; z-index: -1; content: ""; clip-path: inherit; background: rgba(13,13,19,0.9); }
.mirror-facet small { color: var(--gold); font: 8px/1 "DM Mono", ui-monospace, monospace; letter-spacing: 1px; }
.mirror-facet strong { font-size: 12px; font-weight: 500; }
.mirror-facet i { color: var(--faint); font: 7px/1 "DM Mono", ui-monospace, monospace; font-style: normal; }
.mirror-facet.is-neutral { background: linear-gradient(135deg, rgba(255,255,255,0.14), rgba(255,255,255,0.025)); color: var(--faint); }
.mirror-facet.is-neutral small { color: var(--faint); }
.mirror-facet.is-active { background: linear-gradient(135deg, rgba(255,212,121,0.92), rgba(126,198,224,0.42)); filter: drop-shadow(0 0 12px rgba(255,212,121,0.26)); }
.mirror-facet.is-active::after { background: linear-gradient(135deg, rgba(38,31,22,0.96), rgba(14,18,24,0.96)); }
.mirror-facet:hover, .mirror-facet:focus-visible { filter: brightness(1.25); outline: none; }
.facet-1 { left: 114px; top: 3px; }
.facet-2 { left: 224px; top: 54px; }
.facet-3 { left: 224px; top: 117px; }
.facet-4 { left: 114px; top: 158px; }
.facet-5 { left: 4px; top: 117px; }
.facet-6 { left: 4px; top: 54px; }
.mirror-core { position: absolute; left: 132px; top: 68px; width: 86px; height: 86px; display: grid; place-content: center; gap: 5px; clip-path: polygon(25% 0,75% 0,100% 25%,100% 75%,75% 100%,25% 100%,0 75%,0 25%); background: linear-gradient(145deg, rgba(255,212,121,0.22), rgba(94,234,212,0.08)), #0d0e14; text-align: center; }
.mirror-core::before { position: absolute; inset: 7px; content: ""; border: 1px solid rgba(255,212,121,0.24); transform: rotate(45deg); }
.mirror-core span { position: relative; font-size: 12px; }
.mirror-core small { position: relative; color: var(--faint); font-size: 7px; }
.mirror-reading { min-height: 174px; display: grid; align-content: center; padding: 18px; border-left: 1px solid rgba(255,212,121,0.32); background: linear-gradient(90deg, rgba(255,212,121,0.035), transparent); }
.mirror-reading > span { color: var(--gold); font: 8px/1.2 "DM Mono", ui-monospace, monospace; letter-spacing: 1.8px; }
.mirror-reading h4 { margin: 9px 0 10px; font-size: 13px; font-weight: 500; }
.mirror-reading h4 i { margin: 0 4px; color: var(--faint); font-style: normal; }
.mirror-ratio { display: grid; grid-template-columns: 1fr 34px 1fr; align-items: center; gap: 7px; margin-bottom: 13px; }
.mirror-ratio > span { display: grid; gap: 2px; color: var(--faint); font-size: 7px; }
.mirror-ratio > span:last-child { text-align: right; }
.mirror-ratio b { color: var(--text); font: 13px/1 "DM Mono", ui-monospace, monospace; font-weight: 500; }
.mirror-ratio > i { position: relative; height: 1px; background: var(--line-strong); }
.mirror-ratio > i::after { position: absolute; left: 50%; top: 50%; width: 5px; height: 5px; content: ""; border: 1px solid var(--gold); transform: translate(-50%,-50%) rotate(45deg); background: var(--surface); }
.mirror-reading p { margin: 0 0 4px; color: var(--faint); font-size: 9px; }
.mirror-reading > strong { color: var(--gold); font-size: 20px; font-weight: 500; }
.mirror-reading > small { margin-top: 18px; color: var(--faint); font-size: 8px; line-height: 1.6; }

.stamp-ledger { min-height: 254px; padding: 15px 18px 18px; background: linear-gradient(135deg, rgba(255,212,121,0.035), transparent 38%), repeating-linear-gradient(0deg, transparent 0 31px, rgba(255,255,255,0.025) 32px); }
.stamp-ledger__head { display: flex; justify-content: space-between; align-items: center; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.stamp-ledger__head span { color: var(--gold); font: 8px/1.2 "DM Mono", ui-monospace, monospace; letter-spacing: 2px; }
.stamp-ledger__head small { color: var(--faint); font-size: 8px; }
.stamp-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; padding-top: 10px; perspective: 900px; }
.personality-stamp { position: relative; min-height: 88px; border: 1px solid rgba(255,212,121,0.2); border-radius: 6px; background: rgba(8,8,13,0.58); color: var(--text); cursor: pointer; transform-style: preserve-3d; transition: transform 360ms ease, border-color 160ms ease; }
.personality-stamp:hover, .personality-stamp:focus-visible { border-color: rgba(255,212,121,0.58); outline: none; }
.personality-stamp.is-flipped { transform: rotateX(180deg); }
.stamp-face { position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; padding: 8px; backface-visibility: hidden; text-align: center; }
.stamp-front::before { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; content: ""; border: 1px solid rgba(255,212,121,0.34); border-radius: 50%; transform: translate(-50%,-50%); box-shadow: inset 0 0 0 5px rgba(255,212,121,0.025); }
.stamp-face small { position: relative; color: var(--gold); font: 7px/1.2 "DM Mono", ui-monospace, monospace; letter-spacing: 1px; }
.stamp-face strong { position: relative; font-size: 12px; font-weight: 500; }
.stamp-face b { position: relative; color: var(--gold); font: 9px/1 "DM Mono", ui-monospace, monospace; font-weight: 500; }
.stamp-face i { position: relative; color: var(--faint); font-size: 7px; font-style: normal; }
.stamp-back { transform: rotateX(180deg); background: rgba(17,17,24,0.96); }
.stamp-back strong { font-size: 10px; }
.personality-stamp.is-neutral { border-style: dashed; border-color: rgba(255,255,255,0.13); color: var(--faint); }
.personality-stamp.is-neutral .stamp-front::before { border-color: rgba(255,255,255,0.14); }
.personality-stamp.is-neutral .stamp-face small { color: var(--faint); }

.personality-tabs { display: flex !important; align-items: center !important; gap: 4px !important; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,0.025); }
.personality-tabs button { min-width: 76px; min-height: 44px; padding: 5px 11px; border: 0; border-radius: 5px; background: transparent; color: var(--faint); font-size: 10px; cursor: pointer; }
.personality-tabs button.is-active { background: rgba(255,212,121,0.13); color: var(--gold); }
.personality-tabs button:hover, .personality-tabs button:focus-visible { color: var(--text); outline: none; }
.personality-radar { min-height: 254px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: radial-gradient(circle at 32% 50%, rgba(255,212,121,0.045), transparent 42%), rgba(255,255,255,0.022); }
.radar-stage { --radar-accent: #ffd479; --radar-fill: rgba(255,212,121,0.17); display: grid; grid-template-columns: minmax(420px,1fr) 220px; align-items: center; min-height: 254px; }
.radar-stage--reason { --radar-accent: #8fd4e7; --radar-fill: rgba(143,212,231,0.15); }
.radar-chart { display: block; width: 100%; height: 250px; overflow: visible; }
.radar-grid polygon, .radar-grid line { fill: none; stroke: rgba(255,255,255,0.12); stroke-width: 1; vector-effect: non-scaling-stroke; }
.radar-grid polygon:last-of-type { stroke: rgba(255,255,255,0.23); }
.radar-shape { fill: var(--radar-fill); stroke: var(--radar-accent); stroke-width: 1.6; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 7px color-mix(in srgb, var(--radar-accent) 24%, transparent)); }
.radar-nodes circle { fill: var(--surface); stroke: var(--radar-accent); stroke-width: 1.4; vector-effect: non-scaling-stroke; }
.radar-label text { fill: var(--text-soft); font-size: 12px; font-weight: 500; }
.radar-label .radar-label__value { fill: var(--radar-accent); font-family: "DM Mono", ui-monospace, monospace; font-size: 11px; }
.radar-center text:first-child { fill: var(--text); font-size: 12px; }
.radar-center text:last-child { fill: var(--text-faint); font-size: 8px; letter-spacing: 1px; }
.radar-summary { min-height: 188px; display: grid; align-content: center; padding: 16px 18px; border-left: 1px solid color-mix(in srgb, var(--radar-accent) 34%, transparent); background: linear-gradient(90deg, color-mix(in srgb, var(--radar-accent) 5%, transparent), transparent); }
.radar-summary > span { color: var(--radar-accent); font: 8px/1.2 "DM Mono", ui-monospace, monospace; letter-spacing: 2px; }
.radar-summary h4 { margin: 6px 0 4px; font-size: 21px; font-weight: 500; }
.radar-summary > p { margin: 0; color: var(--faint); font-size: 9px; line-height: 1.6; }
.radar-leading { display: grid; gap: 5px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line); }
.radar-leading small { color: var(--faint); font-size: 8px; }
.radar-leading div { display: flex; justify-content: space-between; gap: 8px; }
.radar-leading strong { font-size: 10px; font-weight: 500; }
.radar-leading b { color: var(--radar-accent); font: 10px/1.3 "DM Mono", ui-monospace, monospace; font-weight: 500; }
.radar-summary em { margin-top: 12px; color: var(--faint); font-size: 7px; font-style: normal; }

.shine-empty { display: grid; grid-template-columns: 34px minmax(180px,1fr) repeat(3, 42px); gap: 10px; align-items: center; min-height: 64px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: rgba(255,255,255,0.022); }
.shine-empty > div { display: grid; gap: 3px; }
.shine-empty strong { font-size: 12px; font-weight: 500; }
.shine-empty small { color: var(--faint); font-size: 9px; }
.shine-lock { position: relative; width: 30px; height: 30px; border: 1px solid rgba(255,212,121,0.3); border-radius: 50%; }
.shine-lock::before { position: absolute; left: 9px; top: 12px; width: 10px; height: 8px; content: ""; border: 1px solid var(--gold); border-radius: 2px; }
.shine-lock::after { position: absolute; left: 11px; top: 7px; width: 6px; height: 7px; content: ""; border: 1px solid var(--gold); border-bottom: 0; border-radius: 6px 6px 0 0; }
.shine-slot { width: 42px; aspect-ratio: 1; border: 1px dashed rgba(255,255,255,0.13); border-radius: 50%; background: radial-gradient(circle, rgba(255,212,121,0.045), transparent 66%); }
.bond-card { display: grid; grid-template-columns: 160px 1fr; gap: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.bond-card img { width: 160px; height: 210px; object-fit: cover; object-position: 50% 18%; }
.bond-card__body { padding: 20px 20px 20px 0; }
.bond-status { color: var(--mint); font-size: 11px; }
.bond-card h3 { margin: 10px 0 4px; font-size: 27px; }
.bond-card p { margin: 0; color: var(--soft); font-size: 13px; line-height: 1.6; }
.bond-note { margin-top: 18px !important; padding-top: 14px; border-top: 1px solid var(--line); color: var(--text) !important; }
.bond-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.bond-heading h2 { margin-bottom: 5px; }
.bond-heading p { margin: 0; color: var(--soft); font-size: 11px; }
.bond-heading > span { color: var(--faint); font-size: 10px; white-space: nowrap; }
.bond-overview { min-height: 440px; }
.bond-world-stream { display: grid; gap: 17px; }
.bond-world-section { padding-top: 12px; border-top: 1px solid var(--line); }
.bond-world-section:first-child { padding-top: 0; border-top: 0; }
.bond-world-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.bond-world-heading span { font-size: 13px; font-weight: 600; }
.bond-world-heading small { color: var(--faint); font-size: 9px; }
.bond-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.bond-person-card { position: relative; min-width: 0; aspect-ratio: 3 / 4; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #11131a; color: var(--text); text-align: left; text-decoration: none; cursor: pointer; }
.bond-person-card > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 16%; transition: transform 180ms ease, filter 180ms ease; }
.bond-person-card.is-met { border-color: rgba(255,212,121,0.34); }
.bond-person-card.is-met:hover, .bond-person-card.is-met:focus-visible { border-color: var(--gold); outline: none; }
.bond-person-card.is-met:hover > img { transform: scale(1.035); }
.bond-person-card.is-locked > img { filter: grayscale(1) brightness(0.32) blur(1px); transform: scale(1.03); }
.bond-card-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgba(4,5,9,0.98), rgba(4,5,9,0.42) 21%, rgba(4,5,9,0.03) 53%), linear-gradient(90deg, rgba(4,5,9,0.16), transparent); }
.bond-world { position: absolute; left: 8px; top: 8px; padding: 3px 6px; border: 1px solid rgba(255,255,255,0.18); border-radius: 999px; background: rgba(5,7,11,0.54); color: rgba(255,255,255,0.72); font-size: 8px; }
.bond-card-copy { position: absolute; left: 10px; right: 9px; bottom: 9px; display: grid; }
.bond-card-copy small { color: var(--mint); font-size: 7px; }
.bond-card-copy strong { margin-top: 2px; font-size: 18px; font-weight: 600; letter-spacing: 0.08em; }
.bond-card-copy em { margin-top: 3px; overflow: hidden; color: var(--soft); font-size: 8px; font-style: normal; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bond-person-card.is-locked .bond-card-copy small, .bond-person-card.is-locked .bond-card-copy strong { color: var(--faint); }
.bond-lock { position: absolute; left: 50%; top: 42%; width: 26px; height: 22px; transform: translate(-50%,-50%); border: 1px solid rgba(255,255,255,0.42); border-radius: 4px; background: rgba(4,6,9,0.48); }
.bond-lock::before { position: absolute; left: 6px; top: -10px; width: 12px; height: 12px; content: ""; border: 1px solid rgba(255,255,255,0.42); border-bottom: 0; border-radius: 9px 9px 0 0; }
.bond-silhouette { position: absolute; inset: 0; background: radial-gradient(circle at 50% 30%, rgba(121,133,151,0.22), transparent 28%), linear-gradient(160deg,#171b24,#090b10); }
.bond-silhouette i { position: absolute; left: 50%; top: 20%; width: 42%; height: 68%; transform: translateX(-50%); border-radius: 48% 48% 16% 16%; background: #05070a; clip-path: polygon(27% 0,73% 0,88% 22%,78% 39%,100% 100%,0 100%,22% 39%,12% 22%); }
.bond-extension { margin-top: 12px; min-height: 82px; padding: 12px 14px; display: grid; grid-template-columns: 42px 1fr auto; gap: 13px; align-items: center; border: 1px solid rgba(94,234,212,0.25); border-radius: 8px; background: linear-gradient(90deg, rgba(94,234,212,0.08), rgba(255,255,255,0.025)); }
.bond-extension__icon { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(94,234,212,0.4); border-radius: 50%; color: var(--mint); text-shadow: 0 0 12px rgba(94,234,212,0.42); }
.bond-extension__copy { min-width: 0; }
.bond-extension__copy > span { color: var(--mint); font: 8px/1.2 "DM Mono", ui-monospace, monospace; letter-spacing: 1.5px; }
.bond-extension__copy h3 { margin: 4px 0 2px; font-size: 16px; font-weight: 600; }
.bond-extension__copy p { margin: 0; color: var(--soft); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bond-extension__action { min-height: 42px; padding: 0 13px; display: flex; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,0.04); color: var(--text); text-decoration: none; font-size: 10px; }
.bond-extension__action:hover, .bond-extension__action:focus-visible { border-color: var(--mint); outline: none; }

@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -8px); }
  14%, 72% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -4px); }
}

@media (max-width: 900px), (max-height: 500px) {
  .topbar { height: 46px; }
  .companion-line { right: max(2.5vw, var(--safe-right)); bottom: calc(var(--safe-bottom) + 62px); width: min(365px, 43vw); min-height: 40px; padding: 7px 10px; }
  .companion-quote { font-size: 12px; }
  .bottom-actions { gap: 10px; }
  .heart-entry { min-width: 132px; min-height: 50px; padding: 6px 10px; }
  .continue-button { min-height: 50px; width: min(268px, 34vw); padding: 6px 13px 6px 15px; }
  .continue-copy strong { font-size: 18px; }
  .profile-entry { min-height: 42px; }
  .bond-entry { min-height: 42px; }
  .panel-content { padding: 20px; }
  .modal.profile-mode .modal__panel { max-height: 92vh; }
  .modal.bond-mode .modal__panel { max-height: 92vh; }
  .bond-overview { min-height: 0; }
  .bond-heading { margin-bottom: 8px; }
  .bond-heading h2 { margin-top: 5px; font-size: 24px; }
  .bond-world-stream { gap: 13px; }
  .bond-world-section { padding-top: 9px; }
  .bond-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .bond-person-card { aspect-ratio: 3 / 4; }
  .profile-heading { grid-template-columns: 62px minmax(150px, 1fr) auto; gap: 12px; padding-bottom: 12px; }
  .profile-heading .profile-mark { width: 62px; font-size: 23px; }
  .profile-identity h2 { margin-top: 3px; font-size: 23px; }
  .profile-status div { padding: 7px 9px; }
  .personality-section, .shine-section { padding-top: 11px; }
  .personality-radar, .radar-stage { min-height: 206px; }
  .radar-stage { grid-template-columns: minmax(360px,1fr) 190px; }
  .radar-chart { height: 204px; }
  .radar-summary { min-height: 156px; padding: 12px 14px; }
  .radar-summary h4 { font-size: 17px; }
  .radar-leading { margin-top: 8px; padding-top: 7px; }
  .radar-summary em { margin-top: 7px; }
  .concept-view { min-height: 206px; }
  .mirror-composition { grid-template-columns: minmax(330px,1fr) 210px; min-height: 206px; padding: 0 12px 0 0; }
  .heart-mirror { transform: scale(0.82); }
  .mirror-reading { min-height: 152px; padding: 14px; }
  .mirror-reading h4 { margin-bottom: 12px; }
  .mirror-reading > small { margin-top: 10px; }
  .stamp-ledger { min-height: 206px; padding: 10px 14px 12px; }
  .personality-stamp { min-height: 68px; }
  .stamp-front::before { width: 46px; height: 46px; }
  .shine-empty { min-height: 50px; padding-block: 7px; }
}

@media (max-width: 760px), (max-height: 370px) {
  .profile-copy small, .bond-entry small, .entry-label small { display: none; }
  .profile-entry { padding-right: 10px; }
  .bond-entry { display: flex; padding: 6px 12px; }
  .companion-line { bottom: calc(var(--safe-bottom) + 56px); width: 43vw; }
  .companion-name { display: none; }
  .continue-button { min-height: 50px; }
  .continue-copy small { display: none; }
  .continue-copy strong { margin: 0; font-size: 18px; }
  .heart-entry { min-height: 48px; min-width: 112px; }
  .bond-extension { min-height: 70px; padding: 8px 10px; }
  .bond-extension__copy p { display: none; }
  .bond-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bond-person-card { aspect-ratio: 3 / 4; }
  .unlock-toast { top: 14%; }
  .profile-status { display: none; }
  .profile-heading { grid-template-columns: 52px 1fr; }
  .profile-heading .profile-mark { width: 52px; font-size: 20px; }
  .profile-identity h2 { font-size: 20px; }
  .personality-tabs button { min-width: 66px; min-height: 44px; padding-inline: 8px; }
  .radar-stage { grid-template-columns: minmax(330px,1fr) 170px; }
  .radar-summary > p, .radar-summary em { display: none; }
  .concept-switch button { min-height: 44px; padding-inline: 8px; }
  .mirror-composition { grid-template-columns: minmax(320px,1fr) 180px; }
  .heart-mirror { transform: scale(0.76); }
  .mirror-reading > small { display: none; }
  .stamp-ledger__head small { display: none; }
  .section-heading small { display: none; }
  .shine-slot { display: none; }
  .shine-empty { grid-template-columns: 34px 1fr; }
  .bond-card { grid-template-columns: 125px 1fr; }
  .bond-card img { width: 125px; height: 170px; }
  .bond-card__body { padding: 14px 14px 14px 0; }
  .bond-note { margin-top: 10px !important; padding-top: 9px; }
}

/* Shared mobile interaction floor. */
.profile-entry,.bond-entry{min-height:46px}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.service-entries {
  position: absolute;
  z-index: 4;
  left: max(22px, calc(var(--safe-left) + 8px));
  top: 31%;
  width: min(310px, 31vw);
  display: grid;
  gap: 8px;
}

.service-entries__eyebrow {
  margin: 0 0 2px 2px;
  color: rgba(255, 212, 121, 0.68);
  font: 8px/1.2 "DM Mono", ui-monospace, monospace;
  letter-spacing: 2.8px;
}

.service-entry {
  position: relative;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 8px 12px 8px 10px;
  border-radius: 8px;
  overflow: hidden;
}

.service-entry::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 2px;
  content: "";
  background: currentColor;
  opacity: 0.75;
}

.service-entry__icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 17px;
}

.service-entry__copy { min-width: 0; display: grid; gap: 3px; }
.service-entry__copy strong { color: var(--text); font-size: 15px; font-weight: 600; letter-spacing: 0.04em; }
.service-entry__copy small { color: var(--faint); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.service-entry__arrow { color: var(--soft); font-size: 22px; transform: translateY(-1px); }
.service-entry--theatre { color: #dc9dff; background: linear-gradient(90deg, rgba(35, 19, 44, 0.84), rgba(10, 10, 15, 0.62)); }
.service-entry--journey { color: var(--mint); background: linear-gradient(90deg, rgba(10, 38, 38, 0.82), rgba(10, 10, 15, 0.62)); }
.service-entry:hover .service-entry__arrow,
.service-entry:focus-visible .service-entry__arrow { transform: translate(3px, -1px); }

@media (max-width: 900px), (max-height: 500px) {
  .service-entries { top: 29%; width: min(270px, 33vw); gap: 6px; }
  .service-entry { min-height: 49px; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 9px; padding-block: 6px; }
  .service-entry__icon { width: 30px; height: 30px; font-size: 15px; }
  .service-entry__copy strong { font-size: 13px; }
}

@media (max-width: 760px), (max-height: 370px) {
  .service-entries { top: 27%; width: min(240px, 35vw); }
  .service-entries__eyebrow { display: none; }
  .service-entry { min-height: 44px; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 8px; padding: 5px 9px 5px 8px; }
  .service-entry__icon { width: 28px; height: 28px; }
  .service-entry__copy small { display: none; }
  .service-entry__copy strong { font-size: 12px; }
}

/* Unified pure-black canvas */
:root { --bg: #000; }
html,
body,
.home,
.home__portrait {
  background-color: #000;
}
