html,
body {
  overflow: hidden;
  position: fixed;
  inset: 0;
  user-select: none;
  -webkit-user-select: none;
}

#app {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top)) 12px calc(14px + env(safe-area-inset-bottom));
  gap: 10px;
}

/* stone, the one material every control is made of */
.btn,
.card,
.opt,
.field,
.size,
.word i {
  background: var(--stone);
  box-shadow: inset 0 3px 0 #ffffff22, inset 0 -5px 0 #0004, 0 7px 0 #1a1726, 0 14px 22px #000a;
}

/* who-am-I strip */
.me {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 900;
  font-size: 15px;
  letter-spacing: 0.04em;
}
.me .ghost {
  width: 26px;
}
.me .pts,
.timer {
  font: 400 15px 'Bagel Fat One';
  border-radius: 99px;
  padding: 3px 11px;
  background: var(--stone);
  box-shadow: inset 0 2px 0 #ffffff22, 0 3px 0 #1a1726;
}
.me .pts {
  color: var(--pumpkin);
  text-shadow: 0 0 10px var(--pumpkin);
}
.timer {
  min-width: 2.4em;
  text-align: center;
  color: var(--slime);
  text-shadow: 0 0 10px var(--slime);
  font-variant-numeric: tabular-nums;
}
.timer.low {
  color: var(--blood);
  text-shadow: 0 0 12px var(--blood);
  animation: wobble 0.5s;
}

.mid {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  min-height: 0;
}

.big {
  font: 400 34px 'Bagel Fat One';
  line-height: 1.05;
  color: #ece6ff;
  text-shadow: 0 2px 0 #0008, 0 0 18px #b26bff55;
}
.title {
  font-size: 58px;
  line-height: 0.95;
  color: var(--slime);
  text-shadow: 0 1px 0 #7fcc2e, 0 2px 0 #6db826, 0 3px 0 #5ca31f, 0 4px 0 #4b8e18, 0 5px 0 #3a7911, 0 0 26px #b6ff5a66, 0 12px 18px #000c;
  transform: rotate(-4deg);
}
.sub {
  font-size: 16px;
  font-weight: 700;
  color: #d9d2ee;
  opacity: 0.8;
  max-width: 300px;
}

/* bottom dock: the thumb zone always holds the action */
.dock {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.btn {
  flex: 1;
  height: 64px;
  border-radius: 22px;
  font: 400 24px 'Bagel Fat One';
  color: var(--pumpkin);
  text-shadow: 0 0 14px #ff9a3a99;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn svg {
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 0 6px currentColor);
}
.btn.ghosty {
  flex: 0 0 64px;
  color: #d9d2ee;
  text-shadow: none;
}
.btn.done {
  color: var(--slime);
  text-shadow: 0 0 14px #b6ff5a99;
}

/* join */
.field {
  width: 100%;
  height: 64px;
  border-radius: 22px;
  border: 0;
  color: var(--slime);
  font: 400 26px 'Bagel Fat One';
  text-align: center;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  outline: none;
  text-shadow: 0 0 12px #b6ff5a88;
}
.field::placeholder {
  color: #8a84a6;
  text-shadow: none;
  letter-spacing: 0.06em;
}
.stack {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.lobbyghost {
  width: 150px;
}
.g3d {
  width: 100%;
  height: min(40vh, 300px);
  flex: none;
  touch-action: none;
}
.g3d canvas {
  display: block;
}

/* game picker */
.cards {
  width: 100%;
  display: grid;
  gap: 14px;
}
.card {
  border-radius: 22px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}
.card .chip {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: none;
  display: grid;
  place-items: center;
  color: var(--ink);
  background: radial-gradient(circle at 50% 55%, #fff6 0 18%, var(--g) 42%, transparent 74%);
  box-shadow: 0 0 18px var(--g);
}
.card .chip svg {
  width: 20px;
  height: 20px;
}
.card b {
  font: 400 28px 'Bagel Fat One';
  display: block;
  line-height: 1;
  color: var(--g);
  text-shadow: 0 0 12px var(--g);
}
.card span {
  font-size: 13px;
  font-weight: 700;
  color: #d9d2ee;
  opacity: 0.75;
}

/* drawing */
.paper {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
  position: relative;
  flex: none;
  box-shadow: 0 0 0 4px #2b1a10, 0 0 0 7px #1a0f08, 0 14px 30px #000c;
}
.paper canvas {
  display: block;
  width: 100%;
  touch-action: none;
}
.paper .guide {
  filter: brightness(0.82) saturate(0.8);
  border-bottom: 3px dashed #16101c55;
}
.tools {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: nowrap;
}
.ink {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  border: 3px solid transparent;
  display: grid;
  place-items: center;
  color: var(--ink);
  box-shadow: 0 3px 0 #0008;
}
.ink svg {
  width: 18px;
}
.ink.on {
  border-color: var(--slime);
  box-shadow: 0 0 14px var(--slime);
  transform: scale(1.15);
}
.size {
  width: 46px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
}
.size i {
  display: block;
  background: #d9d2ee;
  border-radius: 50%;
}
.size.on i {
  background: var(--slime);
  box-shadow: 0 0 10px var(--slime);
}

/* lists to vote on */
.opts {
  width: 100%;
  display: grid;
  gap: 12px;
  overflow: auto;
  max-height: 100%;
  padding: 4px 2px 14px;
}
.opt {
  border-radius: 18px;
  padding: 16px;
  font: 400 20px 'Bagel Fat One';
  color: var(--bone);
  display: flex;
  gap: 12px;
  align-items: center;
  text-align: left;
}
.opt em {
  font-style: normal;
  color: var(--pumpkin);
  text-shadow: 0 0 10px var(--pumpkin);
  min-width: 24px;
}
.opt:disabled {
  opacity: 0.35;
}

/* séance */
.word {
  display: flex;
  gap: 6px;
  justify-content: center;
}
.word i {
  font-style: normal;
  width: 50px;
  height: 60px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font: 400 30px 'Bagel Fat One';
  color: #8a84a6;
  transition: color 0.3s, transform 0.4s var(--spring);
}
.word i.lit {
  color: var(--slime);
  text-shadow: 0 0 14px var(--slime);
  transform: rotate(-4deg) scale(1.08);
}
.pad {
  flex: 1;
  width: 100%;
  min-height: 0;
  position: relative;
  touch-action: none;
  display: grid;
  place-items: center;
}
.ring {
  width: min(78vw, 100%);
  aspect-ratio: 1;
  max-height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle, #b6ff5a22, #b6ff5a06 70%);
  border: 3px solid #b6ff5a88;
  box-shadow: 0 0 30px #b6ff5a33, inset 0 0 30px #b6ff5a22;
  position: relative;
}
.knob {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  aspect-ratio: 1;
  margin: -17% 0 0 -17%;
  border-radius: 50%;
  background: var(--stone);
  box-shadow: inset 0 3px 0 #ffffff22, 0 8px 20px #000a, 0 0 20px #b6ff5a44;
  display: grid;
  place-items: center;
}
.knob .ghost {
  width: 62%;
}
.spelled {
  font: 400 20px 'Bagel Fat One';
  letter-spacing: 0.14em;
  min-height: 26px;
  color: var(--slime);
  text-shadow: 0 0 12px #b6ff5a88;
  word-break: break-all;
}
