/* Confirmed 2026-10-26: lobby A and delete B. Keep the existing gameplay handlers. */
:root {
  --fs-ui-font: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", Arial, sans-serif;
  --selected-skin: url('../assets/img/ui/selected-lobby/button-a-normal.png');
  --selected-lit: url('../assets/img/ui/selected-lobby/button-a-hover.png');
  --selected-pressed: url('../assets/img/ui/selected-lobby/button-a-pressed.png');
  --selected-off: url('../assets/img/ui/selected-lobby/button-a-disabled.png');
}
#lobby, #tribeSelect, #deckBuilder, #fsPromptPop, #cardLorePop,
body :is(#lobby, #tribeSelect, #deckBuilder, #fsPromptPop, #cardLorePop) :is(h1,h2,h3,h4,button,input) {
  font-family: var(--fs-ui-font)!important;
}
body .selected-image-button {
  position:relative!important;isolation:isolate;overflow:visible!important;
  display:inline-flex;align-items:center;justify-content:center;
  border:0!important;border-radius:0!important;background:transparent!important;
  box-shadow:none!important;color:#e8d4a3!important;text-shadow:0 2px 2px #000;
  font-family:var(--fs-ui-font)!important;font-weight:700;letter-spacing:0!important;
  cursor:pointer;transition:color .14s,filter .14s;
}
body .selected-image-button::before {
  content:''!important;position:absolute!important;inset:0!important;z-index:-1;
  background:var(--selected-skin) center/100% 100% no-repeat!important;
  mask:none!important;clip-path:none!important;filter:none!important;
  opacity:1!important;pointer-events:none;border:0!important;border-radius:0!important;
}
body .selected-image-button::after {content:none!important;}
body .selected-image-button:not(:disabled):is(:hover,:focus-visible) {
  color:#fff6ce!important;filter:drop-shadow(0 0 6px #e7a74966);
}
body .selected-image-button:not(:disabled):is(:hover,:focus-visible)::before {background-image:var(--selected-lit)!important;}
body .selected-image-button:not(:disabled):active::before {background-image:var(--selected-pressed)!important;}
body .selected-image-button:disabled {opacity:.68!important;cursor:default;}
body .selected-image-button:disabled::before {background-image:var(--selected-off)!important;}
body .selected-image-button:focus-visible {outline:2px solid #ffdd93!important;outline-offset:3px;}
.selected-button-icon {width:19px;height:19px;object-fit:contain;margin-right:6px;filter:sepia(.3) brightness(1.3);}
#lobby .sanctuary-player {font-family:var(--fs-ui-font)!important;}
#lobby .selected-lobby-tools {position:absolute;left:6.77%;right:6.77%;bottom:17px;height:111px;z-index:20;}
#lobby .lobby-left {padding-bottom:145px!important;}
#lobby .selected-lobby-tools .lobby-deck-pager {
  position:relative;display:flex;align-items:center;justify-content:space-between;
  height:43px;min-height:0;margin:0 0 9px;padding:0 2px;gap:0;
}
#lobby .selected-lobby-tools .lobby-deck-pager::before {
  content:'';position:absolute;top:21px;left:65px;right:65px;height:1px;
  background:linear-gradient(90deg,transparent,#82612d 30%,#82612d 70%,transparent);
}
#lobby .selected-lobby-tools .lobby-deck-pager button {width:44px;height:41px;min-width:0;min-height:0;padding:0;font-size:29px;font-weight:400;}
#lobby #lobbyDeckPage {position:relative;min-width:91px;text-align:center;background:#0c0e09;font-size:20px;color:#dbc388;font-variant-numeric:tabular-nums;}
#lobby .selected-lobby-tools .lobby-left-actions {
  position:static!important;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));
  gap:6px;height:56px;min-height:0;margin:0;padding:0;background:none;border:0;border-radius:0;opacity:1;
}
#lobby .selected-lobby-tools .lobby-left-actions button {
  flex:none!important;top:auto!important;left:auto!important;right:auto!important;
  width:100%!important;min-width:0;height:56px!important;min-height:0;margin:0;
  padding:5px 8px;font-size:16px!important;white-space:nowrap;transform:none!important;
}
#lobby #btnLobbyDelete {color:#e7b2a0!important;}
#lobby .sanctuary-actions :is(#btnLobbyShop,#btnLobbyAi,#btnLobbyBack) {
  top:auto!important;left:auto!important;right:auto!important;transform:none!important;
  width:auto!important;min-width:0;flex:1;height:58px!important;min-height:58px;margin:0;
  font-size:21px;font-weight:700;padding:5px 15px;
}
#lobby .sanctuary-actions .lobby-nav-icon {width:24px;height:24px;flex-basis:24px;}
#lobby .selected-lobby-tools .lobby-deck-pager .page-arrow {width:23px;height:27px;pointer-events:none;}
#lobby #btnDeckPrev .page-arrow {transform:scaleX(-1);}
@media(max-width:1000px) and (orientation:landscape) {
  #lobby .lobby-deck-plinth {height:calc(120 * var(--mu));}
  #lobby .sanctuary-actions {top:calc(942 * var(--mu) + 12px);}
  #lobby .lobby-right {min-height:calc(942 * var(--mu) + 82px);}
}

