/* ── Stele Tile Styles ── */

.tile-wrapper {
  position: relative;
  transition: box-shadow 200ms;
}

.tile-wrapper:hover canvas {
  filter: brightness(1.04);
}

/* Hint pulse: glow on non-zero tiles after idle */
.tile-wrapper.tile-hint {
  animation: tileHintPulse 1.6s ease-in-out infinite;
}

@keyframes tileHintPulse {
  0%, 100% { box-shadow: inset 0 0 0 2px transparent; }
  50%       { box-shadow: inset 0 0 0 2px rgba(139,106,63,0.6), 0 0 12px rgba(139,106,63,0.3); }
}

/* Portrait reveal on solve */
.stele-portrait-reveal {
  pointer-events: none;
}

/* Glow effect on solved portrait */
.stele-portrait-reveal.glowing {
  filter: drop-shadow(0 0 28px rgba(139,106,63,0.7)) brightness(1.05);
}

/* ── Ceiling Puzzle ── */

.back-chip {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(244,239,229,0.85);
  border: 1px solid rgba(59,46,33,0.25);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  padding: 6px 16px;
  cursor: pointer;
  z-index: 10;
  transition: background 200ms;
  white-space: nowrap;
}
.back-chip:hover { background: rgba(244,239,229,1); }

/* Hint: pulsing border over top portion of profile image */
.ceiling-hint-profile {
  pointer-events: none;
  z-index: 20;
  animation: ceilingProfilePulse 2s ease-in-out infinite;
  border-bottom: 2px dashed rgba(139,106,63,0.5);
}

@keyframes ceilingProfilePulse {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 1; }
}

/* Hint: pulsing circle over gap */
.ceiling-hint-gap {
  pointer-events: none;
  z-index: 20;
  border: 2px solid rgba(139,106,63,0.7);
  animation: ceilingGapPulse 1.4s ease-in-out infinite;
}

@keyframes ceilingGapPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(139,106,63,0); transform: scale(1); }
  50%       { box-shadow: 0 0 16px 4px rgba(139,106,63,0.35); transform: scale(1.08); }
}

/* ── Locked screen styles ── */
.puzzle-screen.locked .screen-bg {
  filter: sepia(30%) saturate(0.5) brightness(0.9);
}

/* ── Inventory fly ghost ── */
.inventory-fly-ghost {
  pointer-events: none;
  z-index: 1000;
}

/* ── End screen ── */
#end-screen {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  opacity: 0;
  transition: opacity 600ms;
}
#end-screen.visible { opacity: 1; }


.end-figures {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
}

.end-figure-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 200ms, transform 200ms;
}
.end-figure-btn:hover { opacity: 1; transform: translateY(-4px); }
.end-figure-btn img {
  display: block;
  height: clamp(80px, 18vh, 160px);
  width: auto;
  object-fit: contain;
  filter: drop-shadow(0 2px 8px rgba(59,46,33,0.18));
  user-select: none;
}

.end-actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.btn-secondary {
  padding: 8px 24px;
  background: transparent;
  border: 1px solid rgba(59,46,33,0.4);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 200ms;
}
.btn-secondary:hover { background: rgba(59,46,33,0.06); }
