/* PROJECT S beta - pages: welcome / home / flow / matching / room / profile */

/* ================= auth & onboarding ================= */
.welcome {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: stretch;
  overflow: hidden;
}

.welcome-left {
  position: relative;
  z-index: 1;
  flex: 1.1;
  min-height: 44vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 58px 64px 48px 60px;
  overflow: hidden;
  background: transparent;
}

.welcome-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 22px;
  max-width: 620px;
  padding-top: 6vh;
}

.welcome-title {
  font-size: 47px;
  line-height: 1.38;
  max-width: 560px;
}

.welcome-title .accent {
  color: var(--signal);
}

.welcome-sub {
  color: var(--dim);
  max-width: 480px;
  font-size: 16px;
  line-height: 1.9;
}

.welcome-proof {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.welcome-right {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: transparent;
}

.welcome-form {
  width: 100%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.welcome-form .card-title {
  margin-bottom: 2px;
}

.avatar-pick {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.avatar-pick button {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 6px;
  background: rgba(255, 255, 255, 0.75);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.avatar-pick button:hover {
  border-color: var(--signal-border);
}

.avatar-pick .button--on {
  border-color: var(--signal-border);
  background: var(--signal-soft);
  box-shadow: 0 6px 16px rgba(125, 108, 242, 0.2);
}

.avatar-upload-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 92px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.6);
}

.avatar-upload-tile:hover {
  border-color: var(--signal-border);
  color: var(--signal);
}

.avatar-upload-tile .avatar-canvas {
  width: 56px;
  height: 48px;
  border-radius: 6px;
}

/* ================= home hero ================= */
.home-hero {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background:
    radial-gradient(70% 60% at 80% 0%, var(--ambient-a), transparent 66%),
    radial-gradient(60% 60% at 10% 100%, var(--ambient-b), transparent 70%),
    rgba(255, 255, 255, 0.5);
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  padding: 28px;
  box-shadow: var(--shadow-1);
}

.home-hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 560px;
}

.home-hero-title {
  font-size: 38px;
  line-height: 1.08;
}

.home-hero-title .accent {
  color: var(--signal);
}

.home-hero-sub {
  color: var(--dim);
  max-width: 460px;
  font-size: 16px;
}

.home-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 6px;
}


/* ================= home prism stage ================= */
.home-shell {
  position: relative;
  min-height: 100vh;
  background: var(--ink-0);
  overflow: hidden;
}

.home-topbar {
  position: relative;
  z-index: 2;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 44px;
  background: rgba(248, 248, 252, 0.62);
  backdrop-filter: blur(18px);
}

.home-top-left {
  position: relative;
  display: flex;
  align-items: center;
}

.home-brand-live {
  position: absolute;
  top: calc(var(--header-h) + 12px);
  left: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  white-space: nowrap;
}

