/* Gallery Pass page layer on top of /styles.css (the shared Loopline system). */

.theme-gallery-pass {
  --a1: #e9b949;            /* gilded frame gold */
  --a2: #8ec5e8;            /* painted sky */
  --gold-deep: #c8952c;
  --night: #1f2a44;
  --ticket: #f6ebd3;
  --grad: linear-gradient(120deg, var(--a1), var(--a2));
}

/* ---------------------------------------------------------------- brand */
.gp-mark { padding: 0; overflow: hidden; background: var(--night); }
.gp-mark img { display: block; width: 100%; height: 100%; }

/* ----------------------------------------------------------------- hero */
.gp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 48px;
  align-items: center;
  padding-top: 36px;
}
.gp-hero .hero-title { font-size: clamp(2.6rem, 5.6vw, 5.4rem); }
.theme-gallery-pass .grad-text { padding-right: 0.14em; margin-right: -0.14em; }
.gp-hero__copy { display: grid; gap: 22px; }

.gp-ticket-wrap { display: grid; gap: 10px; }
.gp-ticket-label { color: var(--muted); font-family: var(--font-mono); font-size: 0.8rem; }
.gp-ticket {
  position: relative;
  width: min(100%, 360px);
  height: 168px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 1000px;
  font: inherit;
  color: inherit;
  text-align: left;
}
.gp-ticket:focus-visible { outline: 3px solid var(--a2); outline-offset: 6px; border-radius: 22px; }
.gp-ticket__inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 700ms cubic-bezier(0.3, 1.25, 0.4, 1);
}
.gp-ticket.is-flipped .gp-ticket__inner { transform: rotateY(180deg); }
.gp-ticket:hover .gp-ticket__inner { translate: 0 -3px; }
.gp-ticket__face {
  position: absolute;
  inset: 0;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 18px 30px;
  border-radius: 20px;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--ticket);
  color: #2a1d06;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  /* ticket notches */
  -webkit-mask: radial-gradient(circle 13px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 13px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 13px at 0 50%, transparent 98%, #000) left / 51% 100% no-repeat,
                radial-gradient(circle 13px at 100% 50%, transparent 98%, #000) right / 51% 100% no-repeat;
}
.gp-ticket__face::after {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1.5px dashed color-mix(in srgb, var(--gold-deep) 70%, transparent);
  border-radius: 13px;
  pointer-events: none;
}
.gp-ticket__face--back { transform: rotateY(180deg); background: linear-gradient(135deg, #fff6df, var(--ticket)); }
.gp-ticket__kicker { font: 800 0.74rem var(--font-mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--gold-deep); }
.gp-ticket__title { font: 800 1.7rem/1.05 var(--font-display); letter-spacing: -0.03em; }
.gp-ticket__sub { font-size: 0.92rem; color: #5b4a2a; }
.gp-ticket__row { display: flex; align-items: center; gap: 12px; }
.gp-ticket__icon { width: 44px; height: 44px; flex: none; color: var(--night); }
.gp-ticket__icon svg { display: block; width: 100%; height: 100%; }
.gp-ticket__face--back .gp-ticket__icon { color: var(--gold-deep); }
.gp-visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.gp-hunt-head .game-hint { display: block; }

/* gilded frame + mosaic canvas */
.gp-stage { position: relative; display: grid; justify-items: center; gap: 18px; }
.gp-frame {
  position: relative;
  width: min(100%, 520px);
  padding: 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f1cf6d, var(--gold-deep) 35%, #f6d986 55%, var(--gold-deep) 80%, #e9b949);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55), inset 0 0 0 2px rgba(255, 255, 255, 0.25);
}
.gp-frame::before {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(80, 50, 0, 0.35);
  border-radius: 6px;
  pointer-events: none;
}
.gp-frame canvas { display: block; width: 100%; height: auto; border-radius: 3px; background: #ddd2bb; }
.gp-plaque {
  min-width: 240px;
  max-width: 100%;
  padding: 10px 18px;
  border-radius: 10px;
  background: linear-gradient(180deg, #2a2f3d, #1b1f2a);
  border: 1px solid var(--line-hi);
  text-align: center;
}
.gp-plaque strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.05rem; }
.gp-plaque span { color: var(--muted); font-size: 0.85rem; font-style: italic; }
.gp-float {
  position: absolute;
  z-index: 2;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-hi);
  background: rgba(10, 12, 20, 0.75);
  backdrop-filter: blur(8px);
  color: var(--ink);
  font: 600 0.78rem var(--font-mono);
  white-space: nowrap;
  animation: gp-bob 5s ease-in-out infinite;
}
.gp-float--1 { top: -12px; left: -6px; }
.gp-float--2 { bottom: 64px; right: -10px; animation-delay: -2.5s; }
@keyframes gp-bob { 50% { translate: 0 -8px; } }

.gp-soon { display: flex; flex-wrap: wrap; gap: 10px; }
.gp-soon .sticker { color: var(--ink); }

/* ----------------------------------------------------------- six modes */
.gp-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gp-mode {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 22px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: inherit;
}
.gp-mode svg { width: 40px; height: 40px; color: var(--a1); }
.gp-mode h3 { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: 1.25rem; }
.gp-mode p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.gp-mode__kind { color: var(--a2); font: 600 0.72rem var(--font-mono); text-transform: uppercase; letter-spacing: 0.14em; }
.gp-mode__cta { color: var(--a1); font: 600 0.8rem var(--font-mono); }

/* ----------------------------------------------------------- demo shared */
.gp-demo { --c: var(--a1); }
.gp-demo .game-area { align-content: start; min-height: 0; }
.gp-status { margin: 0; min-height: 1.4em; color: var(--text); font-size: 0.92rem; }
.gp-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.gp-art-wrap { position: relative; width: 100%; border-radius: 10px; overflow: hidden; touch-action: manipulation; }
.gp-art-wrap img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.gp-ring {
  position: absolute;
  border: 3px solid #2ee6a6;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.35), 0 0 18px rgba(46, 230, 166, 0.5);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.4);
  opacity: 0;
  animation: gp-pop 380ms cubic-bezier(0.3, 1.6, 0.5, 1) forwards;
}
.gp-ring--hint { border-color: var(--a1); box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3), 0 0 22px color-mix(in srgb, var(--a1) 60%, transparent); }
@keyframes gp-pop { to { transform: translate(-50%, -50%) scale(1); opacity: 1; } }
.gp-miss { animation: gp-shake 300ms ease; }
@keyframes gp-shake { 25% { translate: -5px 0; } 75% { translate: 5px 0; } }
.gp-credit { margin: 0; color: var(--dim); font: 0.72rem var(--font-mono); }

/* tile swap */
.gp-tiles { display: grid; gap: 3px; width: 100%; border-radius: 10px; overflow: hidden; }
.gp-tile {
  aspect-ratio: var(--tile-aspect, 1);
  padding: 0;
  border: 0;
  background-repeat: no-repeat;
  cursor: pointer;
  transition: transform 180ms ease, filter 180ms ease, outline-color 180ms ease;
  outline: 3px solid transparent;
  outline-offset: -3px;
}
.gp-tile:hover { filter: brightness(1.08); }
.gp-tile.is-selected { outline-color: var(--a2); transform: scale(0.94); }
.gp-tile.is-home { cursor: default; }
.gp-tiles.is-solved { gap: 0; transition: gap 400ms ease; }

/* paint by number */
.gp-paint { display: grid; width: 100%; border-radius: 8px; overflow: hidden; touch-action: none; user-select: none; background: #f4f1ea; }
.gp-cell {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 0.5px solid rgba(0, 0, 0, 0.08);
  padding: 0;
  background-color: #f4f1ea;
  color: #6b6f7d;
  font: 700 clamp(0.5rem, 1.6vw, 0.72rem) var(--font-mono);
  background-repeat: no-repeat;
  cursor: crosshair;
}
.gp-cell.is-target { background-color: color-mix(in srgb, var(--swatch) 32%, #f4f1ea); color: #2d3140; }
.gp-cell.is-painted { color: transparent; border-color: transparent; }
.gp-palette { display: flex; flex-wrap: wrap; gap: 8px; }
.gp-swatch {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.85);
  background: var(--swatch);
  color: var(--swatch-ink);
  font: 800 0.9rem var(--font-mono);
  cursor: pointer;
  transition: transform 160ms ease;
}
.gp-swatch[aria-pressed="true"] { transform: scale(1.12); box-shadow: 0 0 0 3px var(--bg), 0 0 0 6px var(--a1); }
.gp-swatch:disabled { cursor: default; opacity: 0.55; }

/* detail hunt */
.gp-hunt-head { display: flex; align-items: center; gap: 14px; }
.gp-lens {
  width: 88px;
  height: 88px;
  flex: none;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  background-repeat: no-repeat;
  background-color: #ddd;
}
.gp-hunt-head strong { display: block; color: var(--ink); font-family: var(--font-display); font-size: 1.1rem; }
.gp-art-wrap.is-clickable { cursor: crosshair; }

/* spot the difference */
.gp-spot { display: grid; grid-template-columns: 1fr; gap: 8px; }
.gp-spot__label { position: absolute; left: 8px; top: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(0, 0, 0, 0.55); color: #fff; font: 600 0.68rem var(--font-mono); pointer-events: none; }

/* ---------------------------------------------------------------- albums */
.gp-albums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.gp-album { display: grid; gap: 14px; padding: 18px; border-radius: var(--radius-lg); }
.gp-album__covers { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.gp-album__covers img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 8px; display: block; }
.gp-album h3 { margin: 0; color: var(--ink); font-family: var(--font-display); font-size: 1.3rem; }
.gp-album p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.gp-album__count { color: var(--a1); font: 600 0.78rem var(--font-mono); }

/* stats spans for five tiles */
.gp-stats .stat--wide { grid-column: span 3; }

/* CTA art */
.gp-cta-art { position: relative; height: 220px; }
.gp-cta-art img {
  position: absolute;
  width: 46%;
  border-radius: 8px;
  border: 6px solid #f1cf6d;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}
.gp-cta-art img:nth-child(1) { left: 2%; top: 18%; rotate: -8deg; }
.gp-cta-art img:nth-child(2) { left: 28%; top: 2%; rotate: 3deg; z-index: 2; }
.gp-cta-art img:nth-child(3) { right: 0; top: 26%; rotate: 9deg; }
.gp-share {
  margin-top: 18px;
  padding: 10px 16px;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 14px;
  background: none;
  color: inherit;
  font: 700 0.95rem var(--font-body);
  cursor: pointer;
}

/* ---------------------------------------------------- legal doc additions */
.gp-table-wrap { overflow-x: auto; margin: 0 0 1.4em; }
.gp-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.gp-table th, .gp-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.gp-table th { color: var(--ink); font-weight: 700; }
.gp-table td { color: var(--text); }

/* -------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .gp-hero { grid-template-columns: 1fr; }
  .gp-stage { order: -1; }
  .gp-modes, .gp-albums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .gp-modes, .gp-albums { grid-template-columns: 1fr; }
  .gp-stats .stat--wide { grid-column: span 6; }
  .gp-ticket__title { font-size: 1.45rem; }
  .gp-float--2 { right: 0; }
  .gp-cta-art { height: 170px; }
}
@media (prefers-reduced-motion: reduce) {
  .gp-ticket__inner, .gp-tile, .gp-swatch { transition: none; }
  .gp-float { animation: none; }
  .gp-ring { animation: none; opacity: 1; transform: translate(-50%, -50%); }
}
