/* ============================================================================
 * BayCast v63.9.3 — Diary / Profile polish styles
 *
 * Scoped to .bc-hero, .bc-diary-*, .bc-share-* — additive, does not touch
 * any existing v63 profile rules. Dark palette, BayCast yellow accent
 * (#ffd44a) reserved for the "big catch" tag and share hovers.
 * ========================================================================== */

/* ---- Hero card ----------------------------------------------------------- */
.bc-hero {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-radius: 16px;
  background:
    radial-gradient(120% 80% at 90% 0%, rgba(255,212,74,0.10) 0%, rgba(255,212,74,0) 55%),
    linear-gradient(180deg, #12233a 0%, #0b1728 100%);
  border: 1px solid #1f3352;
  box-shadow: 0 8px 24px rgba(0,0,0,0.35);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.bc-hero::before {
  content: '';
  position: absolute; inset: -1px;
  border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0) 40%);
  mix-blend-mode: overlay;
}

.bc-hero-avatar {
  width: 96px; height: 96px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 36px; font-weight: 700; color: #0b1728;
  background: linear-gradient(135deg, #ffd44a 0%, #f2ab1c 100%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(242,171,28,0.28), inset 0 0 0 2px rgba(255,255,255,0.15);
  user-select: none;
}
.bc-hero-avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.bc-hero-avatar-initials {
  position: relative; z-index: 1;
  transition: opacity 180ms ease;
}

.bc-hero-body { min-width: 0; }
.bc-hero-name {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.01em;
  line-height: 1.2;
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
}
.bc-hero-sub {
  margin-top: 4px;
  font-size: 13px;
  color: #9ab0c9;
  letter-spacing: 0.01em;
}
.bc-hero-streak {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,140,40,0.22), rgba(255,70,40,0.14));
  border: 1px solid rgba(255,140,40,0.35);
  color: #ffc38a;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1;
}
.bc-hero-flame { font-size: 14px; filter: drop-shadow(0 0 4px rgba(255,140,40,0.5)); }

.bc-hero-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}
.bc-hero-chip {
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  text-align: left;
  min-width: 0;
}
.bc-hero-chip-v {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  line-height: 1.15;
  /* Allow short 2-line wrap for long values like "85 cm" — no ellipsis */
  overflow: hidden;
  word-break: break-word;
}
.bc-hero-chip-k {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #7e94ad;
  margin-top: 2px;
}

@media (max-width: 480px) {
  .bc-hero { grid-template-columns: 80px 1fr; gap: 14px; padding: 14px; }
  .bc-hero-avatar { width: 80px; height: 80px; font-size: 30px; }
  .bc-hero-name { font-size: 19px; }
  .bc-hero-chip { padding: 7px 8px; }
  .bc-hero-chip-v { font-size: 14px; }
  .bc-hero-chip-k { font-size: 9px; letter-spacing: 0.06em; }
}

/* ---- Diary gallery ------------------------------------------------------- */
.bc-diary-sec { margin: 20px 0 16px; }
.bc-diary-sec-hd {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #7e94ad;
  font-weight: 600;
}
.bc-diary-sec-badge {
  font-size: 10px;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255,212,74,0.10);
  border: 1px solid rgba(255,212,74,0.30);
  color: #ffd47a;
  text-transform: none;
}

.bc-diary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
@media (min-width: 640px) { .bc-diary-grid { grid-template-columns: repeat(4, 1fr); gap: 10px; } }

.bc-diary-tile {
  position: relative;
  /* v63.9.15 — 4:5 portrait matches iPhone vertical photos */
  aspect-ratio: 4 / 5;
  margin: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #0c1a2e;
  border: 1px solid #1b2e4a;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.bc-diary-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0,0,0,0.45);
  border-color: rgba(255,212,74,0.45);
}

.bc-diary-tile-img {
  position: absolute; inset: 0;
  background: linear-gradient(120deg, rgba(255,255,255,0.03), rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.03));
  background-size: 200% 100%;
  animation: bcDiaryShimmer 1.4s linear infinite;
}
.bc-diary-tile-img.loaded { animation: none; background: none; }
.bc-diary-tile-img.bc-diary-tile-fail::after {
  content: '—';
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #4c6684; font-size: 24px;
}
@keyframes bcDiaryShimmer {
  0% { background-position: -100% 0; }
  100% { background-position: 100% 0; }
}
.bc-diary-tile-img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  /* v63.9.15 — contain so nothing gets chopped; letterbox fills with deep nav */
  object-fit: contain;
  background: #0c1a2e;
  opacity: 0; transition: opacity 280ms ease;
}
.bc-diary-tile-img.loaded img { opacity: 1; }

