/* 전개 시뮬레이터 2.0 (2026-11-20 시안 승인): 듀얼 준비 화면
   넓은 PC(1100px 이상)는 필드를 보여 주고, 오른쪽에 '듀얼 준비' 칸 하나를 붙인다.
   단계(1/2·2/2)·번호·큰 덱 상자 대신 한 장에 덱 · 시작 패 · 상대 덱 · 효과 자동 처리 · 시작 단추.
   색은 MD Archive 디자인 체계 값. */

body.sim2-wide {
  --s2-surface: #0f111a; --s2-raised: #161927; --s2-active: #1d2134;
  --s2-line: rgba(170, 190, 255, .09); --s2-control: rgba(170, 190, 255, .18);
  --s2-text: #eef1fa; --s2-muted: #a8b0c6; --s2-faint: #8189a3; --s2-accent: #aec2f4;
  --s2-primary: #aec2f4; --s2-primary-ink: #0d1630;
  --s2-w: 380px;
}
html[data-theme="light"] body.sim2-wide {
  --s2-surface: #ffffff; --s2-raised: #eceff8; --s2-active: #e2e7f6;
  --s2-line: rgba(30, 45, 110, .09); --s2-control: rgba(30, 45, 110, .18);
  --s2-text: #141a2e; --s2-muted: #4a5370; --s2-faint: #596280; --s2-accent: #3a54b4;
  --s2-primary: #2c3f8f; --s2-primary-ink: #ffffff;
}

