/* Load after the main stylesheet. Keep existing layouts and control states. */
.button,
.store-button,
.nav-cta,
.menu-toggle,
.gallery-filters button,
.dialog-close {
  --cg-rest-bg: var(--forest);
  --cg-rest-color: var(--cream);
  --cg-rest-border: var(--forest);
  --cg-hover-bg: #3b5f47;
  --cg-hover-color: #fffaf1;
  --cg-hover-border: #3b5f47;
  --cg-active-bg: #1b3126;
  --cg-active-color: #fffaf1;
  --cg-active-border: #1b3126;
  --cg-focus: #977225;
  --cg-control-shadow: 0 7px 18px rgb(24 49 38 / 22%);
  transition: background-color .18s ease, color .18s ease,
    border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.store-button,
.dialog-close {
  --cg-rest-color: #fff;
}

.button.secondary,
.gallery-filters button:not([aria-pressed="true"]) {
  --cg-rest-bg: transparent;
  --cg-rest-color: var(--forest);
  --cg-hover-bg: #dfe8d4;
  --cg-hover-color: var(--forest);
  --cg-hover-border: var(--moss);
  --cg-active-bg: #cdddbd;
  --cg-active-color: var(--forest);
  --cg-active-border: var(--forest);
}

.gallery-filters button:not([aria-pressed="true"]) {
  --cg-rest-color: var(--ink);
  --cg-rest-border: #89967e;
}

.gallery-filters button[aria-pressed="true"] {
  --cg-rest-color: #fff;
}

/* The pale store links on the dark finale keep their light treatment. */
.download-inner .store-button {
  --cg-rest-bg: var(--cream);
  --cg-rest-color: var(--forest);
  --cg-focus: var(--gold);
  --cg-hover-bg: #f0e2bd;
  --cg-hover-color: var(--forest);
  --cg-hover-border: #f0e2bd;
  --cg-active-bg: #e3cea0;
  --cg-active-color: var(--forest);
  --cg-active-border: #e3cea0;
}

/* A compact menu control; its existing text and ARIA behaviour stay intact. */
.menu-toggle {
  --cg-rest-bg: var(--paper);
  --cg-rest-color: var(--forest);
  --cg-rest-border: #8d9d83;
  --cg-hover-bg: var(--forest);
  --cg-hover-border: var(--forest);
  --cg-focus: var(--forest);
  display: none;
  position: relative;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  appearance: none;
  -webkit-appearance: none;
  height: 44px;
  min-height: 44px;
  padding: 0 14px 0 40px;
  border: 1px solid var(--cg-rest-border);
  border-radius: 12px;
  background: var(--cg-rest-bg);
  color: var(--cg-rest-color);
  font: 650 .875rem/1 var(--sans);
  letter-spacing: .01em;
  white-space: nowrap;
}

.menu-toggle::before,
.menu-toggle::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 14px;
  width: 16px;
  height: 2px;
  border-radius: 1px;
  background: currentColor;
  pointer-events: none;
  transition: transform .18s ease, box-shadow .18s ease;
}

.menu-toggle::before {
  transform: translateY(-6px);
  box-shadow: 0 5px 0 currentColor;
}

.menu-toggle::after {
  transform: translateY(4px);
}

.menu-toggle[aria-expanded="true"]::before {
  transform: translateY(-1px) rotate(45deg);
  box-shadow: none;
}

.menu-toggle[aria-expanded="true"]::after {
  transform: translateY(-1px) rotate(-45deg);
}

@media (max-width: 720px) {
  .menu-toggle:not([hidden]) {
    display: inline-flex;
  }
}

