.pair-host {
  margin: 2rem 0 0;
  padding: 1.75rem clamp(1.05rem, 3vw, 2.4rem);
  background: linear-gradient(115deg, #22273e, #171d32 70%);
  border: 1px solid #3c4259;
  border-radius: 1.25rem;
  color: #f6f4ff;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem 2rem;
  line-height: 1.5;
}
.controller-kicker {
  font-size: 0.9rem;
  letter-spacing: 0.045em;
  color: #c5b9ef;
  margin-bottom: 0.3rem;
}
.pair-host h2 {
  font-size: clamp(1.6rem, 3vw, 2.45rem);
  line-height: 1.16;
  letter-spacing: -0.04em;
  margin: 0 0 0.45rem;
}
.pair-host p:not(.controller-kicker) {
  font-size: 1rem;
  color: #ced1e0;
  max-width: 49rem;
}
.pair-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: #e6dfff;
  color: #1d1930;
  border: 1px solid #e6dfff;
  border-radius: 3rem;
  padding: 0.7rem 1.15rem;
  line-height: 1.3;
}
.pair-live {
  grid-column: 1/-1;
  display: grid;
  grid-template-columns: min(28vw, 10rem) 1fr;
  gap: 1.3rem;
  align-items: center;
}
.pair-host [hidden],
.phone [hidden] {
  display: none !important;
}
.pair-live canvas {
  width: 100%;
  height: auto;
  border-radius: 0.32rem;
  image-rendering: pixelated;
}
.pair-live h3 {
  margin: 0 0 0.3rem;
  font-size: 1.35rem;
}
.pair-live a {
  text-decoration: underline;
  text-underline-offset: 0.2rem;
}
.room-code {
  display: block;
  color: white;
  letter-spacing: 0.14em;
  font-size: clamp(1.6rem, 4vw, 2.75rem);
  font-weight: 500;
  line-height: 1.2;
  margin: 0.4rem 0;
}
.pair-status {
  grid-column: 1/-1;
}
.pair-status:empty {
  display: none;
}
.end-room,
.phone #leave {
  border: 0;
  background: transparent;
  color: #ded6f5;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
  font-size: 0.95rem;
  margin-top: 0.4rem;
}
.guest-target {
  outline: 3px solid #a9eddc !important;
  outline-offset: 3px;
}
.phone {
  min-height: 100vh;
  background: radial-gradient(ellipse at 86% 20%, #2b2c51, transparent 58%), #0b101e;
}
.phone header {
  width: min(100% - 2.5rem, 60rem);
  margin: auto;
  height: 5.25rem;
  border-bottom: 1px solid #42465a;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.phone header > a:last-child {
  color: #d8d6e8;
  font-size: 0.94rem;
}
.phone main {
  width: min(100% - 2.5rem, 34rem);
  margin: clamp(2rem, 7.5vh, 6rem) auto;
}
.phone h1 {
  font-size: clamp(3.2rem, 10vw, 6.1rem);
  letter-spacing: -0.065em;
  line-height: 1.04;
  margin: 0.35rem 0 1.15rem;
}
.phone #join-box > p,
.phone #game-help {
  color: #d0d4e5;
  line-height: 1.45;
  font-size: 1.07rem;
  max-width: 32rem;
}
.phone form {
  margin: 2.1rem 0 0;
}
.phone #code {
  width: 100%;
  border: 1px solid #686d89;
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  background: #121a2b;
  color: white;
  letter-spacing: 0.15em;
  font-size: 1.65rem;
  text-transform: uppercase;
  margin: 0.4rem 0;
}
.phone #hint,
.seat-footer,
.connection-status {
  color: #c3bddc;
  font-size: 0.97rem;
}
.phone form button {
  margin-top: 1.25rem;
  min-height: 3rem;
}
.seat-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}
.seat-line strong {
  color: #d2c4ff;
  font-weight: 500;
  font-size: 1.22rem;
}
.seat-line > span {
  border-radius: 1.3rem;
  background: #2c3043;
  color: #d4d8e6;
  font-size: 0.9rem;
  padding: 0.22rem 0.7rem;
}
.seat-line > span.active {
  background: #203e3e;
  color: #b9f4d8;
}
.guest-pad {
  margin: 1.55rem auto;
  display: grid;
  grid-template-columns: 1fr 1.12fr 1fr;
  grid-template-areas: '. up .' 'left ok right' '. down .';
  gap: 0.65rem;
  max-width: 27rem;
}
.guest-pad button {
  min-height: 3.9rem;
  border: 1px solid #53586f;
  border-radius: 1.1rem;
  background: #272b42;
  color: #eeefff;
  font-size: 1.6rem;
  line-height: 1.2;
  touch-action: manipulation;
  cursor: pointer;
}
.guest-pad button:disabled {
  opacity: 0.55;
}
.guest-pad button:active:enabled {
  background: #6b678f;
}
.guest-pad .pad-ok {
  grid-area: ok;
  background: #d3c7ff;
  color: #241e39;
  border-color: transparent;
  font-size: 1.23rem;
}
.pad-up {
  grid-area: up;
}
.pad-left {
  grid-area: left;
}
.pad-right {
  grid-area: right;
}
.pad-down {
  grid-area: down;
}
.guest-pad.foley-pad {
  display: flex;
  justify-content: center;
  margin: 2.1rem auto;
}
.foley-pad .pad-ok {
  width: min(62vw, 13.4rem);
  height: min(62vw, 13.4rem);
  border-radius: 50%;
  font-size: 1.6rem;
  box-shadow: 0 0 42px #9681ed23;
}
.seat-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid #414459;
  padding-top: 1rem;
}
.phone #leave {
  margin: 0;
}
.connection-status {
  margin-top: 0.95rem;
  min-height: 1.4em;
}
@media (max-width: 670px) {
  .pair-host {
    grid-template-columns: 1fr;
  }
  .pair-live {
    grid-template-columns: 6.25rem 1fr;
    gap: 0.85rem;
  }
  .pair-live a {
    overflow-wrap: anywhere;
  }
  .phone header {
    height: 4.15rem;
  }
  .phone header .brand img {
    width: 6.2rem;
  }
}
.room-tools {
  display: flex;
  gap: 1.15rem;
  flex-wrap: wrap;
  margin-top: 0.7rem;
}
.room-tools button {
  border: 0;
  background: transparent;
  color: #ded6f5;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 0.2rem;
  font-size: 0.95rem;
  margin: 0;
}
.pair-live.code-hidden {
  grid-template-columns: 1fr;
}
