:root {
  --ink: #1d1233; --yellow: #ffd23f; --red: #ef233c; --pink: #ff5d8f; --purple: #8338ec; --cream: #fff4e0;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: #2b1d4a radial-gradient(circle at 50% 40%, #4a2f7a, #1d1233 70%);
  color: var(--ink); font-family: "Rubik", system-ui, sans-serif;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; overscroll-behavior: none;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent;
}
#frame {
  position: relative; border: 6px solid var(--ink); border-radius: 22px; overflow: hidden;
  box-shadow: 0 10px 0 var(--ink), 0 20px 60px rgba(0,0,0,.5);
}
canvas { display: block; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.panel {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2.2%; padding: 6%; text-align: center; background: rgba(29, 18, 51, 0.18);
}
.panel[hidden] { display: none; }
#menu { justify-content: flex-start; padding-top: 7%; background: none; }
.logo {
  margin: 0; font-weight: 900; font-size: clamp(40px, 12vmin, 108px); line-height: .9; color: var(--red);
  -webkit-text-stroke: 0.06em var(--ink); paint-order: stroke fill; transform: rotate(-4deg);
  text-shadow: 0 .08em 0 var(--ink);
}
.logo span { display: block; color: #fff; font-size: 1.05em; transform: rotate(3deg); }
.tag { margin: 0; font-weight: 900; font-size: clamp(13px, 2.6vmin, 22px); background: #fff; border: 3px solid var(--ink); padding: .3em .8em; border-radius: 99px; }
h2 { margin: 0; font-weight: 900; font-size: clamp(28px, 7vmin, 60px); color: #fff; -webkit-text-stroke: 0.08em var(--ink); paint-order: stroke fill; }
button {
  font: 900 clamp(14px, 2.8vmin, 24px) "Rubik", system-ui, sans-serif; color: var(--ink);
  background: #fff; border: 4px solid var(--ink); border-radius: 16px; padding: .45em 1em; cursor: pointer;
  box-shadow: 0 5px 0 var(--ink); transition: transform .06s;
}
button:hover:not(:disabled) { background: var(--cream); }
button:active:not(:disabled) { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
button:focus-visible { outline: 4px solid var(--purple); outline-offset: 3px; }
button.big { background: var(--pink); color: #fff; font-size: clamp(22px, 5vmin, 44px); padding: .3em 1.4em; -webkit-text-stroke: 0.05em var(--ink); paint-order: stroke fill; }
button.big:hover { background: #ff7aa3; }
.row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.best { margin: 0; font-weight: 900; color: #fff; -webkit-text-stroke: 4px var(--ink); paint-order: stroke fill; font-size: clamp(16px, 3.4vmin, 28px); }
.score { margin: 0; font-weight: 900; font-size: clamp(60px, 18vmin, 160px); line-height: 1; color: var(--yellow); -webkit-text-stroke: 0.06em var(--ink); paint-order: stroke fill; }
#how-panel, #practice-panel { background: rgba(255, 210, 63, .96); }
#how-panel ul { text-align: left; max-width: 34em; margin: 0; padding-left: 1.2em; font-weight: 500; font-size: clamp(12px, 2.5vmin, 19px); line-height: 1.45; }
#how-panel li { margin-bottom: .4em; }
.small { margin: 0; font-weight: 500; font-size: clamp(12px, 2.3vmin, 17px); }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: 100%; max-width: 640px; }
.pick { padding: .4em .2em; font-size: clamp(10px, 2.1vmin, 17px); }
.pick.boss { background: #3c1642; color: var(--yellow); }
.pick:disabled { opacity: .5; cursor: default; }
.corner { position: absolute; top: 2%; right: 2%; padding: .2em .45em; font-size: clamp(14px, 3vmin, 24px); box-shadow: 0 3px 0 var(--ink); }
.corner.left { right: calc(2% + 3.2em); }
#over-title { color: var(--yellow); }
@media (max-width: 420px) { .grid { grid-template-columns: repeat(3, 1fr); } }
