/* Timed figures live inside the existing room or pool scene. */
.room-stage,
#pool-stage,
.room-ascii,
#pool-ascii {
  position: relative;
}

.scene-cameo {
  position: absolute;
  z-index: 12;
  right: 1.5%;
  bottom: 1.5%;
  display: flex;
  align-items: flex-end;
  gap: clamp(.35rem, 1.1vw, .75rem);
  width: clamp(14rem, 42%, 24rem);
  margin: 0;
  padding: 0;
  color: #171717;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.35;
  pointer-events: none;
  isolation: isolate;
  animation: scene-cameo-arrive .32s ease-out both;
}

.scene-cameo.cameo--dad {
  right: auto;
  left: 1.5%;
}

.scene-cameo.cameo--katherine {
  flex-direction: row-reverse;
}

.cameo-figure {
  display: block;
  flex: 0 0 clamp(5rem, 39%, 9.5rem);
  min-width: 0;
  color: inherit;
  pointer-events: auto;
  filter: drop-shadow(0 .2rem .24rem rgba(0, 0, 0, .32));
}

a.cameo-figure {
  cursor: pointer;
  text-decoration: none;
}

a.cameo-figure:hover,
a.cameo-figure:focus-visible {
  transform: translateY(-2px);
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.cameo-sprite {
  display: block;
  width: 100%;
  min-height: 1px;
  background-repeat: no-repeat;
  mask-repeat: no-repeat;
  mask-mode: luminance;
  -webkit-mask-repeat: no-repeat;
}

.cameo-sprite.is-pixel {
  image-rendering: pixelated;
}

.cameo-text-figure {
  display: grid;
  place-items: end center;
  min-height: 7rem;
  color: currentColor;
  font: clamp(.56rem, 1.2vw, .8rem)/1.05 "Courier New", monospace;
  text-align: left;
  white-space: pre;
}

.cameo-bubble {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  max-height: 12rem;
  margin: 0 0 12%;
  padding: clamp(.55rem, 1.3vw, .8rem);
  overflow: auto;
  color: #171717;
  border: 2px solid #171717;
  border-radius: .8rem;
  background: #fffef2;
  box-shadow: .18rem .22rem 0 rgba(0, 0, 0, .4);
  font: 600 clamp(14px, 1.35vw, 16px)/1.35 Arial, Helvetica, sans-serif;
  text-align: left;
  overflow-wrap: anywhere;
  pointer-events: auto;
}

button.cameo-bubble {
  appearance: none;
  cursor: pointer;
}

button.cameo-bubble:hover,
button.cameo-bubble:focus-visible {
  background: #fff7bd;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.cameo-speaker {
  display: block;
  margin-bottom: .25rem;
  font-size: 14px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.cameo-copy {
  display: block;
}

.cameo-close {
  position: absolute;
  z-index: 2;
  top: -.35rem;
  right: -.35rem;
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  color: #111;
  border: 1px solid #111;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
  font: 700 1.15rem/1 Arial, sans-serif;
  cursor: pointer;
  pointer-events: auto;
}

.cameo-close:hover,
.cameo-close:focus-visible {
  color: #fff;
  background: #111;
  outline: 3px solid #fff;
  outline-offset: 2px;
}

body[data-year="1992"] .cameo-bubble {
  border-radius: 0;
  background: #e5e5e5;
  box-shadow: 2px 2px 0 #111;
  font-family: "Courier New", monospace;
}

body:is([data-year="1997"], [data-year="1998"]) .cameo-bubble {
  border-color: #122d78;
  border-radius: 0;
  background: #fff;
  box-shadow: 3px 3px 0 #7b7b7b;
  font-family: "Trebuchet MS", Arial, sans-serif;
}

body:is([data-year="2001"], [data-year="2002"], [data-year="2003"]) .cameo-bubble {
  border-color: #315da8;
  border-radius: .2rem;
  background: #f3f7ff;
  box-shadow: 3px 3px 0 #87a7d4;
}

body:is([data-year="2006"], [data-year="2007"]) .cameo-bubble {
  border-color: #4c8eac;
  background: linear-gradient(#fff, #e4f6ff);
  box-shadow: 0 .22rem .5rem rgba(30, 81, 105, .35);
}

body[data-year="2012"] .cameo-bubble {
  border-color: #6d3d93;
  background: #fff8ff;
}

body:is([data-year="2017"], [data-year="2020"], [data-year="2022"]) .cameo-bubble {
  color: #f3f3f3;
  border-color: #17181c;
  background: #2d3037;
  box-shadow: 0 .25rem .7rem rgba(0, 0, 0, .45);
}

body[data-year="2026"] .cameo-bubble {
  border-width: 1px;
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 400;
}

@keyframes scene-cameo-arrive {
  from { opacity: 0; transform: translateY(8%); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .scene-cameo,
  .scene-cameo.cameo--dad {
    right: 1%;
    left: auto;
    bottom: 1%;
    width: min(94%, 22rem);
  }
  .scene-cameo.cameo--dad { flex-direction: row; }
  .scene-cameo.cameo--katherine { flex-direction: row-reverse; }
  .cameo-figure { flex-basis: clamp(4.5rem, 34%, 7.5rem); }
  .cameo-bubble { margin-bottom: 5%; font-size: clamp(14px, 3vw, 15px); }
}

@media (max-width: 390px) {
  .scene-cameo,
  .scene-cameo.cameo--dad {
    width: 98%;
  }
  .cameo-figure { flex-basis: 31%; }
  .cameo-bubble { max-height: 9rem; padding: .48rem; }
  .cameo-close { top: -.2rem; right: -.1rem; width: 1.65rem; height: 1.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  .scene-cameo { animation: none; }
  a.cameo-figure:hover,
  a.cameo-figure:focus-visible { transform: none; }
}

.cameo--dad .cameo-figure{filter:none}
