/* 한글화 글꼴: 갈무리11(Galmuri11, SIL OFL 1.1 — app/static/fonts/galmuri-OFL.txt). 게임보이 칸에 맞는 픽셀 글꼴이다. */
@font-face{font-family:"Galmuri11";font-style:normal;font-weight:400;font-display:block;src:url("/static/fonts/Galmuri11.woff2") format("woff2")}
/* 황제포켓몬. 게임보이 화면(160×144)을 4배로 키워 캔버스에 그리고, 이름표 · 말풍선 · 창은 그 위에 얹는다. */
.poke-shell{height:100vh;height:100dvh;display:flex;flex-direction:column;overflow:hidden;background:radial-gradient(120% 90% at 50% 0,#3a0d0d 0,#0e0505 62%)}
/* 데스크톱: 머리글을 뺀 나머지 높이에 딱 맞춘다(페이지 스크롤 없음). 긴 칸은 안쪽에서만 스크롤. */
.poke-main{flex:1;min-height:0;width:100%;box-sizing:border-box;display:grid;grid-template-columns:280px minmax(0,1fr) 340px;grid-template-rows:minmax(0,1fr);grid-template-areas:"chat stage side";gap:18px;max-width:1560px;margin:0 auto;padding:14px 16px 16px;align-items:stretch}
/* 왼쪽 채팅(예전 키 설명 자리): 게임 화면을 내리지 않아도 보이게 화면 높이만큼 길게 */
.poke-chat{grid-area:chat;display:flex;flex-direction:column;min-width:0;min-height:0}
.poke-chat .chat-card{flex:1;min-height:0;box-sizing:border-box}
.poke-chat .chat-log{flex:1;height:auto;min-height:0}
/* 왼쪽 키 설명(예전) */
.poke-guide{position:sticky;top:14px;margin-top:46px;display:flex;flex-direction:column;gap:12px;padding:16px 18px;border:1px solid #ffffff14;border-radius:20px;background:#1b0b0be6;color:#f6e3de}
.poke-guide h2{margin:0;font-family:"Black Han Sans",sans-serif;font-size:22px;font-weight:400;color:#ff6b5a}
.poke-guide dl{display:flex;flex-direction:column;gap:12px;margin:0}
.poke-guide dt{display:flex;gap:4px;flex-wrap:wrap}
.poke-guide dd{margin:2px 0 0;font-size:15px;line-height:1.45;font-weight:700;word-break:keep-all}
.poke-guide dd b{color:#ffe2a0}
.poke-guide i{display:inline-grid;place-items:center;min-width:30px;height:30px;padding:0 8px;border:1px solid #ffffff38;border-bottom-width:3px;border-radius:7px;background:#2a1010;color:#fff;font-style:normal;font-weight:900;font-size:15px}
.poke-guide .guide-tip{margin:0;padding-top:10px;border-top:1px solid #ffffff14;font-size:14px;line-height:1.6;font-weight:600;word-break:keep-all}
.poke-guide .guide-tip b{color:#ffe2a0}
.poke-stage-wrap{grid-area:stage;display:flex;flex-direction:column;gap:8px;align-items:center;justify-content:center;min-width:0;min-height:0}
.poke-stage{position:relative;width:min(100%,640px,calc((100vh - 230px) * 160 / 144));aspect-ratio:160/144;border:10px solid #2b2b33;border-radius:22px;overflow:hidden;background:#000;box-shadow:0 24px 60px #000a,0 0 0 1px #ffffff14;font-family:"Noto Sans KR",sans-serif}
@supports (height:100dvh){.poke-stage{width:min(100%,640px,calc((100dvh - 230px) * 160 / 144))}}
#screen{display:block;width:100%;height:100%;outline:none;image-rendering:pixelated}
.poke-cover{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:16px;background:#0c0505ee;color:#fff;text-align:center}
.poke-cover b{font-family:"Black Han Sans",sans-serif;font-size:28px;font-weight:400;color:#ff6b5a;letter-spacing:1px}
.poke-cover small{color:#f1dcd6;font-size:13px;line-height:1.6}
.poke-cover[hidden]{display:none}
.poke-primary{padding:11px 22px;border:0;border-radius:999px;white-space:nowrap;background:linear-gradient(135deg,#ff7b6b,#d8322a);color:#fff;font-family:"Black Han Sans",sans-serif;font-size:17px;cursor:pointer}
.poke-primary[hidden]{display:none}
.poke-primary:disabled{opacity:.4;cursor:not-allowed}
.poke-ghost{padding:8px 14px;border:1px solid #ffffff14;border-radius:999px;background:#ffffff0d;color:#f6e3de;font-size:13px;font-weight:800;cursor:pointer;white-space:nowrap;transition:background .15s,border-color .15s}
.poke-ghost:hover:not(:disabled){background:#ffffff1a;border-color:#ffffff2e}
.poke-ghost.small{padding:6px 12px;font-size:12px}
.poke-ghost.on{background:#ff6b5a;color:#fff;border-color:#ff6b5a}
.poke-ghost:disabled{opacity:.4;cursor:not-allowed}
.poke-status{margin:0;min-height:0;color:#ffb3a8;font-size:12px}

.poke-modal{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;padding:4%;background:#0009}
.poke-modal[hidden]{display:none}
.poke-modal-box{width:100%;max-height:100%;display:flex;flex-direction:column;border:4px double #282018;border-radius:10px;background:#fbf8ee;color:#16120a;overflow:hidden}
.poke-modal-box header{display:flex;justify-content:space-between;align-items:center;padding:8px 12px;border-bottom:2px solid #28201833;font-size:16px}
#modalBody{padding:10px 12px;overflow:auto;font-size:14px}
#modalBody p{margin:6px 0;line-height:1.5}
.choices{display:grid;gap:8px}
.choices button{padding:12px;border:3px solid #282018;border-radius:8px;background:#fff;color:#16120a;font-size:16px;font-weight:900;cursor:pointer;text-align:left}
.choices button small{display:block;font-size:12px;font-weight:600;color:#6a5f48}
.choices button:hover,.choices button:focus{background:#ffe38a;outline:none}
.choices button:disabled{opacity:.45;cursor:not-allowed}
.row2{display:flex;gap:8px;flex-wrap:wrap}
.trade-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.trade-col{padding:8px;border:2px solid #28201822;border-radius:8px;background:#fff}
.trade-col h4{margin:0 0 6px;font-size:14px}
.trade-col ul{margin:0;padding-left:18px;font-size:13px}
.trade-col .ok{color:#178a2e;font-weight:900}
.bag-list{display:flex;flex-direction:column;gap:4px;max-height:180px;overflow:auto;margin:6px 0}
.bag-list label{display:flex;align-items:center;gap:6px;font-size:13px}
.bag-list input[type=number]{width:54px}
.money-in{width:110px;padding:4px 6px}

.poke-toast{position:absolute;left:50%;top:4%;transform:translateX(-50%);max-width:88%;padding:8px 14px;border-radius:10px;background:#141008e8;color:#ffe9a0;font-size:13px;font-weight:800;text-align:center;pointer-events:none}
.poke-toast[hidden]{display:none}
.poke-repel{position:absolute;right:2%;top:2%;padding:4px 9px;border-radius:999px;background:#141008d0;color:#ffe9a0;font-size:12px;font-weight:800;pointer-events:none}
.poke-repel[hidden]{display:none}

.touch-pad{position:absolute;inset:auto 0 0 0;display:flex;justify-content:space-between;align-items:flex-end;padding:3%;pointer-events:none;opacity:.85}
.touch-pad[hidden]{display:none}
.touch-pad button{pointer-events:auto;border:2px solid #fff6;background:#0007;color:#fff;font-weight:900;touch-action:none;user-select:none;-webkit-user-select:none}
.dpad{position:relative;width:30%;aspect-ratio:1}
.dpad button{position:absolute;width:34%;height:34%;border-radius:10px}
.dpad [data-k=up]{left:33%;top:0}.dpad [data-k=down]{left:33%;bottom:0}.dpad [data-k=left]{left:0;top:33%}.dpad [data-k=right]{right:0;top:33%}
.ss{display:flex;gap:6px}.ss button{padding:4px 8px;border-radius:999px;font-size:10px}
.ab{display:flex;gap:10px}.ab button{width:54px;height:54px;border-radius:50%;font-size:18px}

.poke-keys{display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;justify-content:center;width:min(100%,900px);padding:8px 16px;border:1px solid #ffffff14;border-radius:18px;background:#1b0b0bcc;box-shadow:0 8px 24px #0005;box-sizing:border-box;font-size:11px;line-height:1.6;color:#e0c2bb}
.poke-keys em{font-style:normal;font-weight:800;color:#ffe2a0}
.poke-keys b{color:#fff3ef}
.poke-keys i{display:inline-grid;place-items:center;min-width:18px;height:17px;margin:0 1px;padding:0 4px;font-size:10px;border:1px solid #ffffff2a;border-radius:5px;background:#2a1010;color:#fff;font-style:normal;font-weight:800}

.poke-side{grid-area:side;display:flex;flex-direction:column;gap:12px;min-width:0;min-height:0;overflow-y:auto;padding-right:2px;scrollbar-width:thin;scrollbar-color:#ffffff22 transparent}
.poke-side>*{flex-shrink:0}
.poke-title .eyebrow{margin:0}
.poke-title h1{margin:0;font-family:"Black Han Sans",sans-serif;font-size:28px;font-weight:400;color:#ff6b5a;letter-spacing:1px}
.poke-card{display:flex;flex-direction:column;gap:8px;padding:14px 16px;border:1px solid #ffffff14;border-radius:20px;background:#1b0b0be6;box-shadow:0 10px 28px #0005;color:#f6e3de}
.card-head{display:flex;justify-content:space-between;align-items:center;gap:8px;font-size:14px;white-space:nowrap}
.card-head small{color:#b9958d}
.me-row{display:flex;justify-content:space-between;gap:8px;font-size:14px;flex-wrap:wrap}
.me-row.small{font-size:12px;color:#d6b5ad}
.place-name{font-weight:900;color:#ffe2a0}
.hint{margin:0;font-size:12px;line-height:1.55;color:#d6b5ad}
.hint b{color:#fff}
.side-actions{display:flex;gap:6px;flex-wrap:wrap}
.speed-row{display:flex;align-items:center;gap:8px;font-size:12px;color:#f6e3de}
.speed-row label{font-weight:800;white-space:nowrap}
.speed-row input[type=range]{flex:1;min-width:0;accent-color:#ff6b5a;cursor:pointer}
.speed-row input[type=number]{width:58px;padding:4px 8px;border:1px solid #ffffff14;border-radius:999px;background:#0d0505;color:#fff;font-size:13px;font-weight:800}
.online{display:flex;flex-direction:column;gap:4px;max-height:150px;overflow:auto}
.online button{display:flex;justify-content:space-between;gap:6px;padding:6px 12px;border:1px solid #ffffff10;border-radius:999px;background:#2a1010;color:#f6e3de;font-size:12px;cursor:pointer;text-align:left}
.online button small{color:#b9958d}
.online button.me{border-color:#ff6b5a77}
.scope{display:flex;gap:3px}
.scope button{padding:3px 10px;white-space:nowrap;border:1px solid #ffffff14;border-radius:999px;background:transparent;color:#e0c2bb;font-size:11px;cursor:pointer}
.scope button.on{background:#ff6b5a;color:#fff;border-color:#ff6b5a}
.chat-log{display:flex;flex-direction:column;gap:4px;height:230px;scrollbar-width:thin;scrollbar-color:#ffffff22 transparent;overflow-y:auto;font-size:14.5px;line-height:1.45;word-break:break-all}
.chat-log p{margin:0}
.chat-log b{color:#ffe2a0}
.chat-log .sys{padding:4px 8px;border-radius:8px;background:#ffffff0d;color:#ffe9c9}
.chat-log .sys b{color:#8fc7ff}
.chat-log .notice{padding:5px 8px;border-radius:8px;background:#ffcf4024;border:1px solid #ffcf4066;color:#fff3c4}
.chat-log .notice b::before{content:"📢 [공지] ";color:#ffcf40;font-weight:800}
.poke-notice{position:absolute;left:12px;right:12px;top:12px;z-index:5;padding:12px 16px;border-radius:12px;background:#1a0f00e6;border:2px solid #ffcf40;color:#fff3c4;font-size:15.3px;font-weight:700;line-height:1.4;text-align:center;box-shadow:0 6px 24px #0008;word-break:keep-all}
.poke-notice b{color:#ffcf40;margin-right:6px}
.chat-log img{display:block;max-width:180px;max-height:140px;margin-top:3px;border-radius:8px;cursor:zoom-in}
.chat-form{display:flex;gap:6px}
.chat-form input{flex:1;min-width:0;padding:10px 14px;font-size:13px;border:1px solid #ffffff14;border-radius:999px;background:#0d0505;color:#fff}
.chat-form input{width:100%;box-sizing:border-box}
/* 사진을 끌고 오면 채팅 칸이 밝아진다 */
.chat-card{position:relative}
.chat-card.drop-on{outline:2px dashed #ffcf40;outline-offset:-4px;background:#2a1a08e6}
.chat-card.drop-on::after{content:"📷 놓으면 사진을 보냅니다";position:absolute;inset:auto 12px 56px 12px;padding:10px;border-radius:10px;background:#000c;color:#ffe9a0;font-size:13px;font-weight:800;text-align:center;pointer-events:none}
.poke-credit{margin:0;color:#9a7b73;font-size:11px;line-height:1.5}
.photo-view{position:fixed;inset:0;z-index:50;display:flex;align-items:center;justify-content:center;background:#000c;cursor:zoom-out}
.photo-view img{max-width:92vw;max-height:92vh;border-radius:10px}

@media (max-width:1280px){
  .poke-shell{height:auto;min-height:100vh;overflow:visible}
  .poke-main{grid-template-rows:none;flex:none}
  .poke-side{overflow:visible}
  /* 가운데가 좁으면 채팅은 오른쪽 맨 위로(여전히 내리지 않아도 보인다) */
  .poke-main{grid-template-columns:minmax(0,1fr) 340px;grid-template-areas:"stage chat" "stage side"}
  .poke-chat .chat-card{height:340px;flex:none}
}
@media (max-width:960px){
  .poke-main{grid-template-columns:1fr;grid-template-areas:"stage" "chat" "side";padding:8px 8px 30px}
  .poke-stage-wrap{justify-content:flex-start}
  .poke-chat .chat-card{height:300px}
  .poke-stage{width:100%;border-width:6px}
  .poke-keys{display:none}
}
.party-box{display:flex;flex-direction:column;gap:6px;margin-bottom:8px;font-size:12px;color:#f6e3de}
.party-box>small{color:#b9958d;line-height:1.5}
.party-row{padding:8px 12px;border:1px solid #ffffff10;border-radius:14px;background:#2a1010}
.party-row small{color:#b9958d}
.party-row div{display:flex;flex-wrap:wrap;gap:4px;margin-top:4px}
.pouch-mon{padding:2px 6px;border-radius:6px;background:#ffffff12}
.pouch-mon em{font-style:normal;color:#ffb347}
/* 칭호 · 마법의 주머니 */
.title-ico{height:18px;width:auto;vertical-align:-4px;margin-right:4px}
.title-row{align-items:center}
.my-title{display:flex;align-items:center;gap:4px;font-size:12px;color:#d6b5ad}
.my-title .title-ico{height:24px}
/* 주머니 창은 게임 화면 오른쪽 바깥에 붙는다(게임 화면은 움직이지 않는다) */
.poke-stage-row{position:relative;display:flex;justify-content:center;width:100%}
.magic-panel{position:absolute;top:0;bottom:0;left:calc(50% + min(50%, 320px, (100vh - 230px) * 80 / 144) + 12px);width:240px;box-sizing:border-box;z-index:4;display:flex;flex-direction:column;gap:6px;max-height:calc(100vh - 230px);padding:12px;border:4px double #282018;border-radius:18px;background:#fbf8ee;color:#16120a;font-family:"Noto Sans KR",sans-serif;box-shadow:0 18px 40px #0008}
.magic-panel[hidden]{display:none}
.magic-head{display:flex;flex-direction:column;gap:2px;padding-bottom:6px;border-bottom:2px solid #28201833;font-size:16px;color:#16120a;white-space:nowrap}
.magic-head small{font-size:12px;color:#6a5f48}
.magic-tabs{display:flex;gap:4px}
.magic-tabs button{flex:1;padding:6px 2px;white-space:nowrap;border:2px solid #282018;border-radius:7px;background:#fff;color:#16120a;font-size:11px;font-weight:900;cursor:pointer}
.magic-tabs button.on{background:#ffe38a}
.magic-list{flex:1;min-height:60px;overflow:auto;display:flex;flex-direction:column;gap:4px}
.magic-row{border:2px solid #28201833;border-radius:8px;background:#fff}
.magic-row.sel{border-color:#282018;background:#fff6d2}
.magic-item{display:flex;justify-content:space-between;gap:6px;width:100%;padding:8px 10px;border:0;background:none;color:#16120a;font-size:14px;white-space:nowrap;font-weight:800;cursor:pointer;text-align:left}
.magic-act{display:flex;gap:6px;padding:0 8px 8px}
.magic-act input{width:64px;min-width:0;padding:4px 6px;border:2px solid #28201855;border-radius:6px;font-size:13px}
.poke-primary.small{flex:1;padding:6px 10px;font-size:14px}
.magic-empty{color:#6a5f48}
.magic-note{margin:0;font-size:11px;line-height:1.4;color:#6a5f48}
.magic-card{display:flex;flex-wrap:wrap;gap:4px;font-size:12px}
.magic-card:empty{display:none}
@media (max-width:960px){
  .poke-stage-row{flex-direction:column;align-items:stretch;gap:8px}
  .magic-panel{position:static;width:auto;max-height:260px}
}
.title-ico.small{height:13px;vertical-align:-1px}
.my-title .title-ico.small{height:17px}

/* 인기도 칭호 · 보상 안내(오른쪽 기둥, 원작 안내 아래) */
.fame-guide{display:flex;flex-direction:column;gap:8px}
.fame-guide .fg-lead,.fame-guide .fg-note{margin:0;color:#c9b8b0;font-size:12px;line-height:1.6}
.fame-guide .fg-lead i{display:inline-grid;place-items:center;min-width:18px;height:18px;padding:0 4px;border:1px solid #ffffff22;border-radius:5px;font-style:normal;font-size:11px}
.fg-tiers{display:flex;flex-direction:column;gap:6px;margin:2px 0 0;padding:0;list-style:none}
.fg-tiers li{display:grid;grid-template-columns:44px 1fr;align-items:center;gap:10px;padding:7px 10px;border:1px solid #ffffff12;border-radius:14px;background:#ffffff08}
.fg-tiers img{width:44px;height:30px;object-fit:contain;filter:drop-shadow(0 2px 4px #0008)}
.fg-tiers b{display:inline-block;margin-right:6px;color:#fff;font-size:13px}
.fg-tiers small{color:#ffb38a;font-size:11.5px;font-weight:700}
.fg-tiers span{display:block;margin-top:2px;color:#d9cdc7;font-size:12px;line-height:1.5}
.fg-tiers li.skull{background:#ffffff04;border-style:dashed}
.fg-items{display:grid;grid-template-columns:1fr;gap:4px;margin:2px 0 0}
.fg-items div{display:grid;grid-template-columns:76px 1fr;gap:8px;font-size:12px}
.fg-items dt{color:#fff;font-weight:700;white-space:nowrap}
.fg-items dd{margin:0;color:#c9b8b0}

/* 채팅 줄 앞 [지역] · [전체] 표시, 공지 글자는 10% 작게 */
.chat-log .sc{margin-right:5px;font-style:normal;font-size:11px;font-weight:800;white-space:nowrap}
.chat-log .sc.map{color:#8fd19e}.chat-log .sc.all{color:#8fc7ff}
.chat-log .notice{font-size:90%}

/* 제목 아래 저장 안내(로그인: 자동 저장 · 게스트: 저장 안 됨) */
.poke-title .save-note{margin:6px 0 0;padding:7px 10px;border:1px solid #ffffff14;border-radius:12px;background:#ffffff08;color:#d9cdc7;font-size:12px;line-height:1.55}
.poke-title .save-note.guest{border-color:#ffc53d55;background:#ffc53d14;color:#ffe3a3}

/* 인기도 칭호 · 보상: 오른쪽 맨 끝 기둥(넷째 칸)으로 — 휠 없이 다 보이게. 채팅 · 오른쪽 정보 기둥을 조금 좁혀 자리를 낸다 */
.poke-main{grid-template-columns:250px minmax(0,1fr) 310px 290px;grid-template-areas:"chat stage side guide";gap:14px;max-width:1900px}
.fame-guide{grid-area:guide;align-self:stretch;min-height:0;overflow-y:auto;scrollbar-width:thin;gap:6px;padding:12px 12px 10px}
.fame-guide .fg-lead,.fame-guide .fg-note{font-size:11.5px;line-height:1.5}
.fg-tiers{gap:4px}
.fg-tiers li{grid-template-columns:34px 1fr;gap:8px;padding:5px 8px;border-radius:12px}
.fg-tiers img{width:34px;height:24px}
.fg-tiers b{font-size:12.5px}.fg-tiers small{font-size:11px}
.fg-tiers span{font-size:11.5px;line-height:1.4}
@media (max-width:1280px){
  .poke-main{grid-template-columns:minmax(0,1fr) 340px;grid-template-areas:"stage chat" "stage side" "stage guide"}
  .fame-guide{overflow:visible}
}
@media (max-width:960px){
  .poke-main{grid-template-columns:1fr;grid-template-areas:"stage" "chat" "side" "guide"}
}

/* 키 설명: 한 줄로 길게 늘어놓지 않고 2칸 × 5줄 표로(게임 화면 폭에 맞춘다). 제목은 위 한 줄 */
.poke-keys{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px 18px;justify-content:stretch;align-items:center;
  width:min(100%,640px,calc((100vh - 290px) * 160 / 144));box-sizing:border-box;padding:8px 14px;font-size:11.5px;line-height:1.35}
@supports (height:100dvh){.poke-keys{width:min(100%,640px,calc((100dvh - 290px) * 160 / 144))}}
.poke-keys>b{grid-column:1 / -1;font-size:12px;margin-bottom:1px}
.poke-keys>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
/* 키 표가 두 줄 → 다섯 줄이 된 만큼 게임 화면을 조금 줄인다(휠 없이 한 화면) */
.poke-stage{width:min(100%,640px,calc((100vh - 290px) * 160 / 144))}
@supports (height:100dvh){.poke-stage{width:min(100%,640px,calc((100dvh - 290px) * 160 / 144))}}
/* 휴대폰 · 태블릿(960px 이하)에는 키보드가 없다 — 키 설명 표는 숨긴다(위의 2칸 표 규칙보다 뒤에 둔다) */
@media (max-width:960px){.poke-keys{display:none!important}}