.bc-diary-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 16px 10px 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.75) 70%, rgba(0,0,0,0.88) 100%);
  color: #fff;
  pointer-events: none;
}
.bc-diary-cap-sp {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  /* Allow 2 lines for long species names like "King George Whiting" */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
.bc-diary-cap-sub {
  font-size: 10px;
  color: #cbd9e8;
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.bc-diary-share {
  position: absolute;
  top: 6px; right: 6px;
  width: 30px; height: 30px;
  border-radius: 50%;
  display: grid; place-items: center;
  border: 0;
  background: rgba(10,18,32,0.72);
  color: #ffd47a;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  transition: transform 140ms ease, background 140ms ease;
  z-index: 2;
  padding: 0;
}
.bc-diary-share:hover {
  transform: scale(1.08);
  background: #ffd44a;
  color: #1b1304;
}
.bc-diary-share:focus-visible {
  outline: 2px solid #ffd44a;
  outline-offset: 2px;
}

.bc-diary-empty {
  padding: 20px 16px;
  border-radius: 12px;
  border: 1px dashed #284060;
  background: rgba(255,255,255,0.02);
  color: #9ab0c9;
  font-size: 13px;
  text-align: center;
}

/* ---- Share fallback overlay --------------------------------------------- */
.bc-share-fallback {
  position: fixed; inset: 0;
  z-index: var(--z-sheet);
  opacity: 0;
  transition: opacity 180ms ease;
  pointer-events: none;
}
.bc-share-fallback.open { opacity: 1; pointer-events: auto; }

.bc-share-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.bc-share-card {
  position: absolute; left: 50%; top: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(92vw, 420px);
  max-height: 88vh;
  overflow: auto;
  background: #0d1b2e;
  border: 1px solid #1f3352;
  border-radius: 16px;
  padding: 18px 18px 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
  transition: transform 220ms cubic-bezier(.22,.9,.32,1);
  color: #fff;
}
.bc-share-fallback.open .bc-share-card { transform: translate(-50%, -50%) scale(1); }

.bc-share-close {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,0.06);
  color: #fff;
  font-size: 20px; line-height: 1;
  cursor: pointer;
}
.bc-share-close:hover { background: rgba(255,255,255,0.12); }
.bc-share-head { font-size: 16px; font-weight: 700; margin-bottom: 12px; padding-right: 28px; }

.bc-share-preview {
  display: block;
  width: 100%;
  max-height: 240px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 12px;
  background: #0a1420;
}
.bc-share-caption {
  width: 100%;
  min-height: 76px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #1f3352;
  background: #0a1624;
  color: #cbd9e8;
  font-family: inherit;
  font-size: 13px;
  resize: vertical;
  margin-bottom: 12px;
}

.bc-share-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bc-share-btn {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #1f3352;
  background: #13253d;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}
.bc-share-btn:hover { background: #1a3155; border-color: #2a4a7a; transform: translateY(-1px); }
.bc-share-btn:active { transform: translateY(0); }

.bc-share-fb { background: #1877f2; border-color: #1877f2; }
.bc-share-fb:hover { background: #1464d0; border-color: #1464d0; }
.bc-share-ig {
  background: linear-gradient(135deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
  border-color: #cc2366;
}
.bc-share-ig:hover { filter: brightness(1.1); }

.bc-share-hint {
  margin: 10px 0 0;
  font-size: 11px;
  color: #7e94ad;
  text-align: center;
}

/* ============================================================================
 * v63.9.16 — Unified Gallery overlay
 * Shown by window.Gallery.open(). Lives in the BCv63 overlay chrome so it
 * inherits the navy panel background + close button automatically.
 * ============================================================================ */
.v63-gallery-head {
  padding: 12px 16px 4px;
}
.v63-gallery-head-main {
  font: 700 15px/1.25 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #e7eef6;
}
.v63-gallery-head-hint {
  margin-top: 2px;
  font: 500 12px/1.3 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: #8ca3bd;
}

.v63-gallery-empty {
  padding: 36px 20px;
  text-align: center;
  color: #c3d1e0;
}
.v63-gallery-empty h3 {
  margin: 0 0 8px;
  font: 700 17px/1.2 system-ui, -apple-system, sans-serif;
  color: #e7eef6;
}
.v63-gallery-empty p {
  margin: 0;
  font-size: 13.5px;
  color: #8ca3bd;
  max-width: 340px;
  margin: 0 auto;
}

.v63-gallery-section {
  padding: 12px 16px 20px;
}

.v63-gallery-day-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 10px;
  cursor: default;
}
.v63-gallery-day-head[data-day] {
  cursor: pointer;
  transition: border-color .15s ease;
}
.v63-gallery-day-head[data-day]:hover {
  border-bottom-color: rgba(11, 180, 200, 0.6);
}
.v63-gallery-day-head h4 {
  margin: 0;
  font: 700 14px/1.25 system-ui, -apple-system, sans-serif;
  color: #e7eef6;
  letter-spacing: 0.01em;
}
.v63-gallery-day-head span {
  font: 600 11.5px/1.2 system-ui, -apple-system, sans-serif;
  color: #7e94ad;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.v63-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
}

.v63-gallery-tile {
  position: relative;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  border-radius: 10px;
  overflow: hidden;
  display: block;
  text-align: left;
  color: inherit;
  font: inherit;
  transition: transform .12s ease, box-shadow .12s ease;
}
.v63-gallery-tile:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
}
.v63-gallery-tile:focus-visible {
  outline: 2px solid #0bb4c8;
  outline-offset: 2px;
}

.v63-gallery-tile-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;           /* matches iPhone portrait photos, no crop */
  background: #0e1a27;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.v63-gallery-tile-inner img {
  width: 100%;
  height: 100%;
  object-fit: contain;            /* never crop Brett's fish */
  display: block;
}
.v63-gallery-tile-ph,
.v63-gallery-tile-err {
  font: 500 11px/1.3 system-ui, -apple-system, sans-serif;
  color: #5d7389;
  padding: 8px;
  text-align: center;
}
.v63-gallery-tile-err {
  color: #b88;
}

.v63-gallery-tile-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 2px 2px;
}
.v63-gallery-sp {
  font: 700 12px/1.2 system-ui, -apple-system, sans-serif;
  color: #e7eef6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
  min-width: 0;
}
.v63-gallery-len {
  font: 600 11px/1.2 system-ui, -apple-system, sans-serif;
  color: #7ff0fb;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* Mobile tweaks */
@media (max-width: 740px) {
  .v63-gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 6px;
  }
  .v63-gallery-section {
    padding: 10px 12px 16px;
  }
  .v63-gallery-head {
    padding: 10px 12px 2px;
  }
}