.home-brand-slogan {
  font-size: 22px;
  font-weight: 750;
  color: var(--paper);
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.home-brand-stat {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
}

.home-brand-stat b {
  color: var(--paper);
  font-weight: 750;
}

.home-brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.home-brand-dot--online {
  background: var(--live);
  box-shadow: 0 0 0 4px rgba(111, 191, 160, 0.12);
}

.home-brand-dot--playing {
  background: #b8a0f0;
  box-shadow: 0 0 0 4px rgba(184, 160, 240, 0.14);
}

.home-top-right {
  display: flex;
  align-items: center;
  gap: 22px;
}

.home-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.home-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  color: var(--dim);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.home-nav-link:hover {
  color: var(--paper);
}

.home-nav-link--active {
  color: var(--paper);
  background: #fff;
  box-shadow: 0 8px 22px rgba(140, 120, 200, 0.10);
}

.home-avatar {
  position: relative;
  display: flex;
  align-items: center;
}

.home-avatar-pop {
  position: absolute;
  right: 0;
  top: 52px;
  width: 168px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(184, 160, 240, 0.08);
  border-radius: 16px;
  box-shadow: 0 30px 80px rgba(140, 120, 200, 0.16), 0 3px 10px rgba(140, 120, 200, 0.05);
  backdrop-filter: blur(22px) saturate(1.2);
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}

.home-avatar:hover .home-avatar-pop,
.home-avatar:focus-within .home-avatar-pop {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.home-avatar-pop::before {
  content: "";
  position: absolute;
  top: -5px;
  right: 16px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  background: rgba(255, 255, 255, 0.74);
  border-left: 1px solid rgba(184, 160, 240, 0.08);
  border-top: 1px solid rgba(184, 160, 240, 0.08);
}

.home-avatar-pop button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.home-avatar-pop button:hover {
  background: rgba(184, 160, 240, 0.10);
  color: var(--paper);
}

.home-main {
  position: relative;
  min-height: 100vh;
}

.home-stage {
  position: absolute;
  top: calc(var(--header-h) * -1);
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  width: min(860px, calc(100vw - 48px));
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-diamond-wrap {
  width: 220px;
  height: 190px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.home-diamond {
  position: relative;
  width: 220px;
  height: 190px;
  flex: 0 0 auto;
  padding-top: 20px;
  border: 0;
  background: linear-gradient(135deg, rgba(184, 160, 240, 0.94), rgba(200, 188, 246, 0.78) 46%, rgba(180, 216, 248, 0.86));
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 30px 70px rgba(140, 120, 200, 0.28));
  display: flex;
  align-items: flex-start;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.16s ease;
}

.home-diamond:hover {
  transform: translateY(-3px);
}

.home-diamond span {
  color: #fff;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-shadow: 0 2px 12px rgba(120, 100, 190, 0.22);
}

.home-filter-overlay {
  position: fixed;
  inset: 0;
  z-index: 85;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.home-filter-overlay[hidden] {
  display: none;
}

.home-filter-scrim {
  position: absolute;
  inset: 0;
  background: rgba(248, 248, 252, 0.66);
  backdrop-filter: blur(7px);
  cursor: default;
}

.home-filter-dialog-shell {
  position: relative;
  width: 900px;
  max-width: calc(100vw - 48px);
  filter: drop-shadow(0 34px 90px rgba(140, 120, 200, 0.20)) drop-shadow(0 4px 18px rgba(140, 120, 200, 0.08));
}

.home-filter-dialog {
  position: relative;
  padding: 26px 40px 24px;
  border: 1px solid rgba(184, 160, 240, 0.12);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(28px) saturate(1.2);
  animation: homeFilterRise 0.22s ease;
}

.home-filter-dialog::before,
.home-filter-dialog::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 24px;
  transform: rotate(45deg);
  border-radius: 7px;
}

.home-filter-dialog::before {
  top: -12px;
  right: -12px;
  background: linear-gradient(135deg, rgba(184, 160, 240, 0.55), rgba(180, 216, 248, 0.30));
  box-shadow: 0 8px 18px rgba(184, 160, 240, 0.18);
}

.home-filter-dialog::after {
  bottom: -12px;
  left: -12px;
  background: linear-gradient(315deg, rgba(248, 216, 232, 0.55), rgba(184, 160, 240, 0.26));
  box-shadow: 0 8px 18px rgba(184, 160, 240, 0.16);
}

@keyframes homeFilterRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.home-filter-close {
  position: absolute;
  top: 18px;
  right: 20px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(184, 160, 240, 0.14);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.72);
  color: #888;
  cursor: pointer;
}

.home-filter-close:hover {
  border-color: rgba(184, 160, 240, 0.30);
  color: var(--paper);
}

.home-filter-progress {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding-right: 34px;
  margin-bottom: 22px;
}

.home-filter-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 110px;
  cursor: pointer;
}

.home-filter-node {
  display: block;
  width: 15px;
  height: 15px;
  transform: rotate(45deg);
  border-radius: 4px;
  border: 1.5px solid rgba(184, 160, 240, 0.30);
  background: rgba(255, 255, 255, 0.72);
}

.home-filter-node i {
  display: block;
  width: 7px;
  height: 7px;
  transform: rotate(45deg);
  border-radius: 2px;
  margin: 3px;
}

.home-filter-step.is-on .home-filter-node {
  border-color: transparent;
  background: linear-gradient(135deg, #b8a0f0, #b4d8f8);
  box-shadow: 0 8px 18px rgba(184, 160, 240, 0.30);
}

.home-filter-step.is-on .home-filter-node i {
  background: #fff;
}

.home-filter-step.is-done .home-filter-node {
  border-color: transparent;
  background: rgba(184, 160, 240, 0.38);
}

.home-filter-step.is-done .home-filter-node i {
  background: #fff;
}

.home-filter-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.home-filter-step.is-on .home-filter-label {
  color: var(--paper);
  font-weight: 750;
}

.home-filter-step.is-done .home-filter-label {
  color: var(--dim);
}

.home-filter-step--voice {
  width: 100px;
}

.home-filter-step--voice .home-filter-node {
  border-style: dashed;
  border-color: rgba(184, 160, 240, 0.42);
  background: rgba(184, 160, 240, 0.06);
}

.home-filter-plus {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: #b8a0f0;
  font-size: 13px;
  font-weight: 800;
  transform: rotate(-45deg);
}

.home-filter-step--voice .home-filter-label {
  color: #9b93ae;
}

.home-filter-step--voice.is-on .home-filter-plus {
  color: #fff;
}

.home-filter-connector {
  flex: 1;
  height: 1px;
  margin: 7px 6px 0;
  background: linear-gradient(90deg, rgba(184, 160, 240, 0.26), rgba(180, 216, 248, 0.16));
}

.home-filter-connector--dash {
  background: repeating-linear-gradient(90deg, rgba(184, 160, 240, 0.35) 0 6px, transparent 6px 12px);
}

.home-filter-panel {
  display: none;
  min-height: 248px;
}

.home-filter-panel.is-show {
  display: block;
  animation: homeFilterRise 0.22s ease;
}

.home-filter-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.18em;
  color: #9b93ae;
  text-transform: uppercase;
}

.home-filter-eyebrow i {
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: linear-gradient(135deg, #b8a0f0, #b4d8f8);
}

.home-filter-panel-title {
  margin-top: 10px;
  font-size: 24px;
  font-weight: 780;
  letter-spacing: 0.01em;
  color: var(--paper);
}

.home-filter-panel-sub {
  margin-top: 6px;
  font-size: 13px;
  color: var(--dim);
}

.home-filter-game-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 18px;
}

.home-filter-game-row {
  position: relative;
  display: grid;
  grid-template-columns: 168px 1fr 64px;
  align-items: center;
  gap: 18px;
  height: 64px;
  padding: 0 22px 0 34px;
  cursor: pointer;
  border: 1px solid rgba(184, 160, 240, 0.12);
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 0 100%);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.96), rgba(250, 248, 253, 0.74) 55%, rgba(247, 243, 251, 0.62));
  transition: border-color 0.15s ease, background 0.15s ease;
}

.home-filter-game-row:hover {
  border-color: rgba(184, 160, 240, 0.28);
}

.home-filter-game-row.is-on {
  border-color: rgba(184, 160, 240, 0.50);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.98), rgba(235, 228, 252, 0.58) 55%, rgba(228, 240, 252, 0.52));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5);
}

