/* Amorstory's cover colours in the materials of a lit toy cabinet. */
:root {
  --amor-cover: #e78ca8;
  --amor-rose: #a33e6a;
  --amor-ink: #493448;
  --amor-plum: #563559;
  --amor-lilac: #dfd5ee;
  --amor-blush: #f9e4ed;
  --amor-paper: #fff6fa;
  --amor-cabinet: #4b2549;
  --amor-honey: #ffd991;
}
.amor-masthead {
  position: relative;
  z-index: 2;
  background: linear-gradient(105deg,#fce7ef 10%,#fff3f6 48%,#eee4f5 100%);
  color: var(--amor-ink);
  border-bottom: 3px solid var(--amor-cover);
  box-shadow: 0 5px 18px #33112a22;
}
.amor-navbar {
  min-height: 71px;
  max-width: 1440px;
  padding: 4px clamp(12px,3vw,44px);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(max-content,1fr) auto minmax(max-content,1fr);
  align-items: center;
  gap: clamp(7px,2vw,26px);
}
.amor-brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-height: 56px;
  min-width: 0;
  padding: 0;
  border-radius: 12px;
}
.amor-site-logo {
  display: block;
  width: clamp(135px,14vw,185px);
  max-height: 62px;
  height: auto;
  object-fit: contain;
  object-position: left center;
  transition: transform 230ms cubic-bezier(.22,1,.36,1);
}
.amor-nav,.amor-tools {display:flex;align-items:center;gap:8px}
.amor-tools {justify-content:flex-end}
.amor-key,.amor-settings {
  position:relative;
  isolation:isolate;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  min-height:44px;
  min-width:44px;
  padding:6px 13px;
  border:1px solid transparent;
  border-radius:14px;
  color:var(--amor-plum);
  font-size:14px;
  font-weight:850;
  line-height:1.12;
  transition:background 160ms,color 160ms,border-color 160ms,box-shadow 180ms,transform 180ms;
}
.amor-key svg,.amor-settings svg {flex:none;color:var(--amor-rose);transition:transform 200ms cubic-bezier(.22,1,.36,1)}
.amor-key.active {
  background:linear-gradient(#ffe3f0,#f4b6d1);
  border-color:#d982a8;
  box-shadow:inset 0 1px 1px #fff,0 3px 6px #7834582b;
  color:#582847;
}
.amor-settings {padding:0;background:#f8edf7;border-color:#d7bbd9;box-shadow:inset 0 1px 1px #fff,0 2px 4px #5635591b}
.amor-collection {
  display:flex;
  align-items:center;
  gap:4px;
  padding:4px 7px;
  color:var(--amor-plum);
  white-space:nowrap;
  font-size:14px;
  font-variant-numeric:tabular-nums;
}
.amor-collection small {color:#764b6d;font-size:11px}
.amor-masthead button:focus-visible,#audio-controls button:focus-visible,#audio-controls input:focus-visible {
  outline:3px solid #87355f;
  outline-offset:2px;
}
@media (hover:hover) and (pointer:fine) {
  .amor-brand:hover .amor-site-logo {transform:translateY(-1px)}
  .amor-key:hover,.amor-settings:hover {transform:translateY(-2px);background:#f8cfe4;border-color:#dc8aaf;box-shadow:0 5px 10px #79304b29,inset 0 1px 1px #fff}
  .amor-key:hover svg,.amor-settings:hover svg {transform:rotate(-9deg) scale(1.17)}
}
.amor-key:active,.amor-settings:active {transform:translateY(1px);box-shadow:inset 0 2px 4px #643c7038}

/* Same shaped controls on the music strip, driven by the existing audio panel. */
#app .audio-controls {
  --audio-paper:#fff0f7;
  --audio-ink:#5f3456;
  --audio-soft:#754c69;
  --audio-line:#d89ab8;
  --audio-button:#f8cde2;
  --audio-accent:#92375f;
  --audio-track:#dfbdd2;
  margin-top:5px;
  border-radius:15px;
  box-shadow:0 3px 10px #54284026;
}
#app .audio-controls button {transition:background 150ms,border-color 150ms,box-shadow 150ms}
#app .audio-controls .audio-controls-music {background:linear-gradient(#ffe5f3,#f5bdd9);box-shadow:inset 0 1px 1px #fff}
@media(hover:hover) and (pointer:fine) {
  #app .audio-controls .audio-controls-music:hover {background:#f4afd0;border-color:#bc628d;box-shadow:inset 0 1px 1px #fff,0 3px 6px #7e36542b}
  #app .audio-controls button:hover .audio-controls-icon {transform:scale(1.15)}
}
#app .audio-controls button:active {box-shadow:inset 0 2px 4px #76456136}

/* The entrance is cover pink. The play screen is the deeper plum inside the cabinet. */
body[data-view=welcome] {background:#f9e4ed;color:var(--amor-ink)}
body[data-view=welcome]::before {background:linear-gradient(130deg,#f9e4ed,#f0e5f4)}
body[data-view=welcome] .arcade-welcome {background:linear-gradient(135deg,#fdeaf2,#f1bfd8 73%,#e6cdeb);border-color:#e4a0bc;box-shadow:0 12px 32px #6d2f5426,inset 0 1px 1px #fff9}
body[data-view=welcome] .festival-copy h1 {color:#4d2d4f;text-shadow:none}
body[data-view=welcome] .festival-copy h1 em {color:#983a65;text-shadow:none}
body[data-view=welcome] .festival-copy p {color:#694360}
body[data-view=welcome] .festival-copy .mode-card {background:#fff4fa;color:#563559;border-color:#dba8c1;box-shadow:0 2px 4px #72375118}
body[data-view=welcome] .festival-copy .mode-card.chosen {background:#f9d8e8;border-color:#b95180;box-shadow:inset 0 0 0 1px #b95180}
body[data-view=welcome] .festival-copy .mode-card small,body[data-view=welcome] .festival-copy .mode-select legend,body[data-view=welcome] .festival-copy .welcome-note {color:#714461}
body[data-view=welcome] .festival-copy .mode-card>svg:last-child {color:#9f3465}
body[data-view=welcome] .welcome-film {border-color:#bd6e9c;background:#703c68;box-shadow:0 8px 24px #74395139}
body[data-view=welcome] .theme-chip {background:#fff3fa;color:#5f3559;border-color:#e4b1cc;box-shadow:0 4px 9px #713b571b}
body[data-view=welcome] .site-footer {color:#714461}
body[data-view=welcome] button:focus-visible {outline-color:#87355f}
body[data-view=puzzle] {background:#3e223e;color:#fff2ed}
body[data-view=puzzle]::before {background:linear-gradient(130deg,#3d233f,#5b2f52 60%,#432941)}
body[data-view=puzzle] .arcade-story h1 {color:#ffedf6;text-shadow:0 2px 2px #29132366}
body[data-view=puzzle] .arcade-story>p {color:#f5d5e5;text-shadow:none}
body[data-view=puzzle] .arcade-story .back-button,.film-toggle {background:#542b50;border-color:#be85ab;color:#fff2fa}
body[data-view=puzzle] .arcade-story .back-button:hover,.film-toggle:hover {background:#743764;border-color:#f5b5d5}
.story-screen {border-color:#e9a7c4;background:#603b61;box-shadow:0 8px 22px #25132378}
.puzzle-film .story-film {background:#603b61}
.story-prize small {color:#edc1d7}
.arcade-machine {
  background:linear-gradient(150deg,#9b507d,#6d385f 44%,#4a2b51 90%);
  border-color:#ffb9d7;
  box-shadow:0 6px 0 #8c416d,0 13px 24px #29142482,inset 0 2px 3px #fff0fae0,inset 0 -6px 12px #3d234f99;
}
.arcade-machine::before {border-color:#ffd0e580}
.arcade-machine .machine-crown {color:#ffe1aa;text-shadow:0 2px 2px #38142c;font-size:15px;letter-spacing:.12em}
.arcade-mission {background:linear-gradient(110deg,#fff0f7,#fff8ef);color:#572d4e;border-color:#ffd3e9}
.arcade-board-rim {background:linear-gradient(145deg,#ffdaee,#ef9fc6 31%,#ffedc6 68%,#ffc2dc);box-shadow:0 4px 0 #a65c84,inset 0 2px 3px #fff9f2,0 0 18px #ff9ed061}
.arcade-board {background:linear-gradient(135deg,#38213e,#29182f);border-color:#8f557c;box-shadow:inset 0 3px 8px #1b1028ba}
.arcade-slots i {background:#4c2d4f;border-color:#3d2545}
.arcade-machine .tool-button {background:linear-gradient(#ae78a2,#79466f);border-color:#e1aacb;color:#fff2fb;box-shadow:inset 0 1px 1px #ffedf996,0 3px 0 #54264f;transition:transform 160ms,background 160ms,box-shadow 160ms}
@media(hover:hover) and (pointer:fine) {
  .arcade-machine .tool-button:not(:disabled):hover {transform:translateY(-2px);background:#a95789;box-shadow:inset 0 1px 1px #fff9,0 4px 6px #391b3f80}
  .festival-copy .mode-card:hover {border-color:#b95180;transform:translateY(-2px)}
  .arcade-play:hover>svg {transform:scale(1.2) rotate(-6deg)}
}
.arcade-play>svg {transition:transform 180ms cubic-bezier(.22,1,.36,1)}
.arcade-machine .tool-button:not(:disabled):active {transform:translateY(2px);box-shadow:inset 0 2px 4px #3f214879}

@media(max-width:760px) {
  .amor-navbar {min-height:64px;padding:3px clamp(8px,2vw,15px);gap:5px;grid-template-columns:minmax(max-content,1fr) auto auto}
  .amor-brand {min-height:48px}
  .amor-site-logo {width:clamp(87px,23vw,134px)}
  .amor-nav {gap:2px}
  .amor-key {flex-direction:column;gap:3px;min-width:45px;padding:3px 2px;font-size:9px;border-radius:12px}
  .amor-key svg {width:20px;height:20px}
  .amor-settings {border-radius:12px}
  .amor-collection {display:none}
}
@media(max-width:360px) {
  .amor-key {min-width:44px}
}
@media(min-width:761px) and (max-height:780px) {
  body[data-view=puzzle] .amor-navbar {min-height:61px;padding-block:2px}
  body[data-view=puzzle] .amor-site-logo {max-height:55px}
  body[data-view=puzzle] .amor-brand {min-height:52px}
}
.reduce-motion .amor-masthead *, .reduce-motion #audio-controls *, .reduce-motion .arcade-machine .tool-button, .reduce-motion .festival-copy .mode-card {transition:none!important;transform:none!important}
@media(prefers-reduced-motion:reduce) {
  .amor-masthead *,#audio-controls *, .arcade-machine .tool-button,.festival-copy .mode-card {transition:none!important;transform:none!important}
}

/* The uninterrupted cover margin, as on books 1 and 2. The inside is rounded. */
:root {--amor-cover-edge:20px;--amor-cover-radius:30px;background:var(--amor-cover)}
body[data-view] {padding:var(--amor-cover-edge);background:var(--amor-cover)}
body[data-view]::before {display:none}
#app {
  min-height:calc(100svh - 2 * var(--amor-cover-edge));
  border-radius:var(--amor-cover-radius);
  overflow:clip;
  background:#f9e4ed;
  box-shadow:0 0 0 1px #fff3f6b8;
}
body[data-view=welcome] #app {background:linear-gradient(130deg,#f9e4ed,#f0e5f4)}
body[data-view=puzzle] #app {background:linear-gradient(130deg,#3d233f,#5b2f52 60%,#432941)}
.amor-key:not(.active) {background:#fff6fa;border-color:#e7b9cf;box-shadow:inset 0 1px 1px #fff,0 2px 4px #75395422}
.amor-key:not(.active):nth-child(2) {background:#f3e9f8;border-color:#d6bfdf}
.amor-key:not(.active):nth-child(3) {background:#fff1e6;border-color:#e8c7bc}
@media(hover:hover) and (pointer:fine) {
  .amor-key:not(.active):hover {background:#f8cfe4;border-color:#dc8aaf;box-shadow:0 5px 10px #79304b29,inset 0 1px 1px #fff}
  .amor-key:not(.active):active {box-shadow:inset 0 2px 4px #643c7038}
}
@media(max-width:1050px) {:root{--amor-cover-edge:12px;--amor-cover-radius:23px}}
@media(max-width:760px) {:root{--amor-cover-edge:9px;--amor-cover-radius:19px}}
@media(max-width:360px) {
  .amor-navbar {gap:3px;padding-inline:5px}
  .amor-site-logo {width:87px}
  .amor-nav {gap:0}
}
@media(min-width:1051px) {
  .arcade-layout {grid-template-columns:minmax(0,1fr) clamp(365px,calc(100svh - 352px),520px);gap:30px}
}
@media(min-width:1051px) and (max-height:780px) {
  .arcade-machine .board-instruction {margin-block:4px}
  .arcade-machine .goal-token>.toy-sprite {width:37px;height:37px}
  .arcade-machine .goals {min-height:40px}
  .arcade-machine .joker-charge {min-height:32px}
  .arcade-machine .joker-charge>img {width:28px;height:28px}
  .arcade-machine .run-status {margin-block:2px 4px}
}

/* Give the family portrait its own clear beat; goal counters still update. */
body:has(.family-cameo:not([data-docked])) .goal-flight {visibility:hidden}
