/* the game screen: header and score chips, the band of goals, the board stage and its keycaps,
   the toolbar, the result card below the board, and the settings and privacy sheets */
* {
  box-sizing: border-box;
  min-width: 0;
  -webkit-tap-highlight-color: transparent;
}
html,
body {
  height: 100%;
  margin: 0;
}
body {
  background: var(--cobalt);
  color: #fff;
  font: 16px/1.4 var(--font);
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
button {
  font: inherit;
}
.sky {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(62% 46% at 50% 50%, var(--cobalt-2), transparent 72%);
}
.sky::after {
  content: '';
  position: absolute;
  inset: -30%;
  background:
    repeating-linear-gradient(var(--iso-n), rgba(255, 255, 255, 0.075) 0 1px, transparent 1px 48px),
    repeating-linear-gradient(var(--iso), rgba(255, 255, 255, 0.075) 0 1px, transparent 1px 48px);
  -webkit-mask-image: radial-gradient(closest-side, #000 20%, transparent);
  mask-image: radial-gradient(closest-side, #000 20%, transparent);
}
.app {
  position: relative;
  height: 100%;
  max-width: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto minmax(0, var(--stage, 1fr)) auto auto minmax(0, 1fr);
  grid-template-areas: 'head' '.' 'band' 'stage' 'tools' 'foot' '.';
  gap: 12px;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
    max(14px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
header {
  grid-area: head;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
h1 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: clamp(30px, 8vw, 40px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.gem {
  position: relative;
  display: grid;
  place-items: center;
  width: 66px;
  height: 36px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--gi, #4d3100);
  isolation: isolate;
  flex: none;
}
.gem::before,
.gem::after {
  content: '';
  position: absolute;
  inset: 0;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
  z-index: -1;
}
.gem::before {
  background: var(--gs, #9d7012);
  transform: translateY(5px);
}
.gem::after {
  background: linear-gradient(170deg, var(--gh, #fff1b8), var(--gt, #ecc04a) 55%, var(--gl, #cf9a26));
}
.lvgem {
  width: 54px;
  height: 30px;
  font-size: 16px;
}
.lvgem::before {
  transform: translateY(4px);
}
.lvmode h1 {
  gap: 10px;
}
.lvmode #title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.12;
  max-width: 6em;
}
.lvmode #goal,
.lvmode .goaltag {
  display: none;
}
.goaltag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex: none;
}
.goaltag > span:first-child {
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  color: var(--muted);
}
#menuTitle {
  font-size: clamp(22px, 6.6vw, 36px);
  gap: 10px;
}
#menuTitle .mark {
  width: 1.25em;
  height: 0.75em;
  flex: none;
}
header > h1,
.scores {
  flex: none;
}
[hidden] {
  display: none !important;
}
.scores {
  display: flex;
  gap: 8px;
}
.chip {
  position: relative;
  min-width: 76px;
  padding: 6px 12px 7px;
  border-radius: 14px;
  background: var(--porcelain);
  color: var(--ink);
  text-align: center;
  box-shadow: 0 4px 0 var(--edge);
}
.chip span {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  line-height: 1.2;
}
.chip b {
  display: block;
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.stars {
  display: none;
  justify-content: center;
  gap: 2px;
  margin: 2px 0 -2px;
}
.lvmode .stars {
  display: flex;
}
.stars svg {
  width: 11px;
  height: 11px;
}
.st-on {
  fill: #f5b82e;
  stroke: #9a6408;
  stroke-width: 2.2;
  stroke-linejoin: round;
}
.st-off {
  fill: #d5dbef;
}
.chip.low b {
  color: #c2412d;
}
.plus {
  position: absolute;
  left: 50%;
  top: 0;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 0 rgba(var(--shade), 0.45);
  pointer-events: none;
  animation: plus 0.8s ease-out forwards;
}
@keyframes plus {
  from {
    opacity: 1;
    transform: translate(-50%, 0);
  }
  to {
    opacity: 0;
    transform: translate(-50%, -30px);
  }
}
.stage {
  grid-area: stage;
  position: relative;
  touch-action: none;
  cursor: grab;
}
.stage:active {
  cursor: grabbing;
}
canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}
.key {
  position: relative;
  appearance: none;
  border: 0;
  border-radius: 14px;
  background: var(--porcelain);
  color: var(--ink);
  font: 600 16px/1 var(--font);
  min-height: 44px;
  padding: 0 16px;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--edge);
  transition:
    transform 0.08s,
    box-shadow 0.08s,
    background 0.15s;
  touch-action: manipulation;
}
.key:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--edge);
}
.key:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  box-shadow: 0 4px 0 var(--edge);
}
.key:focus-visible,
.dir:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.key.icon {
  width: 48px;
  padding: 0;
  display: grid;
  place-items: center;
}
.key svg {
  width: 22px;
  height: 22px;
}
.key.warn {
  background: #ffe7a8;
}
.key.solid {
  background: var(--deep);
  color: #fff;
  box-shadow: 0 4px 0 var(--deep-edge);
}
.key.solid:active {
  box-shadow: 0 1px 0 var(--deep-edge);
}
.tools {
  grid-area: tools;
  display: flex;
  gap: 8px;
  align-items: center;
  padding-bottom: 4px;
}
.tools .push {
  margin-left: auto;
}
.badge {
  position: absolute;
  right: -6px;
  top: -7px;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 10px;
  background: var(--deep);
  color: #fff;
  font: 600 13px/20px var(--font);
  text-align: center;
  box-shadow: 0 2px 0 rgba(var(--shade), 0.35);
}
.next {
  display: grid;
  justify-items: center;
  align-content: center;
  min-width: 62px;
  min-height: 44px;
  padding: 2px 8px 3px;
  border-radius: 14px;
  background: var(--porcelain);
  color: var(--ink);
  box-shadow: 0 4px 0 var(--edge);
}
.next > span:first-child {
  font-size: 13px;
  font-weight: 500;
  color: var(--label);
  line-height: 1.1;
}
.mini {
  display: block;
  width: 40px;
  height: 27px;
}
.mini svg {
  display: block;
  width: 40px;
  height: 27px;
}
.next.pop .mini {
  animation: nextpop 0.32s ease-out;
}
@keyframes nextpop {
  40% {
    transform: translateY(-5px);
  }
}
.dir {
  position: absolute;
  left: 0;
  top: 0;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: var(--porcelain);
  color: var(--deep);
  display: grid;
  place-items: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--edge);
  transition:
    box-shadow 0.08s,
    translate 0.08s,
    background 0.2s;
  touch-action: manipulation;
  z-index: 1;
}
.dir:active,
.dir.hit {
  translate: 0 3px;
  box-shadow: 0 1px 0 var(--edge);
}
.dir.bad {
  background: #ffd6cc;
}
.dir svg {
  width: 22px;
  height: 22px;
}
.dir kbd {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 20px;
  padding: 3px 5px;
  border-radius: 7px;
  background: var(--deep);
  color: #fff;
  font: 600 13px/1 var(--font);
}
.hinting .dir {
  animation: glint 1.2s ease-in-out 3;
}
@keyframes glint {
  50% {
    background: #fff0bd;
    color: #8a5a00;
  }
}
footer {
  grid-area: foot;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}
footer p {
  margin: 0;
}
footer kbd {
  font: 600 13px/1 var(--font);
  color: var(--ink);
  background: var(--porcelain);
  border-radius: 6px;
  padding: 2px 6px;
  box-shadow: 0 2px 0 var(--edge);
}
#hint.hot {
  color: #fff0bd;
}
#note {
  color: #fff;
}
@media (hover: none) {
  .dir kbd,
  .keys {
    display: none;
  }
}
.result {
  grid-row: 5/7;
  grid-column: 1;
  align-self: start;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas: 'num text' 'row row';
  gap: 10px 14px;
  align-items: center;
  padding: 14px 16px 16px;
  border-radius: 20px;
  background: var(--porcelain);
  color: var(--ink);
  box-shadow: 0 5px 0 var(--edge);
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.3s,
    transform 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.25);
}
.result.show {
  opacity: 1;
  transform: none;
}
.result[hidden] {
  display: none;
}
.result h2 {
  grid-area: num;
  margin: 0;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.05;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}