.home-filter-game-check {
  position: absolute;
  left: 13px;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translateY(-50%) rotate(45deg);
  border-radius: 2px;
  background: linear-gradient(135deg, #b8a0f0, #b4d8f8);
  opacity: 0;
  transition: opacity 0.15s ease;
}

.home-filter-game-row.is-on .home-filter-game-check {
  opacity: 1;
}

.home-filter-game-name {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.03em;
  color: var(--paper);
}

.home-filter-game-name small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.home-filter-game-swell {
  position: relative;
  height: 36px;
  border-radius: 20px;
  background: linear-gradient(90deg, rgba(184, 160, 240, 0), rgba(184, 160, 240, 0.16) 20%, rgba(180, 216, 248, 0.20) 48%, rgba(248, 216, 232, 0.16) 76%, rgba(184, 160, 240, 0));
  filter: blur(0.6px);
}

.home-filter-game-swell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 20px;
  background: radial-gradient(ellipse at 32% 50%, rgba(255, 255, 255, 0.85), transparent 68%);
}

.home-filter-game-ph {
  display: grid;
  place-items: center;
}

.home-filter-game-ph i {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  transform: rotate(45deg);
  border: 1.5px solid rgba(184, 160, 240, 0.60);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(184, 160, 240, 0.14), rgba(180, 216, 248, 0.10));
  box-shadow: inset 0 0 16px rgba(184, 160, 240, 0.12);
}

.home-filter-game-ph i::after {
  content: "";
  position: absolute;
  left: 11px;
  top: 11px;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(184, 160, 240, 0.45);
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.5);
}

.home-filter-tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  max-width: 640px;
}

.home-filter-tag {
  position: relative;
  padding: 10px 18px 10px 16px;
  border: 1px solid rgba(184, 160, 240, 0.20);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.78);
  color: #6b6480;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.home-filter-tag::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: rgba(184, 160, 240, 0.30);
  vertical-align: 1px;
}

.home-filter-tag:hover {
  border-color: rgba(184, 160, 240, 0.40);
  background: rgba(248, 246, 253, 0.9);
  color: var(--paper);
}

.home-filter-tag.is-on {
  border-color: rgba(184, 160, 240, 0.55);
  background: var(--signal-soft);
  color: var(--signal-strong);
}

.home-filter-tag.is-on::before {
  background: linear-gradient(135deg, #b8a0f0, #b4d8f8);
}

.home-note {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid rgba(184, 160, 240, 0.10);
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  backdrop-filter: blur(14px);
}

.home-note-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--live);
  display: inline-block;
}

.live-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.live-avatars {
  display: flex;
  align-items: center;
}

.live-avatars .avatar-wrap {
  --avatar-size: 42px;
  margin-left: -8px;
  border: 2px solid #ffffff;
  border-radius: 50%;
}

.live-avatars .avatar-wrap:first-child {
  margin-left: 0;
}

.live-avatars-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px dashed var(--line-strong);
  border-radius: 50%;
  color: var(--dim);
}

.live-count {
  color: var(--live);
  font-family: var(--font-mono);
  font-size: 12px;
}

.quick-start {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.quick-start button {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.78);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.quick-start button:hover {
  border-color: var(--signal-border);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.quick-start .icon {
  color: var(--signal);
}

/* ================= forms ================= */
.need-form {
  display: grid;
  gap: 20px;
}

.form-grid {
  display: grid;
  gap: 16px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding-top: 4px;
}

/* ================= results ================= */
.results-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.results-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.candidate-count {
  color: var(--live);
  font-family: var(--font-mono);
  font-size: 13px;
}

/* ================= player profile ================= */
.profile-hero {
  display: grid;
  gap: 20px;
  align-items: start;
}

.profile-identity {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  min-width: 0;
}

.profile-name {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-name h1 {
  font-size: 28px;
}

.profile-handle {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
}

.profile-bio {
  color: var(--dim);
  max-width: 560px;
  margin-top: 8px;
}

.profile-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.profile-info-grid {
  display: grid;
  gap: 14px;
}

.game-identity {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.game-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.game-line:last-child {
  border-bottom: 0;
}

.game-line-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.game-line-name {
  font-weight: 700;
  font-size: 14px;
}

.game-line-meta {
  color: var(--muted);
  font-size: 12px;
}

.game-line-stats {
  display: flex;
  gap: 14px;
  color: var(--dim);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ================= room ================= */
.room-page {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  width: min(1060px, 100% - 32px);
  margin: 0 auto;
  padding: 24px 0 40px;
}

.room-panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.room-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.room-code {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--signal);
}

.room-members {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.room-member {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.78);
}

.room-member--host {
  border-color: var(--signal-border);
}

.room-member-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.room-member-name {
  font-weight: 700;
  font-size: 14px;
}

.room-member-meta {
  color: var(--muted);
  font-size: 12px;
}

.room-member a {
  display: inline-flex;
  border-radius: 50%;
  outline-offset: 2px;
}

.room-member a:hover {
  outline: 2px solid var(--signal-border);
}

.room-timer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--warm);
}

.room-account-value {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

/* room chat */
.room-chat-card {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.chat-messages {
  height: 260px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  background: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}

.chat-empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 40px 0;
}

.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 78%;
}

.chat-msg--mine {
  align-self: flex-end;
  align-items: flex-end;
}

.chat-bubble {
  background: #ffffff;
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
}

.chat-msg--mine .chat-bubble {
  background: linear-gradient(135deg, var(--signal), #9d8bff);
  border-color: transparent;
  color: #ffffff;
}

.chat-time {
  font-size: 11px;
  color: var(--muted);
}

.chat-composer {
  display: flex;
  gap: 8px;
  align-items: center;
}

.chat-composer .input {
  flex: 1;
}

.chat-composer .btn {
  white-space: nowrap;
}

/* ================= game over ================= */
.gameover-page {
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  justify-content: center;
}

.gameover-panel {
  width: 100%;
  max-width: 640px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.gameover-head {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.outcome-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.outcome-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 88px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.78);
  color: var(--dim);
  font-size: 13px;
  font-weight: 600;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}

.outcome-btn:hover {
  border-color: var(--signal-border);
  transform: translateY(-1px);
}

.outcome-btn--on {
  border-color: var(--signal-border);
  color: var(--signal);
  background: var(--signal-soft);
  box-shadow: 0 6px 16px rgba(125, 108, 242, 0.18);
}

.outcome-btn span {
  font-size: 15px;
  font-weight: 700;
}

.rematch-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rematch-choices {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ================= friends & connections ================= */
.friends-list {
  display: grid;
  gap: 12px;
}

.friend-row {
  display: grid;
  gap: 14px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.78);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.friend-row:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}

.friend-main {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.friend-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.friend-name {
  font-weight: 700;
  font-size: 15px;
}

.friend-last {
  color: var(--muted);
  font-size: 12px;
}

/* ================= me ================= */
.me-profile {
  display: grid;
  gap: 16px;
}

.me-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.me-stats .card {
  padding: 14px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.78);
}

.history-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.history-title {
  font-size: 13px;
  font-weight: 700;
}

.history-sub {
  color: var(--muted);
  font-size: 12px;
}

.history-result {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--dim);
}

/* ================= toast ================= */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 20px);
  z-index: 90;
  transform: translateX(-50%);
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-pop);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  animation: toast-in 0.2s ease;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ================= auth ================= */
.auth-card {
  width: 100%;
  max-width: 432px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 44px 42px 38px;
  border-radius: 19px;
  border: 1px solid rgba(184, 160, 240, 0.055);
  background: rgba(255, 255, 255, 0.50);
  box-shadow: 0 48px 130px rgba(140, 120, 200, 0.15), 0 4px 18px rgba(140, 120, 200, 0.05);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 0;
  border-radius: 12px;
  background: rgba(184, 160, 240, 0.07);
}

