/* Two phones (P7): the pairing sheet, the join screen, the player view's waiting note, each
   phone's own shop, the two-phone unlock and the reconnect bar. Candlelight tokens only
   (tokens.css); transform and opacity are the only things that move.

   The one bold thing here is the QR code as a place card for the second seat: parchment card
   stock with the gold foil line, propped a little crooked on the table, the four words under
   it in Fraunces like a name on a place card. Everything else stays quiet. */

/* ---------------------------------------------------------------------------------------
   Pairing sheet (host) */
.overlay-pair {
  align-items: flex-end;
  overflow-y: auto;
}

.pair-sheet {
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.pair-sheet h2 {
  font-size: 28px;
}

.pair-lead {
  margin-top: 0;
}

.pair-who {
  margin: 10px 0 2px;
}

.pair-who .segment input:checked + span {
  border-color: var(--player);
  background: color-mix(in oklab, var(--player) 16%, transparent);
  color: color-mix(in oklab, var(--player) 70%, white);
}

/* The place card. Light card, dark squares: every phone camera reads it in a dim room. */
.pair-qr {
  width: min(52vw, 220px);
  margin: 14px auto 10px;
  padding: 10px;
  border-radius: var(--r-tile);
  background: var(--text);
  box-shadow: inset 0 0 0 1px var(--gold-deep), inset 0 0 0 5px var(--text), inset 0 0 0 6px var(--line), var(--shadow-lift);
  transform: rotate(-1.5deg);
}

.pair-qr svg {
  display: block;
  width: 100%;
  height: auto;
}

.qr-paper {
  fill: var(--text);
}

.qr-ink {
  fill: var(--ink);
}

.pair-how {
  max-width: 34ch;
  margin: 0 auto;
  color: var(--text-soft);
  font-size: var(--fs-small);
  text-align: center;
  overflow-wrap: anywhere;
}

.pair-words,
.join-key {
  margin: 6px 0 2px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 24px;
  line-height: 1.2;
  text-align: center;
  color: var(--gold-hi);
}

.pair-status {
  margin: 10px 0 2px;
  font-weight: 700;
  text-align: center;
  color: var(--muted);
}

.pair-status.is-ok {
  color: var(--gold);
}

.pair-status.is-warn {
  color: var(--danger);
  font-weight: 600;
}

/* ---------------------------------------------------------------------------------------
   Pause menu rows */
.pause-two {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line-soft);
}

.pause-two-text {
  margin: 0;
  color: var(--text-soft);
}

/* ---------------------------------------------------------------------------------------
   Join screen (guest) */
.screen-join {
  text-align: center;
}

.join-cards {
  position: relative;
  height: 172px;
  margin: 8px auto 10px;
}

.join-cards .home-card.is-left {
  transform: rotate(-9deg) translateX(-30px);
}

.join-cards .home-card.is-right {
  transform: rotate(7deg) translateX(30px);
}

.join-lead {
  max-width: 34ch;
  margin: 10px auto 0;
  color: var(--text-soft);
}

.join-form {
  margin-top: 22px;
  text-align: left;
}

.join-input {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  text-align: center;
}

/* ---------------------------------------------------------------------------------------
   Player view: the other phone waits, calmly */
.waiting-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 18px 0 14px;
  padding: 14px 16px;
  border-radius: var(--r-tile);
  background: var(--raised);
  box-shadow: inset 0 0 0 1px var(--line-soft);
  color: var(--text-soft);
  font-size: var(--fs-body);
}

.waiting-flame {
  flex: 0 0 auto;
  width: 12px;
  height: 17px;
  margin-top: 3px;
  color: var(--gold);
  transform-origin: 50% 100%;
  animation: waiting-breathe 2.6s var(--ease) infinite;
}

@keyframes waiting-breathe {
  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.88);
  }
  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

.react-metoo {
  margin: 12px 0;
  font-weight: 700;
  color: var(--heat-3);
}

/* Scoreboard: this phone's own player. */
.chip-you {
  flex: 0 0 auto;
  padding: 1px 7px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--player) 60%, transparent);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-soft);
}

/* While a tap from the second phone is on its way to the host: no double taps. */
html[data-net-wait] #app button {
  pointer-events: none;
}

/* ---------------------------------------------------------------------------------------
   Each phone's own shop, as a sheet over the game */
.overlay-shop {
  overflow-y: auto;
}

.own-shop {
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.own-shop .screen-title {
  margin-top: 0;
}

/* ---------------------------------------------------------------------------------------
   Two-phone unlock: my circle below, the other player's state above */
.overlay-unlock.is-two .hold-zone {
  flex: 1 1 auto;
  min-height: 220px;
}

.hold-peer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--tap);
  margin: 0;
  border-radius: var(--r-control);
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--player) 40%, transparent);
  font-weight: 700;
  color: color-mix(in oklab, var(--player) 82%, white);
}

.hold-peer-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--player);
  opacity: 0.3;
  transform: scale(0.7);
  transition: opacity var(--dur-ui) var(--ease), transform 420ms var(--spring-pop);
}

.hold-peer.is-held .hold-peer-dot {
  opacity: 1;
  transform: scale(1.15);
}

/* ---------------------------------------------------------------------------------------
   A phone is away: a quiet bar at the top */
.net-bar {
  position: fixed;
  top: calc(10px + env(safe-area-inset-top));
  left: 50%;
  z-index: 30;
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 10px 18px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line), var(--shadow-lift);
  color: var(--text);
  font-weight: 700;
  font-size: 16px;
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -16px);
  transition: opacity var(--dur-ui) var(--ease), transform var(--dur-sheet) var(--spring-soft);
}

.net-bar.is-shown {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (prefers-reduced-motion: reduce) {
  .waiting-flame {
    animation: none;
    opacity: 1;
    transform: none;
  }
  .pair-qr {
    transform: none;
  }
}
