/* Friend room: versus lobby. Reuses the clouds/stars of lobby.css and the shared tokens. */
.room { max-width: 1240px; padding-top: 18px; animation: r-in .35s ease both; }
@keyframes r-in { from { opacity: 0; transform: translateY(8px); } }
.room-scene .silh { position: absolute; width: 90px; aspect-ratio: 750 / 1039; border-radius: 10px; background: rgba(63, 124, 255, .1); border: 3px solid rgba(63, 124, 255, .14); }
.silh.r1 { left: 5%; top: 55%; transform: rotate(-14deg); } .silh.r2 { right: 6%; top: 18%; transform: rotate(12deg); } .silh.r3 { right: 12%; bottom: 8%; transform: rotate(-6deg); width: 70px; }

/* A: header */
.rhead { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 22px 34px; margin-bottom: 16px; border-radius: 28px; background: linear-gradient(120deg, #d9e8ff, #efe3ff 60%, #fff2c7); box-shadow: var(--pg-shadow, var(--shadow)); border: 4px solid #fff; background-size: cover; background-position: center; }
.rhead h1 { font-family: var(--font-display, inherit); font-size: clamp(2rem, 4.6vw, 3.2rem); color: #1f2a4d; margin: 0 0 4px; letter-spacing: .02em; text-shadow: 0 3px 0 #fff; }
.rsub { font-weight: 800; font-size: 1.2rem; color: #3b4770; margin: 0; max-width: 30em; }
.rbook { display: grid; justify-items: center; gap: 6px; animation: r-float 3.2s ease-in-out infinite; } .rbook .bubble { max-width: 240px; text-align: center; min-height: 2.6em; font-weight: 900; }
@keyframes r-float { 50% { transform: translateY(-7px); } }

/* invitation */
.invite { position: relative; text-align: center; margin: 0 auto 18px; max-width: 760px; padding: 18px 24px 16px; border-radius: 28px; background: linear-gradient(150deg, #efe9ff, #fff2c7); box-shadow: var(--shadow); border: 4px solid #fff; overflow: hidden; }
.invite h2 { font-size: 1.15rem; letter-spacing: .12em; color: #4a2fb0; margin-bottom: 8px; }
.codebox { display: inline-flex; gap: 10px; padding: 10px 22px; border-radius: 22px; background: #fff; border: 4px solid #8b6cf0; box-shadow: 0 6px 0 #6a4bd0; }
.codebox span { font-family: var(--font-display, inherit); font-weight: 900; font-size: clamp(2.2rem, 6vw, 3.6rem); color: #4a2fb0; width: 1.05em; text-align: center; line-height: 1.15; }
.invbtns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 14px 0 6px; } .invbtns .btn { min-height: 52px; transition: transform .15s; } .invbtns .btn:hover { transform: translateY(-2px); } .invbtns .btn.done { background: #0f7d64; box-shadow: 0 5px 0 #0a5a47; }
.copied { font-weight: 900; color: #0f7d64; font-size: 1.1rem; margin: 6px 0 0; animation: r-pop .35s var(--ease-pop, ease) both; } @keyframes r-pop { from { transform: scale(.7); opacity: 0; } }
.isp { position: absolute; color: #ffc533; font-style: normal; animation: r-tw 3s ease-in-out infinite; } .i1 { left: 6%; top: 14%; font-size: 1.6rem; } .i2 { right: 7%; top: 22%; font-size: 1.2rem; animation-delay: .8s; color: #ff8a78; } .i3 { left: 14%; bottom: 12%; font-size: 1.1rem; animation-delay: 1.6s; color: #8b6cf0; }
@keyframes r-tw { 50% { opacity: .35; transform: scale(.8); } }

/* B: versus */
.versus { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 16px; align-items: stretch; margin-bottom: 18px; }
.pcard { position: relative; display: grid; justify-items: center; align-content: start; gap: 6px; padding: 26px 20px 20px; min-height: 330px; border-radius: 30px; text-align: center; box-shadow: var(--pg-shadow, var(--shadow)); border: 5px solid #fff; transition: box-shadow .3s, transform .3s; }
.p-host { background: linear-gradient(170deg, #dcebff, #b8d4ff); --pc: #2a5bd7; } .p-friend { background: linear-gradient(170deg, #efe6ff, #d8c6ff); --pc: #6a4bd0; }
.pcard.ready { background: linear-gradient(170deg, #dcf8ee, #a8ecd4); --pc: #0f7d64; box-shadow: 0 0 0 4px #35c9a7, var(--shadow); }
.pcard.empty { background: linear-gradient(170deg, #f3eeff, #e6dcff); border-style: dashed; border-color: #b9a4f0; }
.roleb { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: var(--pc); color: #fff; font-weight: 900; font-size: .85rem; letter-spacing: .08em; padding: 4px 16px; border-radius: 99px; white-space: nowrap; box-shadow: var(--shadow-s); }
.p-friend.empty .roleb { background: #8b6cf0; }
.pav { position: relative; width: 120px; height: 120px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-size: 4rem; border: 6px solid var(--pc); box-shadow: 0 6px 14px rgba(38, 48, 77, .2); margin-top: 6px; }
.pav.join { animation: r-join .4s var(--ease-pop, ease) both; } @keyframes r-join { from { transform: scale(.4) translateY(20px); opacity: 0; } }
.pav.wait { border: 6px dotted #b9a4f0; background: rgba(255, 255, 255, .6); animation: r-pulse 2s ease-in-out infinite; font-size: 3.2rem; } .pav.wait .art-img { width: 100%; height: 100%; object-fit: contain; }
@keyframes r-pulse { 50% { transform: scale(1.06); box-shadow: 0 0 0 14px rgba(139, 108, 240, .15); } }
.tick { position: absolute; right: -6px; bottom: -4px; width: 40px; height: 40px; border-radius: 50%; background: #139a7b; color: #fff; display: grid; place-items: center; font-size: 1.5rem; font-weight: 900; border: 4px solid #fff; animation: r-pop .3s var(--ease-pop, ease) both; }
.pname { font-family: var(--font-display, inherit); font-size: clamp(1.4rem, 2.4vw, 2rem); margin: 4px 0 0; color: #1f2a4d; overflow-wrap: anywhere; } .pname small { font-size: .55em; color: #3b4770; }
.pdeck { display: grid; gap: 0; margin: 2px 0; } .pdeck span { font-size: .78rem; font-weight: 900; letter-spacing: .1em; color: #3b4770; } .pdeck b { font-size: 1.15rem; color: #1f2a4d; }
.psub { font-weight: 800; color: #4a2fb0; max-width: 16em; margin: 0; }
.pstat { margin: 6px 0 0; padding: 6px 20px; border-radius: 99px; background: rgba(255, 255, 255, .8); font-weight: 900; letter-spacing: .06em; color: #4a4a5e; display: inline-flex; align-items: center; gap: 8px; } .pstat.on { background: #139a7b; color: #fff; }
.pop { display: inline-grid; place-items: center; animation: r-pop .3s var(--ease-pop, ease) both; }
.pcard.away { filter: saturate(.55); }
.vsemblem { display: grid; place-items: center; width: 110px; } .vsemblem .art-img { width: 100%; }
.vs { display: grid; place-items: center; width: 96px; height: 96px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff2a8, #ffc533 60%, #e8750c); color: #7a2d00; font-family: var(--font-display, inherit); font-weight: 900; font-size: 2.2rem; border: 5px solid #fff; box-shadow: 0 0 0 4px #ffc533, 0 10px 22px rgba(232, 117, 12, .4); transform: rotate(-6deg); }

/* C: controls */
.rctl { text-align: center; padding: 14px 10px 6px; }
.rstatus { font-family: var(--font-display, inherit); font-size: clamp(1.1rem, 2.2vw, 1.5rem); font-weight: 900; color: #1f2a4d; margin-bottom: 12px; } .rstatus.trouble, .rstatus.away { color: #a33a00; } .rstatus.meReady { color: #0f7d64; }
.rbtns { display: flex; gap: 14px; justify-content: center; align-items: center; flex-wrap: wrap; }
.btn.huge { min-height: 72px; min-width: 300px; font-size: 1.7rem; border-radius: 26px; font-family: var(--font-display, inherit); letter-spacing: .04em; transition: transform .15s; } .btn.huge:hover:not(:disabled) { transform: translateY(-3px); }
.youready { display: inline-flex; align-items: center; gap: 10px; min-height: 72px; padding: 0 30px; border-radius: 26px; background: #139a7b; color: #fff; font-weight: 900; font-size: 1.6rem; box-shadow: 0 6px 0 #0c6f59; font-family: var(--font-display, inherit); }
.roomgone { max-width: 560px; margin: 40px auto; }

/* countdown overlay (presentation only) */
.countdown { position: fixed; inset: 0; z-index: 90; display: grid; place-content: center; justify-items: center; gap: 8px; background: radial-gradient(60% 60% at 50% 45%, rgba(255, 249, 220, .96), rgba(207, 224, 255, .94)); animation: r-in .25s ease both; text-align: center; }
.cd-both { font-family: var(--font-display, inherit); font-weight: 900; font-size: clamp(1.2rem, 3vw, 2rem); color: #0f7d64; }
.cd-num { font-family: var(--font-display, inherit); font-weight: 900; font-size: clamp(6rem, 20vw, 13rem); line-height: 1; color: #e8590c; text-shadow: 0 6px 0 #fff, 0 0 40px rgba(255, 197, 51, .95); animation: r-num .8s var(--ease-pop, ease) both; }
.cd-num.go { font-size: clamp(2.6rem, 9vw, 6rem); color: #4a2fb0; }
@keyframes r-num { 0% { transform: scale(.3); opacity: 0; } 35% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }
.cdp { position: absolute; left: 50%; top: 50%; color: #ffc533; font-style: normal; font-size: 1.8rem; opacity: 0; animation: r-burst 1.4s ease-out infinite; animation-delay: var(--d); }
@keyframes r-burst { 0% { opacity: 0; transform: rotate(var(--a)) translateX(60px); } 30% { opacity: 1; } 100% { opacity: 0; transform: rotate(var(--a)) translateX(32vmin); } }

@media (max-width: 900px) { .versus { grid-template-columns: 1fr; } .vsemblem { width: auto; } .rhead { flex-direction: column; text-align: center; padding: 20px; } .btn.huge { min-width: 0; width: 100%; } }
@media (prefers-reduced-motion: reduce) { .room, .rbook, .pav.wait, .pav.join, .isp, .cd-num, .cdp, .tick, .pop, .copied { animation: none !important; } .cdp { display: none; } .btn.huge:hover, .invbtns .btn:hover { transform: none; } }
html.reduce-motion .rbook, html.reduce-motion .pav.wait, html.reduce-motion .isp, html.reduce-motion .cdp { animation: none !important; }
@media (max-width: 520px) { .codebox { gap: 4px; padding: 8px 12px; max-width: 100%; } .codebox span { font-size: clamp(1.7rem, 9vw, 2.6rem); } }
