:root {
  --ink: #2a1d24;
  --pink: #ff5d8f;
  --mint: #b7ead9;
  --cream: #fff6ea;
  --card: rgba(255, 246, 234, 0.94);
  color: var(--ink);
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: #241820;
}

body {
  min-height: 100dvh;
}

button, input {
  font: inherit;
  color: var(--ink);
}

button {
  border: 2px solid var(--ink);
  background: #fff;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  box-shadow: 0 3px 0 var(--ink);
  cursor: pointer;
}

button:hover { transform: translateY(-1px); }

button:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }

button:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
}

input {
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 0.55rem 0.7rem;
  background: #fff;
  min-width: 0;
}

#app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

#top, #dock { position: relative; z-index: 6; }

#top {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.45rem 0.8rem;
  background: var(--cream);
  border-bottom: 3px solid var(--ink);
}

.brand, h1, h2, .mega, #timer, #count, #phaseLabel {
  font-family: "Jua", "Malgun Gothic", sans-serif;
}

.brand { font-size: 1.35rem; }

#phaseLabel {
  padding: 0.15rem 0.6rem;
  border-radius: 999px;
  background: var(--mint);
  border: 2px solid var(--ink);
}

#timer {
  margin-left: auto;
  font-size: 1.8rem;
  line-height: 1;
}

#headerLeaveBtn {
  margin-left: auto;
  padding: 0.22rem 0.65rem;
  font-family: "Jua", "Malgun Gothic", sans-serif;
  font-size: 0.85rem;
  background: #fff;
  color: #e11d48;
  border: 2px solid var(--ink);
  box-shadow: 0 2px 0 var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

#headerLeaveBtn:hover {
  background: #ffe4e6;
}

#headerLeaveBtn[hidden] {
  display: none;
}

#timer.hot { color: var(--pink); }

#stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 0;
  overflow: hidden;
}

canvas#view {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #8fd8ff;
  touch-action: none;
}
