#onlineRooms {
  display: flex; align-items: center; gap: 1.1rem; width: 100%; margin-top: .72rem;
  padding: .5rem .9rem; text-align: left; white-space: normal;
  background: linear-gradient(105deg, #253f47, #172c3a 60%, #1d3440);
  border: 1px solid #66828a; border-bottom: 3px solid #425c64;
}
#onlineRooms strong, #onlineRooms small {display: block}
.roomWebLink {display:inline-block; color:#ffe2ab; padding:.55rem .8rem; border:1px solid #bba375; border-radius:4px}
#onlineRooms strong {font: bold 1.35rem Georgia,serif; color: #ffe2ab}
#onlineRooms small {margin-top: .15rem; color: #d0d9d4}
#onlineRooms .roomArrow {margin-left: auto; padding-inline: .4rem; font: 2rem/1 Georgia,serif; color: var(--gold)}
.roomColours {display: flex; padding-left: .15rem}
.roomColours canvas {width: 1.65rem; height: auto; margin-left: -.16rem; align-self: flex-end}
dialog:has(#roomPanel) {width: min(94vw, 53rem); padding: 1.15rem; max-height: 92dvh}
dialog:has(#roomPanel[data-screen=entry]) {width: min(94vw, 41rem)}
#roomPanel {display: grid; gap: .9rem}
#roomPanel p {margin: 0}
.roomHeading, .roomInvite, .roomActions, #roomExitCheck {
  display: flex; align-items: center; justify-content: space-between; gap: .8rem
}
.roomHeading {padding-bottom: .65rem; border-bottom: 1px solid #746849}
.roomHeading h2 {margin: 0; color: #ffe5ae; font-size: clamp(1.55rem,3.4vw,2.05rem)}
.roomHeading p {color: #bfcac8; font-size: .93rem}
.roomMethods {display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .65rem}
.roomMethod {
  display: flex; flex-direction: column; align-items: stretch; gap: .38rem; padding: .8rem;
  border: 1px solid #52606a; background: #142937;
}
.roomMethod h3,.roomFactions h3 {margin: 0 0 .2rem}
.roomMethod p, .roomMethod label {color: #c3d1cf}
.roomMethod button {margin-top: auto}
.roomMethod input {min-width: 0; width: 100%; margin-bottom: .15rem}
.roomInvite {flex-wrap: wrap; padding: .65rem .9rem; background: #112531; border: 1px solid #3e5460; border-left: 3px solid #d3ad6c}
.roomInvite label {display: block; color: var(--muted); font-size: .8rem}
#roomCode {color: #ffe3aa; font: bold 1.45rem/1.25 'Courier New',monospace; letter-spacing: .12em; user-select: all}
.roomInviteButtons {display: flex; gap: .4rem; flex-wrap: wrap}
#roomManualCopy {width: 100%; min-width: 0}
#roomBanners {display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: .42rem}
.roomBanner {
  display: grid; grid-template-rows: 4.4rem auto 1fr; justify-items: center; align-items: start;
  padding: .2rem .16rem .45rem; white-space: normal; overflow: hidden;
  border: 1px solid #4f6269; border-top: 3px solid var(--banner-colour);
  background: radial-gradient(ellipse at top, color-mix(in srgb,var(--banner-colour) 26%,#142736),#162633 72%);
}
.roomBanner canvas {height: 100%; width: auto}
.roomBanner strong {margin-top: .1rem; color: #f5ead2; font: bold 1.03rem/1.2 Georgia,serif}
.roomBanner small {margin-top: .2rem; color: #b9caca; font-size: .78rem}
.roomBanner[data-owner=self] {border-color: #ffe5a8; border-top-color: var(--banner-colour); box-shadow: inset 0 0 0 1px #bf9a54}
.roomBanner[data-owner=self] small {color: #ffdf9e}
.roomBanner[data-owner=other]:disabled {background: #203540; border-top-color: var(--banner-colour)}
.roomBanner[data-owner=vacant] canvas {opacity: .75}
.roomSetup {display: grid; grid-template-columns: minmax(8.5rem,25%) 1fr; align-items: stretch; border: 1px solid #445662; background: #152835}
#roomRealmArt {width: 100%; height: 100%; max-height: 7.6rem; object-fit: contain; background: #0c1d29}
.roomSettings {display: grid; align-content: center; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); gap: .25rem .6rem; padding: .5rem .75rem}
.roomSettings label {color: #e7c994; font-size: .86rem; min-width: 0}
.roomSettings select {display: block; margin-top: .12rem; width: 100%; font-size: .9rem}
.roomSettings select:disabled {color: #d5dfdc; opacity: .9}
#roomRivalDetail {grid-column: 1/-1; margin: .15rem 0; line-height: 1.35; font-size: .81rem}
.roomActions {padding-top: .55rem; border-top: 1px solid #5f645a}
.roomActions p {color: #c1cfce}
.roomActions button {min-width: 8.2rem}
#roomExitCheck {flex-wrap: wrap; justify-content: flex-end; background: #392e29; padding: .5rem .65rem}
#roomExitCheck p {margin-right: auto; color: #f7d5bb}
#roomNotice {padding: .45rem .65rem; background: #243d43; border-left: 2px solid #91c4b2; overflow-wrap: anywhere}
#roomNotice.roomError {border-color: #e69a7a; background: #422e2c}
#roomConnection {margin-left: auto; color: #e4ce9a; font-size: .82rem}
@media (max-width:620px) {
  dialog:has(#roomPanel) {padding: .7rem; max-height: 94dvh}
  #roomPanel {gap: .62rem}
  #roomBanners {display: flex; flex-wrap: wrap; gap: .32rem}
  .roomBanner {flex: 1 1 28%; grid-template-rows: 3rem auto 1fr; padding: .12rem .2rem .27rem}
  .roomSetup {grid-template-columns: 25% 1fr}
  .roomSettings {padding: .4rem; gap: .25rem .38rem}
  #onlineRooms {gap: .6rem}
}
@media (max-width:410px) {
  .roomMethods {grid-template-columns: 1fr}
  .roomActions {flex-wrap: wrap}
  .roomActions button {flex: auto}
  .roomArrow {display: none}
}