.auth-tab {
  padding: 10px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #666;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.auth-tab:hover {
  color: var(--paper);
}

.auth-tab--active {
  color: #ffffff;
  background: var(--signal);
  box-shadow: 0 8px 18px rgba(184, 160, 240, 0.26);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form .card-title {
  margin-bottom: 2px;
  color: #222;
}

.auth-form .page-sub {
  color: #666;
}

.auth-form .field {
  gap: 8px;
}

.auth-form .input,
.auth-form .select {
  min-height: 54px;
  border-radius: 18px;
  border: 1px solid rgba(184, 160, 240, 0.09);
  background: rgba(255, 255, 255, 0.55);
  padding: 0 18px;
  color: #222;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.auth-form .input::placeholder {
  color: #999;
}

.auth-form .input:focus,
.auth-form .select:focus {
  border-color: var(--signal-border);
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 0 0 4px rgba(184, 160, 240, 0.10);
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .input {
  padding-right: 46px;
}

.auth-password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  color: #999;
  cursor: pointer;
}

.auth-password-toggle:hover {
  color: #666;
  background: rgba(184, 160, 240, 0.08);
}

.auth-password-toggle .eye-off {
  display: none;
}

.auth-password-toggle.is-show .eye-on {
  display: none;
}

.auth-password-toggle.is-show .eye-off {
  display: inline-flex;
}

.auth-form .btn--primary {
  background: linear-gradient(135deg, #b8a0f0 0%, #b4d8f8 100%);
  box-shadow: 0 18px 42px rgba(184, 160, 240, 0.26);
}

.auth-form .btn--primary:hover {
  background: linear-gradient(135deg, #a98fe8 0%, #a3cdf4 100%);
}

.auth-switch {
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: #666;
  font-size: 13px;
  letter-spacing: 0.02em;
}

.auth-switch-link {
  border: 0;
  background: transparent;
  color: var(--signal);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.auth-switch-link:hover {
  color: var(--signal-strong);
}

.auth-switch:hover {
  color: var(--signal);
}

.auth-error {
  padding: 10px 12px;
  border: 1px solid var(--danger-border);
  border-radius: 12px;
  background: var(--danger-dim);
  color: var(--danger);
  font-size: 12px;
  line-height: 1.5;
}

.auth-note {
  padding: 10px 12px;
  border: 1px solid var(--signal-border);
  border-radius: 12px;
  background: var(--signal-soft);
  color: var(--signal);
  font-size: 12px;
  line-height: 1.5;
}

/* ================= match flow wizard ================= */
.flow-page {
  max-width: 780px;
}

.flow-progress {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  padding: 2px 0;
}

.flow-progress__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--r-pill);
  border: 1px solid transparent;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flow-progress__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
}

.flow-progress__item--active {
  color: var(--signal);
  border-color: var(--signal-border);
  background: var(--signal-soft);
}

.flow-progress__item--active .flow-progress__dot {
  background: var(--signal);
  box-shadow: 0 0 0 3px var(--signal-soft);
}

.flow-progress__item--done {
  color: var(--dim);
}

.flow-progress__item--done .flow-progress__dot {
  background: var(--live);
}

.flow-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.flow-question {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  font-family: var(--font-display);
}

.flow-search {
  position: relative;
  max-width: 460px;
  margin-bottom: 18px;
}

.flow-search .icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

.flow-search .input {
  padding-left: 38px;
}

/* game world cards */
.flow-game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

@media (min-width: 640px) {
  .flow-game-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.flow-game-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--paper);
  text-align: left;
  overflow: hidden;
  transition: border-color 0.16s ease, box-shadow 0.2s ease, transform 0.18s ease, opacity 0.2s ease;
}

.flow-game-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
  transform: translateY(-2px);
}