/* Plain navigation and disclosures receive feedback without moving text. */
.site-nav a:not(.nav-cta) {
  border-radius: 8px;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

summary {
  --cg-summary-hover-bg: rgb(80 105 67 / 14%);
  --cg-summary-active-bg: rgb(80 105 67 / 22%);
  --cg-summary-color: var(--forest);
  --cg-summary-border: rgb(80 105 67 / 32%);
  --cg-summary-focus: #977225;
  transition: background-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.play-details > summary {
  --cg-summary-hover-bg: rgb(255 250 241 / 15%);
  --cg-summary-active-bg: rgb(255 250 241 / 23%);
  --cg-summary-color: #fffaf1;
  --cg-summary-border: rgb(255 250 241 / 50%);
  --cg-summary-focus: var(--gold);
}

@media (hover: hover) and (pointer: fine) {
  :is(.button, .store-button, .nav-cta, .menu-toggle, .gallery-filters button, .dialog-close):not(:disabled):not([aria-disabled="true"]):hover {
    background-color: var(--cg-hover-bg);
    color: var(--cg-hover-color);
    border-color: var(--cg-hover-border);
    box-shadow: var(--cg-control-shadow);
    transform: translateY(-2px);
  }

  .site-nav a:not(.nav-cta):not([aria-disabled="true"]):hover {
    background-color: #dfe8d4;
    color: var(--forest);
    box-shadow: inset 0 -2px 0 var(--moss);
  }

  summary:not([aria-disabled="true"]):hover {
    background-color: var(--cg-summary-hover-bg);
    color: var(--cg-summary-color);
    box-shadow: inset 0 0 0 1px var(--cg-summary-border);
  }
}

/* Cancel older unguarded hover rules on touch, before focus/active below. */
@media (hover: none), (pointer: coarse) {
  :is(.button, .store-button, .nav-cta, .menu-toggle, .gallery-filters button, .dialog-close):not(:disabled):not([aria-disabled="true"]):hover {
    background-color: var(--cg-rest-bg);
    color: var(--cg-rest-color);
    border-color: var(--cg-rest-border);
    box-shadow: none;
    transform: none;
  }

  .site-nav a:not(.nav-cta):not([aria-disabled="true"]):hover {
    background-color: transparent;
    color: inherit;
    box-shadow: none;
  }
}

:is(.button, .store-button, .nav-cta, .menu-toggle, .gallery-filters button, .dialog-close):not(:disabled):not([aria-disabled="true"]):focus-visible {
  outline: 2px solid var(--cg-focus);
  outline-offset: 3px;
  background-color: var(--cg-hover-bg);
  color: var(--cg-hover-color);
  border-color: var(--cg-hover-border);
  box-shadow: var(--cg-control-shadow);
}

.site-nav a:not(.nav-cta):not([aria-disabled="true"]):focus-visible {
  outline: 2px solid #977225;
  outline-offset: 3px;
  background-color: #dfe8d4;
  color: var(--forest);
  box-shadow: inset 0 -2px 0 var(--moss);
}

summary:not([aria-disabled="true"]):focus-visible {
  outline: 2px solid var(--cg-summary-focus);
  outline-offset: 3px;
  background-color: var(--cg-summary-hover-bg);
  color: var(--cg-summary-color);
  box-shadow: inset 0 0 0 1px var(--cg-summary-border);
}

:is(.button, .store-button, .nav-cta, .menu-toggle, .gallery-filters button, .dialog-close):not(:disabled):not([aria-disabled="true"]):active {
  background-color: var(--cg-active-bg);
  color: var(--cg-active-color);
  border-color: var(--cg-active-border);
  box-shadow: 0 2px 5px rgb(24 49 38 / 16%);
  transform: translateY(0) scale(.98);
}

.site-nav a:not(.nav-cta):not([aria-disabled="true"]):active {
  background-color: #cdddbd;
  color: var(--forest);
  box-shadow: inset 0 -2px 0 var(--forest);
}

summary:not([aria-disabled="true"]):active {
  background-color: var(--cg-summary-active-bg);
  color: var(--cg-summary-color);
  box-shadow: inset 0 0 0 1px var(--cg-summary-border);
}

/* Preserve disabled/busy controls, including the support form's own opacity. */
:is(.button, .store-button, .nav-cta, .menu-toggle, .gallery-filters button, .dialog-close):is(:disabled, [aria-disabled="true"]),
:is(.button, .store-button, .nav-cta, .menu-toggle, .gallery-filters button, .dialog-close):is(:disabled, [aria-disabled="true"]):hover {
  background-color: var(--cg-rest-bg);
  color: var(--cg-rest-color);
  border-color: var(--cg-rest-border);
  box-shadow: none;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .button,
  .store-button,
  .nav-cta,
  .menu-toggle,
  .menu-toggle::before,
  .menu-toggle::after,
  .gallery-filters button,
  .dialog-close,
  .site-nav a,
  summary {
    transition: none;
  }

  :is(.button, .store-button, .nav-cta, .menu-toggle, .gallery-filters button, .dialog-close):not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible, :active) {
    transform: none;
  }
}

@media (forced-colors: active) {
  .menu-toggle,
  .gallery-filters button,
  .dialog-close {
    border-color: ButtonText;
  }

  :is(.button, .store-button, .nav-cta, .menu-toggle, .gallery-filters button, .dialog-close):not(:disabled):not([aria-disabled="true"]):focus-visible,
  .site-nav a:not(.nav-cta):not([aria-disabled="true"]):focus-visible,
  summary:not([aria-disabled="true"]):focus-visible {
    outline-color: Highlight;
    box-shadow: none;
  }
}

/* The gallery original has an intact bottom bezel. Keep its pixels unchanged;
   clip only the white canvas outside the phone with a responsive CSS silhouette. */
#playtime .screen-link.playroom-phone {
  position: relative;
  aspect-ratio: 660 / 1322;
  border-radius: 0;
  overflow: visible;
  background: transparent;
  filter: drop-shadow(0 8px 12px #0002);
}
#playtime .playroom-phone > img {
  position: absolute;
  left: -4.393939%;
  top: -1.815431%;
  width: 109.090909%;
  max-width: none;
  height: auto;
  clip-path: polygon(
    21.6667% 1.6667%,
    16.3889% 1.8750%,
    15.0000% 2.0139%,
    12.3611% 2.5000%,
    9.8611% 3.2639%,
    7.7778% 4.3056%,
    6.8056% 5.0000%,
    5.4167% 6.5972%,
    4.8611% 7.9861%,
    4.5833% 10.2778%,
    4.5833% 16.8056%,
    4.0278% 16.9444%,
    4.0278% 20.0694%,
    4.5833% 20.2083%,
    4.5833% 23.1944%,
    4.1667% 23.3333%,
    4.0278% 24.5139%,
    4.1667% 29.7917%,
    4.5833% 29.8611%,
    4.5833% 31.7361%,
    4.0278% 31.9444%,
    4.0278% 38.1944%,
    4.5833% 38.4028%,
    4.7222% 86.3194%,
    5.1389% 87.7083%,
    6.2500% 89.3750%,
    7.7778% 90.6250%,
    9.5833% 91.5972%,
    11.8056% 92.3611%,
    15.0000% 92.9861%,
    18.0556% 93.2639%,
    20.1389% 93.3333%,
    79.1667% 93.3333%,
    81.5278% 93.2639%,
    85.1389% 92.9167%,
    88.0556% 92.2917%,
    89.8611% 91.6667%,
    91.9444% 90.5556%,
    93.4722% 89.2361%,
    94.1667% 88.1944%,
    94.7222% 86.8056%,
    94.8611% 36.9444%,
    95.2778% 36.8750%,
    95.5556% 36.6667%,
    95.5556% 31.0417%,
    95.2778% 28.7500%,
    95.5556% 27.2917%,
    94.8611% 27.0139%,
    94.8611% 9.4444%,
    94.5833% 7.8472%,
    93.8889% 6.3194%,
    92.9167% 5.2083%,
    91.3889% 4.0972%,
    90.0000% 3.4028%,
    87.5000% 2.5694%,
    83.3333% 1.8750%,
    80.9722% 1.7361%,
    75.9722% 1.6667%
  );
}
