/* ============================
   DAILY PAGE (isolated styles)
   ============================ */

/* Full-bleed ONLY for daily */
body.pg-daily main {
  max-width: none;
  padding: 0;
}

/* Game shell: exactly fills the viewport, no scroll */
body.pg-daily {
  overflow: hidden;
  height: 100vh;
}

.pg-daily-shell {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr; /* header / stage only */
  overflow: hidden;
  position: relative; /* anchor for floating controls */
}

/* Minimal header */
.pg-daily-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 20px;
  flex-shrink: 0;
}

.pg-daily-header a {
  text-decoration: none;
  color: var(--text);
  font-weight: 800;
}

.pg-round {
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--guessr);
  letter-spacing: -0.01em;
}

/* Stage area: fills remaining space exactly */
.pg-stage {
  width: 100%;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  min-height: 0; /* critical: allows grid child to shrink */
}

/* Photo-only mode */
.pg-stage.is-photo-only {
  display: grid;
  place-items: center;
}

.pg-stage.is-photo-only .pg-map-panel { display: none; }

.pg-stage.is-photo-only .pg-photo-panel {
  width: 100%;
  height: 100%;
  background: var(--bg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* Split mode */
.pg-stage.is-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

@media (max-width: 900px) {
  .pg-stage.is-split {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 380px;
  }
}

.pg-stage.is-split .pg-photo-panel {
  width: 100%;
  height: 100%;
  background: var(--bg);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ---- Photo panel base ---- */
/* Vignette — subtle depth without distracting from the photo */
.pg-photo-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at center,
    transparent 58%,
    rgba(10, 13, 29, 0.3) 100%
  );
  pointer-events: none;
  z-index: 2;
}

.pg-photo-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}

/* The actual image — transform-origin handled by JS */
.pg-photo-panel > img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  image-rendering: auto;
  transition: transform 0.05s ease;
  user-select: none;
  -webkit-user-drag: none;
  will-change: transform;
}

/* When zoomed in, cursor changes to grab/grabbing */
.pg-photo-panel.is-zoomed {
  cursor: grab;
}
.pg-photo-panel.is-zoomed.is-dragging {
  cursor: grabbing;
}

/* ---- Fullscreen button ---- */
.pg-fullscreen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 6px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
  padding: 0;
}

.pg-fullscreen-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.pg-fullscreen-btn svg {
  width: 16px;
  height: 16px;
  pointer-events: none;
}

/* social overlay — see floating controls section */

/* ---- Map panel ---- */
.pg-map-panel {
  position: relative;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 5;
  pointer-events: auto;
}

#map {
  width: 100%;
  height: 100%;
  z-index: 6;
}

/* ---- Social chip — photo credit ---- */
.pg-social-overlay {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 60%;
  z-index: 3;
  pointer-events: auto;
}

.pg-social-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(10, 13, 29, 0.72);
  border: 1px solid rgba(241, 232, 230, 0.15);
  color: var(--color-light);
  border-radius: var(--radius-pill);
  padding: 5px 11px;
  font-size: 0.72rem;
  font-weight: 500;
  text-decoration: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.pg-social-chip::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-accent);
  flex-shrink: 0;
}
.pg-social-chip:hover {
  background: rgba(10, 13, 29, 0.9);
  border-color: rgba(241, 232, 230, 0.3);
  text-decoration: none;
  color: var(--color-light);
}

/* ---- Floating controls — bottom-right of shell ---- */
/* ---- Bottom compact control dock ---- */
.pg-controls {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);

  z-index: 20;

  width: fit-content;
  max-width: calc(100vw - 24px);

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;

  padding:
    11px
    18px
    calc(11px + env(safe-area-inset-bottom));

  background: var(--surface-transparent);
  border: 1px solid var(--border);
  border-bottom: 0;

  border-radius: 22px 22px 0 0;

  box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.14);

  backdrop-filter: blur(1.5px);
  -webkit-backdrop-filter: blur(1.5px);

  pointer-events: none;
}

/* Button row is now only layout, not its own visual pill */
.pg-btn-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;

  pointer-events: auto;
}

/* Hint is now text inside the dock, not a separate pill */
.pg-hint {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  line-height: 1.25;
  color: rgba(241, 232, 230, 0.74);

  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;

  text-align: center;
  white-space: normal;
  max-width: min(88vw, 440px);

  pointer-events: none;
}

/* Map toggle icon button */
.pg-toggle-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--color-light);
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  flex-shrink: 0;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease,
    transform 0.1s ease,
    box-shadow 0.18s ease;
}

.pg-toggle-icon {
  width: 17px;
  height: 17px;
  display: block;
  pointer-events: none;

  background: currentColor;

  -webkit-mask-image: var(--toggle-icon);
  mask-image: var(--toggle-icon);

  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;

  -webkit-mask-position: center;
  mask-position: center;

  -webkit-mask-size: contain;
  mask-size: contain;

  opacity: 0.82;
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.pg-toggle-btn:hover {
  background: rgba(241, 232, 230, 0.1);
  border-color: var(--border-hover);
  color: var(--color-light);
}

.pg-toggle-btn:hover .pg-toggle-icon {
  opacity: 1;
  transform: scale(1.05);
}

/* Active state — map is open */
.pg-toggle-btn.is-active {
  background: var(--color-light);
  color: var(--color-dark);
}

.pg-toggle-btn.is-active:hover {
  background: var(--text-muted);
}

.pg-toggle-btn.is-active .pg-toggle-icon {
  opacity: 1;
  transform: scale(1.05);
}

.pg-toggle-btn.is-active:hover .pg-toggle-icon {
  opacity: 1;
  transform: scale(1);
}

.pg-toggle-btn[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Divider between toggle and CTA */
.pg-btn-divider {
  width: 1px;
  height: 22px;
  background: rgba(241, 232, 230, 0.12);
  flex-shrink: 0;
}

/* CTA morphing button (submit and next round) */
.pg-cta-btn {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: var(--radius-pill);
  min-height: 36px;
  padding: 0.55rem 1.1rem;
  cursor: not-allowed;
  white-space: nowrap;
  border: 1.5px solid var(--border);
  background: var(--surface-2);
  color: var(--text-subtle);
  transition: background 0.18s ease, border-color 0.18s ease,
              color 0.18s ease, transform 0.1s ease;
  line-height: 1;
  display: inline-flex;
  align-items: center;
}

.pg-cta-btn.is-ready,
.pg-cta-btn.is-next {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--color-light);
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(223, 25, 25, 0.22);
}

.pg-cta-btn.is-ready:hover,
.pg-cta-btn.is-next:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.pg-daily-brand img {
  height: 38px;
  width: auto;
  display: block;
}