/* Menus (join screen, lobby, match over) in the same look as the HUD: cut-corner glass panels with neon corner
   brackets and the Title FX cell texture, Lilita labels, segmented toggles, cut-corner buttons. */
.screen { --cut: 16px; --acc: rgba(57, 255, 224, .9); --acc2: rgba(255, 43, 214, .8);
  --surface: linear-gradient(160deg, rgba(18, 22, 58, .9), rgba(7, 9, 26, .86)); }
#join, #lobby { background: radial-gradient(ellipse at 50% 40%, rgba(40, 14, 80, .3), rgba(4, 4, 14, .82)); }

.screen .panel {
  position: relative; border-radius: 0; border: 1px solid rgba(120, 150, 255, .25); background: var(--surface);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  box-shadow: 0 0 40px rgba(80, 60, 255, .28), inset 0 1px 0 rgba(255, 255, 255, .08); padding: 18px 20px;
}
.screen .panel::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .14; mix-blend-mode: soft-light;
  background: repeating-linear-gradient(0deg, rgba(255, 255, 255, .03) 0 1px, transparent 1px 3px), url('../assets/ui/cells.png') center / 320px;
}
.screen .panel::after {
  content: ''; position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(var(--acc), var(--acc)) top right / 22px 2px no-repeat,
    linear-gradient(var(--acc), var(--acc)) top right / 2px 22px no-repeat,
    linear-gradient(var(--acc2), var(--acc2)) bottom left / 22px 2px no-repeat,
    linear-gradient(var(--acc2), var(--acc2)) bottom left / 2px 22px no-repeat,
    linear-gradient(90deg, transparent, rgba(57, 255, 224, .55) 30%, rgba(255, 43, 214, .45) 70%, transparent) top left / 100% 1px no-repeat;
}
.screen .panel > * { position: relative; z-index: 1; }
.panel.menu { width: min(420px, 94vw); background: url('../assets/ui/radar_dim.png') right -90px top -90px / 280px no-repeat, var(--surface); }

/* labels and inputs */
.screen .label, .field > span, .kicker {
  display: flex; align-items: center; gap: 8px; font: 12px 'Lilita', sans-serif; letter-spacing: .28em; text-transform: uppercase;
  color: #9fa8ff; margin: 14px 0 7px;
}
.kicker { color: var(--pink); text-shadow: 0 0 8px rgba(255, 43, 214, .5); margin: 0 0 6px; }
.field { display: block; }
.field > span { margin-top: 0; }
.screen input {
  width: 100%; border-radius: 0; border: 1px solid rgba(120, 150, 255, .35); background: rgba(0, 0, 0, .45); color: #fff;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
  font: 18px 'Lilita', sans-serif; letter-spacing: .06em; padding: 10px 12px;
}
.screen input:focus { border-color: var(--cyan); box-shadow: inset 0 0 12px rgba(57, 255, 224, .2); }
.screen .row { display: flex; gap: 8px; margin-top: 0; }
.screen .row input { letter-spacing: .4em; text-align: center; }
.or { display: flex; align-items: center; gap: 10px; margin: 12px 0 10px; font-size: 12px; color: #7f88c8; letter-spacing: .08em; }
.or::before, .or::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, rgba(120, 150, 255, .4), transparent); }

