/* ── Readiness screen: two boards split by one black line ───────────── */

.screen--ready { align-items: stretch; }

.arena {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  background: #fff;
}

.arena__line {
  flex: none;
  height: 3px;
  background: var(--ink);
}

.side {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* the player's own coloured board, as the backdrop for their details */
.side__board {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 6px;
}

.side__board svg {
  width: auto;
  height: 100%;
  max-width: 100%;
}

.side__body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(9px, 1.8vh, 14px);
  width: 100%;
  padding: 16px;
}

.side--rival .side__body { padding-top: calc(var(--sat) + 52px); }
.side--you .side__body { padding-bottom: calc(var(--sab) + 12px); }

/* ── Player plate ───────────────────────────────────────────────────── */

.plate {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  max-width: 100%;
  padding: 9px 18px 9px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .84);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
  box-shadow: 0 1px 2px rgba(17, 24, 39, .06), 0 8px 22px rgba(17, 24, 39, .1);
}

.plate__avatar {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  background: var(--tone);
  color: #fff;
  font-size: 16px;
  font-weight: 750;
}

.plate__text { display: flex; flex-direction: column; min-width: 0; }
.plate__name { font-size: 15px; font-weight: 750; letter-spacing: -.01em; }
.plate__hash { font-size: 12px; color: var(--ink-soft); }

/* ── Waiting / arrival ──────────────────────────────────────────────── */

.joining {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.joining__pulse {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--tone);
  animation: joining-pulse 1.5s ease-in-out infinite;
}

@keyframes joining-pulse {
  0%, 100% { transform: scale(.7); opacity: .45; box-shadow: 0 0 0 0 transparent; }
  50% { transform: scale(1); opacity: 1; box-shadow: 0 0 0 9px rgba(18, 20, 26, .045); }
}

.joining__text {
  margin: 0;
  padding: 5px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: clamp(12.5px, 3.6vw, 15px);
  font-weight: 600;
  color: var(--ink-mid);
}

.side__arrive {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(9px, 1.8vh, 14px);
}

/* the rival enters from their own side of the line */
.side--rival .side__arrive.is-arriving { animation: arrive-down .55s cubic-bezier(.2, .9, .3, 1) both; }

@keyframes arrive-down {
  from { opacity: 0; transform: translateY(-46px); }
  to { opacity: 1; transform: none; }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 15px 7px 12px;
  border-radius: 999px;
  background: var(--tone);
  color: #fff;
  font-size: clamp(11.5px, 3.3vw, 13.5px);
  font-weight: 750;
  letter-spacing: .01em;
  box-shadow: 0 6px 16px -4px var(--tone);
}

.badge svg { width: 15px; height: 15px; }

/* ── Your side ──────────────────────────────────────────────────────── */

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: clamp(11px, 3.1vw, 13px);
  font-weight: 650;
  color: var(--ink-mid);
}

.chip__dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--tone);
}

.you__action {
  display: grid;
  place-items: center;
  min-height: clamp(48px, 6.8vh, 56px);
  width: 100%;
}

.ready-btn {
  width: min(100%, 240px);
  margin-top: 0;
}

.ready-btn.is-arriving { animation: arrive-up .45s cubic-bezier(.2, .9, .3, 1) both; }

@keyframes arrive-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .joining__pulse { animation: none; }
  .side__arrive.is-arriving, .ready-btn.is-arriving { animation-duration: .01s; }
}
