/* ============================================================
   PCBGames — GeoCities theme: game detail page styles (PH-13)
   game.html loads css/style.css (the shared page shell, game table
   and hit counter) first and this file second. It holds what only
   the detail page has: the title and genre tags, the screenshot
   image box and its lightbox, the NeoQ age-gate button, the
   comment form and list, the .morelist cross-links and the
   not-found sign. The .spec-table is in css/style.css.

   js/game-detail.js builds the slider, the lightbox, the genre
   tags and the comments, so the class names it writes
   (.screenshot-slide, .screenshot-img, .screenshot-video, .dot-btn,
   .genre-tag, .age-tag, .terminal-line, .system-line, .spec-unknown,
   .delete-comment-btn, .cur) are load-bearing here.
   ============================================================ */

/* js sets display:grid inline; one column that may shrink below the
   slider's content width */
#detail-container { grid-template-columns: minmax(0, 1fr); }

/* ---------- Title + genre tags ---------- */

.ph.gtitle { font-size: 18px; margin-top: 4px; }
#game-genres { margin: 0 0 10px; }
#game-genres .genre-tag::before { content: '[ '; }
#game-genres .genre-tag::after  { content: ' ] '; }
#game-genres .age-tag {
  display: inline-block;
  background: #c00;
  color: #fff;
  font-family: var(--font-alt);
  font-size: 10px;
  font-weight: bold;
  padding: 1px 4px;
  border: 1px solid #000;
}

/* ---------- Screenshot image box ----------
   A sunken frame on black. The slider itself is a flex strip moved
   with translateX by game-detail.js; the box clips it. */

/* width: a grid item with auto margins would otherwise shrink to the button row */
.viewer-wrap { width: 100%; max-width: 480px; margin: 0 auto 6px; }

.viewer {
  position: relative;
  aspect-ratio: 4 / 3;
  background: #000;
  border: 3px inset var(--shade);
  overflow: hidden;
  cursor: pointer;
}

.screenshot-slider {
  position: absolute;
  inset: 0;
  display: flex;
  transition: transform 0.3s ease;
  will-change: transform;
}
.screenshot-slide {
  flex: 0 0 100%;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.screenshot-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;   /* the shots are all sorts of shapes: show all of each */
  pointer-events: none;
}
.screenshot-video { display: block; }

.screenshot-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #fff;
  font-family: var(--font-ui);
  font-size: 12px;
}
.loading-text { animation: blink 1s step-end infinite; }

/* Prev / numbered buttons / Next under the picture */
.viewer-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 6px 0 2px;
}
.viewer-nav .slider-arrow { flex: none; }
.screenshot-dots { display: flex; flex-wrap: wrap; justify-content: center; gap: 3px; }
.dot-btn {
  font-family: var(--font-alt);
  font-size: 11px;
  min-width: 22px;
  padding: 1px 4px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  border: 2px outset var(--btn-edge);
  cursor: pointer;
}
.dot-btn.active { border-style: inset; background: var(--btn-down); font-weight: bold; }
.viewer-wrap .meta { margin: 2px 0 0; }

/* ---------- Spec sheet ----------
   .spec-table itself is in css/style.css (about.html uses it too). */

.spec-unknown { color: var(--text-off); font-style: italic; }

.gdesc { font-size: 16px; margin: 10px 0; }
.play { margin: 12px 0 4px; }
.play .btn { font-size: 14px; padding: 4px 16px; }
.btn.adult { background: var(--btn-adult); }   /* NeoQ: same pink as its homepage row */

/* ---------- Not-found sign ---------- */

.notfound {
  background: var(--note-bg);
  border: 3px double var(--alert);
  padding: 6px 10px;
  text-align: center;
}
.notfound-h { font-family: var(--font-alt); font-weight: bold; color: var(--alert); }
.notfound-h img { vertical-align: middle; image-rendering: pixelated; }

