/* Phone layout only. No page scroll — each screen owns 100dvh; only designated
   lists scroll. Safe-area insets padded on the shell. */
body.is-phone {
  background: var(--paper);
  background-image: radial-gradient(rgba(36, 48, 79, 0.05) 1.5px, transparent 1.5px);
  background-size: 22px 22px;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
}
body.is-phone #app { height: 100dvh; }

.ph-screen {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  padding: calc(0.9rem + env(safe-area-inset-top)) 1rem calc(0.9rem + env(safe-area-inset-bottom));
  max-width: 34rem;
  margin: 0 auto;
}
.ph-center { align-items: center; justify-content: center; text-align: center; }

.ph-brand { display: flex; align-items: center; gap: 0.5rem; justify-content: center; }
.ph-brand-logo { font-size: 1.8rem; }
.ph-brand-name {
  font-family: var(--font-doodle);
  font-size: 2rem;
  font-weight: 700;
  color: var(--coral-deep);
  text-shadow: 0.08rem 0.1rem 0 rgba(0, 0, 0, 0.15);
}
.ph-big-emoji { font-size: 3.6rem; }
.ph-title { font-family: var(--font-doodle); font-size: 1.5rem; }
.ph-muted { color: var(--ink-soft); font-size: 0.95rem; }
.ph-error { color: var(--danger); font-weight: 700; }

.ph-input {
  width: 100%;
  font-size: 1.15rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 0.9rem 1.2rem 0.9rem 1.2rem / 1.2rem 0.9rem 1.2rem 0.9rem;
  padding: 0.7em 1em;
  outline: none;
}
.ph-input:focus { border-color: var(--coral); }

/* Lobby */
.ph-players {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}
.ph-player-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 2px solid var(--paper-edge);
  border-radius: 0.8rem;
  padding: 0.55em 0.9em;
  font-weight: 600;
}
.ph-player-me { border-color: var(--coral); }
.ph-player-away { opacity: 0.45; }
.ph-player-you {
  font-size: 0.75rem;
  background: var(--coral);
  color: #fff;
  padding: 0.15em 0.6em;
  border-radius: 1rem;
  font-weight: 700;
}
.ph-host-zone { display: flex; flex-direction: column; gap: 0.5rem; text-align: center; }
.ph-player-name { display: inline-flex; align-items: center; gap: 0.45em; }
.ph-face {
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: #fff;
  object-fit: cover;
}
.ph-avatar-zone { display: flex; align-items: center; justify-content: center; gap: 0.7rem; }
.ph-avatar-preview {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: #fff;
  object-fit: cover;
}
.ph-avatar-canvas-wrap {
  width: min(70vw, 17rem);
  aspect-ratio: 1 / 1;
  margin: 0 auto;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 1rem;
  overflow: hidden;
  flex-shrink: 0;
}
.ph-waitlead { text-align: center; animation: pulse 2s ease-in-out infinite; }

/* Task banner + timer */
.ph-task { text-align: center; }
.ph-task-label { color: var(--ink-soft); font-weight: 700; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; }
.ph-task-word {
  font-family: var(--font-doodle);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.ph-timebar {
  position: relative;
  height: 1.15rem;
  background: rgba(36, 48, 79, 0.12);
  border-radius: 1rem;
  overflow: hidden;
  flex-shrink: 0;
}
.ph-timebar-fill {
  height: 100%;
  width: 100%;
  background: var(--teal);
  border-radius: 1rem;
  transition: width 0.25s linear;
}
.ph-timebar-low { background: var(--coral); }
.ph-timenum {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--ink);
}

/* Drawing screen */
.ph-drawing { gap: 0.55rem; }
.ph-canvas-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 0.8rem;
  overflow: hidden;
  flex-shrink: 0;
}
.dc-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}
.ph-tools { display: flex; flex-direction: column; gap: 0.45rem; }
.ph-toolrow { display: flex; gap: 0.45rem; justify-content: center; align-items: center; flex-wrap: wrap; }
.ph-swatch {
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 50%;
  border: 3px solid rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
.ph-swatch-on { border-color: var(--ink); transform: scale(1.18); box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--ink); }
.ph-sizebtn {
  width: 2.3rem;
  height: 2.3rem;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--paper-edge);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.ph-sizebtn-on { border-color: var(--ink); background: #fff; }
.ph-sizedot { background: var(--ink); border-radius: 50%; display: block; }
.ph-tool {
  background: #fff;
  border: 2px solid var(--paper-edge);
  border-radius: 0.7rem;
  padding: 0.45em 0.8em;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ink);
}
.ph-tool-on { border-color: var(--ink); background: var(--yellow); }
.ph-done { margin-top: auto; flex-shrink: 0; }

/* Guess screen */
.ph-guessing { gap: 0.6rem; }
.ph-guess-imgwrap {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 3px solid var(--ink);
  border-radius: 0.8rem;
  overflow: hidden;
}
.ph-guess-img { max-height: 100%; object-fit: contain; }
.ph-guess-noimg { color: var(--ink-soft); font-weight: 700; padding: 1rem; text-align: center; }

/* Waiting */
.ph-checks {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  max-width: 20rem;
  overflow-y: auto;
  min-height: 0;
}
.ph-check-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  background: #fff;
  border: 2px solid var(--paper-edge);
  border-radius: 0.7rem;
  padding: 0.45em 0.8em;
  font-weight: 600;
}
.ph-check-mark { width: 1.5rem; text-align: center; }

/* Review remote */
.ph-remote { gap: 0.7rem; }
.ph-remote-row { display: flex; gap: 0.5rem; }
.ph-remote-btn { flex: 1; font-size: 1.05rem; }
.ph-remote-mid { background: var(--yellow); }
.ph-remote-label {
  color: var(--ink-soft);
  font-weight: 700;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.3rem;
}
.ph-chains {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
}
.ph-chainbtn {
  background: #fff;
  border: 2px solid var(--paper-edge);
  border-radius: 0.8rem;
  padding: 0.6em 0.5em;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ph-chainbtn-on { border-color: var(--coral); background: #fff4f0; }
