/* ==========================================================================================
   screens/room.css — room/waiting screen: invite key, 4 seat cards, bottom action bar.
   ========================================================================================== */

.room-screen .topbar { height: 1.36rem; }
.room-ping { display: flex; flex-direction: column; align-items: flex-start; gap: .04rem; }

/* ---- invite key ---------------------------------------------------------------------------------------- */
.invite {
  --bk-c: var(--mint-500);
  display: grid;
  grid-template-columns: auto auto;
  column-gap: .2rem;
  row-gap: .06rem;
  align-items: center;
  padding: .1rem .16rem .12rem;
  background: rgba(0, 0, 0, .38);
  border: 1px solid var(--line);
}
.invite__label { grid-column: 1 / -1; display: flex; align-items: center; gap: .07rem; font-size: .14rem; color: var(--text-lo); }
.invite__label .icon { width: .16rem; height: .16rem; color: var(--mint-500); }
.invite__code { display: flex; gap: .06rem; }
.invite__code span {
  display: grid;
  place-items: center;
  width: .46rem;
  height: .58rem;
  background: linear-gradient(180deg, rgba(78, 216, 175, .1), rgba(78, 216, 175, .02));
  border-bottom: 2px solid var(--mint-600);
  color: var(--mint-400);
  font-size: .44rem;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 0 .16rem rgba(23, 249, 183, .45);
}
.invite__btns { display: flex; flex-direction: column; gap: .06rem; }
.solo-note { display: flex; flex-direction: column; align-items: flex-end; gap: .03rem; font-size: .16rem; color: var(--text-lo); }

/* ---- seats ------------------------------------------------------------------------------------------------ */
.seats {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 3.8rem));
  grid-template-rows: minmax(0, 6rem);
  justify-content: center;
  align-content: center;
  gap: .3rem;
  padding: .3rem .6rem .24rem;
}
.seats--solo { grid-template-columns: 3.8rem minmax(0, 6.4rem); }

/* ---- quick-match toggle (host opts the waiting room into the public match pool) ------------------------- */
.match-toggle-row {
  flex: none;
  display: flex;
  justify-content: flex-end;
  /* Align with the start button in the marked bottom-right area. */
  width: 100%;
  margin: 0;
  padding: 0 .6rem .04rem;
}
.match-toggle {
  --bk-c: var(--line-3);
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-width: 3.2rem;
  min-height: .42rem;
  gap: .1rem;
  padding: .07rem .14rem .07rem .11rem;
  background: rgba(0, 0, 0, .38);
  border: 1px solid var(--line);
  color: var(--text-lo);
  font-size: .15rem;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: border-color .15s ease, color .15s ease;
}
.match-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.match-toggle:focus-within { outline: 2px solid var(--mint-400); outline-offset: 4px; }
.match-toggle__box {
  display: grid;
  place-items: center;
  width: .2rem;
  height: .2rem;
  border: 1px solid var(--line-3);
  background: rgba(0, 0, 0, .45);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.match-toggle__box svg {
  width: .13rem;
  height: .11rem;
  overflow: visible;
}
.match-toggle__box svg path {
  fill: none;
  stroke: transparent;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .15s ease;
}
.match-toggle__pulse {
  width: .07rem;
  height: .07rem;
  border-radius: 50%;
  background: var(--mint-400);
  animation: matchPulse 1.2s ease-in-out infinite;
}
.match-toggle:not(.is-locked):hover { border-color: var(--mint-600); color: var(--mint-400); }
.match-toggle:not(.is-locked):hover .match-toggle__box { border-color: var(--mint-600); }
.match-toggle.is-on {
  --bk-c: var(--mint-600);
  border-color: var(--mint-600);
  color: var(--mint-400);
}
.match-toggle.is-on .match-toggle__box {
  border-color: var(--mint-600);
  background: var(--mint-600);
  box-shadow: 0 0 .12rem rgba(23, 249, 183, .45);
}
.match-toggle.is-on .match-toggle__box svg path { stroke: var(--text-on-mint); }
.match-toggle.is-locked { cursor: not-allowed; opacity: .72; }
@keyframes matchPulse {
  0%, 100% { opacity: .3; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1.25); }
}
@media (prefers-reduced-motion: reduce) {
  .match-toggle__pulse { animation: none; }
}

