/* African Roots: Life Routes, finishing layer.
   Loaded last: opening screen, portrait cards, journeys, account bar. */

:root { --amber: #e8ad79; --terracotta: #c4704f; --sage: #8fa58a; --safe-b: env(safe-area-inset-bottom, 0px); }

/* ---------- Opening screen ---------- */
.opening { position: relative; isolation: isolate; border-radius: 22px; overflow: hidden; min-height: min(78vh, 680px); display: flex; align-items: flex-end; background: #0d1116; border: 1px solid #ffffff12; }
.opening-art, .opening-art img { position: absolute; inset: 0; width: 100%; height: 100%; }
.opening-art { z-index: -2; }
.opening-art img { object-fit: cover; object-position: 54% 40%; }
.opening-copy { position: relative; }
.opening::before { content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, #0b0f14f0 0%, #0b0f14b8 34%, #0b0f1420 62%, transparent 100%), linear-gradient(0deg, #0b0f14e6 0%, transparent 45%); }
.opening-copy { padding: clamp(24px, 5vw, 64px); max-width: 620px; }
.opening-copy h1 { font-size: clamp(2.7rem, 7vw, 5.4rem); line-height: 1.02; margin: 18px 0; letter-spacing: -.02em; }
.opening-copy h1 em { color: var(--lime); }
.opening-copy p { color: #e4ded4; max-width: 460px; font-size: 1.05rem; }
.opening-copy small { display: block; margin-top: 20px; font-size: .75rem; color: #c3c0b8; }
.opening-copy .button-row .btn { min-height: 48px; }
@media (max-width: 760px) {
  .opening { min-height: 0; flex-direction: column; align-items: stretch; border-radius: 18px; }
  .opening-art { position: relative; height: 340px; }
  .opening-art img { object-position: 52% 30%; }
  .opening::before { background: linear-gradient(0deg, #0d1116 0%, #0d1116 calc(100% - 340px), #0d111600 calc(100% - 200px)); }
  .opening-copy { padding: 0 20px 26px; margin-top: -70px; }
  .opening-copy h1 { font-size: 2.6rem; margin: 12px 0; }
  .opening-copy .button-row { flex-direction: column; align-items: stretch; }
  .opening-copy .button-row .btn { width: 100%; justify-content: center; }
}

.route-panels { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.route-panel { position: relative; overflow: hidden; border-radius: 18px; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.route-panel > img { width: 100%; height: 170px; object-fit: cover; display: block; }
.route-panel > img.portrait { object-position: 50% 8%; background: #2a3329; }
.route-panel > div { padding: 18px 20px 22px; }
.route-panel b { color: var(--lime); font-size: .75rem; letter-spacing: .08em; }
.route-panel h3 { margin: 8px 0; font-size: 1.25rem; }
.route-panel p { margin: 0; color: var(--muted); }
@media (max-width: 760px) {
  .route-panels { grid-template-columns: 1fr; }
  .route-panel { flex-direction: row; }
  .route-panel > img { width: 112px; height: auto; min-height: 132px; flex: none; }
  .route-panel > div { padding: 14px 16px; }
  .route-panel h3 { font-size: 1.05rem; }
  .route-panel p { font-size: .9rem; }
}

/* ---------- Portraits: signature characters and the "design your own" card ---------- */
.signature-avatar { background: radial-gradient(ellipse at 50% 30%, #3d4a3a 0%, #1d2620 70%); }
.signature-avatar img, .preset-art img, .signature-avatar.sage img, .signature-avatar.terracotta img, .preset-art.sage img, .preset-art.terracotta img { position: absolute; inset: 0; width: 100%; height: 100%; left: 0; transform: none; clip-path: none; object-fit: cover; object-position: 50% 6%; max-width: none; }
.avatar-stage.mini .signature-avatar img { object-position: 50% 4%; }
.preset-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.preset-card { position: relative; cursor: pointer; padding: 0 0 12px; min-height: 44px; }
.preset-card[aria-pressed="true"] { border-color: var(--lime); box-shadow: 0 0 0 2px var(--lime); }
.preset-card[aria-pressed="true"]::after { content: '✓'; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--lime); color: #10151b; font-weight: 700; display: grid; place-items: center; font-size: .8rem; }
.preset-art { height: 170px; background: radial-gradient(ellipse at 50% 30%, #3d4a3a 0%, #1d2620 70%); }
.preset-art.custom { display: grid; place-items: center; background: radial-gradient(ellipse at 50% 30%, #2c3a44 0%, #161d24 70%); }
.preset-art.custom svg { height: 100%; width: auto; }
.preset-card strong { font-size: .85rem; }
.preset-card small { font-size: .7rem; color: var(--muted); }
.setup-avatar { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); }
.avatar-stage.setup-preview { height: 320px; }
.setup-custom[hidden] { display: none; }
@media (max-width: 760px) {
  .setup-avatar { grid-template-columns: 1fr; }
  .avatar-stage.setup-preview { height: 260px; }
  .preset-cards { gap: 8px; }
  .preset-art { height: 130px; }
  .preset-card strong { font-size: .75rem; }
  .preset-card small { display: none; }
}

/* ---------- Journeys ---------- */
.trip-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.trip-card { border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.trip-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; }
.trip-card > div { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.trip-card small { color: var(--muted); font-size: .72rem; letter-spacing: .06em; }
.trip-card h2 { margin: 0; font-size: 1.4rem; }
.trip-card p { margin: 0 0 6px; color: var(--muted); }
.trip-card .btn { margin-top: auto; min-height: 46px; }
.trip-card .trip-reason { letter-spacing: 0; }
@media (max-width: 900px) { .trip-grid { grid-template-columns: 1fr; } }

.cinema-screen { position: relative; isolation: isolate; overflow: hidden; border-radius: 22px; min-height: min(80vh, 720px); display: flex; flex-direction: column; justify-content: space-between; background: #0b0f14; border: 1px solid #ffffff14; }
.cinema-backdrop { position: absolute; inset: -4%; z-index: -2; background-size: cover; background-position: center; animation: cinema-pan 38s ease-in-out infinite alternate; }
.cinema-screen::after { content: ''; position: absolute; inset: 0; z-index: -1; background: linear-gradient(0deg, #07090dee 0%, #07090dcc 32%, #07090d10 62%, #07090d66 100%); }
@keyframes cinema-pan { from { transform: scale(1.04) translateX(-1.5%); } to { transform: scale(1.1) translateX(1.5%); } }
@media (prefers-reduced-motion: reduce) { .cinema-backdrop { animation: none; } }
.cinema-top { display: flex; justify-content: space-between; gap: 10px; padding: 16px 20px; font-size: .72rem; letter-spacing: .12em; color: #e7e1d6; }
.cinema-caption { padding: clamp(20px, 4vw, 44px); max-width: 760px; }
.cinema-caption > small:first-child { color: var(--amber); letter-spacing: .1em; text-transform: uppercase; font-size: .75rem; }
.cinema-caption h1 { margin: 6px 0 10px; font-size: clamp(2rem, 5vw, 3.4rem); }
.cinema-caption p { font-size: 1.1rem; line-height: 1.6; color: #f2ede4; max-width: 640px; }
.cinema-caption > small:not(:first-child) { display: block; margin: 6px 0 4px; color: var(--lime); font-style: italic; }
.cinema-choices { display: grid; gap: 10px; margin: 18px 0 12px; }
.cinema-choice { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 12px 16px; text-align: left; border-radius: 14px; border: 1px solid #ffffff2a; background: #10151bcc; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; backdrop-filter: blur(6px); }
.cinema-choice span { color: var(--lime); font-size: .8rem; font-weight: 700; }
.cinema-choice:hover, .cinema-choice:focus-visible { border-color: var(--lime); background: #1a2028ee; }
.cinema-caption .plain { min-height: 44px; }

/* Choices that are blocked show why, under the button. */
.trip-reason { color: var(--muted); }

/* ---------- Account bar (signed-in state from /account) ---------- */
.account-link { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: .85rem; white-space: nowrap; }
.account-link:hover { border-color: var(--lime); }
.account-link img { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; margin-left: -8px; }
@media (max-width: 760px) { .account-link span { display: none; } .account-link { padding: 0 10px; } .account-link img { margin-left: 0; } }

/* Quick routes now have five entries. */
.quick-routes { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }

/* Bottom navigation clears the iPhone home indicator. */
.bottom-nav { padding-bottom: var(--safe-b); }

/* Life banner: the portrait sits behind the headline, never over it. */
.hero-copy { z-index: 2; }
.hero-avatar { z-index: 1; }
.hero-avatar .signature-avatar { z-index: 0; mask-image: linear-gradient(0deg, transparent 0%, #000 22%); -webkit-mask-image: linear-gradient(0deg, transparent 0%, #000 22%); }
@media (max-width: 760px) {
  .hero-avatar { width: 40%; height: 250px; right: -6px; bottom: 34px; opacity: .9; }
  .hero-copy h1 { text-shadow: 0 2px 18px #0b0f14; }
}
.account-link--signin span { display: inline !important; }
.account-link--signin { border-color: var(--lime); color: var(--lime); }
.opening-account { margin: 14px 0 0; font-size: .9rem; color: #d8d3ca; }
.opening-account a { color: var(--lime); font-weight: 600; }
.account-initial { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--lime); color: #10151b; font-size: .8rem; margin-left: -8px; }
@media (max-width: 760px) { .account-initial { margin-left: 0; } }

/* Starting city chosen from the player's location */
.start-locate { margin: 6px 0 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.start-locate .help-text { margin: 0; }
.start-locate strong { color: var(--lime); }
#start-location:disabled, #start-city:disabled { opacity: 1; color: var(--text); border-color: var(--lime); background-image: none; cursor: not-allowed; }