.result p {
  grid-area: text;
  margin: 0;
  color: var(--text2);
  line-height: 1.35;
}
.result p b {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  margin-bottom: 2px;
}
.result p .sub {
  display: block;
  margin-top: 5px;
  color: var(--label);
  font-size: 14px;
}
.result h2 .gem {
  width: 72px;
  height: 40px;
  font-size: 21px;
}
.bigstars {
  display: flex;
  gap: 1px;
}
.bigstars svg {
  width: 30px;
  height: 30px;
}
.bigstars .st-on {
  stroke-width: 1.3;
  animation: starpop 0.5s cubic-bezier(0.2, 0.9, 0.3, 1.45) backwards;
}
@keyframes starpop {
  from {
    transform: scale(0.1) rotate(-50deg);
    opacity: 0;
  }
}
.row {
  grid-area: row;
  display: flex;
  gap: 10px;
}
.row .key {
  flex: 1;
}
.row .key.icon {
  flex: none;
}
.ended .tools,
.ended footer {
  visibility: hidden;
}
.ended .dir {
  opacity: 0.45;
  pointer-events: none;
}
.intro .tools,
.intro footer {
  visibility: hidden;
}
@media (max-width: 600px) {
  .stage {
    margin-inline: -10px;
  }
}
.band {
  grid-area: band;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.ladder {
  display: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 26px);
  justify-content: center;
  gap: 6px;
  height: 42px;
  align-items: start;
  padding-top: 4px;
}
.rung {
  position: relative;
  height: 19px;
  transition: transform 0.25s;
}
.rung::before,
.rung::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 15px;
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.rung::before {
  top: 4px;
  background: var(--side);
}
.rung::after {
  top: 0;
  background: var(--top);
}
.rung.off::before {
  background: rgba(255, 255, 255, 0.1);
}
.rung.off::after {
  background: rgba(255, 255, 255, 0.17);
}
.rung.max {
  transform: translateY(-4px);
}
.rung b {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
}
@media (max-width: 600px) and (min-height: 700px) {
  .ladder {
    display: grid;
  }
}
.goals {
  display: none;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}