#fsPromptPop.selected-delete {
  --selected-skin:url('../assets/img/ui/selected-lobby/button-b-normal.png');
  --selected-lit:url('../assets/img/ui/selected-lobby/button-b-hover.png');
  --selected-pressed:url('../assets/img/ui/selected-lobby/button-b-pressed.png');
  --selected-off:url('../assets/img/ui/selected-lobby/button-b-disabled.png');
  background:#040605b8;backdrop-filter:blur(3px);
}
#fsPromptPop.selected-delete .fs-prompt-box {
  display:grid;grid-template-columns:244px 1fr;column-gap:35px;
  grid-template-areas:'book title' 'book summary' 'book error' 'book actions';
  width:940px;min-width:0;max-width:calc(100% - 32px);min-height:438px;
  padding:33px 43px;text-align:left;background:linear-gradient(90deg,#1c160dec,#0a100efb 44%);
  border:20px solid transparent;border-radius:0;
  border-image:url('../assets/img/lobby/frame-panel.png') 40 fill/24px;
  box-shadow:0 25px 75px #000e;
}
.selected-delete-book {grid-area:book;position:relative;width:229px;height:298px;align-self:center;background-position:center;background-size:contain;background-repeat:no-repeat;filter:drop-shadow(0 9px 9px #000);}
.selected-delete-book span {position:absolute;bottom:32px;left:20px;right:20px;text-align:center;color:#f0d398;background:#151009f2;font-size:19px;padding:5px 0;font-weight:700;overflow-wrap:anywhere;}
#fsPromptPop.selected-delete #fsPromptTitle {grid-area:title;font-family:var(--fs-ui-font);margin:15px 0 27px;font-size:34px;letter-spacing:2px;color:#f0d495;}
.selected-delete-summary {grid-area:summary;}
#fsDeleteName {display:block;font-size:23px;color:#ffe5aa;overflow-wrap:anywhere;}
#fsDeleteMeta {font-size:18px;color:#d8c7a4;margin:6px 0;line-height:1.8;}
.selected-delete-note {margin:22px 0 0;font-size:15px;line-height:1.8;color:#a99777;}
#fsPromptPop.selected-delete #fsPromptErr {grid-area:error;}
#fsPromptPop.selected-delete .fs-prompt-actions {grid-area:actions;gap:14px;justify-content:flex-start;margin-top:9px;}
#fsPromptPop.selected-delete .fs-prompt-actions button {width:210px;min-width:0;height:64px;font-size:21px;padding:0;}
#fsPromptPop.selected-delete #fsPromptCancel {order:-1;}
#fsPromptPop.selected-delete #fsPromptOk {color:#e7b2a0!important;}
@media(prefers-reduced-motion:reduce){body .selected-image-button{transition:none;}}

/* PC refinement: retain the selected layout and reuse its sanctuary/metal artwork. */
@media(min-width:1001px) {
  #lobby.screen.active {background-image:url('../assets/img/lobby/sanctuary-4k.webp');}
  #lobby .lobby-left {
    padding-top:max(24px,2.5cqh);
    background:linear-gradient(100deg,#191309c9,#080b09cf),url('../assets/img/lobby/sanctuary-4k.webp') 56% center/auto 100% no-repeat;
  }
  #lobby .lobby-left::before {
    background:none;box-sizing:border-box;border:40px solid transparent;
    border-image:url('../assets/img/lobby/frame-panel-hires.png') 92 / 40px / 0 stretch;
    z-index:0;
  }
  #lobby .lobby-head {position:relative;z-index:1;padding-left:max(0px,calc(44px - 1.9cqw));}
  #lobby .sanctuary-brand {transform:none;background:url('../assets/img/lobby/approved-wordmark-hires.png') center/contain no-repeat!important;mask-image:none;}
  #lobby[data-reference-title] .sanctuary-heading h1 {
    width:max-content;height:auto;color:#f5dfa6;background:none;white-space:nowrap;
    text-shadow:0 2px 6px #000;
  }
  /* Use the same stage unit as the button; fixed pixels caused fullscreen drift. */
  #lobby .lobby-right > .lobby-reward-badge {
    width:calc(136 * var(--mu));height:auto;
    left:calc(50% + 292 * var(--mu))!important;
    transform:translate(-100%,-40%);
  }
  #lobby > #collectionCrystalBalance {
    position:absolute;right:3.3cqw;bottom:.6cqh;width:max-content;max-width:43cqw;
    min-height:32px;height:4.3cqh;gap:.7cqw;padding:4px 1.5cqw;
    border:0;border-radius:0;background:var(--selected-skin) center/100% 100% no-repeat;
    color:#e8d4a3;font-family:var(--fs-ui-font);font-size:clamp(14px,1.5cqh,24px);
  }
  #lobby > #collectionCrystalBalance .crystal-icon {width:2.5cqh;height:2.7cqh;min-width:22px;min-height:24px;}
}