/* when one world is chosen it lifts forward, the rest fall back */
.flow-game-grid:has(.flow-game-card--on) .flow-game-card:not(.flow-game-card--on) {
  opacity: 0.62;
  transform: scale(0.985);
}

.flow-game-card--on {
  border-color: var(--signal-border);
  box-shadow: 0 14px 36px rgba(125, 108, 242, 0.28);
  transform: translateY(-4px) scale(1.02);
}

/* the game world tile: pure CSS art per game */
.flow-game-tile {
  position: relative;
  display: block;
  width: 100%;
  height: 86px;
  flex: none;
  color: rgba(255, 255, 255, 0.95);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
}

.flow-game-tile > span,
.flow-game-tile {
  text-shadow: 0 1px 6px rgba(38, 42, 53, 0.3);
}

.flow-game-tile--minecraft {
  background:
    linear-gradient(transparent 62%, rgba(122, 176, 96, 0.95) 62%, rgba(96, 152, 74, 0.95)),
    repeating-conic-gradient(rgba(255, 255, 255, 0.22) 0% 25%, transparent 0% 50%) 0 66% / 18px 18px,
    linear-gradient(160deg, #a8d8f0, #d8f0e2);
}

.flow-game-tile--deadlock {
  background:
    linear-gradient(115deg, transparent 55%, rgba(255, 255, 255, 0.28) 55%, rgba(255, 255, 255, 0.28) 62%, transparent 62%),
    linear-gradient(150deg, #b35c74, #e2a9b6 55%, #d9d4e2);
}

.flow-game-tile--stardew {
  background:
    radial-gradient(26px 26px at 78% 26%, rgba(255, 236, 170, 0.95) 60%, transparent 62%),
    repeating-conic-gradient(rgba(255, 255, 255, 0.25) 0% 25%, transparent 0% 50%) 0 100% / 16px 16px,
    linear-gradient(165deg, #f2e2b2, #cfe4b8 70%, #b9d8a6);
}

.flow-game-tile--valorant {
  background:
    linear-gradient(135deg, transparent 46%, rgba(255, 255, 255, 0.8) 46%, rgba(255, 255, 255, 0.8) 54%, transparent 54%),
    linear-gradient(150deg, #ef8b93, #f6c9d2 60%, #f8e3e6);
}

.flow-game-tile--genshin {
  background:
    linear-gradient(150deg, #a9c4f0, #cfc0f2 55%, #c2ece4);
}

.flow-game-tile--pubg {
  background:
    repeating-conic-gradient(rgba(255, 255, 255, 0.2) 0% 25%, transparent 0% 50%) 0 0 / 20px 20px,
    linear-gradient(150deg, #d9c9a3, #c4cfb4);
}

.flow-game-tile--hok {
  background:
    linear-gradient(150deg, #eec87e, #f0c9c4 60%, #f4e2c8);
}

.flow-game-tile--league {
  background:
    linear-gradient(150deg, #9fc4e2, #b7e3d9 60%, #d5e8f2);
}

.flow-game-meta {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  padding: 10px 12px 12px;
}

.flow-game-name {
  font-size: 14px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-game-tag {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.flow-check {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--signal);
  color: #ffffff;
  box-shadow: 0 4px 10px rgba(125, 108, 242, 0.4);
}

/* choice buttons */
.flow-choice-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.flow-choice-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flow-choice-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.flow-choice-grid--4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

@media (max-width: 520px) {
  .flow-choice-grid--3,
  .flow-choice-grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.flow-choice {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-height: 58px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.85);
  color: var(--paper);
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.12s ease;
}

.flow-choice:hover {
  border-color: var(--signal-border);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.flow-choice--on {
  border-color: var(--signal-border);
  background: var(--signal-soft);
  color: var(--signal);
}

.flow-choice-icon {
  color: var(--signal);
}

.flow-choice-label {
  font-size: 15px;
  font-weight: 700;
}

.flow-choice-note {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.flow-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-details {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.flow-footer {
  margin-top: 18px;
  display: flex;
}

.flow-confirm {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.flow-confirm .need-block {
  gap: 12px;
}

.flow-confirm-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ================= responsive ================= */
@media (min-width: 720px) {
  .welcome-left {
    padding: 36px 40px;
  }

  .welcome-title {
    font-size: 52px;
  }

  .welcome-right {
    padding: 48px;
  }

  .home-hero {
    min-height: 460px;
    padding: 40px;
  }

  .home-hero-title {
    font-size: 46px;
  }

  .profile-hero {
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  }

  .friend-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
}

@media (min-width: 960px) {
  .welcome {
    min-height: 100vh;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid .span-2 {
    grid-column: 1 / -1;
  }

  .results-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (max-width: 719px) {
  .quick-start {
    grid-template-columns: 1fr;
  }

  .me-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .welcome {
    flex-direction: column;
  }

  .welcome-left {
    min-height: auto;
    padding: 32px 24px 28px;
  }

  .welcome-copy {
    padding-top: 2vh;
  }

  .welcome-right {
    border: 0;
    align-items: flex-start;
    padding: 20px 16px 40px;
  }

  .auth-card {
    padding: 32px 24px 28px;
  }

  .welcome-title {
    font-size: 36px;
  }

  .home-hero {
    min-height: 400px;
    padding: 22px;
  }

  .home-hero-title {
    font-size: 34px;
  }

  .room-page {
    grid-template-columns: 1fr;
    width: min(100% - 24px, 1060px);
    padding-top: 16px;
  }

  .room-chat-card {
    position: static;
  }
}

/* ================= shared prism pages (new home visual) ================= */
.prism-page {
  position: relative;
  z-index: 2;
  width: min(940px, calc(100vw - 72px));
  margin: 0 auto;
  padding: calc(var(--header-h) + 86px) 0 64px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.prism-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.prism-head > div:first-child {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.prism-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--signal-strong);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prism-eyebrow i {
  width: 9px;
  height: 9px;
  transform: rotate(45deg);
  border-radius: 2px;
  background: linear-gradient(135deg, var(--signal), var(--prism-cyan));
  box-shadow: 0 0 0 4px var(--signal-soft);
}

.prism-title {
  font-size: 30px;
  font-weight: 750;
  color: var(--paper);
  line-height: 1.16;
}

.prism-sub {
  color: var(--dim);
  font-size: 14px;
  max-width: 620px;
}

.prism-back {
  display: flex;
}

.prism-card {
  position: relative;
  border: 1px solid rgba(184, 160, 240, 0.12);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 30px 80px rgba(140, 120, 200, 0.14), 0 4px 16px rgba(140, 120, 200, 0.05);
  backdrop-filter: blur(18px) saturate(1.1);
  padding: 22px;
  overflow: hidden;
}

.prism-card::before {
  content: "";
  position: absolute;
  top: -1px;
  right: 18px;
  width: 54px;
  height: 54px;
  background: linear-gradient(135deg, var(--prism-lilac), var(--prism-cyan));
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  opacity: 0.16;
  pointer-events: none;
  border-radius: 0 0 0 12px;
}

.prism-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.card {
  border-radius: var(--r-lg);
  padding: 20px;
}

.need-block {
  background: var(--signal-soft);
  border-color: rgba(184, 160, 240, 0.18);
}

/* need flow */
.prism-flow {
  width: min(860px, calc(100vw - 72px));
}

.prism-flow-card {
  padding: 26px;
}

.prism-flow .flow-progress {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0;
}

.prism-flow .flow-progress__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.prism-flow .flow-progress__item:not(:last-child)::after {
  content: "";
  width: 18px;
  height: 1px;
  margin-left: 2px;
  background: linear-gradient(90deg, rgba(184, 160, 240, 0.40), rgba(184, 160, 240, 0));
}

.prism-flow .flow-progress__dot {
  width: 9px;
  height: 9px;
  flex: none;
  transform: rotate(45deg);
  border-radius: 2px;
  border: 1px solid var(--muted);
  background: transparent;
  box-shadow: none;
}

.prism-flow .flow-progress__item--active {
  color: var(--signal);
}

.prism-flow .flow-progress__item--active .flow-progress__dot {
  border-color: transparent;
  background: linear-gradient(135deg, var(--signal), var(--prism-cyan));
  box-shadow: 0 0 0 4px var(--signal-soft);
}

.prism-flow .flow-progress__item--done {
  color: var(--dim);
}

.prism-flow .flow-progress__item--done .flow-progress__dot {
  border-color: transparent;
  background: var(--live);
}

.prism-flow-card .flow-game-card {
  border-radius: var(--r-md);
}

.prism-flow-card .flow-game-tile {
  border-radius: var(--r-md) var(--r-md) 0 0;
}

/* results */
.prism-results {
  width: min(1080px, calc(100vw - 72px));
}

.prism-invite-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-color: var(--signal-border);
  background: var(--signal-soft);
}

/* room */
.prism-room {
  width: min(1080px, calc(100vw - 72px));
  min-height: calc(100vh - var(--header-h));
  padding-top: calc(var(--header-h) + 86px);
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.prism-room .room-chat-card {
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.prism-room .room-member,
.prism-room .card {
  border-radius: var(--r-md);
}

/* live connection room v2 */
.connection-room {
  --room-paper: #f5f3ef;
  --room-ink: #111118;
  --room-violet: #8b6cff;
  --room-mist: #eae4ff;
  --room-online: #4fae5a;
  --room-exit: #d6534d;
  width: min(1120px, calc(100vw - 110px));
  margin: 0 auto;
  padding: calc(var(--header-h) + 58px) 0 92px;
  display: grid;
  grid-template-columns: minmax(0, 1.42fr) minmax(320px, 0.72fr);
  gap: 18px;
  color: var(--room-ink);
}

.connection-room__status,
.connection-room__players,
.connection-room__exchange,
.connection-room__chat,
.connection-room__farewell {
  border: 1px solid rgba(17, 17, 24, 0.14);
  background: rgba(250, 249, 246, 0.9);
  box-shadow: 0 16px 46px rgba(36, 30, 58, 0.07);
}

.connection-room__status {
  grid-column: 1 / -1;
  padding: 28px 32px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  position: relative;
  overflow: hidden;
}

.connection-room__status::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--room-violet);
}

.connection-room__eyebrow,
.connection-player__index,
.connection-room__farewell > div > span {
  font: 700 11px/1 var(--font-mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.connection-room__eyebrow { display: flex; align-items: center; gap: 8px; color: #6752b9; }
.connection-room__eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--room-online); box-shadow: 0 0 0 5px rgba(79, 174, 90, 0.12); }
.connection-room__status h1 { margin: 12px 0 7px; font-size: clamp(34px, 4vw, 54px); letter-spacing: -0.055em; }
.connection-room__status p { margin: 0; color: #6e6a73; }
.connection-room__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.connection-room__meta .room-code, .connection-room__meta .room-timer { border: 1px solid rgba(17,17,24,.14); min-height: 38px; padding: 0 12px; display: inline-flex; align-items: center; gap: 7px; background: white; }

.connection-room__players {
  grid-column: 1 / -1;
  padding: 22px;
  display: grid;
  grid-template-columns: 1fr minmax(96px, 0.22fr) 1fr;
  align-items: stretch;
}

.connection-player { position: relative; min-height: 150px; padding: 25px 24px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 18px; background: #fff; border: 1px solid rgba(17,17,24,.12); overflow: hidden; }
.connection-player.is-me { background: linear-gradient(125deg, #fff 55%, rgba(139,108,255,.13)); }
.connection-player.is-partner { background: linear-gradient(235deg, #fff 55%, rgba(139,108,255,.13)); }
.connection-player.is-exited { opacity: .58; }
.connection-player__index { position: absolute; top: 13px; left: 15px; color: #7d7785; }
.connection-player h2 { margin: 0 0 7px; font-size: 22px; letter-spacing: -.035em; }
.connection-player p { margin: 0; color: #77717d; font-size: 13px; }
.connection-player__live { font: 700 10px/1 var(--font-mono); letter-spacing: .08em; color: var(--room-online); }
.connection-axis { display: flex; align-items: center; justify-content: center; min-width: 88px; }
.connection-axis span { flex: 1; height: 1px; background: var(--room-violet); }
.connection-axis b { width: 42px; height: 42px; display: grid; place-items: center; color: white; background: var(--room-ink); transform: rotate(45deg); }
.connection-axis b svg { transform: rotate(-45deg); }

.connection-tape { grid-column: 1 / -1; height: 28px; overflow: hidden; color: var(--room-ink); background: repeating-linear-gradient(-45deg, var(--room-violet) 0 14px, #b7a4ff 14px 28px); border: 1px solid var(--room-ink); }
.connection-tape span { width: max-content; display: block; padding: 6px 0 0 18px; font: 800 11px/1 var(--font-mono); letter-spacing: .11em; animation: connectionTape 14s linear infinite; }
@keyframes connectionTape { to { transform: translateX(-25%); } }

.connection-room__exchange { padding: 0; display: grid; grid-template-columns: 1fr 1fr; overflow: hidden; }
.connection-exchange-column { padding: 26px; min-width: 0; }
.connection-exchange-column + .connection-exchange-column { border-left: 1px solid rgba(17,17,24,.14); background: rgba(234,228,255,.32); }
.connection-section-title { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 20px; }
.connection-section-title > span { width: 32px; height: 32px; display: grid; place-items: center; flex: 0 0 auto; font: 800 11px/1 var(--font-mono); color: #fff; background: var(--room-ink); }
.connection-section-title h2 { margin: 0 0 5px; font-size: 18px; }
.connection-section-title p { margin: 0; color: #76717a; font-size: 12px; line-height: 1.5; }
.connection-exchange-column form, .connection-partner-accounts { display: flex; flex-direction: column; gap: 12px; }
.connection-account-field { display: flex; flex-direction: column; gap: 7px; font-size: 12px; font-weight: 700; }
.connection-account-row { min-height: 70px; padding: 12px 14px; border: 1px solid rgba(17,17,24,.13); background: #fff; display: flex; flex-direction: column; gap: 8px; }
.connection-account-row > span { color: #77717d; font-size: 11px; }
.connection-friend-state, .connection-friend-request { margin-top: 14px; padding: 12px 14px; display: flex; align-items: center; gap: 9px; border: 1px solid rgba(17,17,24,.15); background: #fff; font-size: 12px; }
.connection-friend-state.is-connected { color: #2f7f3a; border-color: rgba(79,174,90,.35); }
.connection-friend-request { align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }

.connection-room__chat { padding: 26px; display: flex; flex-direction: column; min-height: 430px; }
.connection-room__chat .chat-messages { flex: 1; height: 240px; border-radius: 0; background: rgba(17,17,24,.035); }
.connection-room__chat .chat-composer { margin-top: 12px; }

.connection-room__farewell { grid-column: 1 / -1; padding: 26px 30px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--room-ink); color: #fff; overflow: hidden; position: relative; }
.connection-room__farewell::after { content: ""; position: absolute; top: -80px; right: 22%; width: 190px; height: 190px; border: 1px solid rgba(183,164,255,.4); transform: rotate(45deg); }
.connection-room__farewell h2 { margin: 9px 0 7px; font-size: 22px; }
.connection-room__farewell p { margin: 0; color: rgba(255,255,255,.58); font-size: 12px; }
.connection-farewell-actions { position: relative; z-index: 1; display: flex; gap: 10px; }
.connection-goodbye-button { min-width: 174px; min-height: 58px; font-size: 18px; background: var(--room-violet); color: #fff; border-color: var(--room-violet); }
.connection-goodbye-button:hover { transform: translateY(-2px); background: #9c83ff; }
.connection-goodbye-confirm .profile-identity { padding: 16px; background: rgba(139,108,255,.09); border: 1px solid rgba(139,108,255,.22); }

@media (max-width: 980px) {
  .connection-room { width: calc(100vw - 82px); grid-template-columns: 1fr; }
  .connection-room__chat { grid-column: 1 / -1; min-height: 350px; }
  .connection-room__players { grid-template-columns: 1fr; gap: 10px; }
  .connection-axis { min-height: 42px; transform: rotate(90deg); }
}

@media (prefers-reduced-motion: reduce) {
  .connection-tape span { animation: none; }
  .connection-goodbye-button:hover { transform: none; }
}

/* game over */
.prism-over {
  width: min(680px, calc(100vw - 72px));
  min-height: calc(100vh - var(--header-h));
  justify-content: flex-start;
  padding-top: calc(var(--header-h) + 86px);
}

.prism-over .gameover-panel {
  width: 100%;
  max-width: 680px;
}

/* profile / me */
.prism-profile,
.prism-me {
  width: min(1080px, calc(100vw - 72px));
}

.prism-me .me-stats .card {
  border-radius: var(--r-md);
}

/* connections / friends */
.prism-connections,
.prism-friends {
  width: min(1080px, calc(100vw - 72px));
}

.prism-connections .prism-section,
.prism-friends .prism-section {
  gap: 14px;
}

.prism-connections .friends-list,
.prism-friends .friends-list {
  gap: 14px;
}

.prism-connections .friend-row,
.prism-friends .friend-row {
  border: 1px solid rgba(184, 160, 240, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.82);
  padding: 18px 20px;
  box-shadow: 0 18px 50px rgba(140, 120, 200, 0.10), 0 2px 8px rgba(140, 120, 200, 0.04);
  transition: border-color 0.16s ease, box-shadow 0.2s ease, transform 0.16s ease;
}

.prism-connections .friend-row:hover,
.prism-friends .friend-row:hover {
  border-color: rgba(184, 160, 240, 0.34);
  box-shadow: 0 24px 64px rgba(140, 120, 200, 0.14), 0 3px 10px rgba(140, 120, 200, 0.05);
  transform: translateY(-2px);
}

.prism-connections .friend-name,
.prism-friends .friend-name {
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.prism-connections .friend-last,
.prism-friends .friend-last {
  color: var(--dim);
  font-size: 13px;
}

.prism-search-result {
  border-color: var(--signal-border);
  background: var(--signal-soft);
}

/* confirm need panel stays inside the home filter dialog */
.home-filter-panel[data-home-panel="confirm"] {
  min-height: 300px;
}

.home-filter-confirm-summary {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 18px 20px;
  border: 1px solid rgba(184, 160, 240, 0.14);
  border-radius: 16px;
  background: rgba(248, 246, 253, 0.72);
}

.home-filter-confirm-summary .need-line {
  color: var(--dim);
  font-size: 14px;
}

.home-filter-confirm-summary .need-line strong {
  color: var(--paper);
  font-size: 15px;
}

/* post-connection feedback */
.connection-gameover {
  --connection-ink: #111119;
  --connection-paper: #f5f3ee;
  --connection-violet: #7452d7;
  min-height: calc(100vh - 54px);
  color: var(--connection-ink);
  background:
    linear-gradient(rgba(17, 17, 25, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 17, 25, 0.035) 1px, transparent 1px),
    var(--connection-paper);
  background-size: 42px 42px;
  padding: clamp(34px, 5vw, 72px);
}

.connection-gameover__header {
  max-width: 920px;
  margin: 0 auto 34px;
  text-align: center;
}

.connection-gameover__header > p {
  margin: 34px 0 6px;
  color: #696774;
  font-size: 13px;
  letter-spacing: 0.18em;
}

.connection-gameover__header h1 {
  margin: 0 0 8px;
  font-size: clamp(36px, 5vw, 68px);
  letter-spacing: -0.055em;
}

.connection-gameover__header > span:last-child { color: #696774; }

.connection-gameover > .connection-tape {
  width: calc(100% + clamp(68px, 10vw, 144px));
  margin-left: calc(clamp(34px, 5vw, 72px) * -1);
}

.connection-gameover__partner,
.connection-gameover__experience,
.connection-gameover__footer {
  width: min(920px, 100%);
  margin-inline: auto;
  border: 1px solid rgba(17, 17, 25, 0.18);
  background: rgba(255, 255, 255, 0.62);
}

.connection-gameover__partner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px 28px;
  margin-top: 38px;
  padding: 38px;
}

.connection-gameover__partner::before {
  content: "";
  position: absolute;
  inset: -1px auto -1px -1px;
  width: 6px;
  background: var(--connection-violet);
}

.connection-gameover__partner > .connection-player__index {
  position: absolute;
  top: 13px;
  left: 38px;
}

.connection-gameover__identity {
  display: flex;
  align-items: center;
  gap: 20px;
}

.connection-gameover__identity h2 { margin: 0; font-size: 28px; }
.connection-gameover__identity p { margin: 5px 0 0; color: #696774; }

.connection-like {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 152px;
  min-height: 52px;
  border: 1px solid var(--connection-ink);
  background: transparent;
  color: var(--connection-ink);
  cursor: pointer;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.connection-like:hover { transform: translateY(-2px); }
.connection-like.is-liked { color: white; background: var(--connection-violet); border-color: var(--connection-violet); }
.connection-like.is-liked svg { fill: currentColor; }

.connection-gameover__friend {
  grid-column: 1 / -1;
  padding-top: 20px;
  border-top: 1px solid rgba(17, 17, 25, 0.12);
}

.connection-gameover__experience { margin-top: 18px; padding: 32px 38px 38px; }

.connection-rating-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.connection-rating {
  position: relative;
  min-height: 150px;
  padding: 22px;
  border: 1px solid rgba(17, 17, 25, 0.18);
  background: rgba(255, 255, 255, 0.46);
  color: var(--connection-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.connection-rating:hover { transform: translateY(-3px); border-color: var(--connection-violet); }
.connection-rating.is-selected { border-color: var(--connection-violet); background: rgba(116, 82, 215, 0.1); }
.connection-rating b { display: block; margin-bottom: 30px; color: var(--connection-violet); font-size: 12px; }
.connection-rating span { display: block; font-size: 20px; font-weight: 700; }
.connection-rating small { display: block; margin-top: 7px; color: #696774; line-height: 1.5; }

.connection-gameover__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 24px 38px;
}

.connection-gameover__footer p { margin: 0; color: #696774; }
.connection-gameover__footer > div { display: flex; gap: 10px; }

@media (max-width: 800px) {
  .connection-gameover__partner { grid-template-columns: 1fr; }
  .connection-like { width: 100%; }
  .connection-rating-grid { grid-template-columns: 1fr; }
  .connection-gameover__footer { align-items: stretch; flex-direction: column; }
  .connection-gameover__footer > div { flex-direction: column; }
}