/* buttons: cut corners everywhere */
.btn {
  border-radius: 0; border: none; clip-path: polygon(10px 0, 100% 0, 100% calc(100% - 10px), calc(100% - 10px) 100%, 0 100%, 0 10px);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .35); letter-spacing: .06em;
}
.btn.big { margin-top: 0; padding: 13px 22px; font-size: 21px; }
.btn.small { clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); padding: 5px 12px; }
.btn.hot { background: linear-gradient(135deg, #ff2bd6, #8b3bff); }
.btn.cool { background: linear-gradient(135deg, #1fd8ff, #3b5bff); }
.btn.ghost { background: rgba(255, 255, 255, .08); color: #dfe3ff; }
.btn:disabled { filter: grayscale(.9) brightness(.55); }

/* open rooms: live list */
.live { width: 7px; height: 7px; border-radius: 50%; background: #39e07a; box-shadow: 0 0 8px #39e07a; animation: livepulse 1.4s infinite; }
@keyframes livepulse { 50% { opacity: .3; } }
#openrooms { display: flex; flex-direction: column; gap: 6px; max-height: 190px; overflow: auto; }
#openrooms .empty { font-size: 13px; color: #7f88c8; padding: 8px 2px; }
#openrooms .room {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 7px 8px 7px 12px; margin: 0;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(120, 150, 255, .2); border-radius: 0; cursor: pointer;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); transition: background .12s, border-color .12s;
}
#openrooms .room:hover:not(.locked) { background: rgba(57, 255, 224, .1); border-color: var(--cyan); }
#openrooms .room.locked { cursor: default; opacity: .6; }
#openrooms .room .code { font: 20px 'Lilita', sans-serif; letter-spacing: .12em; color: #fff; }
#openrooms .room .info { min-width: 0; font-size: 12px; color: #aab2ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#openrooms .room .pips { display: inline-flex; gap: 3px; margin-right: 8px; vertical-align: -1px; }
#openrooms .room .pips i { width: 9px; height: 9px; transform: skewX(-18deg); background: rgba(255, 255, 255, .14); }
#openrooms .room .pips i.on { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
#openrooms .room .state { font: 11px 'Lilita', sans-serif; letter-spacing: .14em; padding: 4px 9px; color: #08081a; background: var(--cyan);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%); }
#openrooms .room.locked .state { background: #ffb13b; }

/* settings: segmented toggles */
.settings { display: grid; gap: 8px; margin-top: 16px; padding-top: 12px; border-top: 1px solid rgba(120, 150, 255, .18); }
.set { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.set > span { font: 12px 'Lilita', sans-serif; letter-spacing: .2em; text-transform: uppercase; color: #9fa8ff; }
.seg { display: flex; background: rgba(0, 0, 0, .45); border: 1px solid rgba(120, 150, 255, .3); padding: 2px; gap: 2px;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.seg button { font: 13px 'Lilita', sans-serif; letter-spacing: .08em; color: #c3c9ff; background: transparent; border: none; padding: 5px 12px; cursor: pointer; min-width: 58px; }
.seg button:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.seg button.on { color: #08081a; background: var(--cyan); box-shadow: 0 0 10px rgba(57, 255, 224, .5); }

/* lobby */
.lobbywrap { display: flex; gap: 14px; align-items: stretch; justify-content: center; flex-wrap: wrap; width: min(980px, 98vw); }
.runnerbox { width: min(380px, 96vw); display: flex; flex-direction: column; }
.lobbyside { width: min(520px, 96vw); max-height: 92vh; overflow: auto; }
#runnercv { width: 100%; height: 300px; display: block; cursor: grab; touch-action: none;
  background: radial-gradient(ellipse at 50% 85%, rgba(57, 255, 224, .12), transparent 60%); }
#runnercv:active { cursor: grabbing; }
.runnername { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 10px; }
.runnername b { font: 24px 'Lilita', sans-serif; font-weight: normal; letter-spacing: .04em; text-align: center; flex: 1; text-shadow: 0 0 12px rgba(57, 255, 224, .45); }
.arrow { width: 38px; height: 38px; font: 26px/1 'Lilita', sans-serif; color: #fff; background: rgba(255, 255, 255, .07); border: 1px solid rgba(120, 150, 255, .35); cursor: pointer;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); }
.arrow:hover { border-color: var(--cyan); background: rgba(57, 255, 224, .14); }
.screen .looks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.screen .looks button {
  position: relative; padding: 0; aspect-ratio: 1; border: 1px solid rgba(120, 150, 255, .25); border-radius: 0; background: rgba(255, 255, 255, .04); cursor: pointer; overflow: hidden;
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px);
}
.screen .looks button img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .15s; }
.screen .looks button:hover img { transform: scale(1.08); }
.screen .looks button.sel { border-color: var(--cyan); background: rgba(57, 255, 224, .16); box-shadow: inset 0 0 14px rgba(57, 255, 224, .35); }
.screen .looks button span { position: absolute; left: 0; right: 0; bottom: 0; font: 9px 'Lilita', sans-serif; letter-spacing: .04em; color: #fff; background: rgba(4, 4, 14, .7); padding: 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lobbyside h2 { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; font-size: 30px; }
.lobbyside h2 .kicker { margin: 0; }
.lobbyside h2 #lobbycode { letter-spacing: .14em; text-shadow: 0 0 14px rgba(57, 255, 224, .5); }
.lobbyside h2 .btn { margin-left: auto; align-self: center; }
#lobbylist { display: flex; flex-direction: column; gap: 5px; }
#lobbylist .lp {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 10px; padding: 3px 10px 3px 3px;
  background: rgba(255, 255, 255, .04); border-left: 3px solid var(--c); font: 15px 'Lilita', sans-serif; letter-spacing: .03em;
}
#lobbylist .lp img { width: 34px; height: 34px; object-fit: cover; display: block; background: rgba(255, 255, 255, .05); }
#lobbylist .lp small { font: 12px system-ui, sans-serif; color: #8f97d8; }
#lobbylist .lp .you { color: var(--cyan); font-size: 11px; letter-spacing: .14em; margin-left: 6px; }
.screen .teams { gap: 6px; }
.screen .teams button { border-radius: 0; border: none; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); padding: 10px 4px; opacity: .55; transition: opacity .12s; }
.screen .teams button:hover:not(:disabled) { opacity: .85; }
.screen .teams button.sel { opacity: 1; box-shadow: inset 0 0 0 2px #fff; }
.screen .teams button:disabled { opacity: .15; }
#startbtn { width: 100%; margin-top: 16px; }
.screen .note { margin-top: 8px; font-size: 13px; color: #9fa8ff; }
.screen .how { margin-top: 14px; }
.screen .how summary { font: 14px 'Lilita', sans-serif; letter-spacing: .1em; }

/* match over */
#over .overwrap { padding: 8px; width: auto; }
#over table { background: none; }
#over th { font: 12px 'Lilita', sans-serif; letter-spacing: .14em; text-transform: uppercase; }
#over tr + tr td { border-top: 1px solid rgba(120, 150, 255, .14); }
#lobbybtn { width: auto; min-width: 260px; }

@media (max-height: 560px) {
  .screen { justify-content: flex-start; }
  .screen .title { font-size: 40px; }
  .lobbywrap { flex-wrap: nowrap; }
  .runnerbox { width: 260px; }
  #runnercv { height: 170px; }
  .screen .looks { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .lobbyside { max-height: 94vh; }
}
@media (max-width: 640px) {
  .lobbywrap { flex-direction: column; align-items: center; flex-wrap: nowrap; }
  #runnercv { height: 220px; }
}

/* the logo (title of the loading and join screens) */
.title .logo { display: block; width: min(440px, 78vw, 40vh); height: auto; margin: 0 auto -6px; filter: drop-shadow(0 0 24px rgba(255, 43, 214, .25)); animation: logoin .7s ease-out both; }
#loading .title .logo { width: min(520px, 84vw, 62vh); }
@keyframes logoin { from { opacity: 0; transform: scale(.94); filter: brightness(2) drop-shadow(0 0 40px rgba(57, 255, 224, .6)); } }
@media (max-height: 560px) { .title .logo { width: min(240px, 50vw, 36vh); } }
#lobbylist .lp .cap { color: #ffd23b; font-size: 11px; letter-spacing: .12em; margin-left: 8px; text-shadow: 0 0 6px rgba(255, 210, 59, .5); }
#lobbynotice { margin: 4px 0 6px; padding: 8px 12px; font-size: 14px; color: #ffe9a8; background: rgba(255, 177, 59, .12); border-left: 3px solid #ffb13b; }

/* lobby: map cards and the base picker */
.lobbywrap { width: min(1260px, 100%); }
.runnerbox { width: min(330px, 96vw); }
.lobbyside { width: min(470px, 96vw); }
.basebox { width: min(360px, 96vw); display: flex; flex-direction: column; }
.basebox h3 { font: 24px 'Lilita', sans-serif; font-weight: normal; margin: 0 0 6px; text-shadow: 0 0 12px rgba(57, 255, 224, .4); }
#basepick { width: 100%; aspect-ratio: 1; display: block; touch-action: manipulation; }
.label .dim { font: 11px system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: #7f88c8; }
.maps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.mapcard { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 6px; text-align: left; cursor: pointer; color: #dfe3ff;
  background: rgba(255, 255, 255, .04); border: 1px solid rgba(120, 150, 255, .25); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.mapcard canvas { width: 100%; aspect-ratio: 1; display: block; }
.mapcard b { font: 15px 'Lilita', sans-serif; font-weight: normal; color: #fff; }
.mapcard small { font-size: 11px; line-height: 1.3; color: #9aa2dd; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.mapcard:hover:not(:disabled) { border-color: var(--cyan); }
.mapcard.sel { border-color: var(--cyan); background: rgba(57, 255, 224, .12); box-shadow: inset 0 0 16px rgba(57, 255, 224, .25); }
.mapcard.sel b { color: var(--cyan); }
.mapcard:disabled { opacity: .45; cursor: default; }
@media (max-height: 560px) { .basebox { width: 240px; } .mapcard small { display: none; } }
@media (max-height: 560px) { .lobbyside { width: auto; flex: 1 1 300px; min-width: 0; } }

/* the lobby on a phone held sideways: compact, the Start button always in view */
@media (max-height: 560px) {
  .lobbywrap { gap: 8px; }
  .screen .panel { padding: 10px 12px; }
  .runnerbox { width: 230px; }
  #runnercv { height: 130px; }
  .runnername b { font-size: 16px; }
  .runnername { margin: 2px 0 6px; }
  .arrow { width: 30px; height: 30px; font-size: 20px; }
  .lobbyside h2 { font-size: 22px; }
  .screen .label { margin: 8px 0 5px; }
  #lobbylist .lp { font-size: 13px; }
  .mapcard { padding: 4px; }
  .mapcard b { font-size: 12px; }
  .screen .teams button { padding: 7px 2px; font-size: 13px; }
  #startbtn { position: sticky; bottom: -10px; z-index: 3; margin-top: 10px; font-size: 18px; padding: 10px; box-shadow: 0 -8px 16px rgba(7, 9, 26, .9); }
  .basebox { width: 220px; }
  .basebox h3 { font-size: 17px; }
  .basebox .note { font-size: 11px; }
  .screen .how { display: none; }
}
