@import url('./view-duel-responsive.css');
/* 들판 겨루기 화면(2026-10-24, 사용자가 보낸 33 원정대 전투 화면 사진 "이렇게 구현해") — 아래를 덮는 판 없이 3D 들판을 화면 가득.
   ★33 원정대 배치: 왼쪽 세로 차례 띠 · 도깨비 머리 위 기운 막대 · 아이 곁 비스듬한 명령 붓질 · 오른쪽 기술 설명 · 오른쪽 아래 내 상태 ·
   왼쪽 아래 달아나기. 우리 것: 검은 붓질은 먹 붓질, 테는 금빛, 기는 파란 마름모 구슬.
   10-23 밤 Codex가 칠한 아래 판 디자인을 이 화면이 대신한다(사용자 10-24 사진). --foe-x/y·--me-x/y는 view-duel-session이 3D 자리로 넣는다 */
body.duel-on .round-bar,body.duel-on #walk-toggle{display:none!important}   /* 공통 진행 막대·걷기 고정 — 왼쪽 아래 달아나기와 겹친다 */
.duel-host{--ink:#15110d;--gold:#d7b45a;--cream:#f6efe0;--blue:#5fb0f0;--red:#d9483b;
  --brush:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 64' preserveAspectRatio='none'%3E%3Cpath fill='%2315110d' fill-opacity='.84' d='M8 14C60 6 150 9 230 7S350 4 392 10c6 6 5 14 1 20 5 6 4 15-3 20-60 7-140 6-220 9S50 62 14 56C4 50 2 40 6 32 1 26 2 18 8 14z'/%3E%3Cpath fill='%2315110d' fill-opacity='.5' d='M330 52c20-1 44-2 64-6l-2 6c-20 4-44 5-62 4zM346 8c18 0 34-2 50-4l-1 5c-16 2-32 3-49 3zM2 30c-2 6 0 14 4 18l3-3c-3-4-4-9-3-14z'/%3E%3C/svg%3E");
  --stroke:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 12' preserveAspectRatio='none'%3E%3Cpath fill='%23d7b45a' d='M2 7C80 2 200 4 300 3s70 1 98 3c-30 3-90 3-150 4S40 11 2 7z'/%3E%3C/svg%3E");
  position:fixed;inset:0;z-index:35;pointer-events:none;color:var(--cream);font:16px/1.45 system-ui,"Malgun Gothic",sans-serif;
  --foe-x:62%;--foe-y:30%;--me-x:34%;--me-y:46%}