.lvmode .goals {
  display: flex;
}
.lvmode .ladder {
  display: none !important;
}
body.drawn .ladder {
  display: grid !important;
  grid-auto-columns: minmax(0, 24px);
  gap: 3px;
  height: 46px;
  padding-top: 5px;
}
.pot {
  position: relative;
  height: 24px;
  transition: transform 0.25s;
}
.pot svg {
  display: block;
  width: 24px;
  height: 24px;
}
.pot.max {
  transform: translateY(-5px);
}
.pot b {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  color: #fff;
}
.pot.end b {
  left: auto;
  right: -3px;
  transform: none;
}
.pot.start b {
  left: -3px;
  transform: none;
}
.goal svg.gp {
  width: 21px;
  height: 21px;
  margin: -2px 0;
}
.gem svg {
  display: block;
  width: 26px;
  height: 26px;
  margin-top: -1px;
}
.result h2 .bigpot {
  display: block;
  width: 56px;
  height: 56px;
}
.skins {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px 8px;
  padding: 2px 0 10px;
}
.skins button {
  border: 0;
  padding: 0;
  background: none;
  font: 600 13px/1.2 var(--font);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  border-radius: 13px;
}
.skins .sw {
  display: grid;
  place-items: center;
  width: 100%;
  height: 54px;
  border-radius: 12px;
  color: #fff;
  font: 700 17px/1 var(--font);
  box-shadow: inset 0 -3px 0 rgba(0, 0, 0, 0.2);
}
.skins .sw svg {
  width: 34px;
  height: 34px;
}
.skins button.on {
  color: var(--ink);
}
.skins button.on .sw {
  box-shadow:
    inset 0 -3px 0 rgba(0, 0, 0, 0.2),
    0 0 0 2px var(--porcelain),
    0 0 0 4.5px var(--deep);
}
.skins button:focus-visible {
  outline: none;
}
.skins button:focus-visible .sw {
  box-shadow:
    0 0 0 2px var(--porcelain),
    0 0 0 4.5px var(--ink);
}
.goal {
  --p: 0%;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 32px;
  padding: 0 13px 0 9px;
  border-radius: 16px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.27) var(--p), rgba(255, 255, 255, 0.1) var(--p));
  color: #fff;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}
