:root {
  --pink: #ff8fb8;
  --pink-dark: #e85d93;
  --mint: #b8f0d8;
  --cream: #fff8ee;
  --ink: #5a3d55;
  --sky: #cfe6ff;
  --panel: rgba(255, 248, 238, 0.94);
}
* { box-sizing: border-box; }
html, body {
  margin: 0; height: 100%;
  background: linear-gradient(#e7d9ff, #cfe6ff);
  color: var(--ink);
  font-family: "Trebuchet MS", "Comic Sans MS", "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none; user-select: none;
  touch-action: none;
  overscroll-behavior: none;
}
#app { height: 100%; display: flex; align-items: center; justify-content: center; }
#stage {
  position: relative;
  aspect-ratio: 16 / 9;
  width: min(100vw, 177.78vh);
  width: min(100vw, 177.78dvh);
  max-width: 100vw;
}
canvas {
  width: 100%; height: 100%; display: block;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(90, 61, 85, 0.25);
  background: var(--sky);
}
#hud {
  position: absolute; top: 8px; left: 10px; right: 10px;
  display: flex; gap: 12px; align-items: center; justify-content: space-between;
  font-size: clamp(13px, 2.4vh, 18px);
  pointer-events: none;
}
#hud > span { background: rgba(255,255,255,0.75); padding: 3px 10px; border-radius: 999px; }
#hud button { pointer-events: auto; }
.panel {
  position: absolute; top: 5%; bottom: 5%; left: 50%; transform: translateX(-50%);
  width: min(620px, 92%);
  background: var(--panel);
  border-radius: 26px;
  border: 4px solid #ffd3e4;
  padding: 4% 6%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1.4vh; text-align: center;
  overflow-y: auto;
}
.panel[hidden], #hud[hidden] { display: none; }
h1 { margin: 0; font-size: clamp(22px, 4.6vh, 38px); color: var(--pink-dark); text-shadow: 2px 2px 0 #fff; }
h2 { margin: 0.4em 0 0; font-size: clamp(16px, 2.8vh, 22px); }
p { margin: 0; font-size: clamp(14px, 2.3vh, 18px); line-height: 1.35; }
.small { font-size: clamp(12px, 1.9vh, 15px); opacity: 0.85; }
.quote { font-style: italic; }
.namebox { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: center; }
.name {
  background: var(--mint); padding: 4px 12px; border-radius: 999px;
  font-size: clamp(16px, 2.8vh, 22px);
}
button {
  font: inherit; color: var(--ink); cursor: pointer;
  border: 0; border-radius: 999px;
  background: #fff; box-shadow: 0 3px 0 #e9c6d6;
}
button:active { transform: translateY(2px); box-shadow: 0 1px 0 #e9c6d6; }
button.big {
  background: var(--pink); color: #fff;
  font-size: clamp(18px, 3.4vh, 28px); font-weight: bold;
  padding: 0.4em 1.6em; box-shadow: 0 5px 0 var(--pink-dark);
}
button.mini { padding: 4px 12px; font-size: clamp(12px, 1.9vh, 15px); }
.bigscore { font-size: clamp(20px, 3.8vh, 30px); }
#board {
  margin: 0; padding: 0 0 0 1.8em; text-align: left;
  width: 100%; max-width: 320px;
  font-size: clamp(13px, 2.1vh, 17px);
}
#board li { padding: 2px 6px; border-radius: 8px; display: list-item; }
#board li span { float: right; font-weight: bold; }
#board li.me { background: #ffe3ee; }
button:focus-visible { outline: 3px solid var(--pink-dark); outline-offset: 3px; }
