/* The phone controller. One thumb, one drink, portrait. */
html,
body {
  overscroll-behavior: none;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

.bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.25);
  border-bottom: 3px solid var(--c, var(--pink));
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--c, var(--violet));
  display: grid;
  place-items: center;
  font-size: 19px;
  flex: none;
}

.me-name {
  font-family: var(--display);
  font-size: 17px;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.me-score {
  font-family: var(--display);
  color: var(--yellow);
}

.vip-menu {
  font-size: 24px;
  font-weight: 900;
  width: 40px;
  height: 34px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--line);
}

.vip-panel {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.35);
}

.vip-panel .btn {
  flex: 1;
  font-size: 13px;
  padding: 10px;
}

.timer {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
}

.timer-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--mint), var(--yellow));
  transform-origin: left;
}

.timer.low .timer-bar {
  background: var(--red);
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 16px 24px;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
}

.view > * {
  animation: pop 0.3s both;
}

.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
}

.big-emoji {
  font-size: 84px;
  line-height: 1;
}

.h1 {
  font-family: var(--display);
  text-transform: uppercase;
  font-size: 30px;
  line-height: 1;
  margin: 0;
  color: var(--yellow);
}

.p {
  font-size: 17px;
  line-height: 1.4;
  color: var(--ink-dim);
  margin: 0;
}

.prompt {
  font-family: var(--display);
  font-size: 21px;
  line-height: 1.15;
  background: var(--ink);
  color: #14061f;
  border-radius: 16px;
  padding: 14px 16px;
  box-shadow: 5px 5px 0 var(--violet);
  overflow-wrap: anywhere;
}

.prompt.small {
  font-size: 17px;
  box-shadow: 4px 4px 0 var(--violet);
}

.logo.join-logo {
  font-size: 52px;
  text-align: center;
  margin: 18px 0 8px;
}

label.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

input[type='text'],
textarea {
  font: inherit;
  font-size: 20px; /* 16px+ stops iOS from zooming on focus */
  font-weight: 700;
  color: var(--ink);
  background: rgba(0, 0, 0, 0.35);
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  width: 100%;
  outline: none;
  user-select: text;
  -webkit-user-select: text;
  resize: none;
  letter-spacing: 0;
  text-transform: none;
}

input[type='text']:focus,
textarea:focus {
  border-color: var(--mint);
}

input.code {
  font-family: var(--display);
  font-size: 34px;
  letter-spacing: 0.3em;
  text-align: center;
  text-transform: uppercase;
}

.count {
  align-self: flex-end;
  font-size: 12px;
  color: var(--ink-dim);
  margin-top: -8px;
}

.btn {
  font-size: 20px;
  width: 100%;
}

.btn.small {
  font-size: 14px;
  padding: 10px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  text-align: left;
  background: var(--panel-2);
  border: 3px solid transparent;
  border-radius: 16px;
  padding: 14px 16px;
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-wrap: anywhere;
}

.option small {
  font-weight: 600;
  color: var(--ink-dim);
  font-size: 13px;
}

.option img {
  max-width: 100%;
  border-radius: 10px;
  background: #fff;
}

.option.on {
  border-color: var(--yellow);
  background: var(--pink);
}

.game-pick {
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.game-pick .gi {
  font-size: 30px;
}

.game-pick.off {
  opacity: 0.45;
}

/* Volume sliders in the VIP menu */
.vip-slider {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 4px;
  font-weight: 700;
}
.vip-slider input[type='range'] {
  flex: 1;
  min-width: 0;
}

/* Pause: covers everything except the toast and reconnect banner. */
.pause-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 24px;
  text-align: center;
  background: rgba(10, 3, 20, 0.94);
}
.pause-icon { font-size: 64px; line-height: 1; }

/* VIP player list with Remove buttons */
.roster {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.roster-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.roster-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.roster-remove {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

/* drawing */
.canvas-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 5px 5px 0 var(--violet);
}

canvas {
  width: 100%;
  height: 100%;
  touch-action: none;
  display: block;
}

.tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.swatch {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid transparent;
  background: var(--s);
}

.swatch.on {
  border-color: var(--yellow);
  transform: scale(1.15);
}

.tools .tool {
  margin-left: auto;
  padding: 8px 12px;
  border-radius: 10px;
  box-shadow: inset 0 0 0 2px var(--line);
  font-weight: 800;
  font-size: 14px;
}

.tools .tool + .tool {
  margin-left: 0;
}

/* number */
.num-value {
  font-family: var(--display);
  font-size: 64px;
  text-align: center;
  color: var(--yellow);
}

input[type='range'] {
  width: 100%;
  height: 44px;
  accent-color: var(--pink);
}

.toast,
.offline {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  background: var(--red);
  color: #fff;
  font-weight: 800;
  text-align: center;
  padding: 12px 16px;
  border-radius: 14px;
  z-index: 10;
}

.offline {
  background: #555;
}

/* Guests' phones respect their reduced-motion setting. The TV does not: it is the show. */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
