:root {
  color-scheme: dark;
  font-family: "Trebuchet MS", system-ui, sans-serif;
  color: #fff7e7;
  background: #261c43;
  --bar: 120px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 4px solid #fff1a8; outline-offset: -5px; }
main {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
  height: 100dvh;
  position: relative;
  isolation: isolate;
}
main::after {
  position: absolute;
  content: "";
  pointer-events: none;
  width: 4px;
  top: var(--bar);
  bottom: 0;
  left: calc(50% - 2px);
  background: #ffdcaa;
  box-shadow: 0 0 19px 4px #ffcf9180;
}
.side { display: grid; grid-template-rows: var(--bar) minmax(0, 1fr); min-width: 0; min-height: 0; }
.crescent { --night: #2d2254; --light: #d4c4ff; --wash: #523877; }
.star { --night: #542a46; --light: #ffda8d; --wash: #7d4051; }
.side-bar {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1.2vw, 24px);
  padding-inline: clamp(16px, 2vw, 40px) 155px;
  background: var(--night);
  border-bottom: 2px solid #fff4cc36;
}
.star .side-bar { flex-direction: row-reverse; padding-inline: 175px clamp(16px, 2vw, 40px); }
h1 {
  display: flex;
  align-items: center;
  gap: .18em;
  margin: 0;
  font-size: clamp(26px, 3vw, 58px);
  letter-spacing: -.045em;
  line-height: 1;
}
h1 span { color: var(--light); font-size: 1.55em; text-shadow: 0 0 .28em #fff5; }
.board-controls {
  z-index: 1;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 0;
  display: flex;
  border-inline: 2px solid #fff4cc36;
  background: #281c3a;
}
.board-controls a, .board-controls button, .change {
  min-width: 120px;
  height: var(--bar);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 0 13px;
  border: 0;
  background: transparent;
  color: inherit;
  text-decoration: none;
  font-weight: 800;
  font-size: clamp(18px, 1.4vw, 27px);
  line-height: 1.12;
}
.board-controls button { border-inline-start: 1px solid #fff4cc36; width: clamp(146px, 9vw, 172px); }
.board-controls span { color: #ffda8d; font-size: 1.55em; }
.change { color: var(--light); border-inline: 1px solid #fff4cc36; }
.board-controls :active, .change:active { background: #fff2; }
.space, .screen { position: relative; min-width: 0; min-height: 0; overflow: hidden; }
.picker {
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  padding: clamp(18px, 3vh, 38px) clamp(20px, 3vw, 64px) 30px;
  background: radial-gradient(ellipse at 50% -8%, var(--wash), transparent 68%), var(--night);
}
h2 { margin: 0 0 clamp(14px, 2.3vh, 26px); font-size: clamp(37px, 4vw, 76px); letter-spacing: -.055em; text-align: center; }
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 168px), 1fr));
  gap: clamp(12px, 1vw, 21px);
  max-width: 850px;
  margin: 0 auto;
}
.tile {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  min-height: 164px;
  padding: 12px 8px 15px;
  border: 0;
  border-radius: 28px 28px 22px 22px;
  background: var(--tile);
  color: #2a1c36;
  box-shadow: inset 0 3px #fff7, inset 0 -7px #34203a29, 0 6px 0 #1b1129a1;
  font-weight: 900;
  font-size: clamp(22px, 1.65vw, 33px);
  line-height: .99;
  text-wrap: balance;
  transition: transform .15s, box-shadow .15s;
}
.tile span:first-child { font-size: 66px; line-height: 1; filter: drop-shadow(0 4px 1px #542a462a); }
.tile:active { transform: translateY(5px) scale(.97); box-shadow: inset 0 -3px #34203a29; }
.peach { --tile: #ffc49c; }
.mint { --tile: #a8ebd1; }
.lilac { --tile: #d9c5ff; }
.pink { --tile: #ffbfda; }
.sky { --tile: #bde6ff; }
.gold { --tile: #ffe199; }
.status { text-align: center; font-size: 26px; }
.status:empty { display: none; }
.frame-notice {
  position: absolute;
  z-index: 3;
  bottom: 16px;
  inset-inline: 16px;
  margin: 0 auto;
  width: fit-content;
  padding: 12px 20px;
  background: #281c3a;
  color: #fff7e7;
  border: 2px solid var(--light);
  border-radius: 14px;
  font-size: clamp(18px, 2vw, 30px);
  text-align: center;
  pointer-events: none;
}
.screen { position: absolute; inset: 0; background: radial-gradient(ellipse, var(--wash), var(--night) 80%); }
iframe { position: absolute; display: block; border: 0; background: #fff7e7; transform-origin: top left; }
.spark {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  pointer-events: none;
  color: var(--light);
  font-size: 36px;
  animation: burst .42s ease-out both;
}
@keyframes burst {
  from { transform: translate(-50%, -50%) scale(.45); opacity: 1; }
  to { transform: translate(var(--x), var(--y)) scale(1.15); opacity: 0; }
}
@media (max-width: 1400px) {
  .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile span:first-child { font-size: 53px; }
  .picker { padding-block: 14px 12px; }
  h2 { margin-bottom: 14px; }
}
@media (max-height: 850px) and (max-width: 1400px) {
  .tile { min-height: 160px; }
  .tiles { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
