/* TARGET//WORLD — video card opens the explainer, one segment at a time */
.player[hidden], [hidden] { display: none !important; }
.player {
  position: fixed; inset: 0; z-index: 100;
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  padding-inline: 16px; padding-block: 14px 18px;
  background: rgba(4, 6, 9, .92);
  backdrop-filter: blur(10px);
  animation: player-in .3s ease both;
}
@keyframes player-in { from { opacity: 0; } }

.player-head { display: flex; align-items: center; gap: 16px; max-width: 1180px; width: 100%; margin: 0 auto; }
.player-head .brand { font-size: 17px; }
.seg-count { font: 500 12px/1 var(--f-mono); letter-spacing: .1em; color: var(--muted); font-variant-numeric: tabular-nums; }
.player-close {
  position: relative; margin-left: auto; flex: none;
  width: 40px; height: 40px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer;
}
.player-close::before, .player-close::after { content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 2px; background: var(--text); border-radius: 1px; }
.player-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.player-close::after { transform: translate(-50%, -50%) rotate(-45deg); }
.player-close:hover { border-color: var(--accent); }

.viewer {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 64px; align-items: center; gap: 18px;
  max-width: 1180px; width: 100%; min-height: 0; margin: 0 auto;
}
.seg-figure { position: relative; display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 0; min-height: 0; height: 100%; justify-content: center; }
.seg-frame { position: relative; display: flex; justify-content: center; min-height: 0; max-width: 100%; touch-action: pan-y; }
.seg-frame.is-missing img { visibility: hidden; }
.seg-frame.is-missing::after {
  content: "Image not found: " attr(data-file) "\A Open index.html from the website folder so the segments folder sits next to it.";
  white-space: pre-line;
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px;
  border: 1px dashed var(--line-2); border-radius: 12px; background: var(--panel);
  font: 500 13px/1.6 var(--f-mono); color: var(--muted); text-align: center;
}
.seg-frame img {
  display: block; max-width: 100%; object-fit: contain; background: var(--panel);
  border: 1px solid var(--line-2); border-radius: 12px;
  box-shadow: 0 40px 100px -30px #000;
  user-select: none; -webkit-user-drag: none;
}
.seg-frame img.enter-next { animation: seg-next .38s cubic-bezier(.2, .8, .2, 1) both; }
.seg-frame img.enter-prev { animation: seg-prev .38s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes seg-next { from { opacity: 0; transform: translateX(28px); } }
@keyframes seg-prev { from { opacity: 0; transform: translateX(-28px); } }

.seg-caption { display: grid; justify-items: center; gap: 4px; text-align: center; max-width: 60ch; }
.seg-meta { display: flex; align-items: center; gap: 12px; }
.seg-num { font: 700 13px/1 var(--f-mono); color: var(--accent-2); }
.seg-time { font: 500 12px/1 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.seg-title { font: 800 clamp(20px, 2.2vw, 26px)/1.1 var(--f-display); font-stretch: 104%; letter-spacing: -0.02em; text-transform: none; }
.seg-note { margin: 0; font-size: 14px; color: #b8bfc7; }

.seg-btn {
  position: relative; width: 64px; height: 64px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--panel-2); cursor: pointer;
  transition: background .2s, border-color .2s, transform .2s, opacity .2s;
}
.seg-btn::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 22px; height: 22px; background: var(--text);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 5l7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
}
.seg-prev::after { transform: scaleX(-1); }
.seg-btn:hover:not(:disabled) { background: var(--accent); border-color: var(--accent); transform: scale(1.05); }
.seg-btn:disabled { opacity: .3; cursor: default; }

.seg-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 0; padding: 0; list-style: none; }
.seg-dots button {
  min-width: 36px; height: 30px; padding: 0 8px;
  border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel);
  font: 500 11.5px/1 var(--f-mono); color: var(--muted); cursor: pointer;
}
.seg-dots button:hover { color: var(--text); border-color: var(--dim); }
.seg-dots button[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

@media (max-width: 720px) {
  .viewer { grid-template-columns: minmax(0, 1fr); }
  .seg-btn { position: absolute; top: 40%; z-index: 2; width: 46px; height: 46px; background: rgba(9, 12, 17, .75); }
  .seg-prev { left: 20px; }
  .seg-next { right: 20px; }
  .seg-dots button { min-width: 30px; height: 28px; padding: 0 5px; }
}
