/* The original 512 × 256 scene placement remains the ground coordinate.
   The normalized 512 × 352 poses have 96px of transparent headroom above it. */
.tunafish-surface {
  position: absolute;
  display: block;
  pointer-events: none;
  user-select: none;
}
.tunafish-rest,
.tunafish-canvas {
  position: absolute;
  display: block;
  left: 0;
  top: -37.5%;
  width: 100%;
  height: 137.5%;
  max-width: none;
  pointer-events: none;
  user-select: none;
}
.tunafish-canvas { visibility: hidden; }
.tunafish-surface[data-cat-ready='true'] .tunafish-canvas { visibility: visible; }
.tunafish-surface[data-cat-ready='true'] .tunafish-rest { visibility: hidden; }

/* One narrow row on the existing caption. The irregular paper face stays
   smaller than its native button's touch target. */
.immersive .cat-actions {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  margin: 6px -2px -3px;
}
.immersive .cat-actions .paper-button {
  flex: 1 1 0;
  min-width: 44px;
  min-height: 36px;
  padding: 8px 7px;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  --paper-inset-y: 3px;
}
.immersive .cat-actions .paper-button:nth-child(even) { --paper-tilt: .6deg; }

/* Reserve the same three lines for the introduction and every response.
   The buttons keep their position through pet, treat, and queue changes;
   native overflow still works at larger text sizes or in short viewports. */
.immersive .scene-note[data-object-id='cat'] #sceneNoteText {
  height: 4.05em;
  min-height: 4.05em;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.immersive .cat-actions .paper-button[data-cat-feedback='playing'],
.immersive .cat-actions .paper-button[data-cat-feedback='resting'] {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.immersive .cat-actions .paper-button[data-cat-feedback='loading'],
.immersive .cat-actions .paper-button[data-cat-feedback='queued'] {
  text-decoration: underline dotted;
  text-underline-offset: 3px;
}
@media (prefers-reduced-motion: no-preference) {
  .immersive .scene-note[data-object-id='cat'][data-cat-opening='true'] {
    animation: cat-caption-in 160ms ease-out both;
  }
}
@keyframes cat-caption-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
