@font-face {
  font-family: "Space Grotesk";
  src: url(../../fonts/SpaceGrotesk.ttf);
  font-weight: 300 700;
  font-display: swap;
}
:root {
  --ink:#101530;
  --paper:#fffdf7;
  --glass:rgba(22,26,62,.62);
  --line:rgba(255,255,255,.14);
  --gold:#ffd27a;
  --mint:#7fe3c4;
  --rose:#ff9db4;
  --txt:#f5f3ff;
  --mut:#aeb2dc;
  --safe-t:env(safe-area-inset-top);
  --safe-b:env(safe-area-inset-bottom);
}
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--ink);
  color: var(--txt);
  font-family:
    "Space Grotesk",
    system-ui,
    sans-serif;
  overscroll-behavior: none;
}
button {
  font: inherit;
  color: inherit;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 0;
}
#app {
  position: fixed;
  inset: 0;
  overflow: hidden;
}
#bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      120% 80% at 20% 0%,
      #2a2f6e 0,
      transparent 60%),
    radial-gradient(
      90% 70% at 100% 100%,
      #3b2257 0,
      transparent 60%),
    linear-gradient(
      180deg,
      #141a3e,
      #0c1028);
}
#glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      40% 30% at 70% 20%,
      rgba(255, 210, 122, .12),
      transparent 70%),
    radial-gradient(
      30% 25% at 15% 80%,
      rgba(127, 227, 196, .10),
      transparent 70%);
}
#screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(var(--safe-t) + 14px) 16px calc(var(--safe-b) + 60px);
  overflow: auto;
}
#app[data-screen=draw] #screen {
  padding: calc(var(--safe-t) + 8px) 8px calc(var(--safe-b) + 6px);
  overflow: hidden;
}
.top {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}
.top h1 {
  flex: 1;
  margin: 0;
  font-size: 22px;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ib {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: var(--glass);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
  display: grid;
  place-items: center;
  flex: none;
  transition: transform .12s;
}
.ib:active {
  transform: scale(.94);
}
.ib svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: #fff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ib[disabled] {
  opacity: .35;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 22px;
  border-radius: 18px;
  font-weight: 700;
  font-size: 17px;
  background:
    linear-gradient(
      180deg,
      #ffe2a1,
      #ffc35c);
  color: #2b1d05;
  box-shadow: 0 10px 28px -10px rgba(255, 195, 92, .8);
}
.cta.alt {
  background: rgba(255, 255, 255, .1);
  color: #fff;
  box-shadow: none;
  border: 1px solid var(--line);
}
.cta.sm {
  padding: 10px 16px;
  font-size: 15px;
  border-radius: 14px;
}
.hero {
  text-align: center;
  padding: 14px 4px 6px;
}
.hero .mark {
  width: 84px;
  height: 84px;
  margin: 0 auto 6px;
  filter: drop-shadow(0 8px 24px rgba(255, 210, 122, .45));
}
.hero h1 {
  margin: 0;
  font-size: 34px;
  letter-spacing: -.03em;
  background:
    linear-gradient(
      90deg,
      #fff,
      #ffe2a1 50%,
      #a6f0da);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  margin: 4px 0 0;
  color: var(--mut);
}
.rank {
  margin: 16px auto 6px;
  max-width: 520px;
  width: 100%;
  padding: 14px 16px;
  border-radius: 22px;
  background: var(--glass);
  border: 1px solid var(--line);
  display: flex;
  gap: 14px;
  align-items: center;
  backdrop-filter: blur(12px);
}
.rank .medal {
  width: 54px;
  height: 54px;
  flex: none;
}
.rank b {
  display: block;
  font-size: 18px;
}
.rank small {
  color: var(--mut);
  font-size: 13px;
  line-height: 1.3;
  display: block;
}
.rbar {
  display: flex;
  gap: 5px;
  margin-top: 8px;
}
.rbar i {
  flex: 1;
  height: 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .12);
}
.rbar i.on {
  background:
    linear-gradient(
      90deg,
      var(--gold),
      var(--mint));
}
.modes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 12px;
  max-width: 640px;
  width: 100%;
  margin: 12px auto;
}
.mode {
  position: relative;
  text-align: left;
  padding: 16px;
  border-radius: 24px;
  min-height: 150px;
  background:
    linear-gradient(
      160deg,
      color-mix(in srgb, var(--ac) 30%, #1b2050),
      #151a3f 70%);
  border: 1px solid rgba(255, 255, 255, .12);
  overflow: hidden;
  box-shadow: 0 18px 40px -22px var(--ac);
  transition: transform .15s;
}
.mode:active {
  transform: scale(.97);
}
.mode svg.mi {
  width: 58px;
  height: 58px;
  margin-bottom: 8px;
}
.mode b {
  display: block;
  font-size: 18px;
}
.mode span {
  display: block;
  color: var(--mut);
  font-size: 13px;
  margin-top: 3px;
  line-height: 1.3;
}
.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--rose);
  color: #3a0d1c;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px;
  max-width: 760px;
  width: 100%;
  margin: 12px auto 30px;
}
.pg {
  position: relative;
  border-radius: 20px;
  padding: 8px;
  background: var(--glass);
  border: 1px solid var(--line);
  text-align: center;
  transition: transform .15s;
}
.pg:active {
  transform: scale(.97);
}
.pg canvas {
  width: 100%;
  aspect-ratio: 3/4;
  border-radius: 14px;
  background: var(--paper);
  display: block;
}
.pg b {
  display: block;
  font-size: 14px;
  margin: 8px 0 2px;
}
.pg small {
  color: var(--mut);
  font-size: 12px;
}
.pg.locked canvas {
  filter: grayscale(1) brightness(.55);
}
.pg .lk {
  position: absolute;
  inset: 8px 8px 46px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-shadow: 0 2px 8px #000;
}
.pg.assigned {
  border-color: var(--rose);
  box-shadow: 0 0 0 2px rgba(255, 157, 180, .35);
}
.pg .ok {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--mint);
  color: #06352a;
  font-weight: 800;
  display: grid;
  place-items: center;
}
.sec {
  max-width: 760px;
  width: 100%;
  margin: 10px auto 0;
  color: var(--mut);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.stage {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  touch-action: none;
  border-radius: 20px;
}
.board {
  position: relative;
  transform-origin: 0 0;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .1);
  border-radius: 14px;
  overflow: hidden;
  background: var(--paper);
}
.board canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
}
.board .stk {
  position: absolute;
  width: 13%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  touch-action: none;
  cursor: grab;
  filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .25));
}
.board .stk.sel {
  outline: 2px dashed rgba(60, 60, 120, .6);
  outline-offset: 3px;
  border-radius: 12px;
}
.board .stk img {
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.bar {
  display: flex;
  gap: 8px;
  align-items: center;
  overflow-x: auto;
  padding: 6px 2px;
  scrollbar-width: none;
}
.bar::-webkit-scrollbar {
  display: none;
}
.tool {
  flex: none;
  width: 60px;
  height: 64px;
  min-width: 0;
  border-radius: 18px;
  background: var(--glass);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: var(--mut);
  transition: transform .15s, background .15s;
}
.tool svg {
  width: 34px;
  height: 34px;
}
.tool.on {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, .4);
}
.tool.lock {
  opacity: .35;
}
.sw {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, .25);
  box-shadow: inset 0 -4px 8px rgba(0, 0, 0, .18);
  transition: transform .15s;
}
.sw.on {
  transform: scale(1.18);
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .25);
}
.sw.num {
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  color: #1a1a2a;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
}
.sw.done {
  opacity: .4;
}
.stkbar .sb {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  padding: 6px;
}
.stkbar .sb img {
  width: 100%;
  height: 100%;
}
.hint {
  text-align: center;
  color: var(--mut);
  font-size: 13px;
  min-height: 18px;
}
.sizes {
  display: flex;
  gap: 6px;
}
.sizes button {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.sizes button.on {
  background: rgba(255, 255, 255, .2);
}
.sizes i {
  display: block;
  border-radius: 50%;
  background: #fff;
}
.spanel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 6px 2px;
}
.spanel label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--mut);
  background: var(--glass);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 12px;
}
.spanel input[type=range] {
  width: 90px;
  accent-color: var(--gold);
}
.spanel input[type=color] {
  width: 34px;
  height: 28px;
  border: 0;
  background: none;
  padding: 0;
}
.layers {
  display: flex;
  gap: 6px;
}
.layers button {
  padding: 6px 10px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 700;
}
.layers button.on {
  background: rgba(255, 210, 122, .25);
  border-color: var(--gold);
}
.layers button.hid {
  opacity: .45;
  text-decoration: line-through;
}
.chip {
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--glass);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 700;
}
.chip.on {
  background: rgba(255, 255, 255, .2);
}
#overlay {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(6, 8, 24, .66);
  backdrop-filter: blur(10px);
}
#overlay.on {
  display: flex;
  animation: fi .25s;
}
@keyframes fi {
  from {
    opacity: 0;
  }
}
.card {
  width: min(440px, 100%);
  max-height: 100%;
  overflow: auto;
  padding: 22px;
  border-radius: 28px;
  background:
    linear-gradient(
      180deg,
      #232a62,
      #161b42);
  border: 1px solid rgba(255, 255, 255, .16);
  text-align: center;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .7);
}
.card h2 {
  margin: 6px 0;
  font-size: 26px;
  letter-spacing: -.02em;
}
.card p {
  color: #d8dbf7;
  line-height: 1.45;
  margin: 8px 0;
}
.card .btns {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}
.ring {
  width: 150px;
  height: 150px;
  margin: 6px auto;
  position: relative;
}
.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring b {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 36px;
}
.ring circle {
  fill: none;
  stroke-width: 12;
  stroke-linecap: round;
}
.ring .tr {
  stroke: rgba(255, 255, 255, .12);
}
.ring .fl {
  transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .2, 1);
}
.stats {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin: 6px 0;
}
.stats div {
  flex: 1;
  padding: 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .07);
}
.stats b {
  display: block;
  font-size: 20px;
}
.stats span {
  font-size: 12px;
  color: var(--mut);
}
.unl {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}
.unl span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(127, 227, 196, .18);
  color: #bff5e4;
  font-size: 13px;
  font-weight: 700;
}
.beat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.beat svg {
  width: 100%;
  max-width: 340px;
  aspect-ratio: 16/10;
  border-radius: 20px;
  background:
    linear-gradient(
      180deg,
      #bfe4ff,
      #e9f6ff);
}
.dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 10px 0;
}
.dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .25);
}
.dots i.on {
  background: var(--gold);
  width: 20px;
  border-radius: 4px;
}
.qa {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.qa button {
  padding: 13px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .08);
  border: 1px solid var(--line);
  font-weight: 600;
  text-align: left;
}
.qa button.good {
  background: rgba(127, 227, 196, .3);
  border-color: var(--mint);
}
.qa button.try {
  animation: wig .35s;
}
@keyframes wig {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}
#toast {
  position: absolute;
  left: 50%;
  bottom: calc(var(--safe-b) + 120px);
  transform: translate(-50%, 20px);
  opacity: 0;
  z-index: 30;
  padding: 10px 16px;
  border-radius: 14px;
  background: rgba(10, 12, 34, .9);
  border: 1px solid var(--line);
  font-weight: 600;
  font-size: 14px;
  transition: .25s;
  pointer-events: none;
  max-width: 86vw;
  text-align: center;
}
#toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
.spark {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle,
      #fff,
      #ffd27a 50%,
      transparent 70%);
  pointer-events: none;
  z-index: 25;
  animation: sp 1s ease-out forwards;
}
@keyframes sp {
  to {
    transform: translate(var(--dx), var(--dy)) scale(.2);
    opacity: 0;
  }
}
.foot {
  margin: auto auto 0;
  color: var(--mut);
  font-size: 12px;
  text-align: center;
  padding-top: 16px;
}
[hidden] {
  display: none !important;
}
#app[data-screen=draw] #screen {
  padding-bottom: calc(var(--safe-b) + 50px);
}
.dwrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.rail {
  display: contents;
}
.rail .top {
  order: 0;
}
.rail .hint {
  order: 1;
}
.dwrap > .stage {
  order: 2;
}
.tbx {
  order: 3;
  min-width: 0;
}
.tools {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 8px 2px 4px;
}
.tools .tool {
  width: auto;
  height: 58px;
  font-size: 10px;
}
.tools .tool img {
  width: 30px;
  height: 30px;
}
.szrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 6px;
}
.szl {
  font-size: 12px;
  font-weight: 700;
  color: var(--mut);
}
.szrow input {
  flex: 1;
  accent-color: var(--gold);
  height: 28px;
  min-width: 0;
}
.szrow .szdot {
  flex: none;
  display: block;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .35);
  max-width: 40px;
  max-height: 40px;
  margin: 0 6px;
}
.colors {
  display: grid;
  grid-auto-flow: column;
  grid-template-rows: repeat(2, 32px);
  grid-auto-columns: 32px;
  gap: 7px;
  overflow-x: auto;
  padding: 5px 4px;
  scrollbar-width: none;
}
.colors::-webkit-scrollbar {
  display: none;
}
.colors .sw {
  width: 32px;
  height: 32px;
  border-width: 2px;
}
.stkbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px 2px;
  align-items: center;
}
@media (max-width:380px) {
  .tools {
    gap: 4px;
  }
  .tools .tool {
    height: 52px;
    font-size: 9px;
    border-radius: 14px;
  }
  .tools .tool img {
    width: 26px;
    height: 26px;
  }
}
@media (orientation:landscape) and (min-width:640px) {
  #app[data-screen=draw] #screen {
    padding: calc(var(--safe-t) + 8px) 10px calc(var(--safe-b) + 8px);
  }
  .dwrap {
    flex-direction: row;
    gap: 14px;
  }
  .rail {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: clamp(232px, 27vw, 320px);
    flex: none;
    min-height: 0;
    overflow-y: auto;
    padding: 0 2px 52px;
    scrollbar-width: thin;
  }
  .rail .top {
    flex-wrap: wrap;
    gap: 8px;
  }
  .rail .top h1 {
    order: -1;
    flex-basis: 100%;
    font-size: 19px;
  }
  .rail .top .cta {
    flex: 1;
  }
  .rail .hint {
    text-align: left;
    font-size: 12px;
  }
  .tools {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .colors {
    grid-auto-flow: row;
    grid-template-rows: none;
    grid-template-columns: repeat(auto-fill, 32px);
    overflow: visible;
    justify-content: space-between;
  }
  .stkbar {
    flex-wrap: wrap;
    overflow: visible;
  }
  .rail .bar {
    flex-wrap: wrap;
    overflow: visible;
  }
  .rail .spanel label {
    flex: 1 1 100%;
  }
  .rail .spanel input[type=range] {
    flex: 1;
  }
  .dwrap > .stage {
    flex: 1;
    border-radius: 16px;
  }
  .tool.on {
    transform: none;
  }
}
