/* v55 Creative Road-Trip Features — Postcards, Scrapbook, Bush Radio, Van Showcase, Companion Moments */

/* ---------------------------------------------------------------- shared */
.cr-modal .modal-content { max-width: 760px; }
.cr-sub { font-size: 12.5px; color: #475569; margin: 0 0 10px; line-height: 1.45; }
.cr-h { margin: 14px 0 8px; font-size: 14px; color: #0f172a; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.cr-count { font-size: 11.5px; font-weight: 700; color: #64748b; }
.cr-empty { padding: 14px; text-align: center; color: #64748b; font-size: 12.5px; background: #f8fafc; border: 1px dashed #cbd5e1; border-radius: 12px; width: 100%; }
.cr-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: center; }
.cr-actions .btn { flex: 1 1 130px; }
.cr-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cr-lbl { font-size: 12px; font-weight: 800; color: #334155; min-width: 74px; }
.cr-input { flex: 1 1 180px; min-width: 0; padding: 8px 10px; border-radius: 10px; border: 1.5px solid #cbd5e1; font-family: inherit; font-size: 14px; }
.cr-input:focus { outline: none; border-color: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25); }
.cr-chips { display: flex; flex-wrap: wrap; gap: 6px; flex: 1 1 200px; }
.cr-chip { padding: 5px 11px; border-radius: 999px; border: 1.5px solid #cbd5e1; background: #f8fafc; color: #334155; font-family: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.cr-chip.on { background: #0f172a; color: #fde68a; border-color: #0f172a; }

/* ---------------------------------------------------------------- 1. Postcards */
.cr-pc-canvas { width: 100%; height: auto; aspect-ratio: 3 / 2; border-radius: 12px; box-shadow: 0 8px 22px rgba(15, 23, 42, 0.25); touch-action: none; background: #fffbeb; display: block; }
.cr-pc-hint { font-size: 11px; color: #64748b; text-align: center; margin: 6px 0 2px; }
.cr-pc-stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.cr-pc-stats span { font-size: 12px; background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 3px 10px; border-radius: 999px; }
.cr-pc-tabs { display: flex; gap: 6px; margin-top: 8px; }
.cr-pc-sources { display: flex; gap: 8px; overflow-x: auto; padding: 6px 2px 8px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.cr-pc-src { flex: 0 0 auto; width: 96px; border: 2px solid transparent; border-radius: 10px; background: #f1f5f9; padding: 3px; cursor: pointer; font-family: inherit; scroll-snap-align: start; }
.cr-pc-src img { width: 100%; height: 58px; object-fit: cover; border-radius: 7px; display: block; background: #e2e8f0; }
.cr-pc-src span { display: block; font-size: 10.5px; font-weight: 700; color: #334155; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cr-pc-src.on { border-color: #f59e0b; background: #fffbeb; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35); }
.cr-sticker-tray { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 220px; }
.cr-tray { width: 38px; height: 38px; font-size: 22px; border-radius: 10px; border: 1.5px solid #e2e8f0; background: #fff; cursor: pointer; line-height: 1; }
.cr-tray:active { transform: scale(0.9); }
.cr-pc-hero { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; background: linear-gradient(135deg, #fff7ed, #fef3c7); border: 1.5px solid #fdba74; border-radius: 14px; padding: 12px; margin-bottom: 10px; color: #7c2d12; }
.cr-pc-hero > div { flex: 1 1 240px; display: flex; flex-direction: column; gap: 3px; font-size: 12.5px; }
.cr-pc-hero b { font-size: 15px; }
.cr-pc-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.cr-pc-thumb { border: none; background: #fff; border-radius: 10px; padding: 5px; box-shadow: 0 3px 10px rgba(15, 23, 42, 0.18); cursor: pointer; font-family: inherit; transform: rotate(-1deg); transition: transform 0.15s; }
.cr-pc-thumb:nth-child(even) { transform: rotate(1.2deg); }
.cr-pc-thumb:hover { transform: rotate(0) scale(1.03); }
.cr-pc-thumb canvas { width: 100%; height: auto; border-radius: 6px; display: block; }
.cr-pc-thumb span { display: block; font-size: 11px; font-weight: 700; color: #334155; margin-top: 4px; }

/* ---------------------------------------------------------------- 1b. Scrapbook */
.cr-pane { color: #1e293b; }
.cr-sb-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px; align-items: baseline; margin-bottom: 10px; }
.cr-sb-head b { font-size: 14px; color: #0f172a; }
.cr-sb-head span { font-size: 11.5px; color: #b45309; font-weight: 700; }
.cr-sb-book { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: #7c2d12; padding: 10px; border-radius: 14px; box-shadow: inset 0 0 0 3px #92400e, 0 10px 24px rgba(0, 0, 0, 0.35); perspective: 1400px; transition: transform 0.26s ease, opacity 0.26s ease; }
.cr-sb-book.flip-next { transform: rotateY(-14deg) translateX(-8px); opacity: 0.35; }
.cr-sb-book.flip-prev { transform: rotateY(14deg) translateX(8px); opacity: 0.35; }
.cr-sb-page { background: #f5e6c8; background-image: repeating-linear-gradient(0deg, transparent 0 23px, rgba(146, 64, 14, 0.08) 23px 24px); padding: 12px; min-height: 280px; display: flex; flex-direction: column; gap: 6px; }
.cr-sb-page.left { border-radius: 8px 0 0 8px; box-shadow: inset -12px 0 18px -10px rgba(120, 53, 15, 0.45); }
.cr-sb-page.right { border-radius: 0 8px 8px 0; box-shadow: inset 12px 0 18px -10px rgba(120, 53, 15, 0.45); background-color: #fffbeb; }
.cr-sb-photo { position: relative; background: #fffdf7; padding: 6px 6px 18px; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); transform: rotate(-2deg); }
.cr-sb-page.right .cr-sb-photo { transform: rotate(1.6deg); }
.cr-sb-photo img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.cr-sb-photo.sepia img { filter: sepia(0.92) contrast(1.06) brightness(0.92) saturate(0.85); }
.cr-sb-photo.sepia::after { content: ""; position: absolute; inset: 6px 6px 18px; background: radial-gradient(ellipse at center, transparent 55%, rgba(66, 32, 6, 0.45) 100%); pointer-events: none; }
.cr-sb-photo.empty { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 11; border: 2px dashed #d6b98a; background: rgba(255, 255, 255, 0.55); box-shadow: none; font-size: 34px; }
.cr-sb-year { position: absolute; right: 8px; bottom: 2px; font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; font-size: 13px; font-weight: 700; color: #78350f; }
.cr-sb-year.today { color: #0f766e; }
.cr-sb-ch { font-size: 12.5px; font-weight: 800; color: #7c2d12; }
.cr-sb-page.right .cr-sb-ch { color: #0f766e; }
.cr-sb-note { margin: 0; font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; font-size: 12px; line-height: 1.5; color: #57534e; }
.cr-sb-note.mine { color: #134e4a; }
.cr-sb-sig { font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; font-size: 11.5px; color: #92400e; text-align: right; }
.cr-sb-sig.mine { color: #0f766e; }
.cr-sb-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.cr-sb-nav { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 10px; }
.cr-sb-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; flex: 1; }
.cr-sb-dot { width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid #94a3b8; background: rgba(255, 255, 255, 0.85); color: #334155; font-size: 10.5px; font-weight: 800; cursor: pointer; padding: 0; font-family: inherit; }
.cr-sb-dot.done { background: #16a34a; color: #fff; border-color: #15803d; }
.cr-sb-dot.active { background: #facc15; color: #713f12; border-color: #ca8a04; }
.cr-sb-dot.on { box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.6); transform: scale(1.12); }
@media (max-width: 520px) {
  .cr-sb-book { grid-template-columns: 1fr; }
  .cr-sb-page.left { border-radius: 8px 8px 0 0; box-shadow: inset 0 -12px 18px -10px rgba(120, 53, 15, 0.45); }
  .cr-sb-page.right { border-radius: 0 0 8px 8px; box-shadow: inset 0 12px 18px -10px rgba(120, 53, 15, 0.45); }
  .cr-sb-page { min-height: 0; }
}

/* ---------------------------------------------------------------- 2. Bush radio */
.cr-radio {
  position: absolute; right: 12px; bottom: calc(var(--safe-bottom, 0px) + 158px); z-index: 26;
  display: none; align-items: center; gap: 3px; padding: 3px;
  background: linear-gradient(180deg, rgba(41, 37, 36, 0.9), rgba(12, 10, 9, 0.9));
  border: 1.5px solid rgba(250, 204, 21, 0.55); border-radius: 16px; box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}
body.mode-driving .cr-radio { display: flex; }
body.has-modal .cr-radio, body.in-minigame .cr-radio { display: none !important; }
.cr-radio-btn { width: 26px; height: 26px; border-radius: 50%; border: none; background: rgba(250, 204, 21, 0.16); color: #fde68a; font-size: 11px; cursor: pointer; padding: 0; }
.cr-radio-btn:active { transform: scale(0.88); background: rgba(250, 204, 21, 0.35); }
.cr-radio-display { display: flex; align-items: center; gap: 5px; border: none; background: #052e16; border-radius: 10px; padding: 3px 8px; cursor: pointer; font-family: inherit; min-width: 104px; box-shadow: inset 0 0 8px rgba(74, 222, 128, 0.25); }
.cr-radio-icon { font-size: 15px; }
.cr-radio-txt { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.05; }
.cr-radio-freq { font-size: 10.5px; color: #4ade80; letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.cr-radio-name { font-size: 9.5px; color: #bbf7d0; font-weight: 700; white-space: nowrap; max-width: 92px; overflow: hidden; text-overflow: ellipsis; }
.cr-radio-bubble {
  position: absolute; right: 12px; bottom: calc(var(--safe-bottom, 0px) + 196px); z-index: 26;
  max-width: min(300px, calc(100vw - 24px)); padding: 8px 11px; border-radius: 14px 14px 4px 14px;
  background: rgba(15, 23, 42, 0.86); border: 1px solid rgba(74, 222, 128, 0.45); color: #f1f5f9;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4); opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.cr-radio-bubble.show { opacity: 1; transform: translateY(0); }
body:not(.mode-driving) .cr-radio-bubble, body.has-modal .cr-radio-bubble { display: none; }
.cr-rb-head { display: flex; align-items: center; gap: 6px; font-size: 11px; color: #86efac; margin-bottom: 3px; }
.cr-rb-ava, .cr-rb-ava svg { width: 22px; height: 22px; border-radius: 50%; display: inline-block; overflow: hidden; flex-shrink: 0; }
.cr-rb-text { font-size: 12px; line-height: 1.4; }
@media (max-height: 500px) {
  .cr-radio { bottom: calc(var(--safe-bottom, 0px) + 112px); }
  .cr-radio-bubble { bottom: calc(var(--safe-bottom, 0px) + 148px); }
}

/* ---------------------------------------------------------------- 3. Van showcase */
.cr-van-canvas, .cr-dash-canvas { width: 100%; height: auto; display: block; border-radius: 12px; box-shadow: 0 6px 18px rgba(15, 23, 42, 0.25); }
.cr-van-canvas { aspect-ratio: 900 / 560; }
.cr-dash-canvas { aspect-ratio: 3 / 1; cursor: pointer; touch-action: manipulation; }
.cr-sticker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 7px; }
.cr-stk { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto; column-gap: 6px; align-items: center; text-align: left; padding: 6px 8px; border-radius: 12px; border: 2px solid var(--bd); background: linear-gradient(135deg, var(--c1), var(--c2)); color: #fff; font-family: inherit; cursor: pointer; position: relative; min-height: 52px; }
.cr-stk-e { grid-row: 1 / span 2; font-size: 24px; text-align: center; }
.cr-stk-n { font-size: 11.5px; font-weight: 800; line-height: 1.15; }
.cr-stk-s { font-size: 9.5px; font-weight: 700; opacity: 0.88; line-height: 1.2; }
.cr-stk.on { box-shadow: 0 0 0 3px #22c55e, 0 4px 10px rgba(0, 0, 0, 0.25); }
.cr-stk.locked { background: #e2e8f0; border-color: #cbd5e1; color: #475569; filter: grayscale(0.4); }
.cr-mem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 6px; margin-top: 8px; }
.cr-mem { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px; border-radius: 12px; border: 1.5px solid #e2e8f0; background: #fff; font-family: inherit; cursor: pointer; }
.cr-mem span { font-size: 24px; }
.cr-mem b { font-size: 10.5px; color: #334155; text-align: center; line-height: 1.2; }
.cr-mem.on { border-color: #f59e0b; background: #fffbeb; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.35); }
.cr-journal-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 4px; }

/* ---------------------------------------------------------------- 4. Companion road moments */
#event-options .cr-assist-btn {
  display: flex; align-items: center; gap: 8px; text-align: left;
  background: linear-gradient(135deg, #fde047, #f59e0b) !important; color: #422006 !important;
  border: 2px solid #fef9c3 !important; box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.45), 0 6px 16px rgba(245, 158, 11, 0.45) !important;
  animation: crAssistGlow 1.8s ease-in-out infinite;
}
.cr-assist-ava, .cr-assist-ava svg { width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0; overflow: hidden; display: inline-block; background: #fff7ed; }
.cr-assist-txt { display: flex; flex-direction: column; gap: 1px; font-weight: 800; line-height: 1.25; min-width: 0; flex: 1 1 auto; }
.cr-assist-label { display: block; font-size: 13px; color: #422006; white-space: normal; }
#event-options .cr-assist-btn { height: auto !important; min-height: 54px; white-space: normal !important; }
.cr-assist-skill { font-size: 10.5px; font-weight: 800; color: #92400e; text-transform: uppercase; letter-spacing: 0.03em; }
#event-options .cr-tool-btn { background: linear-gradient(135deg, #bae6fd, #38bdf8) !important; color: #082f49 !important; border: 2px solid #e0f2fe !important; }
@keyframes crAssistGlow { 0%, 100% { filter: brightness(1); } 50% { filter: brightness(1.08); } }

.cr-road-card {
  position: absolute; left: 50%; top: calc(var(--safe-top, 0px) + 64px); z-index: 90;
  display: flex; align-items: center; gap: 10px; width: min(440px, calc(100vw - 24px));
  padding: 10px 12px; border-radius: 16px; background: rgba(255, 251, 235, 0.97); border: 2px solid #f59e0b;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35); color: #422006;
  opacity: 0; transform: translate(-50%, -14px); pointer-events: none; transition: opacity 0.35s ease, transform 0.35s ease;
}
.cr-road-card.show { opacity: 1; transform: translate(-50%, 0); }
.cr-rc-ava, .cr-rc-ava svg { width: 48px; height: 48px; border-radius: 50%; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #fef3c7; }
.cr-rc-ico { font-size: 28px; }
.cr-rc-body { display: flex; flex-direction: column; gap: 2px; }
.cr-rc-body b { font-size: 12px; color: #b45309; }
.cr-rc-body span { font-size: 13px; line-height: 1.4; }

/* Accessibility: respect reduced motion */
body.a11y-reduced-motion .cr-assist-btn { animation: none !important; }
body.a11y-reduced-motion .cr-sb-book { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .cr-assist-btn { animation: none !important; }
  .cr-sb-book, .cr-radio-bubble, .cr-road-card { transition: none; }
}