/* Remaining36: compact current-rank profile; controls retain existing handlers. */
#lobby > #lobbyUser {
  position:absolute;top:2%;right:2%;width:64px;height:64px;min-height:0;
  display:block;margin:0;padding:0;border:0;background:none;z-index:35;
}
#lobby #lobbyProfileToggle {
  display:flex;align-items:center;justify-content:center;width:64px;height:64px;
  margin:0;padding:0;border:0;background:none;color:#e8d4a3;cursor:pointer;
}
#lobby #lobbyProfileToggle .tier-em {position:relative;inset:auto;--s:64px;margin:0;flex:none;}
#lobby #lobbyProfileToggle .tier-num {font-size:calc(var(--s)*.2);background:none;}
#lobby #lobbyProfileToggle:focus-visible {outline:2px solid #ffdd93;outline-offset:2px;}
#lobby #lobbyProfileToggle .rank-unavailable {font-size:12px;white-space:normal;line-height:1.3;}
#lobby #lobbyProfilePanel {
  position:absolute;top:100%;right:0;box-sizing:border-box;width:min(360px,90vw);
  display:grid;grid-template-columns:minmax(0,1fr) 48px;gap:10px 12px;
  padding:14px 16px;color:#e8d4a3;border:1px solid #a68549;
  background:linear-gradient(140deg,#20190efc,#090f0ffc);box-shadow:0 10px 30px #000b,inset 0 0 0 3px #352819;
}
#lobby #lobbyProfilePanel[hidden] {display:none!important;}
#lobby #lobbyProfilePanel .profile-identity {width:auto;min-width:0;padding:0;display:flex;flex-direction:column;gap:4px;}
#lobby #lobbyProfilePanel .profile-name {max-width:none;font-size:18px;line-height:1.3;letter-spacing:0;overflow-wrap:anywhere;white-space:normal;}
#lobby #lobbyProfilePanel .rank-trigger {font-size:17px;min-height:44px;gap:8px;}
#lobby #lobbyProfilePanel .rank-trigger .tier-em {position:relative;inset:auto;transform:none;--s:44px;flex:none;}
#lobby #lobbyProfilePanel .profile-settings {
  position:static;align-self:start;width:48px;height:48px;min-width:48px;min-height:48px;
  padding:0;margin:0;border:1px solid #8d6d3877;border-radius:0;font-size:0;cursor:pointer;
  background:url('../assets/img/lobby/icon-settings.png') center/28px 32px no-repeat;
}
#lobby #lobbyProfilePanel .profile-settings:is(:hover,:focus-visible) {filter:brightness(1.5) drop-shadow(0 0 4px #e7a749);}
#lobby #lobbyProfilePanel .profile-settings:focus-visible {outline:2px solid #ffdd93;outline-offset:2px;}
#lobby #lobbyProfilePanel .profile-status {
  position:static;width:auto;grid-column:1/-1;transform:none;display:flex;flex-direction:row;
  align-items:center;justify-content:space-between;gap:10px;border:0;padding:0;font-size:17px;
}
#lobby #lobbyProfilePanel .profile-status .lobby-user-name {display:inline-flex;align-items:center;gap:6px;font-size:17px;line-height:1.35;white-space:normal;}
#lobby #lobbyProfilePanel .profile-status .lp-link {min-width:64px;min-height:44px;font-size:16px;}
#lobby .selected-lobby-tools .lobby-left-actions button {display:flex;align-items:center;justify-content:center;text-align:center;gap:0;}
@media(max-height:500px) {
  #lobby > #lobbyUser {top:8px;right:12px;width:52px;height:52px;}
  #lobby #lobbyProfileToggle {width:52px;height:52px;}
  #lobby #lobbyProfileToggle .tier-em {--s:52px;}
  #lobby #lobbyProfilePanel {width:min(310px,90vw);padding:10px 12px;gap:6px 10px;}
}
/* The legacy mobile layout sized its height from width, clipping the controls. */
@media(max-width:1000px) and (orientation:landscape) {
  #lobby.screen.active {background-image:url('../assets/img/lobby/sanctuary-4k.webp');}
  #lobby .lobby {height:calc(100% - 60px);min-height:0;}
  #lobby .lobby-left {height:100%;min-height:0;padding-bottom:129px!important;}
  #lobby .lobby-left:has(#lobbyAssets) #lobbyDecks.lobby-decks {min-height:0;grid-template-rows:repeat(2,88px);overflow:auto;}
  #lobby .lobby-left .lobby-deck {--book-h:88px;}
  #lobby .lobby-right {
    --mu:min(calc((100vw * .59) / 966),calc((100dvh - 140px) / 942));
    height:100%;min-height:0;margin-top:0;
  }
  #lobby .lobby-right .lobby-match {width:min(86%,320px);min-height:44px;}
  #lobby .lobby-right > .lobby-reward-badge {left:calc(50% + min(43%,160px))!important;width:76px;height:40px;}
}
