/* 내 덱 갤러리와 밴 리스트에만 적용한다. 대기실의 .deck-card는 기존 모양을 유지한다. */
#decks-screen { overflow-y:auto; padding:0 28px var(--legal-h,0px); background:#0d1420; scrollbar-gutter:stable; }
.deck-manager-head, #decks-screen .deck-list { width:100%; max-width:1760px; margin:0 auto; flex:none; }
.deck-manager-head { padding:20px 0 14px; }
.deck-manager-titlebar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:14px; margin:0 0 12px; }
.deck-manager-title { display:flex; align-items:center; gap:12px; }
.deck-manager-title h2 { font-size:28px; letter-spacing:-1px; color:#edf1f6; }
#deck-manager-count { border:1px solid #2c394c; border-radius:6px; padding:3px 8px; color:#9dacbf; font-size:12px; white-space:nowrap; }
#deck-manager-store { margin-top:6px; color:#9dacbf; font-size:12px; }
.deck-manager-actions { display:flex; gap:8px; flex-wrap:wrap; }
.deck-action { display:inline-flex; align-items:center; justify-content:center; gap:6px; min-height:38px; padding:8px 14px; border:1px solid #35445a; border-radius:8px; background:#192638; color:#edf1f6; font:inherit; font-size:13px; text-decoration:none; }
.deck-action:hover { background:#24354c; border-color:#7a8ba1; }
.deck-action-primary { background:#d6c18f; border-color:#d6c18f; color:#182030; font-weight:600; }
.deck-action-primary:hover { background:#e7d4a6; border-color:#e7d4a6; }
.deck-action-quiet { border-color:transparent; background:transparent; color:#aab8c9; }
.deck-manager-utilities { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px; font-size:12px; color:#9dacbf; }
.deck-manager-utilities>div { display:flex; gap:4px; }
.deck-manager-utilities button { padding:6px 8px; font-size:12px; }
#decks-screen .deck-list { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:16px; overflow:visible; padding:0 0 34px; }
#decks-screen .deck-card { container-type:inline-size; display:flex; flex-direction:column; width:auto; min-width:0; padding:0; background:#162132; border:1px solid #2c394c; border-radius:16px; }
/* 최소 높이가 비율을 통해 가로 너비를 키우지 않도록 카드 너비를 명시한다. */
.deck-portrait { position:relative; overflow:hidden; flex:none; width:100%; min-width:0; max-width:100%; height:auto; aspect-ratio:1; min-height:140px; max-height:320px; border-radius:15px 15px 0 0; background:radial-gradient(ellipse at top right,#344463,#172239); }
.deck-portrait img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; object-position:center top; }
#btn-decks-back { min-height:44px; padding:10px 18px; border-color:#dbc28a; background:#d6c18f; color:#182030; font-size:14px; font-weight:700; }
#btn-decks-back:hover { background:#e7d4a6; border-color:#e7d4a6; }
.deck-portrait::after { content:''; position:absolute; inset:0; background:linear-gradient(180deg,transparent 40%,#101b2b33 58%,#101b2bb8 78%,#101b2bd9 100%); pointer-events:none; }
.deck-portrait-copy { position:absolute; z-index:1; left:20px; right:20px; bottom:18px; }
.deck-portrait-copy>span { display:block; margin-bottom:5px; color:#e9e2cf; font-size:11px; letter-spacing:2px; text-transform:uppercase; }
#decks-screen .deck-card h3 { margin:0; color:#fff; font-size:21px; line-height:1.35; overflow-wrap:anywhere; letter-spacing:-.4px; }
.deck-card-body { display:flex; flex-direction:column; flex:1; min-height:152px; padding:18px; }
.deck-identity { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:8px 12px; font-size:12px; color:#aab8c9; }
.deck-domains { display:flex; gap:10px; flex-wrap:wrap; }
.deck-domains>span { display:inline-flex; align-items:center; gap:5px; font-size:11px; }
.deck-domains>span::before { content:''; width:7px; height:7px; border-radius:50%; background:var(--domain-color); }
.deck-champion { margin-top:7px; font-size:12px; color:#9dacbf; overflow-wrap:anywhere; }
.deck-ban-note { margin-top:10px; color:#f2aaa7; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
#decks-screen .dk-btns { display:flex; flex-wrap:nowrap; gap:8px; margin-top:auto; padding-top:16px; align-items:center; }
#decks-screen .dk-btns>button, .deck-more>summary { flex:none; min-height:36px; padding:7px 12px; border:1px solid #35445a; border-radius:8px; background:#192638; color:#edf1f6; font-size:12px; white-space:nowrap; text-align:center; }
#decks-screen .dk-btns>button:hover, .deck-more>summary:hover { background:#24354c; border-color:#7a8ba1; }
#decks-screen .deck-button-icon { display:inline-block; width:12px; height:12px; margin-right:4px; vertical-align:-2px; fill:none; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
#decks-screen .dk-btns>.deck-edit { flex:1; background:#d6c18f; border-color:#d6c18f; color:#182030; font-weight:600; }
#decks-screen .dk-btns>.deck-edit:hover { background:#e7d4a6; }
.deck-more { position:relative; flex:none; }
.deck-more>summary { display:block; min-width:38px; list-style:none; cursor:pointer; }
.deck-more>summary::-webkit-details-marker { display:none; }
.deck-more[open] { z-index:5; }
.deck-more-actions { scroll-margin-block:8px; }
.deck-more-actions { position:absolute; bottom:calc(100% + 8px); right:0; width:190px; padding:6px; border:1px solid #40516b; border-radius:10px; background:#1d2b40; box-shadow:0 12px 32px #0007; }
#decks-screen .deck-card:nth-child(5n+1) .deck-more-actions { left:0; right:auto; }
#decks-screen .deck-more-actions button { display:block; width:100%; min-height:38px; padding:9px 11px; border:0; border-radius:6px; background:transparent; color:#edf1f6; text-align:left; font-size:13px; }
#decks-screen .deck-more-actions button:hover { background:#2c3d55; }
#decks-screen .deck-more-actions .deck-delete { margin-top:4px; border-top:1px solid #40516b; border-radius:0 0 6px 6px; color:#f2a1aa; }
#decks-screen :is(button,summary):focus-visible, .banlist-dialog :is(button,a):focus-visible { outline:2px solid #e7d4a6; outline-offset:3px; }
.deck-empty { grid-column:1/-1; padding:56px 20px; text-align:center; border:1px dashed #35445a; border-radius:16px; }
.deck-empty h3 { color:#e5d5b0; font-size:20px; }
.deck-empty p { margin-top:10px; color:#9dacbf; font-size:13px; line-height:1.7; }

/* 루트 zoom은 viewport 미디어 쿼리를 바꾸지 않으므로 카드의 실제 폭으로 전환한다. */
@container (max-width:240px) {
  #decks-screen .dk-btns { display:grid; grid-template-columns:minmax(0,1fr) 36px; gap:6px; }
  #decks-screen .dk-btns>.deck-edit { grid-column:1/-1; }
  #decks-screen .dk-btns>button, #decks-screen .deck-more>summary { min-width:0; padding:7px 4px; white-space:normal; }
}

/* 공유 모달의 다른 화면으로 이동하면 :has 규칙도 자동 해제된다. */
#modal-overlay:has(.banlist-dialog) { padding:16px; background:#030812b3; backdrop-filter:blur(4px); }
#modal-shell:has(.banlist-dialog) { width:780px; max-width:100%; min-height:0; max-height:100%; }
#modal-shell #modal-box:has(>.banlist-dialog) { display:flex; width:100%; max-width:100%; max-height:min(850px,calc(100dvh - 32px)); padding:0; overflow:hidden; border:1px solid #3b4b61; border-radius:18px; background:#111b2a; }
.banlist-dialog { display:flex; flex-direction:column; width:100%; min-height:0; color:#edf1f6; }
.banlist-header { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; padding:24px 26px 18px; }
.banlist-eyebrow { color:#dbc28a; font-size:10px; letter-spacing:2px; }
#modal-box .banlist-header h3 { margin:6px 0; color:#edf1f6; font-size:27px; letter-spacing:-.7px; }
.banlist-header p { color:#9dacbf; font-size:12px; }
.banlist-close { width:38px; padding:0; font-size:24px; background:transparent; }
.banlist-meta { display:flex; flex-wrap:wrap; gap:8px; padding:0 26px 18px; }
.banlist-meta span { padding:5px 9px; border:1px solid #34445b; border-radius:6px; color:#b6c4d4; font-size:12px; }
.banlist-content { overflow-y:auto; min-height:0; padding:0 26px 22px; overscroll-behavior:contain; }
#banlist-info { padding:14px 16px; border-left:3px solid #c9af7a; border-radius:0 8px 8px 0; background:#1b283b; color:#c2cede; font-size:13px; line-height:1.7; }
.banlist-hint { margin:14px 0 18px; color:#9dacbf; font-size:12px; line-height:1.6; }
.banlist-grid { display:grid; grid-template-columns:repeat(5,minmax(0,1fr)); gap:22px 14px; }
.banlist-card { min-width:0; display:flex; flex-direction:column; align-items:center; text-align:center; }
#modal-box .banlist-card .card-mini { flex:none; width:100%; height:auto; aspect-ratio:74/104; background-size:contain; background-repeat:no-repeat; background-position:center; border:1px solid #3b4b61; border-radius:8px; cursor:zoom-in; }
#modal-box .banlist-card .card-mini:hover { border-color:#dbc28a; }
#modal-box .banlist-battlefield .card-mini { aspect-ratio:104/74; }
#modal-box .banlist-card .cm-name, #modal-box .banlist-card .cm-cost { display:none; }
#modal-box .banlist-card .noimg .cm-name { display:block; }
.banlist-card-name { padding:9px 0 3px; background:none; border:0; color:#edf1f6; font-size:12px; line-height:1.5; overflow-wrap:anywhere; }
.banlist-card-name:hover { color:#e7d4a6; text-decoration:underline; }
.banlist-card-type { color:#8e9fb5; font-size:11px; margin-top:auto; }
.banlist-footer { display:flex; flex-shrink:0; align-items:center; justify-content:space-between; gap:14px; padding:16px 26px; border-top:1px solid #2c394c; }
.banlist-source a { color:#b4c4d8; font-size:12px; text-underline-offset:3px; }
.banlist-footer button { min-width:100px; }
@media(max-width:720px) {
  #decks-screen { padding-left:16px; padding-right:16px; }
  .deck-manager-head { padding-top:18px; }
  .deck-manager-title h2 { font-size:25px; }
  #decks-screen .deck-list { gap:14px; }
  .deck-card-body { padding:14px; }
  .deck-portrait-copy { left:16px; right:16px; }
  .banlist-grid { grid-template-columns:repeat(3,minmax(0,1fr)); }
}
@media(max-width:600px) {
  .deck-manager-actions { gap:6px; }
  .deck-manager-actions button { padding:8px 10px; font-size:12px; }
  #modal-overlay:has(.banlist-dialog) { padding:8px; }
  #modal-shell #modal-box:has(>.banlist-dialog) { max-height:calc(100dvh - 16px); border-radius:14px; }
  .banlist-header { padding:18px 16px 14px; }
  .banlist-meta { padding:0 16px 14px; }
  .banlist-content { padding:0 16px 18px; }
  .banlist-grid { grid-template-columns:repeat(2,minmax(0,1fr)); gap:18px 14px; }
  .banlist-footer { padding:12px 16px; }
}
/* 작은 창에서도 덱을 비교할 수 있도록 5열에서 최소 3열까지만 줄인다. */
@media(max-width:1200px) {
  #decks-screen { padding-left:16px; padding-right:16px; }
  .deck-manager-head { padding:16px 0 14px; }
  .deck-manager-titlebar { margin:0 0 10px; }
  #decks-screen .deck-list { gap:12px; }
  .deck-portrait-copy { left:10px; right:10px; bottom:12px; }
  .deck-portrait-copy>span { font-size:10px; letter-spacing:1px; overflow-wrap:anywhere; }
  #decks-screen .deck-card h3 { font-size:16px; }
  .deck-card-body { padding:10px; min-height:170px; }
  .deck-identity { overflow-wrap:anywhere; }
  #decks-screen .dk-btns { display:grid; grid-template-columns:minmax(0,1fr) 36px; gap:6px; padding-top:12px; }
  #decks-screen .dk-btns>.deck-edit { grid-column:1/-1; }
  #decks-screen .dk-btns>button, .deck-more>summary { min-width:0; padding:7px 4px; }
  .deck-more-actions { width:170px; }
}
@media(max-width:999px) {
  #decks-screen .deck-list { grid-template-columns:repeat(4,minmax(0,1fr)); }
  #decks-screen .deck-card:nth-child(n) .deck-more-actions { left:auto; right:0; }
  #decks-screen .deck-card:nth-child(4n+1) .deck-more-actions { left:0; right:auto; }
}
@media(max-width:799px) {
  #decks-screen .deck-list { grid-template-columns:repeat(3,minmax(0,1fr)); }
  #decks-screen .deck-card:nth-child(n) .deck-more-actions { left:auto; right:0; }
  #decks-screen .deck-card:nth-child(3n+1) .deck-more-actions { left:0; right:auto; }
}
@media(max-width:600px), (pointer:coarse) and (max-height:600px) {
  #decks-screen { padding-left:10px; padding-right:10px; }
  #decks-screen .deck-list { gap:8px; }
  .deck-card-body { padding:7px; min-height:0; }
  .deck-portrait { min-height:130px; }
  .deck-identity, .deck-portrait-copy>span { display:none; }
  .deck-champion { margin-top:0; line-height:1.4; }
  .deck-portrait-copy { left:7px; right:7px; bottom:10px; }
  #decks-screen .deck-card h3 { font-size:13px; }
  .deck-identity, .deck-champion, .deck-ban-note { font-size:11px; }
  .deck-domains { gap:5px; }
  #decks-screen .dk-btns { grid-template-columns:minmax(0,1fr) 28px; gap:4px; padding-top:8px; }
  #decks-screen .dk-btns>button { white-space:normal; }
  .deck-more-actions { width:160px; }
}
@media(max-width:600px) {
  #decks-screen .deck-card:nth-child(3n+1) .deck-more-actions { left:0; right:auto; }
  #decks-screen .deck-card:nth-child(3n+2) .deck-more-actions { right:50%; transform:translateX(50%); }
}
@media(pointer:coarse) {
  .deck-action, #decks-screen .dk-btns>button, .deck-more>summary, #decks-screen .deck-more-actions button, .banlist-card-name { min-height:44px; }
}
@media(max-width:600px), (pointer:coarse) and (max-height:600px) {
  #decks-screen .dk-btns>button, #decks-screen .deck-more>summary { min-height:32px; padding:5px 2px; font-size:10px; border-radius:6px; }
  .deck-manager-actions .deck-action, .deck-manager-utilities .deck-action { min-height:34px; }
  .deck-manager-utilities .deck-action { padding:4px 6px; }
  .deck-manager-actions { gap:5px; }
  .deck-manager-actions button, #btn-decks-back { padding:6px 7px; font-size:11px; }
  #btn-decks-back { min-height:34px; }
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px) {
  #decks-screen .deck-list { grid-template-columns:repeat(5,minmax(0,1fr)); }
  #decks-screen .deck-card:nth-child(n) .deck-more-actions { left:auto; right:0; transform:none; }
  #decks-screen .deck-card:nth-child(5n+1) .deck-more-actions { left:0; right:auto; }
  .deck-manager-head { padding:10px 0 8px; }
  .deck-manager-title h2 { font-size:22px; }
  .deck-manager-titlebar { margin-bottom:4px; }
  .deck-portrait { aspect-ratio:16/9; min-height:108px; }
}
@media(max-height:540px) {
  .banlist-header { padding-top:12px; padding-bottom:10px; }
  #modal-box .banlist-header h3 { font-size:21px; margin:2px 0; }
  .banlist-eyebrow { display:none; }
  .banlist-meta { padding-bottom:10px; }
  .banlist-footer { padding-top:10px; padding-bottom:10px; }
}

/* Keep the active storage and its account visible as one choice. */
#decks-screen .deck-storage { margin:16px 0 10px; }
#decks-screen .deck-storage-label { margin:0 0 8px; font-size:11px; color:#a7b5c9; }
#decks-screen .deck-storage-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
#decks-screen .deck-storage-tab { display:grid; grid-template-columns:42px minmax(0,1fr) auto; align-items:center; gap:14px; min-width:0; padding:15px 20px; border:1px solid #304057; border-radius:12px; background:#111c2b; color:#edf1f6; text-align:left; font:inherit; cursor:pointer; }
#decks-screen .deck-storage-tab[aria-pressed="true"] { border-color:#d6c18f; background:linear-gradient(120deg,#d6c18f10,#1c293b); }
#decks-screen .deck-storage-tab:hover:not(:disabled) { border-color:#d6c18f; }
#decks-screen .deck-storage-tab:disabled { cursor:default; }
#decks-screen .deck-storage-tabs[aria-busy="true"] .deck-storage-tab { cursor:wait; opacity:.7; }
#decks-screen .deck-storage-icon { display:grid; place-items:center; width:42px; height:42px; border:1px solid #40506a; border-radius:11px; color:#a7b5c9; background:#1b2a3e; }
#decks-screen .deck-storage-icon svg { width:23px; height:23px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
#decks-screen .deck-storage-tab[aria-pressed="true"] .deck-storage-icon { color:#e5d3a6; background:#d6c18f14; border-color:#8f805e; }
#decks-screen .deck-storage-copy { min-width:0; overflow-wrap:anywhere; }
#decks-screen .deck-storage-copy strong { display:block; font-size:16px; }
#decks-screen .deck-storage-copy small { display:block; margin-top:4px; font-size:12px; color:#a7b5c9; }
#decks-screen .deck-storage-check { font-size:12px; color:#e5d3a6; white-space:nowrap; visibility:hidden; }
#decks-screen .deck-storage-tab[aria-pressed="true"] .deck-storage-check { visibility:visible; }
#decks-screen .deck-storage-context { display:flex; justify-content:space-between; align-items:start; flex-wrap:wrap; gap:5px 16px; padding-top:10px; }
#decks-screen #deck-manager-store { margin:0; font-size:12px; color:#e5d3a6; overflow-wrap:anywhere; }
#deck-store-endpoint { font-size:11px; color:#a7b5c9; overflow-wrap:anywhere; min-width:0; }
#deck-store-status { color:#efa5ae; font-size:12px; margin:0 0 12px; }
#deck-store-status:empty { display:none; }
@media(max-width:600px) {
  #decks-screen .deck-storage { margin:12px 0 6px; }
  #decks-screen .deck-storage-tabs { gap:8px; }
  #decks-screen .deck-storage-tab { grid-template-columns:28px minmax(0,1fr); padding:10px; gap:6px 8px; border-radius:10px; }
  #decks-screen .deck-storage-icon { width:28px; height:28px; border-radius:7px; }
  #decks-screen .deck-storage-icon svg { width:18px; height:18px; }
  #decks-screen .deck-storage-copy strong { font-size:13px; }
  #decks-screen .deck-storage-copy small { font-size:11px; margin-top:2px; }
  #decks-screen .deck-storage-check { grid-column:2; font-size:10px; }
  #decks-screen .deck-storage-context { gap:4px; padding-top:8px; }
  #decks-screen #deck-manager-store, #deck-store-endpoint { font-size:11px; }
  #decks-screen .deck-manager-utilities { gap:6px; }
}
@media(pointer:coarse) and (orientation:landscape) and (max-height:600px) {
  #decks-screen .deck-storage { margin:8px 0 4px; }
  #decks-screen .deck-storage-label { margin-bottom:4px; font-size:10px; }
  #decks-screen .deck-storage-tabs { gap:8px; }
  #decks-screen .deck-storage-tab { grid-template-columns:28px minmax(0,1fr) auto; padding:7px 12px; gap:10px; }
  #decks-screen .deck-storage-icon { width:28px; height:28px; border-radius:7px; }
  #decks-screen .deck-storage-icon svg { width:18px; height:18px; }
  #decks-screen .deck-storage-copy strong { font-size:12px; }
  #decks-screen .deck-storage-copy small { font-size:10px; margin-top:2px; }
  #decks-screen .deck-storage-check { grid-column:auto; font-size:10px; }
  #decks-screen .deck-storage-context { padding-top:5px; }
  #decks-screen #deck-manager-store, #deck-store-endpoint { font-size:10px; }
}