.duel-host *{box-sizing:border-box}
:where(.duel-host) button{pointer-events:auto;font-family:inherit;font-size:16px;line-height:1.3;color:inherit}
.duel-host kbd{display:inline-grid;place-items:center;min-width:26px;height:26px;padding:0 6px;border:2px solid var(--cream);border-radius:999px;font:800 12px/1 system-ui,sans-serif;color:var(--cream);background:#0006}
.duel-host :focus-visible{outline:3px solid var(--gold);outline-offset:3px}
.duel-ink{background:var(--brush) center/100% 100% no-repeat}

/* ── 왼쪽 세로 차례 띠 — 얼굴 칸 ── */
.duel-line{position:absolute;left:10px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;gap:7px;margin:0;padding:0;list-style:none}
.duel-chip{position:relative;display:grid;place-items:center;width:78px;height:50px;background:var(--brush) center/100% 100% no-repeat;transition:transform .2s}
.duel-chip span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
.duel-chip .duel-face,.duel-chip .duel-face-text{width:42px;height:42px;border-radius:8px;object-fit:cover;background:#0004}
.duel-chip .duel-face-text{display:grid;place-items:center;font-weight:900}
.duel-chip.me::after,.duel-chip.foe::after{content:"";position:absolute;right:4px;top:6px;bottom:6px;width:4px;border-radius:2px;background:#57c2b0}
.duel-chip.foe::after{background:var(--red)}
.duel-chip.now{transform:translateX(10px) scale(1.16)}
.duel-chip.now .duel-face,.duel-chip.now .duel-face-text{box-shadow:0 0 0 2px var(--gold),0 0 14px #d7b45a99}

/* ── 도깨비 머리 위 — 이름·기운·흔들림 ── */
.duel-foe{position:absolute;left:var(--foe-x);top:var(--foe-y);transform:translate(-50%,-120%);display:grid;justify-items:center;gap:3px;width:190px;text-shadow:0 1px 3px #000c}
.duel-name{font-size:14px;font-weight:900;letter-spacing:.04em}
.duel-bar{position:relative;display:block;width:100%;height:9px;border:1.5px solid #000c;border-radius:2px;background:#0008;overflow:hidden}
.duel-bar i{position:absolute;inset:0 auto 0 0;background:linear-gradient(90deg,#a92f27,var(--red));transition:width .3s ease}
.duel-bar em{position:absolute;inset:-1px 4px auto auto;font:800 9px/1 system-ui,sans-serif;font-style:normal;color:#fff}
.duel-foe .duel-bar em{display:none}
.duel-bar.shake{height:5px;width:70%}
.duel-bar.shake i{background:linear-gradient(90deg,#d39523,#f2cb58)}
.duel-stun{padding:0 10px;border-radius:2px;background:var(--gold);color:var(--ink);font-size:12px;font-weight:900;text-shadow:none;animation:duel-throb .8s infinite alternate}

/* ── 오른쪽 아래 — 내 상태 ── */
.duel-me{position:absolute;right:16px;bottom:14px;display:flex;align-items:center;gap:10px;width:310px;padding:12px 18px 12px 12px;background:var(--brush) center/100% 100% no-repeat}
.duel-me .duel-face,.duel-me .duel-face-text{flex:0 0 70px;width:70px;height:70px;border-radius:50%;object-fit:cover;background:#0005;box-shadow:0 0 0 3px var(--gold)}
.duel-me .duel-face-text{display:grid;place-items:center;font-size:24px;font-weight:900}
.duel-me-body{display:grid;gap:4px;flex:1}
.duel-me-numbers{display:flex;align-items:baseline;justify-content:flex-end;gap:4px}
.duel-me-numbers strong{font:900 30px/1 system-ui,sans-serif}
.duel-me-numbers small{font-weight:800;color:#d9cfb8}
.duel-ap{display:flex;align-items:center;gap:4px}
.duel-ap-count{display:grid;place-items:center;width:22px;height:22px;margin-right:4px;transform:rotate(45deg);background:var(--blue);color:#0c1a26;font:900 12px/1 system-ui,sans-serif}
.duel-ap-count::first-letter{}
.duel-ap i{width:11px;height:11px;transform:rotate(45deg);border:1.5px solid #9cc9ee;background:#0006}
.duel-ap i.on{background:var(--blue);box-shadow:0 0 8px #5fb0f0aa}

/* ── 소식 줄·도움말·왼쪽 아래 ── */
.duel-said{position:absolute;left:50%;top:12px;transform:translateX(-50%);max-width:min(760px,84vw);margin:0;padding:10px 34px;text-align:center;font-weight:800;word-break:keep-all;background:var(--brush) center/100% 100% no-repeat;text-shadow:0 1px 2px #000}
.duel-said:empty{display:none}
.duel-tip{position:absolute;left:50%;bottom:16px;transform:translateX(-50%);max-width:44vw;margin:0;text-align:center;font-size:13px;font-weight:700;color:#efe6d0;text-shadow:0 1px 3px #000,0 0 8px #000}
.duel-hints{position:absolute;left:16px;bottom:14px;display:flex;gap:16px}
.duel-hints button{display:flex;align-items:center;gap:7px;min-height:44px;padding:4px 10px;border:0;background:transparent;font-weight:800;text-shadow:0 1px 3px #000,0 0 8px #000;cursor:pointer}

/* ── 명령 — 아이 곁에 비스듬히 쌓인 먹 붓질(★33 원정대) ── */
.duel-menu,.duel-cards{position:absolute;left:calc(var(--me-x) + 70px);top:calc(var(--me-y) + 34px);display:grid;gap:8px}
.duel-cmd,.duel-card{position:relative;display:flex;align-items:center;gap:12px;width:280px;min-height:54px;padding:6px 22px 6px 16px;border:0;cursor:pointer;
  background:var(--brush) center/100% 100% no-repeat;text-align:left;transform:translateX(calc(var(--i, 0) * -24px)) rotate(-4deg);transition:transform .15s,filter .15s}
.duel-cmd::after,.duel-card::after{content:"";position:absolute;left:46px;right:18px;bottom:2px;height:8px;background:var(--stroke) center/100% 100% no-repeat;opacity:.65;transition:opacity .15s}
.duel-cmd:hover:not(:disabled),.duel-cmd:focus-visible,.duel-card:hover:not(:disabled),.duel-card:focus-visible{transform:translateX(calc(var(--i, 0) * -24px + 8px)) rotate(-4deg);filter:drop-shadow(0 0 8px #d7b45a88)}
.duel-cmd:hover:not(:disabled)::after,.duel-card:hover:not(:disabled)::after{opacity:1}
.duel-cmd:disabled,.duel-card:disabled{cursor:default}
.duel-cmd:disabled .duel-cmd-words,.duel-cmd:disabled .duel-cost{opacity:.4}
.duel-card-key{flex:0 0 30px;display:grid;place-items:center;width:30px;height:30px;border:2px solid var(--cream);border-radius:50%;font:800 13px/1 system-ui,sans-serif;background:#0006}
.duel-cmd-words{display:grid;gap:1px;min-width:0}
.duel-skill-name{font-size:19px;font-weight:900;letter-spacing:.02em}
.duel-skill-note{font-size:12px;font-weight:700;color:#e2cf9b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:170px}
.duel-cost{display:flex;gap:4px;margin-left:auto}
.duel-cost i{width:10px;height:10px;transform:rotate(45deg);background:var(--blue);box-shadow:0 0 6px #5fb0f088}
.duel-cost i.free{background:transparent;border:1.5px solid #9cc9ee;box-shadow:none}
.duel-more .duel-skill-note{max-width:190px}

/* ── 오른쪽 기술 설명 ── */
.duel-info{position:absolute;right:16px;top:30%;width:300px;padding:16px 18px 16px 40px;background:linear-gradient(90deg,transparent,#15110dd9 18%);text-shadow:0 1px 2px #000}
.duel-info small{color:#9cc9ee;font-weight:800}
.duel-info .duel-cost{display:inline-flex;margin-left:8px}
.duel-info b{display:block;margin:4px 0 2px;font-size:21px;color:var(--gold)}
.duel-info p{margin:2px 0;font-size:14px;font-weight:700}
.duel-info .duel-info-rule{margin-top:8px;font-size:12px;color:#d9cfb8}

/* ── 문제 — 위에 걸린 먹 두루마리, 답은 명령과 같은 붓질 띠 ── */
.duel-q{position:absolute;left:50%;top:64px;transform:translateX(-50%);width:min(720px,calc(100vw - 210px));padding:14px 26px 18px;background:linear-gradient(#15110de6,#15110dcc);border-top:3px solid var(--gold);border-bottom:1px solid #d7b45a66;box-shadow:0 10px 30px #0008}
.duel-ask-head{display:flex;justify-content:space-between;align-items:center;gap:10px}
.duel-skill-tag{display:inline-flex;align-items:center;gap:7px;color:var(--gold);font-size:14px}
.duel-tag-art{width:28px;height:28px}
.duel-back{min-height:38px;padding:4px 12px;border:1px solid #d7b45a88;background:#0005;font-size:14px;font-weight:800;cursor:pointer}
.duel-ask{margin:8px 0 0;font-size:24px;font-weight:900;line-height:1.35;word-break:keep-all;color:var(--cream)}
.duel-cards{top:calc(var(--me-y) + 40px)}
.duel-card{width:330px;min-height:60px}
.duel-card-answer{font-size:23px;font-weight:900;word-break:keep-all;overflow-wrap:anywhere}
.duel-card[data-picked="right"]{filter:drop-shadow(0 0 10px #f2cb58)}
.duel-card[data-picked="right"] .duel-card-key{background:#4f9e5b;border-color:#bfe8b0}
.duel-card[data-picked="wrong"]{filter:drop-shadow(0 0 8px #d9483b) saturate(.8)}
.duel-card[data-picked="wrong"] .duel-card-key{background:var(--red)}
.duel-card[data-picked="answer"]::before{content:"정답";position:absolute;right:16px;top:-10px;padding:0 8px;background:var(--gold);color:var(--ink);font-size:12px;font-weight:900;transform:rotate(4deg)}
/* 문제 단계의 문제·답 배치(한 흐름에 쌓고 넘치면 스크롤)는 view-duel-responsive.css가 정본이다(10-24 Codex — 긴 문제에서 답이 문제를 덮던 것을 고쳤다) */

/* ── 고리 — 기술 고리는 도깨비 위, 막기 고리는 아이 위 ── */
.duel-qte{position:absolute;inset:0;pointer-events:auto;cursor:pointer;touch-action:manipulation;user-select:none}
.duel-guard{position:absolute;inset:0}
.duel-ring{position:absolute;width:86px;height:86px;transform:translate(-50%,-50%)}
.duel-qte .duel-ring{left:var(--foe-x);top:calc(var(--foe-y) + 40px)}
.duel-guard .duel-ring{left:var(--me-x);top:calc(var(--me-y) - 20px)}
.duel-ring i{position:absolute;inset:0;border-radius:50%}
.duel-ring-target{border:5px solid var(--gold);box-shadow:0 0 0 2px #0008,inset 0 0 0 2px #0008}
.duel-ring-move{border:4px solid #fff;box-shadow:0 0 10px #fff8;will-change:transform}
.duel-ring.foe .duel-ring-move{border-color:#ffb2a8}
.duel-ring-move.ready{border-color:#f2cb58;box-shadow:0 0 18px #f2cb58}
.duel-now{position:absolute;left:50%;bottom:64px;transform:translateX(-50%) rotate(-3deg);min-width:200px;min-height:66px;border:0;background:var(--brush) center/100% 100% no-repeat;font:900 26px system-ui,sans-serif;cursor:pointer}
.duel-hits{position:absolute;left:var(--me-x);top:calc(var(--me-y) + 34px);transform:translateX(-50%);font-size:14px;letter-spacing:3px;text-shadow:0 1px 3px #000}
.duel-guard-word{position:absolute;left:var(--me-x);top:calc(var(--me-y) - 92px);transform:translateX(-50%);margin:0;font-weight:900;color:#9cc9ee;text-shadow:0 1px 3px #000,0 0 8px #000;white-space:nowrap}
.duel-dodge,.duel-parry{position:absolute;bottom:100px;display:flex;align-items:center;gap:10px;min-width:190px;min-height:74px;padding:6px 26px 6px 18px;border:0;cursor:pointer;background:var(--brush) center/100% 100% no-repeat;touch-action:manipulation}
.duel-dodge{left:16px;transform:rotate(-3deg)}
.duel-parry{right:340px;transform:rotate(3deg)}
.duel-dodge b,.duel-parry b{font-size:24px;font-weight:900}
.duel-dodge:active,.duel-parry:active{filter:drop-shadow(0 0 10px #d7b45a)}

/* ── 솟는 글 — 맞힌 칸·막기·피함 ── */
.duel-pops{position:absolute;inset:0}
.duel-pop{position:absolute;transform:translate(-50%,-50%);font:900 34px/1 system-ui,sans-serif;color:#fff;-webkit-text-stroke:2px #15110d;paint-order:stroke;text-shadow:0 3px 0 #15110d;white-space:nowrap;animation:duel-rise 1.15s ease-out forwards}
.duel-pop.at-foe{left:var(--foe-x);top:calc(var(--foe-y) - 10px)}
.duel-pop.at-me{left:var(--me-x);top:calc(var(--me-y) - 40px)}
.duel-pop.perfect{color:#f2cb58;font-size:40px}
.duel-pop.weak,.duel-pop.whiff{color:#d9cfb8;font-size:26px}
.duel-pop.heal{color:#9be38f}
.duel-pop.hurt{color:#ff8a7a}
.duel-pop.guard{color:#9cc9ee}
.duel-pop.dodge{color:#8fe3cf;font-size:28px}
.duel-pop.stun{color:#f2cb58;font-size:30px}
.duel-pop.still{animation:none}
@keyframes duel-rise{0%{opacity:0;transform:translate(-50%,-30%) scale(.6)}15%{opacity:1;transform:translate(-50%,-60%) scale(1.15)}30%{transform:translate(-50%,-70%) scale(1)}100%{opacity:0;transform:translate(-50%,-190%)}}
@keyframes duel-throb{to{filter:brightness(1.35)}}

/* ── 첫 겨루기 안내 ── */
.duel-lesson{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);display:grid;gap:12px;width:min(560px,calc(100vw - 32px));padding:20px 24px;pointer-events:auto;
  background:linear-gradient(#15110df2,#15110de0);border-top:3px solid var(--gold);border-bottom:3px solid var(--gold);box-shadow:0 16px 40px #000a}
.duel-lesson small{color:var(--gold);font-weight:800}
.duel-lesson p{margin:0;font-size:18px;font-weight:700;line-height:1.55;word-break:keep-all}
.duel-lesson-go{justify-self:end;min-width:150px;min-height:54px;border:0;background:var(--gold);color:var(--ink)!important;font:900 18px system-ui,sans-serif;cursor:pointer}

/* ── 맞았을 때 — 붉게 번쩍·내 상태가 흔들림 ── */
.duel-host.duel-hurt::after{content:"";position:absolute;inset:0;background:radial-gradient(ellipse at center,transparent 55%,#d9483b66);animation:duel-flash .35s ease-out forwards}
.duel-host.duel-hurt .duel-me{animation:duel-shake .3s}
.duel-jolt .duel-ring-target{animation:duel-jolt .25s}
@keyframes duel-flash{from{opacity:1}to{opacity:0}}
@keyframes duel-shake{25%{translate:-6px 0}75%{translate:6px 0}}
@keyframes duel-jolt{50%{box-shadow:0 0 0 10px #d7b45a99}}

/* ── 태블릿 세로·작은 화면 — 명령·답은 엄지 닿는 아래로, 설명 칸은 접는다 ── */
@media (max-width:900px){
  .duel-menu,.duel-cards{left:auto;right:16px;top:auto;bottom:150px}
  .duel-info{display:none}
  .duel-q{top:62px;width:calc(100vw - 110px);left:auto;right:12px;transform:none}
  .duel-parry{right:16px;bottom:150px}
  .duel-dodge{bottom:150px}
  .duel-tip{display:none}
}
@media (max-width:560px){
  .duel-line{top:60px;transform:none;gap:4px}
  .duel-chip{width:54px;height:36px}
  .duel-chip .duel-face,.duel-chip .duel-face-text{width:28px;height:28px}
  .duel-chip:nth-child(n+5){display:none}
  .duel-said{top:auto;bottom:calc(100% - 110px);padding:8px 22px;font-size:14px;max-width:calc(100vw - 80px)}
  .duel-me{left:auto;right:6px;top:56px;bottom:auto;width:208px;padding:8px 14px 8px 8px;gap:8px}
  .duel-me .duel-face,.duel-me .duel-face-text{flex-basis:44px;width:44px;height:44px}
  .duel-me-numbers strong{font-size:22px}
  .duel-menu,.duel-cards{left:10px;right:10px;bottom:66px}
  .duel-cmd,.duel-card{width:auto;transform:rotate(-2deg)}
  .duel-cmd:hover:not(:disabled),.duel-card:hover:not(:disabled){transform:rotate(-2deg)}
  .duel-q{padding:10px 14px 12px}
  .duel-ask{font-size:19px}
  .duel-dodge,.duel-parry{bottom:72px;min-width:44vw}
  .duel-dodge{left:6px}
  .duel-parry{right:6px}
  .duel-now{bottom:70px}
  .duel-hints{left:8px;bottom:8px;gap:6px}
}
@media (prefers-reduced-motion:reduce){
  .duel-cmd,.duel-card,.duel-chip,.duel-bar i{transition:none}
  .duel-host.duel-hurt::after,.duel-host.duel-hurt .duel-me,.duel-jolt .duel-ring-target,.duel-stun,.duel-pop{animation:none}
}
