/* GameChrome and EntryEffects colours from the PC client. */
:root {
  --panel: linear-gradient(155deg,#1b3d53,#0e2336 76%,#091a29);
  --button: linear-gradient(#1d3c50,#102638);
  --rim: #426a80;
  --accent: #8fe7ff;
}
#lobby, #social, #hubPanel, #installHelp {
  color: #eaf7ff;
  background: var(--panel);
  border: 1px solid var(--rim);
  border-radius: 5px;
  box-shadow: 0 6px 25px #020e1ba6;
}
#lobby::before, #lobby::after, #social::before { content: none }
#lobby h1, #lobby h2, #hubPanel h2, #social h2 { color: #f0faff; text-shadow: none }
#lobby label, #social label { color: #a6c7db }
#lobby :is(input,select), #hubPanel :is(input,select), #social :is(input,textarea) {
  background: #061522; color: #eaf7ff; border: 1px solid #3c6075; border-radius: 4px;
}
#lobby :is(input,select):focus { outline: 1px solid var(--accent) }
#lobby button:not(#townProfile,#mail,#friends), #hubPanel button:not([data-slot]), #social button, #installHelp button {
  border-radius: 4px; border-color: var(--rim); color: #cdedf7;
}
#lobby button:not(#townProfile,#mail,#friends), #hubPanel header button, #social button, #installHelp button {
  background: var(--button); box-shadow: none;
}
#hubPanel header h2 { background: transparent; padding-inline: 0; color: #f0faff }
#hubPanel header { border-bottom: 1px solid var(--rim) }
#hubPanel .lacquerCard { background: #132c40; border: 1px solid var(--rim); border-radius: 4px }
#lobby:has(#login:not([hidden])), #lobby:has(#enterWorld:not([hidden])):has(#login[hidden]) {
  width: min(400px,92vw); min-height: 0; max-height: 94dvh; overflow-y: auto;
  margin: auto; padding: clamp(10px,3dvh,22px); border-top: 2px solid var(--accent);
}
main:has(#login:not([hidden])), main:has(#enterWorld:not([hidden])):has(#login[hidden]) {
  display: grid; align-content: center;
}
#lobby:has(#login:not([hidden])) header { margin-bottom: 5px }
#login { display: grid; gap: 4px }
#login[hidden], #modeTiles[hidden], #lobby.inRoom #modeTiles { display: none }
#login label { margin: 0 }
#login input { min-height: 35px; font-size: 16px }
#login .actions { display: grid; gap: 5px; margin: 5px 0 }
#lobby #login #submitLogin { color: #071a29; background: linear-gradient(#9aebfb,#55c3e3); border-color: var(--accent) }
#fullScreen { min-height: 32px }
#installHelp { width: min(440px,92vw); max-height: 92dvh; overflow: auto; padding: 16px }
#installHelp::backdrop { background: #071524c9 }
#installHelp p { line-height: 1.55 }
#lobby #cityShortcuts { display: flex; flex-wrap: wrap; gap: 4px; max-width: none }
#lobby #cityShortcuts[hidden] { display: none }
#lobby #cityShortcuts button { width: auto; min-height: 34px; padding: 4px 8px; border: 1px solid var(--rim); color: #eaf7ff; text-shadow: none }
#lobby #cityShortcuts button::before { content: none }
#modeTiles { display: grid; grid-template-columns: 1fr 1.35fr; gap: 4px; margin-block: 7px }
#lobby #modeTiles button {
  position: static; width: auto; height: clamp(46px,12dvh,104px); min-width: 0; margin: 0;
  display: flex; align-items: end; padding: 4px 7px; border: 1px solid #5b93a8;
  color: white; font-weight: bold; font-size: clamp(14px,2.3vw,22px); text-shadow: 0 2px 3px #04111d;
  background-image: linear-gradient(transparent,#0a1b2dd9), url('/mobile/city-modes.png');
  background-size: 100% 100%,200% 200%;
}
#modeTiles #cityDuel { background-position: center,right top }
#modeTiles #cityStart { background-position: center,left top }
#modeTiles #cityDungeon { background-position: center,left bottom }
#modeTiles #cityTeam { background-position: center,right bottom }
.fighterSkills { display: grid; gap: 5px; padding: 0; list-style: none }
.fighterSkills li { display: flex; align-items: center; gap: 14px; padding: 4px 10px; background: #153146; border: 1px solid var(--rim) }
.fighterSkills [data-slot] { width: 42px; height: 42px; background: url('/mobile/skill-icons.webp') no-repeat; background-size: 500% 1000% }
.partySeats .seatFighter { display: block; width: 100%; height: clamp(38px,12dvh,76px); object-fit: contain }
.partySeats select { width: 100%; min-width: 0; font-size: 13px }
.partySeats.brawlSeats { grid-template-columns: repeat(4,minmax(0,1fr)) }
#lobby.inRoom { width: min(96vw,1080px); max-width: 96vw; margin: 2dvh auto; padding: 12px }
#lobby.inRoom :is(#hero,#cityShortcuts,#socialTools,#fullScreen,#selectHero) { display: none }
.cityTools,.citySections { display: flex; flex-wrap: wrap; gap: 4px }
html,body,main { width:100%; height:100%; min-height:0; margin:0; overflow:clip; overscroll-behavior:none }
main { position:fixed; inset:0; display:grid; place-items:center }
#lobby:not([hidden]) { min-height:0; max-height:100%; overflow:auto; overscroll-behavior:contain }
#cityOptions,#cityChat:empty { display:none }
#townMenu { width:min(320px,88vw); max-height:92dvh; overflow:auto; color:#eaf7ff; background:var(--panel); border:1px solid var(--rim) }
#townMenu::backdrop { background:#061321b8 }
#townMenu header { justify-content:space-between; margin:0 }
#townActions { display:grid; gap:6px }
#lobby:not(.inRoom):has(#townProfile) {
  --gap:clamp(4px,1.4dvh,12px);
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto;
  grid-template-rows:auto minmax(0,1fr) auto;
  width:100%; height:100%; max-width:none; max-height:none; margin:0;
  gap:var(--gap); padding:var(--gap); overflow:clip;
  color:white; border:0; border-radius:0; box-shadow:none;
  background:linear-gradient(#091b2e99,transparent 24%,transparent 77%,#0b1c2aaf);
}
#lobby:not(.inRoom):has(#townProfile) > header { grid-area:1 / 1; margin:0; gap:3px; min-width:0 }
#lobby:not(.inRoom):has(#townProfile) :is(#music,#fullScreen,#logout,#selectHero>label,#party,#socialTools) { display:none }
#lobby:not(.inRoom):has(#townProfile) #cityOptions { display:block; grid-area:1 / 3; align-self:center; padding:4px; min-height:32px }
#lobby:not(.inRoom):has(#townProfile) #cityShortcuts { display:contents }
#lobby:not(.inRoom):has(#townProfile) :is(.citySections,.cityTools) { flex-wrap:nowrap; align-items:center; justify-content:end; gap:3px; min-width:0 }
.cityTools { grid-area:1 / 2 }
.citySections { grid-area:3 / 2 / 4 / 4 }
#lobby:not(.inRoom):has(#townProfile) #cityShortcuts button { display:block; min-width:0; min-height:32px; padding:3px clamp(2px,.7vw,10px); font-size:clamp(11px,1.65vw,16px); background:var(--button) }
#lobby:not(.inRoom):has(#townProfile) #townProfile { width:48%; max-width:224px; height:48px }
#townProfile .travelerIcon { width:30px; height:30px; left:3px; top:8px }
#townProfile .profileName { left:37px; top:3px; font-size:13px }
#townProfile .profileLevel { left:37px; top:24px; font-size:10px }
#townProfile .profileXp { left:auto; right:4px; top:25px; font-size:10px }
#townProfile .profileXpFill { top:40px }
#townBalances { min-width:0; gap:1px }
#townBalances .resourceMeter { min-width:0; padding:2px 4px; font-size:11px }
#lobby:not(.inRoom):has(#townProfile) #selectHero { grid-area:2 / 1; display:grid; min-height:0; grid-template-columns:52% minmax(0,1fr); grid-template-rows:minmax(0,1fr); gap:4px; align-items:center }
#lobby:not(.inRoom):has(#townProfile) #townFighter:not([hidden]) { grid-area:1 / 2; align-self:end; width:100%; height:clamp(68px,42dvh,220px); max-height:90%; object-fit:contain; object-position:center bottom; margin:0 }
#lobby:not(.inRoom):has(#townProfile) #hero { grid-area:1 / 1; padding:clamp(5px,1.4dvh,12px); max-height:100%; overflow:auto; background:#102638e8; border:1px solid var(--rim); border-radius:5px }
#lobby:not(.inRoom):has(#townProfile) #hero :is(h2,p,button) { margin:3px 0; line-height:1.25 }
#lobby:not(.inRoom):has(#townProfile) #hero h2 { font-size:clamp(13px,2.1vw,20px) }
#lobby:not(.inRoom):has(#townProfile) #hero :is(p,button) { font-size:clamp(12px,1.65vw,16px) }
#lobby:not(.inRoom):has(#townProfile) #hero button { min-height:30px; padding:4px; width:100% }
#lobby:not(.inRoom):has(#townProfile) #modeTiles { grid-area:2 / 2 / 3 / 4; height:76%; max-height:250px; align-self:end; grid-template-rows:repeat(2,minmax(0,1fr)); margin:0 }
#lobby #modeTiles > button { height:100%; min-height:0; background-repeat:no-repeat; line-height:1.15 }
#lobby #modeTiles > #cityDuel { background-position:center,right top }
#lobby #modeTiles > #cityStart { background-position:center,left top }
#lobby #modeTiles > #cityDungeon { background-position:center,left bottom }
#lobby #modeTiles > #cityTeam { background-position:center,right bottom }
#cityChat { grid-area:3 / 1; min-width:0; align-self:stretch; position:relative }
#cityChat details { position:absolute; bottom:0; width:100%; border:1px solid var(--rim); border-radius:3px; background:#102638f5; padding:4px 8px; z-index:4; margin:0; max-height:70dvh; overflow:auto }
#cityChat summary { min-height:24px; cursor:pointer }
#cityChat #chatForm { display:flex; flex-wrap:wrap }
#cityChat #message { flex:1 1 45% }
#lobby:not(.inRoom):has(#townProfile) > #status:not(:empty),
#lobby:not(.inRoom):has(#townProfile) > #retryConnection:not([hidden]) { position:absolute; top:19%; left:50%; transform:translateX(-50%); z-index:6; padding:3px 8px; background:#122c40; margin:0 }
#lobby:not(.inRoom):has(#townProfile) > #retryConnection:not([hidden]) { top:30% }
#status:empty { display:none }
#lobby.inRoom { max-height:96%; min-height:0; overflow:auto }
#lobby.inRoom :is(#cityOptions,#modeTiles,#cityChat) { display:none }
:is(#arena,.padPreview) :is(#keys,.previewKeys) button[data-slot] { border-radius:18%; background-color:#102438; background-repeat:no-repeat }
@media (max-width:650px) {
  #lobby:not(.inRoom):has(#townProfile) { grid-template-columns:minmax(0,.95fr) minmax(0,1fr) auto }
  #lobby:not(.inRoom):has(#townProfile) #townProfile { width:56% }
  #townProfile .profileXp { font-size:9px }
  #townBalances .resourceMeter { font-size:10px; padding:1px 2px }
}
#lobby.inRoom:has(.managedRoomBody) {
  display:flex; flex-direction:column; width:min(100%,1080px); height:100%;
  max-width:100%; max-height:100%; margin:0; padding:clamp(4px,1dvh,10px); overflow:clip;
}
#lobby.inRoom:has(.managedRoomBody) > :is(header,#logout) { display:none }
#lobby.inRoom #party:has(.managedRoomBody) { display:flex; flex:1; flex-direction:column; min-height:0 }
#party:has(.managedRoomBody) > h2 { font-size:clamp(14px,3.6dvh,22px); margin:0 0 3px }
#room:has(.managedRoomBody) { display:flex; flex-direction:column; flex:1; min-height:0; gap:3px }
#room:has(.managedRoomBody) > .actions { margin:0; gap:3px }
#room:has(.managedRoomBody) :is(button,select,input), #party:has(.managedRoomBody) #voice button { min-height:28px; padding:3px 5px; font-size:clamp(11px,1.6vw,15px) }
#room:has(.managedRoomBody) > .actions .seat { padding:1px 4px; gap:5px }
.managedRoomBody { display:grid; grid-template-columns:minmax(0,1.8fr) minmax(0,1fr); gap:6px; flex:1; min-height:0 }
.managedRoomBody > div { overflow:auto; overscroll-behavior:contain; min-height:0 }
.managedRoomBody .partySeats { gap:3px }
.managedRoomBody .seat { padding:2px; font-size:12px; min-height:36px }
.managedRoomBody .seatFighter { height:clamp(26px,8dvh,60px) }
.managedRoomBody label { margin:0 0 3px; font-size:12px }
#party:has(.managedRoomBody) #voice { margin:2px 0 0 }@media (max-width:620px), (max-height:295px) {
  #lobby:not(.inRoom):has(#townProfile) #selectHero { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr) auto; gap:1px }
  #lobby:not(.inRoom):has(#townProfile) #townFighter:not([hidden]) { grid-area:1 / 1; height:100%; max-height:100% }
  #lobby:not(.inRoom):has(#townProfile) #hero { grid-area:2 / 1; padding:3px 5px }
  #lobby:not(.inRoom):has(#townProfile) #hero h2 { letter-spacing:0 }
  #lobby:not(.inRoom):has(#townProfile) #hero button { width:auto; margin:1px; min-height:27px }
}
