/* LOL DF — 화면 배치: 540×540 맵(왼쪽) + 오른쪽 패널. #stage 를 화면에 맞게 통째로 확대/축소 */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #05080e; color: #e6edf5;
  font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif; user-select: none; -webkit-user-select: none; touch-action: none; }
button { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; touch-action: manipulation; }
.hidden { display: none !important; }

#stage { position: absolute; left: 0; top: 0; width: 960px; height: 540px; transform-origin: 0 0; overflow: hidden;
  background: radial-gradient(120% 100% at 70% 0%, #122033 0%, #070c14 60%); }
#mapWrap { position: absolute; left: 0; top: 0; width: 540px; height: 540px; overflow: hidden; }
#map { position: absolute; left: 0; top: 0; width: 540px; height: 540px; display: block; }

/* ---------- 맵 위 알림 ---------- */
#banner { position: absolute; left: 50%; top: 128px; transform: translateX(-50%); pointer-events: none; text-align: center; opacity: 0; transition: opacity .3s, transform .3s; white-space: nowrap; }
#banner.on { opacity: 1; transform: translateX(-50%) translateY(6px); }
#banner .w { font-size: 34px; font-weight: 900; letter-spacing: 3px; color: #f4e2b0; text-shadow: 0 2px 0 #4a3510, 0 0 18px rgba(255,200,90,.45); }
#banner .s { margin-top: 2px; font-size: 14px; font-weight: 700; color: #fff; background: rgba(8,12,20,.78); border: 1px solid rgba(255,210,120,.35); padding: 5px 14px; border-radius: 20px; display: inline-block; }
#banner .w img { width: 42px; height: 42px; vertical-align: -6px; margin-right: 10px; }
#banner.boss .w { color: #ffb4d4; text-shadow: 0 2px 0 #4a1030, 0 0 22px rgba(255,80,160,.55); }
#banner.boss .s { border-color: rgba(255,110,170,.6); }
#toast { position: absolute; left: 50%; bottom: 80px; transform: translateX(-50%); pointer-events: none; display: flex; flex-direction: column; align-items: center; gap: 5px; }
#toast div { background: rgba(8,12,20,.86); border: 1px solid rgba(255,255,255,.16); color: #fff; padding: 6px 14px; border-radius: 16px; font-size: 13px; font-weight: 700; white-space: nowrap; animation: tin .25s ease-out; }
#toast div.g1 { border-color: #43a9ff; } #toast div.g2 { border-color: #b86dff; color: #eed9ff; } #toast div.g3 { border-color: #ffb52e; color: #ffe6b0; } #toast div.g4 { border-color: #ff4f6d; color: #ffd0d8; box-shadow: 0 0 14px rgba(255,79,109,.5); }
#toast div.bad { border-color: #ff5a5a; color: #ffd0d0; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#bossBar { position: absolute; left: 120px; right: 120px; top: 80px; text-align: center; pointer-events: none; }
#bossBar b { font-size: 13px; color: #ffd0e4; text-shadow: 0 1px 2px #000; }
#bossBar img { width: 26px; height: 26px; vertical-align: middle; margin: -6px 6px 0 0; }
#bossBar img:not([src]) { display: none; }
#bossBar .bar { margin-top: 3px; height: 10px; background: rgba(0,0,0,.7); border: 1px solid #ff7ab0; border-radius: 6px; overflow: hidden; }
#bossBar i { display: block; height: 100%; background: linear-gradient(90deg, #ff3d7f, #ff8ab8); width: 100%; transition: width .15s; }

/* ---------- 오른쪽 패널 ---------- */
#panel { position: absolute; left: 540px; top: 0; bottom: 0; right: 0; padding: 7px 9px; display: flex; flex-direction: column; gap: 6px;
  border-left: 1px solid #23344a; background: linear-gradient(180deg, rgba(14,24,38,.96), rgba(8,13,22,.98)); }
.box { background: rgba(255,255,255,.035); border: 1px solid #22344a; border-radius: 10px; }
.top { display: flex; align-items: center; gap: 6px; height: 42px; flex: none; padding: 0 6px 0 10px; }
.wave { flex: 1; min-width: 0; }
.wave b { font-size: 19px; font-weight: 900; letter-spacing: 1px; color: #f4e2b0; }
.wave b small { font-size: 12px; color: #8ea3b8; font-weight: 700; margin-left: 4px; letter-spacing: 0; }
.wave .sub { font-size: 11px; color: #9fb3c8; display: flex; justify-content: space-between; gap: 6px; margin-top: 1px; white-space: nowrap; }
.wave .sub span { overflow: hidden; text-overflow: ellipsis; }
.wave .sub .red { color: #ff9aa6; font-weight: 800; }
.wbar { height: 4px; background: #0b121c; border-radius: 3px; overflow: hidden; margin-top: 2px; }
.wbar i { display: block; height: 100%; background: linear-gradient(90deg, #c8a050, #f4e2b0); width: 0; }
.ib { height: 34px; min-width: 38px; padding: 0 8px; border-radius: 8px; background: #16253a; border: 1px solid #2c4560; font-weight: 800; font-size: 13px; color: #dfe9f5; }
.ib:active { transform: translateY(1px); }
.ib.next { color: #ffe29a; border-color: #6a5422; background: #2a2210; }
.ib[disabled] { opacity: .4; }
.ib.dbg { color: #b8ff9a; border-color: #3a6a2a; background: #142a14; }
.dbg h3 { margin: 10px 0 5px; font-size: 13px; color: #9fe8ff; }
.dbg .row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.dbg .row button { height: 36px; padding: 0 12px; border-radius: 8px; background: #1b2c42; border: 1px solid #355273; font-weight: 800; font-size: 13px; }
.dbg .row button.on { background: #2a5a2a; border-color: #7fe39a; }
.dbg input, .dbg select { height: 36px; border-radius: 8px; background: #0b131e; color: #fff; border: 1px solid #355273; padding: 0 8px; font: inherit; font-size: 13px; user-select: text; -webkit-user-select: text; }
.dbg input { width: 80px; }

.res { display: flex; align-items: center; gap: 6px; height: 34px; flex: none; padding: 0 10px; }
.res .it { display: flex; align-items: center; gap: 4px; font-weight: 800; font-size: 15px; white-space: nowrap; }
.res .gold { color: #ffd34d; min-width: 70px; } .res .ess { color: #8fe6ff; min-width: 44px; }
.res .nx { flex: 1; display: flex; align-items: center; gap: 5px; min-width: 0; }
.res .nx .bar { flex: 1; height: 9px; background: #0b121c; border-radius: 5px; overflow: hidden; border: 1px solid #23364c; }
.res .nx i { display: block; height: 100%; background: linear-gradient(90deg, #2fbf6a, #6be39a); width: 100%; transition: width .2s; }
.res .nx span { font-size: 12px; color: #a8f0c4; min-width: 26px; text-align: right; }
.res .cnt { font-size: 12px; color: #9fb3c8; }
.ico { display: inline-block; width: 16px; text-align: center; }

.bench { padding: 5px 8px 7px; flex: none; }
.bench .hd { display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: #9fb3c8; font-weight: 700; margin-bottom: 4px; height: 20px; }
.bench .hd button { font-size: 11px; padding: 3px 9px; border-radius: 6px; background: #1d2f47; border: 1px solid #355273; color: #cfe2f7; font-weight: 800; }
.bench .hd button[disabled] { opacity: .35; }
.slots { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
#stage.wide .slots { grid-template-columns: repeat(8, 1fr); }
#stage:not(.wide) .slot { height: 44px; }
#stage:not(.wide) .slot .tok { width: 38px; height: 38px; }
.slot { position: relative; height: 50px; border-radius: 9px; background: #0b131e; border: 1px dashed #2a3e56; display: flex; align-items: center; justify-content: center; }
.slot.has { border-style: solid; }
.slot.sel { outline: 2px solid #fff; outline-offset: 1px; }
.slot.drop { background: #13304a; }
.slot.new { animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: scale(.6); } 60% { transform: scale(1.12); } 100% { transform: none; } }
.tok { position: relative; width: 42px; height: 42px; border-radius: 50%; padding: 2.5px; flex: none; }
.tok img { width: 100%; height: 100%; border-radius: 50%; display: block; background: #111; pointer-events: none; }
.tok.g4 { animation: myth 2.4s linear infinite; }
@keyframes myth { 0% { filter: hue-rotate(0deg); } 100% { filter: hue-rotate(360deg); } }
.slot .n3 { position: absolute; right: 2px; top: 2px; font-size: 10px; font-weight: 900; padding: 0 4px; border-radius: 6px; background: #ffd34d; color: #2a1a00; }
.slot .gl { position: absolute; left: 3px; bottom: 2px; font-size: 9px; font-weight: 800; }

.info { flex: 1; min-height: 0; padding: 7px 9px; overflow: hidden; display: flex; flex-direction: column; gap: 5px; }
.info > * { flex: none; }
/* 긴 설명은 이 안에서 손가락으로 밀어 봄 (합성 · 판매 버튼은 위에 고정이라 항상 보임) */
.info > .scr { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; touch-action: pan-y; overscroll-behavior: contain; display: flex; flex-direction: column; gap: 5px; padding-right: 2px; }
.info > .scr > * { flex: none; }
.info > .scr::-webkit-scrollbar { width: 4px; }
.info > .scr::-webkit-scrollbar-thumb { background: #3a5878; border-radius: 2px; }
.info .row { display: flex; gap: 10px; align-items: center; }
.info .tok { width: 48px; height: 48px; padding: 3px; }
.info .nm { font-size: 16px; font-weight: 900; line-height: 1.2; }
.info .tag { display: inline-block; font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 6px; margin-right: 4px; vertical-align: 2px; }
.info .stats { display: grid; grid-template-columns: repeat(4, auto); gap: 2px 10px; font-size: 12px; color: #b9c9da; margin-top: 3px; }
.info .stats b { color: #fff; font-weight: 800; }
.info .sk { font-size: 12px; line-height: 1.4; color: #c9d6e3; background: rgba(0,0,0,.22); border-radius: 8px; padding: 5px 8px; }
.info .sk b { color: #ffe29a; }
.info .sk .ps b { color: #9fe8ff; }
.info .btns { display: flex; gap: 6px; }
.info .btns button { flex: 1 1 0; min-width: 0; height: 34px; white-space: nowrap; padding: 0 4px; overflow: hidden; text-overflow: ellipsis; border-radius: 8px; font-weight: 900; font-size: 13px; background: #1b2c42; border: 1px solid #355273; }
.info .btns button.mg { background: linear-gradient(180deg, #5b3fa0, #3a2770); border-color: #8f6be0; }
.info .btns button.aw { background: linear-gradient(180deg, #a03050, #651a33); border-color: #ff6b8a; }
.info .btns button.sl { background: #2a1a1a; border-color: #6a3a3a; color: #ffc9c9; }
.info .btns button[disabled] { opacity: .35; }
.info .hint { font-size: 11px; color: #7f95ab; }
.info h4 { margin: 0; font-size: 13px; color: #f4e2b0; }
.info .odds { display: flex; gap: 4px; font-size: 11px; font-weight: 800; }
.info .odds span { flex: 1; text-align: center; padding: 3px 0; border-radius: 6px; background: rgba(0,0,0,.3); }
.info .tips { font-size: 12px; color: #a9bbcd; line-height: 1.55; margin: 0; padding-left: 16px; }
.info .wv { font-size: 12px; color: #c9d6e3; line-height: 1.5; }
.info .mcs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 9px; margin: 1px 0 3px; }
.info .mc { display: inline-flex; align-items: center; gap: 2px; font-weight: 900; font-size: 13px; }
.info .mc img { width: 24px; height: 24px; }
.info .mc.b { color: #9ccfff; } .info .mc.r { color: #ff9c9c; } .info .mc.j { color: #c2f09a; }
.info .nm img.mp { width: 30px; height: 30px; vertical-align: middle; margin: -4px 6px 0 0; }
.etab img.mi { width: 22px; height: 22px; vertical-align: middle; margin-right: 2px; }
.pin { display: flex; gap: 12px; justify-content: center; margin: 10px 0 6px; }
.pin i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #6a8aaa; }
.pin i.on { background: #ffd34d; border-color: #ffd34d; }
.pin.bad { animation: pinShake .35s; }
@keyframes pinShake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-9px); } 75% { transform: translateX(9px); } }
.pad { display: grid; grid-template-columns: repeat(3, 70px); gap: 6px; justify-content: center; margin-top: 8px; }
.pad button { height: 42px; border-radius: 9px; background: #1b2c42; border: 1px solid #355273; font-size: 18px; font-weight: 900; }
.pad button.pri { font-size: 14px; color: #2a1a00; background: linear-gradient(180deg, #ffe08a, #e0a838); border-color: #fff0b8; }

.acts { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 6px; flex: none; }
.big { height: 50px; border-radius: 10px; font-weight: 900; font-size: 18px; color: #2a1a00; background: linear-gradient(180deg, #ffe08a, #e0a838); border: 1px solid #fff0b8; box-shadow: 0 3px 0 #7a5418, 0 0 16px rgba(255,200,90,.25); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.big small { font-size: 12px; font-weight: 800; color: #5a3a00; }
.big:active { transform: translateY(2px); box-shadow: 0 1px 0 #7a5418; }
.big[disabled] { filter: grayscale(.8) brightness(.6); }
.lucky { height: 50px; border-radius: 10px; font-weight: 900; font-size: 14px; background: linear-gradient(180deg, #3a8fb0, #1d4f70); border: 1px solid #8fe6ff; box-shadow: 0 3px 0 #0e2a3c; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.lucky small { font-size: 11px; color: #c9f4ff; }
.lucky[disabled] { filter: grayscale(.8) brightness(.6); }
.drg { height: 50px; border-radius: 10px; font-weight: 900; font-size: 14px; background: linear-gradient(180deg, #d66a2c, #7a2a12); border: 1px solid #ffb07a; box-shadow: 0 3px 0 #3a1406; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; }
.drg small { font-size: 11px; color: #ffe0c8; }
.drg:active { transform: translateY(2px); box-shadow: 0 1px 0 #3a1406; }
.drg[disabled] { filter: grayscale(.8) brightness(.6); }
.upg { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.upg button { height: 38px; border-radius: 9px; background: #15233a; border: 1px solid #2c4560; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.15; font-weight: 800; font-size: 12px; white-space: nowrap; overflow: hidden; padding: 0 2px; }
.upg button.cp { border-color: #7a6a2a; }
.upg button small { font-size: 11px; color: #ffd34d; font-weight: 800; }
.upg button.ad { border-color: #8a4a2a; } .upg button.ap { border-color: #4a4aa0; } .upg button.lk { border-color: #2a7a5a; }
.upg button[disabled] { opacity: .45; }

/* ---------- 타이틀 ---------- */
#title { position: absolute; left: 540px; top: 0; right: 0; bottom: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px;
  background: linear-gradient(180deg, rgba(10,18,30,.97), rgba(5,9,16,.99)); border-left: 1px solid #23344a; }
.logo { text-align: center; margin-bottom: 6px; }
.logo .l1 { font-size: 64px; font-weight: 900; letter-spacing: 4px; line-height: 1; background: linear-gradient(180deg, #fff6d8, #f0c870 45%, #a86e1c); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 3px 0 #3a2508) drop-shadow(0 0 22px rgba(255,190,80,.3)); }
.logo .l2 { font-size: 16px; font-weight: 800; color: #9fd8ff; letter-spacing: 6px; margin-top: 6px; }
.menu { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 300px; }
.menu button { height: 46px; border-radius: 10px; font-size: 16px; font-weight: 900; background: #15233a; border: 1px solid #2f4b6a; }
.menu button.pri { color: #2a1a00; background: linear-gradient(180deg, #ffe08a, #e0a838); border-color: #fff0b8; box-shadow: 0 3px 0 #7a5418; }
.menu button small { display: block; font-size: 11px; font-weight: 700; color: #8ea3b8; margin-top: -2px; }
.menu button.pri small { color: #6a4a10; }
.pick { display: flex; flex-direction: column; align-items: center; gap: 8px; width: 100%; max-width: 420px; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; width: 100%; }
.side { display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 10px; border-radius: 10px; background: #111c2c; border: 2px solid #2a3e56; text-align: left; opacity: .62; }
.side .mm { width: 34px; height: 34px; flex: none; }
.side div { min-width: 0; }
.side b { display: block; font-size: 15px; font-weight: 900; white-space: nowrap; }
.side span { display: block; font-size: 11px; color: #9fb3c8; line-height: 1.25; }
.side.blue b { color: #8fc8ff; } .side.red b { color: #ff8a8a; }
.side.on { opacity: 1; }
.side.blue.on { background: #12284a; border-color: #4aa8ff; box-shadow: 0 0 12px rgba(74,168,255,.35); }
.side.red.on { background: #3a141c; border-color: #ff5a6a; box-shadow: 0 0 12px rgba(255,90,106,.35); }
.diffs { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 420px; }
.diffs button { display: grid; grid-template-columns: 104px 1fr auto; align-items: center; gap: 8px; height: 46px; padding: 0 14px; border-radius: 10px; background: #15233a; border: 1px solid #2f4b6a; text-align: left; }
.diffs button b { font-size: 17px; font-weight: 900; white-space: nowrap; }
.diffs button span { font-size: 11px; color: #9fb3c8; }
.diffs button em { font-style: normal; font-size: 11px; color: #ffd34d; text-align: right; white-space: nowrap; }
.diffs .veryeasy b { color: #8fe8ff; } .diffs .easy b { color: #7fe39a; } .diffs .normal b { color: #ffe29a; } .diffs .hard b { color: #ff8a8a; } .diffs .veryhard b { color: #d68aff; }
.diffs .veryhard { border-color: #5a3a7a; }
.ver { font-size: 12px; color: #7f95ab; margin-top: -4px; }
.dbgt { height: 34px; padding: 0 18px; border-radius: 17px; font-size: 13px; font-weight: 800; background: #142030; border: 1px solid #3a5878; color: #a9bed2; }
.dbgt b { margin-left: 4px; color: #ff9a8a; }
.dbgt.on { background: #163416; border-color: #6fd06f; color: #e0ffd8; box-shadow: 0 0 12px rgba(111,208,111,.35); }
.dbgt.on b { color: #9aff8a; }

/* ---------- 창 ---------- */
#modal { position: absolute; inset: 0; background: rgba(2,5,10,.66); display: flex; align-items: center; justify-content: center; z-index: 20; }
#modalCard { width: 560px; max-width: 94%; max-height: 92%; overflow: auto; background: linear-gradient(180deg, #13223a, #0b1424); border: 1px solid #c8a050; border-radius: 14px; padding: 18px 20px; box-shadow: 0 10px 40px rgba(0,0,0,.6); touch-action: pan-y; }
#modalCard h2 { margin: 0 0 10px; font-size: 22px; color: #f4e2b0; text-align: center; }
#modalCard p { margin: 6px 0; font-size: 14px; color: #c9d6e3; line-height: 1.6; text-align: center; }
#modalCard .mb { display: flex; gap: 8px; justify-content: center; margin-top: 14px; flex-wrap: wrap; }
#modalCard .mb button { min-width: 130px; height: 44px; padding: 0 16px; border-radius: 10px; font-weight: 900; font-size: 15px; background: #1b2c42; border: 1px solid #355273; }
#modalCard .mb button.pri { color: #2a1a00; background: linear-gradient(180deg, #ffe08a, #e0a838); border-color: #fff0b8; }
#modalCard .mb button.bad { background: #3a1a1a; border-color: #8a3a3a; color: #ffd0d0; }
.stat { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 10px 0; }
.stat div { background: rgba(0,0,0,.25); border-radius: 10px; padding: 8px; text-align: center; font-size: 12px; color: #9fb3c8; }
.stat div b { display: block; font-size: 20px; color: #fff; }
.codex .gh { font-size: 14px; font-weight: 900; margin: 12px 0 6px; }
.codex .ch { display: flex; gap: 10px; align-items: flex-start; padding: 7px 8px; border-radius: 10px; background: rgba(0,0,0,.22); margin-bottom: 6px; }
.codex .ch .tok { width: 44px; height: 44px; padding: 2.5px; }
.codex .ch .tx { font-size: 12px; color: #b9c9da; line-height: 1.45; flex: 1; }
.codex .ch .tx b { color: #fff; font-size: 14px; }
.codex .ch .tx .k { color: #ffe29a; font-weight: 800; }
.codex .ch .tx .p { color: #9fe8ff; font-weight: 800; }
.help { font-size: 13px; color: #c9d6e3; line-height: 1.65; padding-left: 18px; margin: 0; }
.help b { color: #ffe29a; }
.etab { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.etab td, .etab th { padding: 4px 6px; border-bottom: 1px solid #22344a; text-align: center; }
.etab th { color: #9fb3c8; font-weight: 700; }
.etab td:first-child { text-align: left; font-weight: 800; color: #fff; }

#drag { position: absolute; width: 46px; height: 46px; margin: -23px 0 0 -23px; pointer-events: none; z-index: 30; opacity: .92; }
#drag .tok { width: 46px; height: 46px; box-shadow: 0 6px 16px rgba(0,0,0,.6); }

#rotate { display: none; position: fixed; inset: 0; background: #05080e; color: #f4e2b0; font-size: 18px; font-weight: 800; align-items: center; justify-content: center; z-index: 99; }
@media (orientation: portrait) and (max-width: 700px) { #rotate { display: flex; } }