.goal b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.goal svg {
  display: block;
  width: 22px;
  height: 16px;
  flex: none;
}
.goal.done {
  background: var(--porcelain);
  color: var(--ink);
  box-shadow: 0 3px 0 var(--edge);
}
.goal .ck {
  width: 17px;
  height: 17px;
  margin-left: -2px;
}
.sheet {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  align-items: end;
  justify-items: center;
  padding: 16px;
  background: rgba(var(--shade), 0.45);
}
.sheet[hidden] {
  display: none;
}
.panel {
  color-scheme: light;
  width: min(100%, 420px);
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: var(--porcelain);
  color: var(--ink);
  box-shadow: 0 6px 0 var(--edge);
}
.panel h3 {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
}
.field {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  border-top: 1px solid var(--line);
  font-weight: 500;
}
.panel h3 + .field {
  border-top: 0;
}
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 12px;
  background: var(--seg);
}
.seg button {
  border: 0;
  background: none;
  min-height: 38px;
  padding: 0 11px;
  border-radius: 9px;
  font: 600 15px/1 var(--font);
  color: var(--text2);
  cursor: pointer;
  white-space: nowrap;
}
.seg button.on {
  background: var(--deep);
  color: #fff;
}
input[type='range'] {
  width: 150px;
  accent-color: var(--deep);
}
input[type='checkbox'] {
  width: 22px;
  height: 22px;
  accent-color: var(--deep);
  flex: none;
}
.panel small {
  display: block;
  color: var(--small);
  font-size: 13px;
  padding: 0 0 8px;
}
.linkrow {
  width: 100%;
  border: 0;
  border-top: 1px solid var(--line);
  background: none;
  font: 500 16px/1.2 var(--font);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}
.linkrow span:last-child {
  font-size: 22px;
  color: var(--small);
}
.ver {
  text-align: center;
  padding: 4px 0 10px !important;
}
.policy h3 {
  margin: 0 0 6px;
}
.policy h4 {
  margin: 14px 0 4px;
  font-size: 15px;
}
.policy p {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text2);
}
.field:has(input:disabled) {
  opacity: 0.5;
}
.panel .key {
  width: 100%;
  margin-top: 10px;
}
@media (orientation: landscape) and (max-height: 560px) {
  .app {
    max-width: none;
    grid-template-columns: minmax(250px, 330px) minmax(0, 1fr);
    grid-template-rows: auto auto auto minmax(0, 1fr);
    grid-template-areas: 'head stage' 'band stage' 'tools stage' 'foot stage';
    column-gap: 20px;
  }
  .goals {
    justify-content: flex-start;
  }
  .band {
    align-items: flex-start;
  }
  header {
    flex-direction: column;
    align-items: flex-start;
  }
  .tools {
    flex-wrap: wrap;
  }
  .tools .push {
    margin-left: 0;
  }
  .key {
    padding: 0 12px;
  }
  .result {
    grid-row: 3/5;
    grid-column: 1;
  }
  .stage {
    margin-inline: 0;
  }
  footer {
    text-align: left;
    align-self: end;
  }
}
.panel .lvnote {
  display: none;
}
.lvmode .panel .lvnote {
  display: block;
  padding: 2px 0 10px;
}
.lvmode .rule {
  display: none;
}
/* the skin shop, in the iOS app only (js/ui/shop.js adds this markup there) */
.skins button.locked {
  position: relative;
}
.skins .lock {
  position: absolute;
  top: 5px;
  right: 5px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.32);
  color: #fff;
}
.skins .lock[hidden] {
  display: none;
}
.skins .lock svg {
  width: 12px;
  height: 12px;
}
.skins .price {
  margin-top: -4px;
  font: 500 12px/1 var(--font);
  font-style: normal;
  color: var(--small);
}
.shop {
  display: grid;
  gap: 10px;
  padding: 2px 0 10px;
}
.shop[hidden],
.shop [hidden] {
  display: none;
}
.shop .key {
  width: 100%;
}
.shop .key:not(.solid) {
  background: var(--seg);
  box-shadow: 0 4px 0 var(--line);
}
.shop .key:disabled {
  opacity: 0.55;
  cursor: default;
}
.shop small {
  padding: 0;
  text-align: center;
}
.shop small:empty {
  display: none;
}