/* 필드 색·칸 모양: 엔진 화면(시안)과 같은 깊은 남색 판 + 옅은 페리윙클 선 */
html body.sim-page { --duel-arena: radial-gradient(ellipse 70% 60% at 50% 45%, #16304a 0%, #0b1626 55%, #07080d 100%); --duel-zone: rgba(14, 26, 48, .45); --duel-zone-line: rgba(174, 194, 244, .16); --duel-zone-inset: transparent; }
html[data-theme="light"] body.sim-page.sim-page { --duel-arena: radial-gradient(ellipse 70% 60% at 50% 45%, #dbe5f7 0%, #e9eef8 55%, #f4f5fa 100%); --duel-zone: rgba(255, 255, 255, .55); --duel-zone-line: rgba(30, 45, 110, .16); }
html body.sim-page .sim-board-wrap { background: radial-gradient(ellipse 70% 60% at 50% 45%, #16304a 0%, #0b1626 55%, #07080d 100%) !important; border: 1px solid rgba(174, 194, 244, .11) !important; border-radius: 12px !important; }
html body.sim-page .sim-board .zone { background: rgba(14, 26, 48, .45) !important; border: 1px solid rgba(174, 194, 244, .16) !important; border-radius: 8px !important; box-shadow: none !important; }
html body.sim-page .sim-board .zone .zl { color: #8189a3 !important; font: 600 11px/1 var(--font-sans, Pretendard, sans-serif) !important; }
html[data-theme="light"] body.sim-page .sim-board-wrap { background: radial-gradient(ellipse 70% 60% at 50% 45%, #dbe5f7 0%, #e9eef8 55%, #f4f5fa 100%) !important; border-color: rgba(30, 45, 110, .09) !important; }
html[data-theme="light"] body.sim-page .sim-board .zone { background: rgba(255, 255, 255, .55) !important; border-color: rgba(30, 45, 110, .16) !important; }
html[data-theme="light"] body.sim-page .sim-board .zone .zl { color: #596280 !important; }

/* 넓은 PC: 왼쪽 카드 정보 칸(카드를 누르기 전에도 자리를 지킨다) */
body.sim2-wide #sim2InfoDock { position: fixed; z-index: 40; left: 0; top: 56px; bottom: 0; width: 300px; box-sizing: border-box; display: flex; align-items: flex-end; padding: 16px; background: var(--s2-surface); border-right: 1px solid var(--s2-line); }
body.sim2-wide #sim2InfoDock[hidden] { display: none; }
body.sim2-wide #sim2InfoDock p { margin: 0; font: 500 12px/1.5 var(--font-sans, Pretendard, sans-serif); color: var(--s2-faint); }
body.sim2-wide:not(.practice-empty) #cardSheet.duel-detail { background: var(--s2-surface) !important; border: 0 !important; border-right: 1px solid var(--s2-line) !important; box-shadow: none !important; padding: 16px !important; box-sizing: border-box; }
body.sim2-wide:not(.practice-empty) #cardSheet .cs-box { padding: 0 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; }
body.sim2-wide:not(.practice-empty) #cardSheet .cs-head strong { font: 650 17px/1.3 var(--font-sans, Pretendard, sans-serif) !important; letter-spacing: -.02em; }
body.sim2-wide:not(.practice-empty) #cardSheet .cs-type { font: 600 13px/1.4 var(--font-sans, Pretendard, sans-serif) !important; color: var(--s2-muted) !important; }
body.sim2-wide:not(.practice-empty) #cardSheet .cs-desc { font: 400 13px/1.6 var(--font-sans, Pretendard, sans-serif) !important; }

/* '연습 시작' 줄: 제목 줄 안의 오른쪽(필드 위 빈 줄 하나를 없앤다) */
body.sim2-wide .sim-heading > #practiceGuideLine { margin: 0 0 0 auto !important; padding: 0 !important; gap: 12px !important; font: 500 13px/1.3 var(--font-sans, Pretendard, sans-serif); color: var(--s2-faint); }
body.sim2-wide .sim-heading > #practiceGuideLine button { height: 36px; min-height: 36px !important; padding: 0 18px !important; border-radius: 10px !important; border: 0 !important; background: var(--s2-primary) !important; color: var(--s2-primary-ink) !important; font: 700 14px/1 var(--font-sans, Pretendard, sans-serif) !important; }

/* 폰 가로: '연습 시작'은 줄 하나를 차지하지 않고 필드 위 가운데(EX 칸 사이)에 떠 있는 단추 하나 */
html.sim-compact #practiceGuideLine { position: fixed !important; z-index: 60; top: 92px; left: 50%; transform: translateX(-50%); padding: 0 !important; background: none !important; }
html.sim-compact #practiceGuideLine > span { display: none !important; }
html.sim-compact #practiceGuideLine button { min-height: 36px !important; padding: 0 16px !important; border-radius: 10px !important; border: 0 !important; background: #aec2f4 !important; color: #0d1630 !important; font: 700 13px/1 var(--font-sans, Pretendard, sans-serif) !important; box-shadow: 0 6px 18px rgba(0, 0, 0, .5) !important; }

/* 폰 가로: '이어서 열었어요' 알림은 한 줄 32px(필드 높이를 덜 먹게) */
html.sim-compact .resume-note { min-height: 0 !important; padding: 2px 8px !important; margin: 0 !important; gap: 6px !important; font-size: 12px !important; display: flex !important; align-items: center !important; flex-wrap: nowrap !important; white-space: nowrap; flex: 0 0 auto !important; }
html.sim-compact .resume-note button { min-height: 28px !important; height: 28px; padding: 0 10px !important; font-size: 12px !important; }

/* 카드 테두리: 고른 카드는 또렷한 페리윙클, 효과 엔진에서 쓸 수 있는 카드는 엔진 화면과 같은 도는 금빛 */
@property --s2-a { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
@keyframes s2-spin { to { --s2-a: 360deg; } }
@keyframes s2-breathe-gold { 0%, 100% { filter: drop-shadow(0 0 4px rgba(240, 197, 144, .6)); } 50% { filter: drop-shadow(0 0 10px rgba(255, 220, 160, .95)) drop-shadow(0 0 18px rgba(240, 160, 70, .45)); } }
html body.sim-page #board .sc.duel-selected { outline: 2px solid #aec2f4 !important; outline-offset: 2px !important; box-shadow: 0 0 0 1px rgba(7, 8, 13, .8), 0 0 16px rgba(174, 194, 244, .75) !important; z-index: 5; }
/* 마스터 듀얼처럼: 쓸 수 있는 카드는 고정된 노란 테두리 + 옅은 빛(숨 쉬기·회전 없음) */
html body.sim-page #board .sc.eng-can { outline: 0 !important; box-shadow: 0 0 0 2px #ffd76a, 0 0 4px 2px rgba(255, 236, 170, .95), 0 0 10px 4px rgba(255, 196, 80, .55), 0 0 22px 6px rgba(255, 160, 40, .22) !important; }
@media (prefers-reduced-motion: reduce) { html body.sim-page #board .sc.eng-can, html body.sim-page #board .sc.eng-can::after { animation: none; } }

/* 필드는 준비 중에도 보인다(흐리게). 덱을 고르면 그대로 듀얼 화면이 된다 */
body.sim2-wide.practice-empty .sim-board-wrap { opacity: .55; pointer-events: none; }
html body.sim2-wide.practice-empty.duel-stage #board#board, html body.sim2-wide.practice-empty #board#board { display: grid !important; }
body.sim2-wide.practice-empty .sim-heading { margin-bottom: 12px !important; }

/* 오른쪽 '듀얼 준비' 칸 */
body.sim2-wide #duelPrepDialog.prep-inline {
  position: fixed !important; inset: var(--site-header-h, 64px) 0 0 auto !important;
  width: var(--s2-w) !important; max-width: none !important; height: auto !important; max-height: none !important;
  margin: 0 !important; padding: 0 !important; overflow: auto !important; z-index: 60;
  background: var(--s2-surface) !important; color: var(--s2-text) !important;
  border: 0 !important; border-left: 1px solid var(--s2-line) !important; border-radius: 0 !important; box-shadow: none !important;
}
body.sim2-wide #duelPrepDialog.prep-inline .duel-prep-box { padding: 20px !important; display: flex !important; flex-direction: column; min-height: 100%; box-sizing: border-box; }
body.sim2-wide #duelPrepDialog.prep-inline header small { display: none; }
body.sim2-wide #duelPrepDialog.prep-inline h2 { margin: 0 0 4px !important; font: 650 17px/1.3 var(--font-sans, Pretendard, sans-serif) !important; letter-spacing: -.02em; }
body.sim2-wide #duelPrepDialog.prep-inline .duel-prep-lead { margin: 0 0 12px !important; font: 500 12px/1.5 var(--font-sans, Pretendard, sans-serif) !important; color: var(--s2-faint); }

/* 덱: 작은 목록 줄(덱 상자 그림은 작게) */
body.sim2-wide #duelPrepDialog.prep-inline .duel-prep-grid { padding: 14px 0; border-top: 1px solid var(--s2-line); }
body.sim2-wide #duelPrepDialog.prep-inline .duel-prep-grid > section > b { display: block !important; margin: 0 0 8px; font: 650 14px/1.3 var(--font-sans, Pretendard, sans-serif); }
body.sim2-wide #duelPrepDialog.prep-inline .duel-prep-grid > section > b i { display: none; }
body.sim2-wide #duelPrepDialog.prep-inline #prepSearch { max-width: none !important; width: 100%; height: 36px; box-sizing: border-box; margin: 0 0 8px !important; border-radius: 10px; }
body.sim2-wide #duelPrepDialog.prep-inline #prepDeckGrid { display: grid !important; grid-template-columns: 1fr !important; gap: 4px !important; max-height: 34dvh !important; overflow: auto !important; }
body.sim2-wide #duelPrepDialog.prep-inline .prep-deck-tile {
  display: grid !important; grid-template-columns: 44px minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 10px; align-items: center !important;
  padding: 6px 8px !important; border: 0 !important; border-radius: 10px !important; background: transparent; text-align: left; height: 56px; overflow: hidden;
}
body.sim2-wide #duelPrepDialog.prep-inline .prep-deck-tile[aria-pressed="true"] { background: var(--s2-active) !important; }
body.sim2-wide #duelPrepDialog.prep-inline .prep-deck-tile:hover { background: var(--s2-raised); }
body.sim2-wide #duelPrepDialog.prep-inline .prep-deck-tile .deck-visual {
  grid-row: 1 / span 2; width: 210px !important; height: 176px !important; margin: 0 !important;
  transform: scale(.21) !important; transform-origin: top left !important; justify-self: start; align-self: start;
}
body.sim2-wide #duelPrepDialog.prep-inline .prep-deck-tile > :is(.deck-visual) { max-width: none; }
body.sim2-wide #duelPrepDialog.prep-inline .prep-deck-tile { position: relative; }
body.sim2-wide #duelPrepDialog.prep-inline .prep-deck-tile .deck-visual { position: absolute; left: 8px; top: 9px; }
body.sim2-wide #duelPrepDialog.prep-inline .prep-deck-tile strong { grid-column: 2; font: 700 14px/1.3 var(--font-sans, Pretendard, sans-serif) !important; }
body.sim2-wide #duelPrepDialog.prep-inline .prep-deck-tile small { grid-column: 2; font: 500 12px/1.3 var(--font-sans, Pretendard, sans-serif) !important; color: var(--s2-faint); }
body.sim2-wide #duelPrepDialog.prep-inline #duelPrepEditMe { margin-top: 8px !important; height: 36px; padding: 0 12px !important; border-radius: 10px; }

/* 시작 패 · 상대 덱 · 자동 처리 */
body.sim2-wide #duelPrepDialog.prep-inline #prepPage2 { padding: 14px 0 0; border-top: 1px solid var(--s2-line); }
body.sim2-wide #duelPrepDialog.prep-inline #prepPage2::before { content: '시작 패'; display: block; margin: 0 0 8px; font: 650 14px/1.3 var(--font-sans, Pretendard, sans-serif); }
body.sim2-wide #duelPrepDialog.prep-inline .prep-options { gap: 4px !important; padding: 4px !important; border-radius: 12px; background: var(--s2-raised); }
body.sim2-wide #duelPrepDialog.prep-inline .prep-options > label { min-height: 32px !important; padding: 0 10px !important; border: 0 !important; border-radius: 8px !important; font: 600 13px/1 var(--font-sans, Pretendard, sans-serif); color: var(--s2-muted); }
body.sim2-wide #duelPrepDialog.prep-inline .prep-options > label:has(input:checked) { background: var(--s2-active) !important; outline: 0 !important; color: var(--s2-text); font-weight: 700; }
body.sim2-wide #duelPrepDialog.prep-inline .prep-options > label:has(#prepHandCount) { background: transparent !important; padding: 0 4px !important; }
body.sim2-wide #duelPrepDialog.prep-inline #prepHandCount { width: 52px !important; flex-basis: 52px; min-height: 30px !important; height: 30px; }
body.sim2-wide #duelPrepDialog.prep-inline .prep-advanced { margin-top: 14px !important; padding-top: 14px !important; border-top: 1px solid var(--s2-line) !important; gap: 8px !important; }
body.sim2-wide #duelPrepDialog.prep-inline .prep-advanced > section > b { font: 650 14px/1.3 var(--font-sans, Pretendard, sans-serif) !important; flex-basis: 100%; }
body.sim2-wide #duelPrepDialog.prep-inline #duelPrepOp { height: 36px; border-radius: 10px; }
body.sim2-wide #duelPrepDialog.prep-inline #duelPrepEditOp { height: 36px; border-radius: 10px; }
body.sim2-wide #duelPrepDialog.prep-inline .prep-advanced > label { font: 650 14px/1.3 var(--font-sans, Pretendard, sans-serif); }
body.sim2-wide #duelPrepDialog.prep-inline .prep-advanced > p { font: 500 12px/1.5 var(--font-sans, Pretendard, sans-serif) !important; color: var(--s2-faint) !important; }

/* 시작 단추: 칸 맨 아래 큰 주요 단추 하나 */
body.sim2-wide #duelPrepDialog.prep-inline .duel-prep-actions { margin-top: auto !important; padding-top: 16px !important; border-top: 0 !important; }
body.sim2-wide #duelPrepDialog.prep-inline #duelPrepStart {
  width: 100% !important; height: 44px; min-height: 44px; justify-content: center; border: 0 !important; border-radius: 10px !important;
  background: var(--s2-primary) !important; color: var(--s2-primary-ink) !important; font: 700 15px/1 var(--font-sans, Pretendard, sans-serif) !important;
}
