.creative-game {
  display: grid;
  justify-items: center;
  gap: clamp(.65rem, 3vw, 1.15rem);
  width: min(100%, 33rem);
  margin-inline: auto;
  color: var(--ink, #271949);
  text-align: center;
}

.creative-game [hidden] {
  display: none;
}

.creative-game__stage,
.creative-game__tools,
.creative-game__choices {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(.5rem, 2vw, .8rem);
  max-width: 100%;
}

.creative-game__stage {
  min-width: 3.9rem;
  min-height: 3.2rem;
  border-radius: 1.05rem;
  background: var(--answer-paper, #f9f4ff);
  font-size: 2rem;
}

.creative-game__choices {
  width: min(100%, 23rem);
}

.creative-game__button {
  display: grid;
  min-width: 3.5rem;
  min-height: 3.5rem;
  padding: .3rem .6rem;
  place-items: center;
  border: 2px solid var(--accent-strong, #361986);
  border-radius: .92rem;
  color: var(--ink, #271949);
  background: #fff;
  box-shadow: 0 3px 0 var(--soft-line, #d7c6f7);
  touch-action: manipulation;
}

.creative-game__button:focus-visible {
  outline: 3px solid var(--accent-strong, #361986);
  outline-offset: 3px;
}

.creative-game__button:not(:disabled):hover {
  border-color: var(--purple, #542dc8);
}

.creative-game__icon {
  font-size: clamp(1.45rem, 9vw, 2.45rem);
  line-height: 1;
}

.creative-draw__swatch {
  width: min(46%, 10rem);
  min-height: clamp(4.4rem, 15vw, 6rem);
}

#activity:has(.creative-piano) .activity-progress {
  display: none;
}

.creative-piano__keyboard {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  grid-template-rows: clamp(7rem, 27vw, 13rem);
  width: 100%;
  padding: .55rem .38rem .75rem;
  border: 2px solid #210f40;
  border-radius: 1rem;
  background: #3a245a;
  box-shadow: 0 .25rem 0 #210f40;
}

.creative-piano__key {
  position: relative;
  display: grid;
  grid-row: 1;
  min-width: 0;
  align-items: end;
  justify-items: center;
  margin-inline: 1px;
  padding: 0 0 .55em;
  border: 1px solid #baa9d8;
  border-radius: .25rem .25rem .58rem .58rem;
  color: #2a1749;
  background: #fffaf0;
  box-shadow: 0 .22rem 0 #cbbbe3;
  font: 800 clamp(1.32rem, 5vw, 2rem)/1 system-ui, sans-serif;
  touch-action: manipulation;
  cursor: pointer;
}

.creative-piano__key[data-number="1"] { grid-column: 1 / 3; }
.creative-piano__key[data-number="2"] { grid-column: 3 / 5; }
.creative-piano__key[data-number="3"] { grid-column: 5 / 7; }
.creative-piano__key[data-number="4"] { grid-column: 7 / 9; }
.creative-piano__key[data-number="5"] { grid-column: 9 / 11; }
.creative-piano__key[data-after="1"] { grid-column: 2 / 4; }
.creative-piano__key[data-after="2"] { grid-column: 4 / 6; }
.creative-piano__key[data-after="4"] { grid-column: 8 / 10; }

.creative-piano__key[data-after] {
  z-index: 1;
  align-self: start;
  justify-self: center;
  width: min(68%, 3.1rem);
  min-width: 1.8rem;
  height: 58%;
  margin-inline: 0;
  padding: 0;
  border-color: #1d102f;
  color: #fff;
  background: #25173f;
  box-shadow: 0 .2rem 0 #11091d;
}

.creative-piano__key[data-next] {
  border-color: #7a4900;
  background: #ffe294;
  box-shadow: inset 0 0 0 2px #9d5a09, 0 .22rem 0 #be8d36;
}

.creative-piano__key[data-next]::before {
  content: "▾";
  position: absolute;
  inset: auto 0 1.5em;
  color: #634000;
  pointer-events: none;
}

.creative-piano__key:is([data-pressed], :active) {
  border-color: #125346;
  color: #103f36;
  background: #81e3c9;
  box-shadow: inset 0 0 0 2px #217d69;
  transform: translateY(.15rem);
}

.creative-piano__key:focus-visible {
  outline: 3px solid #572dab;
  outline-offset: -5px;
}

.creative-piano__key[data-after]:focus-visible { outline-color: #ffe294; }

.creative-piano__tools { flex-wrap: wrap; }

.creative-piano__tools .creative-game__button,
.creative-piano__guide .creative-game__button {
  display: inline-flex;
  justify-content: center;
  gap: .45rem;
  padding-inline: .8rem;
  font-weight: 750;
}

.creative-piano__guide {
  width: 100%;
  padding: .65rem;
  border: 2px solid #d7c6f7;
  border-radius: 1rem;
  background: #faf6ff;
}

.creative-piano__steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: .38rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.creative-piano__step {
  display: grid;
  min-width: 2.1rem;
  min-height: 2.1rem;
  place-items: center;
  border: 2px solid #d7c6f7;
  border-radius: .55rem;
  background: #fff;
  font-weight: 850;
}

.creative-piano__step[data-state="next"] {
  border-color: #875108;
  background: #ffe294;
}

.creative-piano__step[data-state="done"] {
  border-color: #1c7762;
  background: #cdf6e9;
  text-decoration: underline;
}

.creative-piano__message {
  min-height: 1.45em;
  font-weight: 750;
}

.creative-game__feedback {
  display: grid;
  width: 2.9rem;
  aspect-ratio: 1;
  place-items: center;
  border-radius: 50%;
  font: 800 1.65rem/1 system-ui, sans-serif;
}

.creative-game__feedback[data-state="yes"] {
  border: 2px solid #18573b;
  color: #18573b;
  background: #dff3ea;
}

.creative-game__feedback[data-state="retry"],
.creative-game__feedback[data-state="hint"] {
  border: 2px dashed #694528;
  color: #694528;
  background: #fff1dc;
}

.creative-draw__board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(.5rem, 3vw, 1.2rem);
  width: min(100%, 23rem);
  padding: clamp(.55rem, 3vw, 1.2rem);
  border: 2px solid var(--soft-line, #d7c6f7);
  border-radius: 1.15rem;
  background: var(--answer-paper, #f9f4ff);
}

.creative-draw__tile {
  min-width: 0;
  min-height: clamp(5rem, 21vw, 8rem);
  border-width: 3px;
  border-style: dashed;
}

.creative-draw__board[data-scene="house"] .creative-draw__tile[data-position="0"] {
  border-radius: .65rem;
}

.creative-draw__board[data-scene="house"] .creative-draw__tile[data-position="1"] {
  border-radius: 50% 50% .55rem .55rem;
}

.creative-draw__board[data-scene="kite"] .creative-draw__tile[data-position="0"] {
  border-radius: 58% .7rem .7rem .7rem;
}

.creative-draw__board[data-scene="kite"] .creative-draw__tile[data-position="1"] {
  border-radius: .7rem 58% .7rem .7rem;
}

.creative-draw__swatch[aria-pressed="true"] {
  outline: 3px solid var(--accent-strong, #361986);
  outline-offset: 3px;
}

.creative-draw__tile[data-paint] {
  border-style: solid;
  opacity: 1;
}

.creative-draw__swatch[data-paint="0"],
.creative-draw__tile[data-paint="0"] {
  color: #143d64;
  background: radial-gradient(circle, #79bdf0 1px, transparent 2px) 0 0 / 11px 11px #d8efff;
}

.creative-draw__swatch[data-paint="1"],
.creative-draw__tile[data-paint="1"] {
  color: #694410;
  background: repeating-linear-gradient(45deg, #ffe9aa 0 7px, #fff4c9 7px 14px);
}

.creative-game__button[data-hint] {
  outline: 3px dashed var(--accent-strong, #361986);
  outline-offset: 3px;
}

.creative-game__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