/* ---------- Comment form (the feedback terminal) ----------
   .form-row is display:flex because setAdminUI() puts it back with
   style.display = 'flex' after a /logout. */

.cform {
  background: var(--box-bg);
  border: 2px outset var(--bevel);
  padding: 8px;
  font-family: var(--font-alt);
  font-size: 13px;
}
.cform .form-row { display: flex; align-items: center; gap: 6px; margin: 0 0 6px; }
.cform label { flex: none; width: 70px; font-weight: bold; }
.cform input {
  flex: 1;
  min-width: 0;
  font-family: var(--font-alt);
  font-size: 13px;
  border: 2px inset var(--bevel);
  background: var(--field-bg);
  color: var(--field-fg);
  padding: 2px 4px;
}
.cform input:disabled { background: var(--field-off); }
.cform .form-row.submit { margin: 2px 0 0 76px; }
.cstatus:empty { display: none; }
.cstatus {
  margin-top: 6px;
  padding: 3px 6px;
  background: var(--status-bg);
  border: 1px solid var(--shade);
  font-family: var(--font-ui);
  font-size: 11px;
}

/* the comment list, newest first */
.clist { margin: 10px 0; }
.clist-h { font-family: var(--font-ui); font-size: 11px; color: var(--text-dim); margin: 0 0 4px; }
.clist-empty { font-style: italic; color: var(--text-dim); }
.clist .terminal-line {
  border: 1px solid var(--shade);
  background: var(--row-alt);
  margin: 0 0 6px;
  padding: 4px 8px;
}
.clist .terminal-line:nth-child(odd) { background: var(--sheet); }
.comment-meta { font-family: var(--font-ui); font-size: 11px; color: var(--text-dim); border-bottom: 1px dotted var(--shade); padding-bottom: 2px; }
.comment-header { color: var(--heading); }
.comment-body { margin: 4px 0 2px; overflow-wrap: anywhere; }
.btn.delete-comment-btn { font-size: 10px; padding: 0 6px; margin-left: 6px; color: var(--alert); }

/* ---------- More-games cross-links (right column) ---------- */

.morelist a { display: block; padding: 2px 0; }
.morelist a::before { content: '\00bb  '; color: var(--text); }
.morelist a.cur { font-weight: bold; color: var(--text); text-decoration: none; }
.morelist a.cur::after { content: ' \2190 here'; font-weight: normal; font-size: 10px; color: var(--text-soft); }
.morelist em { font-style: normal; font-size: 10px; color: var(--text-soft); }
.morelist em.adult { color: var(--red-text); font-weight: bold; }

/* ---------- Lightbox (full-size screenshot) ---------- */

.lightbox-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
}
.lightbox-close {
  position: absolute;
  top: 10px;
  right: 18px;
  font: bold 36px var(--font-alt);
  color: #fff;
  cursor: pointer;
  z-index: 10002;
  user-select: none;
}
.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  padding: 6px 12px;
  z-index: 10001;
}
#lightbox-prev { left: 20px; }
#lightbox-next { right: 20px; }
.lightbox-content-container {
  position: relative;
  width: 80%;
  height: 80%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.lightbox-image-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border: 3px outset var(--bevel);
  background: #000;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: center center;
}
.lightbox-caption { margin-top: 10px; color: #fff; font: bold 13px var(--font-ui); }
.lightbox-hint    { margin-top: 4px; color: #ccc; font: 11px var(--font-ui); }

/* ---------- Phones ---------- */

@media (max-width: 700px) {
  .ph.gtitle { font-size: 15px; }
  .viewer-wrap { max-width: none; }
  .cform label { width: 62px; }
  .cform .form-row.submit { margin-left: 0; }
  .lightbox-content-container { width: 95%; height: 70%; }
  #lightbox-prev { left: 6px; }
  #lightbox-next { right: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .loading-text { animation: none; }
  .screenshot-slider { transition: none; }
}
