/* Only the scenery is blurred during the automated attract sequence. */
main.is-preview,
main.is-playing {
  overflow: clip;
}
main .chalet-motion {
  /* Extend beyond the crop so the blur never samples transparent edges. */
  inset: -12px;
  transition: filter 350ms ease;
}
main.is-preview .chalet-motion {
  filter: blur(3px);
}
.play-scene canvas {
  transition: filter 350ms ease;
}
.play-scene.is-preview canvas {
  filter: blur(3px);
  opacity: 1;
}

/* Original unified retailer and game sign. */
main.is-preview > header,
main.is-playing > header {
  display: block;
  height: var(--intro-height, 20dvh);
  margin: 0 auto;
  width: min(100%, calc(var(--intro-height, 20dvh) * 1.5));
}
main > header::before {
  inset: 0;
  background-image: url("assets/title-sign.webp");
  clip-path: polygon(
    4% 21%,
    10% 15%,
    28% 17%,
    40% 12%,
    45% 8%,
    49% 12%,
    57% 16%,
    69% 13%,
    86% 16%,
    96% 21%,
    99% 48%,
    95% 57%,
    95% 82%,
    92% 85%,
    8% 85%,
    5% 82%,
    5% 57%,
    1% 49%
  );
  border-radius: 0;
  filter: drop-shadow(0 3px 4px #0005);
}
main > header #store-logo {
  left: 21.5%;
  top: 25%;
  width: 57%;
  height: auto;
  object-fit: contain;
}
main > header h1 {
  inset: auto;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
}
main > header h1 img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
main.is-preview.is-landscape > header,
main.is-playing.is-landscape > header {
  width: 100%;
  height: min(50dvh, 220px);
  aspect-ratio: auto;
  align-self: center;
}
main.is-playing {
  grid-template-rows: var(--intro-height) var(--board-height) var(
      --feedback-height
    );
}
main.is-preview.is-landscape,
main.is-playing.is-landscape {
  grid-template-columns: var(--intro-width) var(--board-width);
  grid-template-rows: var(--board-height) var(--feedback-height);
}
main.is-landscape .instructions {
  grid-column: 2;
}
@media (prefers-reduced-motion: reduce) {
  main .chalet-motion,
  .play-scene canvas {
    transition: none;
  }
}

/* Warm translucent cards keep the HUD readable against the chalet. */
main > .hud {
  left: calc(var(--board-offset, 0px) + 10px);
  display: grid;
  grid-template-columns: 1fr 1.3fr 1fr;
  gap: 8px;
}
main > .hud > span {
  width: auto;
  min-width: 0;
  background: rgb(48 27 17 / 74%);
  border: 1px solid rgb(255 224 175 / 20%);
  border-radius: 12px;
  box-shadow: none;
  gap: 5px;
}
main .hud b,
main .hud .score-panel b {
  color: #fff5de;
  text-shadow: none;
  font-variant-numeric: tabular-nums;
}
main .hud .score-panel b {
  font-size: 28px;
}
main .hud i {
  text-shadow: none;
}
@media (max-width: 650px) {
  main:not(.is-landscape) {
    justify-items: center;
  }
  main.is-playing > .hud {
    left: calc(var(--board-offset, 0px) + 10px);
  }
  main:not(.is-landscape) .instructions {
    width: 100%;
  }
}

/* The table extends beyond the fixed gameplay canvas, through the frame edges. */
.table-scenery {
  position: absolute;
  left: var(--scenery-left);
  right: 0;
  top: var(--scenery-top);
  bottom: 0;
  overflow: clip;
  z-index: -1;
  pointer-events: none;
}
.table-scenery img {
  position: absolute;
  left: var(--table-left);
  top: var(--table-top);
  width: var(--table-width);
  height: var(--table-height);
  max-width: none;
  transition: filter 350ms ease;
}
main.is-preview .table-scenery img {
  filter: blur(3px);
}
@media (prefers-reduced-motion: reduce) {
  .table-scenery img {
    transition: none;
  }
}
