/*
 * Player Lens integration bridge
 * Stage 3: make /player-lens/ feel like a section of プロ野球観戦メモ
 * while keeping Player Lens' teal data identity and existing functionality.
 */

body.pbwg-integrated-player-lens {
  --bg: #fffaf1;
  --paper: #ffffff;
  --ink: #233044;
  --muted: #667085;
  --line: #eadfcf;
  --line-strong: #d9cbb8;
  --shadow: 0 14px 32px rgba(80, 50, 20, 0.07);
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.035) 0 1px, transparent 1px 100%),
    linear-gradient(0deg, rgba(15, 118, 110, 0.03) 0 1px, transparent 1px 100%),
    var(--bg);
  background-size: 36px 36px;
}

.pbwg-bridge-header,
.pbwg-bridge-header * {
  box-sizing: border-box;
}

.pbwg-bridge-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  border-bottom: 1px solid #eadfcf;
  background: rgba(255, 250, 241, 0.96);
  color: #233044;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  backdrop-filter: blur(10px);
}

.pbwg-bridge-inner {
  display: flex;
  width: min(1080px, 92vw);
  min-height: 68px;
  margin-inline: auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.pbwg-bridge-brand {
  display: flex;
  min-width: max-content;
  align-items: center;
  gap: 11px;
  color: #233044 !important;
  text-decoration: none !important;
}

.pbwg-bridge-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #f3b23c, #fff0c2);
  box-shadow: 0 10px 24px rgba(80, 50, 20, 0.09);
  font-size: 20px;
}

.pbwg-bridge-brand-copy strong,
.pbwg-bridge-brand-copy small {
  display: block;
}

.pbwg-bridge-brand-copy strong {
  color: #233044;
  font-size: 16px;
  line-height: 1.25;
}

.pbwg-bridge-brand-copy small {
  margin-top: 2px;
  color: #667085;
  font-size: 11px;
  line-height: 1.3;
}

.pbwg-bridge-nav {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.pbwg-bridge-nav a {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  color: #233044 !important;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none !important;
  white-space: nowrap;
}

.pbwg-bridge-nav a:hover {
  background: #fff1d6;
}

.pbwg-bridge-nav a.is-current {
  border: 1px solid #acd7d0;
  background: #e4f4f1;
  color: #0b5f59 !important;
}

/* Player Lens remains teal, but its surrounding surfaces now match the parent site. */
body.pbwg-integrated-player-lens .topbar,
body.pbwg-integrated-player-lens .page-header {
  background: #ffffff;
  border-bottom-color: var(--line);
}

body.pbwg-integrated-player-lens > .site-nav {
  border-bottom-color: var(--line);
  background: rgba(255, 250, 241, 0.96);
}

body.pbwg-integrated-player-lens > .site-nav a {
  border-radius: 999px;
}

body.pbwg-integrated-player-lens .content-card,
body.pbwg-integrated-player-lens .intro-band,
body.pbwg-integrated-player-lens .focus-band,
body.pbwg-integrated-player-lens .ranking-panel,
body.pbwg-integrated-player-lens .detail-panel,
body.pbwg-integrated-player-lens .control-band,
body.pbwg-integrated-player-lens .data-status-panel,
body.pbwg-integrated-player-lens .recent-home-panel,
body.pbwg-integrated-player-lens .watch-note-bridge {
  border-color: var(--line);
  box-shadow: var(--shadow);
}

body.pbwg-integrated-player-lens .site-footer {
  border-top-color: var(--line);
  background: #fff4df;
}

body.pbwg-integrated-player-lens .site-footer a {
  color: #5b4b33;
}

/* The parent header owns the sticky top edge. Keep the data detail panel below it. */
body.pbwg-integrated-player-lens .detail-panel {
  top: 84px;
}

@media (max-width: 900px) {
  .pbwg-bridge-inner {
    width: 100%;
    min-height: 0;
    padding: 8px 12px;
  }

  .pbwg-bridge-brand-copy small {
    display: none;
  }

  .pbwg-bridge-nav {
    margin-left: auto;
  }

  .pbwg-bridge-nav a {
    padding: 7px 9px;
    font-size: 11px;
  }
}

@media (max-width: 640px) {
  .pbwg-bridge-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
  }

  .pbwg-bridge-brand-copy {
    display: none;
  }

  .pbwg-bridge-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 18px;
  }

  .pbwg-bridge-nav {
    width: 100%;
  }

  body.pbwg-integrated-player-lens .detail-panel {
    top: auto;
  }
}