.seat {
  --bk-c: var(--line-3);
  --bk-l: .18rem;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .07rem;
  height: 100%;
  min-height: 0;
  padding: .16rem .2rem .18rem;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(29, 35, 32, .95), rgba(11, 14, 13, .97));
  border: 1px solid var(--line);
  box-shadow: 0 .14rem .34rem rgba(0, 0, 0, .4);
  transition: border-color var(--t-med), box-shadow var(--t-med);
  animation: seat-in var(--t-slow) var(--ease-out) backwards;
  animation-delay: calc(var(--seat-i, 0) * 60ms);
}
@keyframes seat-in { from { opacity: 0; transform: translateY(.18rem); } }
.seat::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 3px;
  background: var(--line-2);
  transition: background var(--t-med), box-shadow var(--t-med);
}
.seat__head { align-self: stretch; display: flex; align-items: center; gap: .1rem; }
.seat__no { font-size: .22rem; font-weight: 700; color: var(--text-md); padding-left: .08rem; border-left: 3px solid var(--line-3); line-height: 1.1; }
.seat__host {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: .04rem;
  padding: .02rem .09rem;
  background: var(--gold);
  color: #1d1400;
  font-size: .13rem;
  font-weight: 700;
}
.seat__host .icon { width: .15rem; height: .15rem; }
.seat__art {
  position: relative;
  flex: 1;
  min-height: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .08rem;
  margin: .06rem 0 .04rem;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 42%, rgba(78, 216, 175, .08), transparent 62%),
    linear-gradient(rgba(78, 216, 175, .04) 1px, transparent 1px) 0 0 / .3rem .3rem,
    linear-gradient(90deg, rgba(78, 216, 175, .04) 1px, transparent 1px) 0 0 / .3rem .3rem,
    #0b0e0d;
  border: 1px solid rgba(255, 255, 255, .04);
}
.seat__stripes {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: .14rem;
  background: repeating-linear-gradient(-45deg, rgba(255, 255, 255, .06) 0 .05rem, transparent .05rem .1rem);
}
.seat__art .avatar { --av: 2.1rem; }
.seat__bot-label {
  display: flex;
  align-items: center;
  gap: .05rem;
  padding: .02rem .1rem;
  background: rgba(159, 212, 255, .1);
  border: 1px solid rgba(159, 212, 255, .35);
  color: var(--ice);
  font-size: .14rem;
  font-weight: 700;
}
.seat__bot-label .icon { width: .16rem; height: .16rem; }
.seat__who { display: flex; align-items: center; gap: .08rem; max-width: 100%; }
.seat__name { font-size: .26rem; font-weight: 700; max-width: 3rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.seat__you { flex: none; padding: .01rem .07rem; background: var(--mint-500); color: var(--text-on-mint); font-size: .13rem; font-weight: 700; }
.seat__foot {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .1rem;
  min-height: .46rem;
  margin-top: .06rem;
  padding-top: .1rem;
  border-top: 1px solid var(--line);
}
.seat__foot .tt-anchor { position: absolute; right: .14rem; bottom: .14rem; }
.seat__state { display: flex; align-items: center; gap: .06rem; font-size: .18rem; font-weight: 700; letter-spacing: .06em; }
.seat__state .icon { width: .22rem; height: .22rem; }
.seat__state--ready { color: var(--mint-400); }
.seat__state--waiting { color: var(--text-lo); }
.seat__state--offline { color: var(--orange-hi); }
.seat__state--host { color: var(--gold-2); }

.seat.is-ready { --bk-c: var(--mint-500); border-color: var(--mint-800); }
.seat.is-ready::before { background: var(--mint-500); box-shadow: 0 0 .12rem rgba(23, 249, 183, .6); }
.seat.is-host .seat__no { border-left-color: var(--gold); }
.seat.is-me { box-shadow: 0 0 0 1px rgba(78, 216, 175, .28), 0 0 .44rem rgba(23, 249, 183, .12), 0 .14rem .34rem rgba(0, 0, 0, .4); }
.seat.is-me .seat__no { color: var(--mint-400); }
.seat.is-offline::before { background: var(--orange); }
.seat.is-bot .seat__art { background:
    radial-gradient(circle at 50% 42%, rgba(159, 212, 255, .08), transparent 62%),
    linear-gradient(rgba(159, 212, 255, .04) 1px, transparent 1px) 0 0 / .3rem .3rem,
    linear-gradient(90deg, rgba(159, 212, 255, .04) 1px, transparent 1px) 0 0 / .3rem .3rem,
    #0b0e10; }

.seat--empty { background: rgba(10, 13, 12, .5); border-style: dashed; border-color: var(--line-2); box-shadow: none; }
.seat--empty .seat__art { background: transparent; border: 0; }
.seat__radar {
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background:
    repeating-radial-gradient(circle, transparent 0 .2rem, rgba(78, 216, 175, .14) .2rem .21rem),
    /* same geometry as .title-bg__sweep: bright edge at 100% (== 0deg) so it leads the clockwise
       rotation and the glow trails behind; see the comment in screens/title.css. */
    conic-gradient(from 0deg, transparent 0 75%, rgba(23, 249, 183, .2) 100%);
  -webkit-mask-image: radial-gradient(circle, #000 60%, transparent 71%);
  mask-image: radial-gradient(circle, #000 60%, transparent 71%);
  animation: radar-sweep 4s linear infinite;
}
@keyframes radar-sweep { to { transform: rotate(360deg); } }
.seat__wait { font-size: .2rem; color: var(--text-lo); letter-spacing: .08em; }
.seat--empty .seat__foot { border-top-style: dashed; }

.solo-brief {
  --bk-c: var(--mint-500);
  align-self: stretch;
  display: flex;
  flex-direction: column;
  gap: .14rem;
  height: 100%;
  padding: .34rem .4rem;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .014) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(24, 29, 27, .92), rgba(11, 14, 13, .95));
  border: 1px solid var(--line);
  animation: seat-in var(--t-slow) 80ms var(--ease-out) backwards;
}
.solo-brief h2 { font-size: .36rem; font-weight: 900; letter-spacing: .06em; }
.solo-brief p { font-size: .18rem; color: var(--text-md); }
.solo-brief ul { margin: .06rem 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: .08rem; font-size: .16rem; color: var(--text-lo); }
.solo-brief li::before { content: ''; display: inline-block; width: .06rem; height: .06rem; margin: 0 .12rem .02rem 0; background: var(--mint-600); transform: rotate(45deg); vertical-align: middle; }
.solo-brief b { color: var(--text-hi); }

/* ---- spectator seats (观战席, community report #26) -------------------------------------------------------------- */
.specbar {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: .14rem;
  padding: 0 .6rem .16rem;
  font-size: .15rem;
  color: var(--text-lo);
}
.specbar__label { display: flex; align-items: baseline; gap: .06rem; font-weight: 700; color: var(--text-md); }
.specbar__label .icon { width: .18rem; height: .18rem; align-self: center; color: var(--mint-500); }
.specbar__label b { color: var(--mint-400); }
.specbar__who {
  display: inline-flex;
  align-items: center;
  gap: .06rem;
  min-height: .36rem;
  padding: 0 .14rem;
  border: 1px solid var(--line-2);
  background: rgba(0, 0, 0, .32);
  color: var(--text-hi);
}
.specbar__who.is-me { border-color: var(--mint-600); }
.specbar__who.is-offline { color: var(--text-dim); }
.specbar__who > .icon { width: .16rem; height: .16rem; }

/* ---- bottom bar ----------------------------------------------------------------------------------------- */
.room-bar {
  position: relative;
  flex: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: .3rem;
  height: 1.5rem;
  padding: 0 .6rem;
  background: linear-gradient(0deg, rgba(7, 9, 8, .96), rgba(10, 13, 12, .7));
  border-top: 1px solid var(--line);
}
.room-bar::before {
  content: '';
  position: absolute;
  left: .6rem;
  right: .6rem;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, var(--mint-700), transparent 30%, transparent 70%, var(--mint-700));
}
.room-bar__left { display: flex; align-items: center; gap: .22rem; min-width: 0; }
.room-bar__label { display: flex; flex-direction: column; font-size: .17rem; font-weight: 700; color: var(--text-md); line-height: 1.35; }
.room-bar__center { display: flex; flex-direction: column; align-items: center; gap: .06rem; }
.room-bar__right { justify-self: end; display: flex; align-items: center; gap: .16rem; }
.room-bar__status { font-size: .15rem; }
.room-bar__status .icon { width: .18rem; height: .18rem; margin-right: .05rem; vertical-align: -.03rem; }

.dpick { display: flex; border: 1px solid var(--line-2); background: rgba(0, 0, 0, .3); }
.dpick__opt {
  --d-color: var(--amber);
  position: relative;
  display: flex;
  align-items: center;
  gap: .06rem;
  height: .54rem;
  padding: 0 .2rem;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: var(--text-lo);
  font-size: .18rem;
  font-weight: 700;
  letter-spacing: .08em;
  transition: color var(--t-fast), background-color var(--t-med), box-shadow var(--t-med);
}
.dpick__opt:last-child { border-right: 0; }
.dpick__opt .icon { width: .2rem; height: .2rem; color: var(--d-color); opacity: .55; transition: opacity var(--t-fast); }
.dpick__opt:hover:not(:disabled) { color: var(--text-hi); background: rgba(255, 255, 255, .03); }
.dpick__opt:hover:not(:disabled) .icon { opacity: 1; }
.dpick__opt:disabled { cursor: default; }
.dpick__opt.is-active {
  color: var(--d-color);
  background: transparent; background: color-mix(in srgb, var(--d-color) 17%, transparent);
  box-shadow: inset 0 -3px 0 var(--d-color);
}
.dpick__opt.is-active .icon { opacity: 1; filter: drop-shadow(0 0 5px var(--d-color)); }
.dpick--ro { border: 0; background: none; gap: .18rem; align-items: center; font-size: .14rem; }

.ready-count[hidden] { display: none; }
.ready-count { display: flex; align-items: baseline; gap: .06rem; font-size: .16rem; }
.ready-count b { font-size: .36rem; line-height: 1; color: var(--mint-400); text-shadow: 0 0 .14rem rgba(23, 249, 183, .45); }
.ready-count .t-dim { font-size: .22rem; }
.ready-count__icons { display: flex; gap: .02rem; margin-left: .12rem; align-self: center; }
.ready-count__icons .icon { width: .28rem; height: .28rem; color: var(--line-3); transition: color var(--t-med); }
.ready-count__icons .icon.is-on { color: var(--mint-400); filter: drop-shadow(0 0 4px var(--mint-glow)); }

.room-bar .btn--xl { min-width: 3.2rem; letter-spacing: .2em; }

/* ---- search / success screen ------------------------------------------------------------------- */
.matching-screen {
  overflow: auto;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 52%, rgba(0, 58, 43, .17), transparent 48%), #030605;
  color: #e8eeec;
  padding: .38rem .4rem;
}
.matching-brand { position: absolute; top: .36rem; left: .52rem; font-family: var(--font-display); font-size: .24rem; color: #58615d; letter-spacing: .025em; }
.matching-brand > span { margin-right: .08rem; }
.matching-card { width: min(7.4rem, 92vw); text-align: center; display: flex; flex-direction: column; align-items: center; padding: .45rem 0 .1rem; }
.matching-heading { display: flex; align-items: baseline; justify-content: center; gap: .24rem; min-height: .68rem; }
.matching-heading h1 { font-size: .54rem; line-height: 1.1; font-weight: 900; letter-spacing: .06em; text-shadow: 0 0 .3rem rgba(255,255,255,.38); }
.matching-time { font-size: .3rem; font-weight: 700; }
.matching-dots { display: inline-block; width: .58rem; text-align: left; animation: matching-blink 1.5s ease-in-out infinite; }
.matching-tags { display: flex; align-items: center; justify-content: center; gap: .16rem; margin-top: .18rem; }
.matching-tags .dtag { padding: .08rem .16rem; border-radius: 1rem; background: #17241d; background: color-mix(in srgb, var(--d-color) 15%, #080c0a); }
.matching-type { padding: .09rem .22rem; border-radius: 1rem; background: #2c312f; font-size: .21rem; color: #c4cdc8; font-weight: 700; }
.matching-art { position: relative; width: 100%; height: 2.55rem; margin: .3rem 0 .06rem; overflow: hidden; color: #19ddae; }
.matching-island { position: absolute; inset: .3rem 0 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.matching-pixel { width: 2.5rem; height: 1.56rem; filter: drop-shadow(0 0 .08rem rgba(23,249,183,.65)); animation: matching-bob 2.8s ease-in-out infinite; }
.matching-ground { width: 2.9rem; height: .08rem; background: #19ddae; box-shadow: 0 0 .16rem rgba(23,249,183,.55); margin: .03rem 0 .1rem; }
.matching-island .micro { font-size: .085rem; letter-spacing: .13em; }
.matching-cross { position: absolute; top: .12rem; color: #1c4437; font-size: .45rem; font-weight: 300; }
.matching-cross--a { left: 12%; }
.matching-cross--b { right: 12%; }
.matching-wave { position: absolute; inset: 0; background: url('/assets/local/ui/outer/banner_matching_loading_scene_tile.png') center 90% / 7.5rem auto repeat-x; opacity: .08; animation: matching-wave 12s linear infinite; }
.matching-progress { color: #79a191; font-size: .18rem; letter-spacing: .06em; margin: .04rem 0 .2rem; }
.matching-tips { width: 100%; min-height: .8rem; margin: .05rem 0 .28rem; }
.matching-tips p { font-size: .22rem; font-weight: 700; line-height: 1.6; min-height: .7rem; animation: matching-tip-in .4s ease-out; }
.matching-tip-track { width: .9rem; height: 2px; background: #173126; margin: .16rem auto 0; overflow: hidden; }
.matching-tip-track > span { display: block; height: 100%; background: #4ed8af; transform-origin: left; animation: matching-tip-progress 5s linear forwards; }
.matching-note { margin-top: .1rem; font-size: .16rem; color: #688679; }
.matching-cancel { min-width: 1.8rem; opacity: .85; }
.matching-guest { display: flex; flex-direction: column; gap: .12rem; align-items: center; }
.matching-screen.is-success .matching-heading { color: #24e5a5; }
.matching-screen.is-success .matching-heading h1 { text-shadow: 0 0 .3rem rgba(23,249,183,.5); }
.matching-screen.is-success .matching-progress { color: #73d7af; }
.matching-screen.is-success .matching-pixel { animation: none; }
@keyframes matching-blink { 50% { opacity: .35; } }
@keyframes matching-bob { 50% { transform: translateY(-.06rem); } }
@keyframes matching-wave { to { background-position-x: 7.5rem; } }
@keyframes matching-tip-in { from { opacity: 0; transform: translateY(.06rem); } }
@keyframes matching-tip-progress { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) {
  .matching-dots, .matching-pixel, .matching-wave, .matching-tips p, .matching-tip-track > span { animation: none; }
}
