/* 어디서도 12px 보다 작은 글씨는 쓰지 않는다: <small> 의 기본 크기(약 10px)를 12px 로 */
small { font-size: 12px; }
/* 쥬라기 탐험대 — 기본 스타일 (Phase 0: index.html 에서 그대로 옮김) */

    /* 시간·날씨에 따라 터미널 배경 분위기가 바뀐다 (body에 night / storm / blackout 클래스가 붙음) */
    :root { --bg: #0f1a12; --panel: #162619; --panel2: #122015; --panel3: #1a2e1f; --line: #2f5238; }
    body.storm { --bg: #0d1114; --panel: #161c21; --panel2: #12171b; --panel3: #1b232a; --line: #33434f; }
    body.night { --bg: #060914; --panel: #0d1224; --panel2: #090d1b; --panel3: #111833; --line: #26325c; }
    body.night.storm { --bg: #05070f; --panel: #0b0f1d; --panel2: #080b16; --panel3: #0e1429; --line: #2a3350; }
    body.blackout, body.night.blackout, body.storm.blackout, body.night.storm.blackout { --bg: #040404; --panel: #0b0707; --panel2: #070404; --panel3: #120a0a; --line: #3f1c1c; }
    /* 낮↔밤·날씨가 바뀌면 화면 색이 4초 동안 천천히 물듦 (정전은 순식간에 꺼짐) */
    body, header, footer, #hud, #quick, #hudToggle, .chip.static, #minimap div { transition: background-color 4s ease, border-color 4s ease; }
    body.blackout, body.blackout header, body.blackout footer, body.blackout #hud, body.blackout #quick, body.blackout #hudToggle, body.blackout .chip.static, body.blackout #minimap div { transition-duration: .25s; }
    /* 밤 장막: 화면 전체에 푸른 어스름이 천천히 내려앉음 */
    #wxNight { position: fixed; inset: 0; pointer-events: none; z-index: 40; opacity: 0; transition: opacity 4s ease;
      background: radial-gradient(ellipse at 50% 0%, rgba(40,60,140,.10), rgba(5,8,25,.28) 70%); }
    body.night #wxNight { opacity: 1; }
    /* 비: 사선 빗줄기 (폭풍우는 더 굵고 빠르게) */
    #wxRain { position: fixed; inset: -60px 0 0; pointer-events: none; z-index: 41; opacity: 0; transition: opacity 3s ease;
      background-image:
        repeating-linear-gradient(105deg, transparent 0 22px, rgba(170,210,255,.22) 22px 23px, transparent 23px 61px),
        repeating-linear-gradient(105deg, transparent 0 37px, rgba(170,210,255,.14) 37px 38px, transparent 38px 89px);
      background-size: 100% 140px, 100% 210px; animation: rainFall .55s linear infinite; }
    body.rain #wxRain { opacity: .55; }
    body.storm #wxRain { opacity: .9; animation-duration: .32s; filter: brightness(1.2); }
    @keyframes rainFall { from { background-position: 0 0, 0 0; } to { background-position: -38px 140px, -57px 210px; } }
    /* 번개: 하얗게 두 번 번쩍 + 살짝 흔들림 */
    #wxFlash { position: fixed; inset: 0; pointer-events: none; z-index: 42; opacity: 0; background: #eef4ff; }
    #wxFlash.go { animation: flash .9s ease-out; }
    @keyframes flash { 0% { opacity: 0; } 6% { opacity: .75; } 14% { opacity: .1; } 22% { opacity: .55; } 100% { opacity: 0; } }
    body.shake { animation: shake .45s ease-out; }
    @keyframes shake { 0%,100% { transform: none; } 20% { transform: translate(-3px, 1px); } 40% { transform: translate(3px, -1px); } 60% { transform: translate(-2px, 0); } 80% { transform: translate(1px, 0); } }
    @media (prefers-reduced-motion: reduce) { #wxRain { animation: none; } #wxFlash.go { animation-duration: .4s; } body.shake { animation: none; } }
  

    body {
      margin: 0;
      background: var(--bg);
      color: #6df29a;
      font-family: "Courier New", monospace;
      display: flex;
      flex-direction: column;
      height: 100vh;
      height: 100dvh; /* 모바일 주소창·키보드를 뺀 실제 보이는 높이 */
      overflow: hidden;
    }
    #log { min-height: 0; }
    footer { flex-shrink: 0; }
    #cmdInput { font-size: 16px; min-width: 0; } /* 16px 미만이면 iOS가 확대함 */
    header {
      padding: 10px 14px;
      background: var(--panel);
      border-bottom: 1px solid var(--line);
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }
    /* 확인 창 (환영·돌아가기) */
    .mudDlg { max-width: min(380px, calc(100vw - 32px)); padding: 20px 20px 16px; background: var(--panel); color: #cfe9d6; border: 1px solid #356343; border-radius: 10px; font-family: inherit; box-shadow: 0 10px 40px rgba(0,0,0,.6); }
    .mudDlg::backdrop { background: rgba(0,0,0,.65); }
    .mudDlg h2 { margin: 0 0 10px; font-size: 17px; color: #C6F24E; }
    .mudDlg p { margin: 0 0 12px; font-size: 14px; line-height: 1.6; }
    .mudDlg p b { color: #ffd43b; }
    .mudDlg input { width: 100%; box-sizing: border-box; font-size: 16px; padding: 8px 10px; }
    .mudDlg form { margin: 0; }
    .mudDlg { overflow: hidden; }
    .mudDlg .dlgErr { min-height: 1.2em; margin: 6px 0 4px; font-size: 12px; color: #ff8a80; }
    .mudDlg .dlgPriv { margin: 0 0 6px; font-size: 12px; color: #8fb09b; line-height: 1.5; }
    .mudDlg .dlgPriv a { color: #C6F24E; }
    .dlgBtns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }
    .dlgBtns button { min-width: 72px; padding: 8px 14px; border-radius: 6px; }
    .dlgBtns button:not(.ghost) { background: #2f6b3f; color: #fff; border-color: #6df29a; }
    .dlgBtns .ghost { background: transparent; color: #8fb09b; }
    /* 가입·로그인 창: 글씨는 9pt(12px)보다 작아지지 않게 */
    #welcomeDlg, #welcomeDlg * { font-size: max(12px, 1em); }
    #welcomeDlg small, #welcomeDlg .dlgErr, #welcomeDlg #acHelp { font-size: 12px; }
    .acTabs { display: flex; gap: 6px; margin: 0 0 10px; }
    .acTabs button { flex: 1; padding: 7px 0; border-radius: 6px; background: transparent; color: #8fb09b; }
    .acTabs button.on { background: #2f6b3f; color: #fff; border-color: #6df29a; }
    #welcomeForm input { margin-bottom: 8px; }
    #welcomeForm #acHelp { font-size: 13px; color: #a9c7b3; margin-bottom: 10px; }
    #acctBtn { white-space: nowrap; }
    #nameInput.justSet { outline: 2px solid #C6F24E; box-shadow: 0 0 12px rgba(198,242,78,.6); transition: outline .3s, box-shadow .3s; }
    /* 홈으로 가기 */
    .homeBtn { color: #8fd9a8; text-decoration: none; border: 1px solid #356343; padding: 5px 10px; border-radius: 6px; font-size: 12px; white-space: nowrap; }
    .homeBtn:hover, .homeBtn:focus-visible { color: #C6F24E; border-color: #6df29a; outline: none; }
    input, button {
      background: var(--bg);
      color: #6df29a;
      border: 1px solid #356343;
      padding: 6px 10px;
      font-family: inherit;
    }
    button {
      cursor: pointer;
      background: #183020;
    }
    button:hover {
      background: #23472f;
    }
    #log {
      flex: 1;
      overflow-y: auto;
      padding: 14px;
      white-space: pre-wrap;
      line-height: 1.45;
    }
    .room { color: #9cf7ba; }
    .spacer { height: 1.1em; }
    .radio { color: #ffd166; }
    .say { color: #9bd7ff; }   /* 같은 방 대화 */
    .combat { color: #ff9f43; }
    .danger { color: #ff595e; }
    .warn { color: #adb5bd; }
    footer {
      padding: 10px 14px;
      background: var(--panel);
      border-top: 1px solid var(--line);
      display: flex;
      gap: 8px;
    }
    #cmdInput {
      flex: 1;
    }
    #quick {
      flex-shrink: 0;
      display: grid;
      grid-template-columns: repeat(5, 1fr);
      gap: 6px;
      padding: 8px 14px;
      background: var(--panel2);
      border-top: 1px solid var(--line);
    }
    #quick button {
      padding: 10px 0;
      font-size: 15px;
      touch-action: manipulation;
      user-select: none;
    }
    #hud {
      flex-shrink: 0;
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 8px 14px;
      background: var(--panel2);
      border-bottom: 1px solid var(--line);
    }
    #hud[hidden] { display: none; }
    #hudInfo { flex: 1; min-width: 0; font-size: 12px; }
    #hudRoom { color: #9cf7ba; font-weight: bold; margin-bottom: 4px; }
    #hpWrap { position: relative; height: 18px; background: #1a2a20; border: 1px solid #356343; }
    #hpBar { height: 100%; width: 100%; background: #2fa85a; transition: width .3s, background .3s; }
    #hpText { position: absolute; inset: 0; text-align: center; font-size: 12px; line-height: 18px; color: #fff; text-shadow: 0 0 3px #000; }
    #hudKits { margin-top: 4px; color: #7fe8e8; }
    #hudHint { margin-top: 4px; color: #ffd166; min-height: 1.2em; }
    #hudHint.danger { color: #ff7b7b; font-weight: bold; }
    #hudHint.calm { color: #8fe3a8; }
    #hudGear { margin-top: 4px; color: #c9d8ff; }
    #hudLv { margin-top: 5px; font-size: 12px; }
    #lvText { font-weight: bold; }
    #lvText.t-gray { color: #b6c4bb; } #lvText.t-green { color: #6df29a; } #lvText.t-blue { color: #6db8ff; }
    #lvText.t-purple { color: #c99bff; } #lvText.t-gold { color: #ffd166; }
    #lvText.t-legend { background: linear-gradient(90deg, #ffd166, #ff9f43, #ff6fae, #ffd166); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: legendShine 3s linear infinite; }
    @keyframes legendShine { to { background-position: 200% 0; } }
    #xpWrap { height: 6px; background: #1a2a20; border: 1px solid #356343; border-radius: 3px; margin-top: 3px; overflow: hidden; }
    #xpBar { height: 100%; width: 0; background: linear-gradient(90deg, #6db8ff, #c99bff); transition: width .4s; }
    .levelup { color: #ffd166; font-weight: bold; }
    #hudSkill { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
    #hudSkill[hidden] { display: none; }
    #hudSkill button { font: inherit; font-size: 12px; cursor: pointer; border-radius: 4px; padding: 2px 7px; }
    #hudSkill .skInfo { background: transparent; border: 1px dashed #4b6a57; color: #c9b8ff; }
    #hudSkill .skAct { background: #1f3527; border: 1px solid #4f9a68; color: #d8ffe4; }
    #hudSkill .skAct.on { background: #3b3410; border-color: #ffd166; color: #ffd166; }
    #hudSkill .skAct:disabled { opacity: .55; cursor: default; }
    #hudStatus { margin-top: 4px; color: #ff7b7b; font-weight: bold; min-height: 0; }
    #hud { flex-wrap: wrap; }
    #hudChips { flex-basis: 100%; }
    .chipTitle { font-size: 12px; color: #9cf7ba; margin: 2px 0; }
    .chipTitle small { color: #6a8f77; }
    .bagToggle { display: block; width: 100%; text-align: left; background: none; border: 0; padding: 3px 0; font: inherit; font-size: 12px; cursor: pointer; }
    .bagToggle:hover #bagArrow { color: #ffd166; }
    #bagArrow { float: right; color: #6a8f77; }
    #bagBox { position: relative; }
    /* 가방 목록은 패널 안을 늘리지 않고, 가방 줄 위로 떠오르는 작은 창으로 펼친다(그래서 패널에 스크롤바가 생기지 않는다) */
    #bagChips { position: absolute; left: 0; right: 0; bottom: 100%; margin: 0 0 3px; padding: 6px; max-height: 230px; overflow-y: auto; z-index: 30; background: var(--panel); border: 1px solid #356343; border-radius: 6px; box-shadow: 0 -6px 18px rgba(0,0,0,.55); }
    .chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; max-height: 116px; overflow-y: auto; }
    .chip { font-size: 12px; padding: 3px 7px; border-radius: 4px; line-height: 1.3; cursor: pointer; }
    .chip.static { cursor: default; background: var(--panel); color: #8fb09b; border-color: var(--line); }
    .chip.eq { background: #5a4a10; border-color: #ffd166; color: #ffd166; }
    .chip.ground { background: #20302a; border-color: #4a8a6a; }
    [hidden] { display: none !important; }
    #hudToggle, #quickMore { display: none; }
    /* 모바일·태블릿: 상태·지도와 버튼을 접었다 펼 수 있게 */
    @media (max-width: 899px) {
      #hudToggle {
        display: flex; justify-content: space-between; align-items: center; flex-basis: 100%;
        width: 100%; text-align: left; padding: 6px 10px; font-size: 13px; background: var(--panel3);
      }
      #hudSummary { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
      #hudArrow { margin-left: 8px; color: #9cf7ba; }
      #hud.collapsed { padding-top: 6px; padding-bottom: 6px; }
      #hud.collapsed > *:not(#hudToggle) { display: none; }
      #quick { grid-template-columns: repeat(6, 1fr); gap: 5px; padding: 6px 10px; }
      #quick button { padding: 9px 0; font-size: 12px; }
      #quickMore { display: block; }
      #quick:not(.collapsed) { grid-template-columns: repeat(5, 1fr); }
      #quick:not(.collapsed) button { font-size: 13px; }
      #quick:not(.collapsed) #quickMore { grid-column: 1 / -1; padding: 4px 0; }
      #quick.collapsed button:not([data-cmd="북"]):not([data-cmd="남"]):not([data-cmd="서"]):not([data-cmd="동"]):not([data-cmd="공격"]):not(#quickMore):not(#chatOpen) { display: none; }
    }
    @media (max-width: 520px) {
      .chipTitle small { display: none; }
      #hudRoom { font-size: 12px; }
      #hudInfo { font-size: 12px; }
      #hudInfo div { margin-top: 2px; }
      .chips { max-height: 76px; }
    }
    .chip.empty { cursor: default; background: none; border: none; color: #6a8f77; padding-left: 0; }
    #minimap {
      display: grid;
      flex-shrink: 0;
    }
    #envText { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #14232b; color: #9fd4ff; }
    #envText:empty { display: none; }
    #envText.storm { background: #2a2a40; color: #c9c9ff; }
    #envText.night { background: #1a1a33; color: #b5b5ff; }
    #envText.blackout { background: #3a1414; color: #ffb0b0; font-weight: bold; }
    #minimap .sw { color: #ffd166; font-size: 12px; }
    #mapBox { flex-shrink: 0; display: flex; flex-direction: column; align-items: center; }
    #mapZone { font-size: 12px; color: #9cf7ba; margin-bottom: 4px; white-space: nowrap; }
    #mapDoors { font-size: 12px; color: #EF9F27; margin-top: 8px; text-align: center; max-width: 100%; }
    #mapDoors:empty { display: none; }
    #minimap div { padding: 0; white-space: nowrap; position: relative; }
    #minimap i.door { position: absolute; color: #EF9F27; font-size: 12px; line-height: 1; font-style: normal; pointer-events: none; }
    #minimap i.door.n { top: -8px; left: 50%; transform: translateX(-50%); }
    #minimap i.door.s { bottom: -8px; left: 50%; transform: translateX(-50%); }
    #minimap i.door.w { left: -7px; top: 50%; transform: translateY(-50%); }
    #minimap i.door.e { right: -7px; top: 50%; transform: translateY(-50%); }
    #minimap .link { background: #356343; border: none; border-radius: 0; }
    #minimap .link.h { align-self: center; height: 3px; }
    #minimap .link.v { justify-self: center; width: 3px; }
    #minimap div { font-size: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid #2a4a35; background: var(--panel); color: #6a8f77; border-radius: 3px; line-height: 1.1; }
    #minimap .me { background: #1f5a34; color: #fff; border-color: #6df29a; font-weight: bold; }
    #minimap .near { border-color: #ff9f43; }
    #minimap .here { border-color: #ff595e; background: #4a1a1c; }
    #minimap .empty { border: none; background: none; }
    #quick button:disabled { opacity: .35; cursor: default; }
    #radioToggle .rl { display: none; font-size: 14px; }
    #radioToggle { font-size: 18px; padding: 4px 10px; flex-shrink: 0; }
    #radioToggle.on { background: #5a4a10; border-color: #ffd166; box-shadow: 0 0 0 1px #ffd166 inset; }
    #cmdInput.radio-mode { border-color: #ffd166; color: #ffd166; }
    /* PC(넓은 화면): 왼쪽 로그·입력, 오른쪽 사이드바(상태·지도·버튼) */
    @media (min-width: 900px) {
      /* 왼쪽(로그+입력줄)과 오른쪽(상태·지도+버튼)이 각자 독립 높이: 로그가 입력줄 바로 위까지 꽉 참 */
      body { display: grid; grid-template-columns: 1fr 460px; grid-template-rows: auto minmax(0, 1fr); }
      header { grid-column: 1 / -1; }
      body > #left { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; min-height: 0; min-width: 0; }
      body > #right { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; justify-content: flex-end; min-height: 0; border-left: 1px solid var(--line); }
      #log { font-size: 12px; }
      footer { align-items: center; }
      #radioToggle .rl { display: inline; }
      #radioToggle { padding: 6px 12px; }
      #hud {
        flex: 1 1 auto; min-height: 0; flex-direction: column; align-items: stretch;
        flex-wrap: nowrap; justify-content: flex-start; gap: 12px; padding: 16px; overflow-y: auto;
        border-bottom: none;
      }
      #hudInfo { flex: none; font-size: 12px; }
      #hudRoom { font-size: 12px; margin-bottom: 8px; }
      #hpWrap { height: 22px; }
      #hpText { line-height: 22px; font-size: 12px; }
      #mapBox { align-self: center; }
      /* PC 지도 글씨: 굴림체 9pt(=12px) 고정 */
      #minimap, #minimap div, #minimap span { font-family: "GulimChe", "굴림체", "Gulim", "굴림", monospace; font-size: 12px; font-weight: normal; -webkit-font-smoothing: auto; }
      #quick {
        flex: 0 0 auto; grid-template-columns: repeat(5, 1fr);
        padding: 10px 16px;
      }
      #quick button { font-size: 12px; padding: 14px 0; }
    }
    #quick .dir { background: #1b3a26; }
    #quick .atk { background: #4a2a14; color: #ff9f43; border-color: #7a4a24; }
    #quick .flee { background: #4a1a1c; color: #ff8c90; border-color: #7a2a2e; }
    #quick .run.on { background: #3a3510; color: #ffe27a; border-color: #8a7a22; box-shadow: 0 0 0 1px #8a7a22 inset; }
    #quick .heal { background: #1a3a3a; color: #7fe8e8; border-color: #2a6a6a; }

    /* ===== 모바일·공통 개편 (모바일 Zero-Typing, 슬림 헤더, 시트) ===== */
    #left, #right, #hdrFull { display: contents; }
    #ctx, #slimBar, .menuOnly, #chatOpen, #chatClose { display: none; }
    #radioBadge { display: none; font-size: 12px; font-weight: bold; color: #1b1500; background: #ffd166; border-radius: 4px; padding: 4px 6px; flex-shrink: 0; }
    #radioBadge.on { display: inline-block; }
    #soundBtn, #bgmBtn { padding: 4px 9px; }
    #acctBtn .nm { display: inline-block; max-width: 9em; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; }
    #minimap div.adj { cursor: pointer; border-color: #9cf7ba; box-shadow: 0 0 0 1px #9cf7ba inset; }
    #minimap div.adj:hover { background: #1f5a34; color: #fff; }
    #mapBox.blind #minimap { filter: blur(6px); pointer-events: none; }
    #mapBox.blind #mapDoors { visibility: hidden; }
    /* 바텀시트 (가방·제작·도감) */
    #sheetWrap { position: fixed; inset: 0; z-index: 70; }
    #sheetBack { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
    #sheet { position: absolute; left: 0; right: 0; bottom: 0; max-height: 82vh; max-height: 82dvh; display: flex; flex-direction: column;
      background: var(--panel); border-top: 2px solid #356343; border-radius: 14px 14px 0 0; box-shadow: 0 -10px 30px rgba(0,0,0,.6); }
    @media (min-width: 900px) { #sheet { left: 50%; right: auto; width: 520px; margin-left: -260px; } }
    #sheetHead { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); color: #9cf7ba; font-size: 12px; }
    #sheetClose { min-width: 44px; min-height: 40px; font-size: 16px; }
    #sheetBody { overflow-y: auto; padding: 10px 14px 18px; font-size: 12px; }
    .shRow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
    .shRow .tx { flex: 1; min-width: 0; line-height: 1.35; }
    .shRow .tx small { display: block; color: #8fb09b; font-size: 12px; }
    .shRow .tx small .ok { color: #8fe3a8; } .shRow .tx small .no { color: #ff9a8a; }
    .shRow button, .shBtn { min-height: 44px; min-width: 56px; font-size: 12px; border-radius: 6px; }
    .shRow button.drop { background: #3a1a1c; color: #ff8c90; border-color: #7a2a2e; }
    .shTier { margin: 12px 0 6px; color: #ffd166; font-size: 12px; }
    .shChips { display: flex; flex-wrap: wrap; gap: 6px; }
    .shChips button { min-height: 44px; padding: 6px 12px; font-size: 12px; }
    .shChips button:disabled { opacity: .4; }
    /* 제작창 카드 */
    .craftBar { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; position: sticky; top: -10px; z-index: 2; background: var(--panel); padding: 4px 0 6px; margin-bottom: 2px; }
    .craftBar .shNote { margin: 0; flex: 1 1 180px; }
    .craftFilter { min-height: 36px; padding: 4px 12px; font-size: 12px; border-radius: 18px; }
    .craftFilter.on { background: #1f5a34; border-color: #9cf7ba; color: #fff; }
    .craftGrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 6px; }
    .craftCard { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 6px 9px; min-height: 44px; border-radius: 8px; font-size: 12px; line-height: 1.3; background: var(--panel2); border: 1px solid var(--line); color: #cfe9d6; }
    .craftCard .t1 { display: flex; width: 100%; justify-content: space-between; gap: 6px; font-weight: bold; }
    .craftCard .bd { flex: none; color: #ffd166; font-weight: normal; }
    .craftCard small { color: #8fb09b; font-size: 12px; }
    .craftCard small .ok { color: #8fe3a8; } .craftCard small .no { color: #ff9a8a; }
    .craftCard.can { border-color: #4a8a6a; background: #1b2f26; cursor: pointer; }
    .craftCard.can .bd { color: #9cf7ba; }
    .craftCard:disabled { opacity: .62; cursor: default; }
    .shNote { color: #8fb09b; font-size: 12px; line-height: 1.5; margin: 6px 0; }
    .shCard { white-space: pre-wrap; line-height: 1.5; font-size: 12px; color: #cfe9d6; margin: 8px 0; }
    /* 3-5 PC 헤더: 1000px 부근에서도 한 줄 (로그아웃 글자·등록 인원은 좁을 때 숨김) */
    #statusText, #onlineText, #envText { white-space: nowrap; }
    @media (min-width: 900px) {
      header { padding: 8px 12px; gap: 6px 10px; }
      header strong { white-space: nowrap; }
    }
    @media (min-width: 900px) and (max-width: 1199px) { #acctBtn .lo { display: none; } #nameInput { width: 100px; } }
    @media (min-width: 900px) and (max-width: 1099px) { #onlineText .reg { display: none; } header strong { display: none; } }
    /* 모바일 */
    @media (max-width: 899px) {
      #hud { order: 10; } #log { order: 20; } #ctx { order: 30; } #quick { order: 40; } footer { order: 50; }
      /* 1-2 상황 맞춤 칩 바 */
      #ctx:not([hidden]) { display: flex; justify-content: flex-start; gap: 6px; overflow-x: auto; scroll-padding-left: 10px; padding: 6px 10px; background: var(--panel2); border-top: 1px solid var(--line); flex-shrink: 0; scrollbar-width: none; }
      #ctx button { flex: 0 0 auto; min-height: 44px; padding: 6px 14px; font-size: 12px; white-space: nowrap; border-radius: 22px; }
      #ctx .c-atk { background: #4a2a14; color: #ff9f43; border-color: #7a4a24; }
      #ctx .c-flee { background: #4a1a1c; color: #ff8c90; border-color: #7a2a2e; }
      #ctx .c-get { background: #20302a; border-color: #4a8a6a; }
      #ctx .c-heal { background: #1a3a3a; color: #7fe8e8; border-color: #2a6a6a; }
      #ctx .c-sw { background: #5a4a10; color: #ffd166; border-color: #ffd166; }
      /* 2-4 터치 크기 */
      #quick button { min-height: 44px; white-space: nowrap; }
      #quick.collapsed { grid-template-columns: repeat(7, 1fr); gap: 4px; }
      #quick.collapsed button { font-size: 13px; padding-left: 0; padding-right: 0; }
      #quick.collapsed button:not([data-cmd="북"]):not([data-cmd="남"]):not([data-cmd="서"]):not([data-cmd="동"]):not([data-cmd="공격"]):not(#quickMore):not(#chatOpen) { display: none; }
      #chatOpen { display: block; }
      #quick:not(.collapsed) #chatOpen { grid-column: span 1; }
      /* 1-4 채팅 입력줄은 💬를 눌렀을 때만 */
      footer { display: none; align-items: center; }
      body.chatOn footer { display: flex; }
      footer input, footer button { min-height: 44px; }
      #chatClose { display: block; min-width: 44px; }
      /* 2-1 접속 후 슬림 헤더 */
      body.connected > header { padding: 0 10px; gap: 0; min-height: 48px; flex-shrink: 0; }   /* 메뉴를 열면 헤더가 길어지는데, 줄어들면 아래 [장면][지도] 줄에 가려진다 */
      body.connected #slimBar { display: flex; align-items: center; gap: 8px; flex: 1 1 100%; min-width: 0; min-height: 48px; font-size: 12px; }
      body.connected #hdrFull { display: none; }
      body.connected.menuOpen #hdrFull { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1 1 100%; padding: 4px 0 10px; }
      body.connected.menuOpen .menuOnly { display: inline-block; min-height: 44px; }
      body.connected.menuOpen #hdrFull button, body.connected.menuOpen #hdrFull .homeBtn { min-height: 44px; display: inline-flex; align-items: center; }
      #slimRoom { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #9cf7ba; font-weight: bold; }
      #slimHp { white-space: nowrap; }
      #slimEnv { white-space: nowrap; font-size: 12px; }
      #slimBar button { min-height: 44px; min-width: 44px; font-size: 18px; padding: 0 8px; }
      #slimBar button.on { background: #23472f; border-color: #6df29a; }
      /* 2-2 지도·상태는 본문을 밀어내지 않는 오버레이 */
      body.connected #hudToggle { display: none; }
      body.connected #hud { display: none; position: fixed; top: 48px; left: 0; right: 0; z-index: 45; max-height: calc(100dvh - 120px);
        overflow-y: auto; border-bottom: 2px solid #356343; box-shadow: 0 10px 24px rgba(0,0,0,.6); }
      body.connected.hudOpen #hud { display: flex; }
    }
  

/* 상단 메뉴줄 글씨는 로그와 같은 12px. 접속 중에는 [연결] 버튼을 숨긴다(끊기면 다시 나타남) */
#hdrFull, #hdrFull button, #hdrFull label, #hdrFull strong, #hdrFull span, #hdrFull .homeBtn { font-size: 12px; }
@media (pointer: fine) { #hdrFull input { font-size: 12px; } }   /* 모바일은 16px 유지(iOS 확대 방지) */
body.connected #connectBtn { display: none; }
/* 홈 버튼 = 결앤솔 로고 이미지. 글씨가 작아진 만큼 PC(마우스) 상단 버튼·입력칸 여백도 줄인다 */
@media (pointer: fine) {
  header { padding: 6px 12px; gap: 6px; }
  /* 이모지·배경색 때문에 버튼만 커 보이지 않게: 높이를 24px 로 통일하고 배경은 투명하게(마우스를 올리면 채워짐) */
  #hdrFull button, #hdrFull input { height: 28px; box-sizing: border-box; padding: 0 9px; line-height: normal; display: inline-flex; align-items: center; overflow: visible; }
  #hdrFull input { display: inline-block; }
  #hdrFull button { background: transparent; border-color: #2a4a35; }
  #hdrFull button:hover { background: #183020; border-color: #356343; }
  #hdrFull #acctBtn .nm { vertical-align: baseline; }
  #hdrFull #nameInput { width: 110px; }
}
/* 상단 로고·게임 이름: 메인 페이지(kandsol.com)의 것과 같은 글꼴·색 */
#hdrFull .homeBtn { display: inline-flex; align-items: center; height: 28px; box-sizing: border-box; gap: .14em; padding: 0 6px; border-color: transparent; background: transparent; }
#hdrFull .homeBtn .kr { font-family: 'Noto Sans KR', sans-serif; font-weight: 700; font-size: 20px; line-height: 1; letter-spacing: -.05em; color: #F4F2EC; white-space: nowrap; position: relative; top: 1px; }
#hdrFull .homeBtn .kr i { font-style: normal; display: inline-block; }
#hdrFull .homeBtn .kr i:nth-child(2) { font-size: .8em; }
#hdrFull .homeBtn:hover .kr { color: #C6F24E; }
#hdrFull .gTitle { display: inline-flex; align-items: center; height: 28px; padding-top: 1px; box-sizing: border-box; font-family: 'Jua', sans-serif; font-weight: 400; font-size: 20px; line-height: 1; color: #C6F24E; text-shadow: 0 0 14px rgba(198,242,78,.35); white-space: nowrap; }
/* 게임 버전 표시: 새 기능 하나 = 0.01 (index.html 의 gVer·tVer, 메인 페이지 jver 같이 올릴 것) */
#hdrFull .gTitle .gVer { align-self: flex-end; margin: 0 0 3px 6px; font-family: 'Space Grotesk', sans-serif; font-size: 12px; font-weight: 500; color: #9fc0a6; text-shadow: none; opacity: .85; }
#hdrFull .gTitle em { font-style: normal; color: #ffd43b; text-shadow: 0 0 12px rgba(255,212,59,.45); }

/* 상단 줄의 글씨들이 모두 같은 가운데 선에 오도록 */
#hdrFull label, #hdrFull #statusText, #hdrFull #onlineText, #hdrFull #envText { display: inline-flex; align-items: center; height: 28px; line-height: 1; }
#hdrFull label { gap: 6px; }
#hdrFull #envText { box-sizing: border-box; padding: 0 9px; }

/* PC(900px 이상): 상단 줄은 항상 한 줄. 폭풍우·정전 배지가 함께 떠도 전체화면 버튼이 아래로 밀리지 않게 간격을 줄이고 줄바꿈을 막는다 */
@media (min-width: 900px) {
  header { flex-wrap: nowrap; gap: 5px; padding: 6px 10px; }
  #hdrFull .homeBtn, #hdrFull .gTitle, #hdrFull label, #hdrFull button { flex: 0 0 auto; }
  #hdrFull #nameInput { width: 92px; }
  #hdrFull button, #hdrFull input { padding-left: 7px; padding-right: 7px; }
  #hdrFull #statusText, #hdrFull #onlineText { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  #hdrFull #envText { flex: 0 0 auto; white-space: nowrap; padding: 0 7px; font-size: 12px; }
}
/* 하단 행동 버튼: '스위치'처럼 한 단어가 두 줄로 쪼개지지 않게 */
#quick button { white-space: nowrap; }
#quick button[data-cmd="스위치"] { padding-left: 12px; padding-right: 14px; white-space: nowrap; }

/* 짧은 화면(예: 375x741): 하단 버튼 세로 패딩을 줄여 한 화면에 깔끔히 */
@media (max-width: 899px) and (max-height: 760px) {
  #quick button, #ctx button { min-height: 40px; }
  #quick { padding-top: 4px; padding-bottom: 4px; gap: 4px; }
  #ctx:not([hidden]) { padding-top: 4px; padding-bottom: 4px; }
}

/* PC: 상황 칩(빠른 이동·보급·제작·냉각 등)도 보이게 */
@media (min-width: 900px) {
  #ctx:not([hidden]) { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 12px; background: var(--panel2); border-top: 1px solid var(--line); }
  #ctx button { padding: 6px 12px; font-size: 12px; white-space: nowrap; border-radius: 16px; cursor: pointer; }
  #ctx .c-atk { background: #4a2a14; color: #ff9f43; border-color: #7a4a24; }
  #ctx .c-flee { background: #4a1a1c; color: #ff8c90; border-color: #7a2a2e; }
  #ctx .c-get { background: #20302a; border-color: #4a8a6a; }
  #ctx .c-heal { background: #1a3a3a; color: #7fe8e8; border-color: #2a6a6a; }
  #ctx .c-sw { background: #5a4a10; color: #ffd166; border-color: #ffd166; }
}
/* 12px 상향 보정: 하단 행동 버튼 좌우 여백 축소 */
#quick button { padding-left: 4px; padding-right: 4px; letter-spacing: -0.2px; }
#quick button[data-cmd="스위치"] { padding-left: 2px; padding-right: 2px; }

/* 슬롯 칩(무기·키트) */
#ctx .c-slot { background: #1c2f3a; border-color: #3d7a99; color: #cfe8f5; }
#ctx .c-slot.c-eq { background: #2d4a1f; border-color: #9be15d; color: #e4f6c8; font-weight: 700; }
#ctx .c-slot.c-empty { color: #ff9a8a; border-color: #8a3a34; }       /* 탄약이 0 */

/* 입력줄의 무전·전송 버튼은 같은 크기 */
footer #radioToggle, footer #sendBtn { box-sizing: border-box; height: 38px; width: 84px; padding: 0; font-size: 14px; line-height: 1; display: inline-flex; align-items: center; justify-content: center; gap: 4px; flex-shrink: 0; white-space: nowrap; }
footer #radioToggle .rl { font-size: 14px; }

/* 서버가 물어보는 예/아니오 창 */
#askBar { position: fixed; left: 50%; bottom: 150px; transform: translateX(-50%); z-index: 60; width: min(420px, calc(100vw - 32px)); box-sizing: border-box; padding: 12px 14px; background: var(--panel); border: 1px solid #39ff14; border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.65); color: #e8fff0; font-size: 14px; line-height: 1.45; }
#askBar .askBtns { display: flex; gap: 8px; margin-top: 10px; }
#askBar button { flex: 1 1 0; min-height: 40px; border-radius: 8px; font-size: 14px; font-weight: 700; cursor: pointer; border: 1px solid #356343; background: #1a2a20; color: #cfe9d6; }
#askBar .askYes { background: #14301c; color: #C6F24E; border-color: #3f7a4a; }

/* 계정으로 접속 중이면 닉네임 입력칸·연결 버튼은 필요 없으므로 숨긴다 */
body.connected.acctOn #hdrFull > label, body.connected.acctOn #connectBtn { display: none !important; }

/* 게임 중 배경음악 팝오버(🎵 버튼): 켜기/끄기 · 볼륨 · 곡 선택 */
.bgmPop { position: fixed; z-index: 90; width: min(300px, calc(100vw - 16px)); box-sizing: border-box; padding: 10px 12px; background: #0c1a12; border: 1px solid rgba(109,242,154,.35); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.6); color: #d4eadb; font-size: 12px; }
.bgmPop[hidden] { display: none; }
.bgmPop:not([hidden]) { animation: bgmPopIn 110ms ease-out; }      /* 열릴 때 짧게 나타나기 (닫기는 즉시) */
@keyframes bgmPopIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.bgmPopHead { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-weight: 700; color: #b9d8c2; }
.bgmPopHead button { min-height: 32px; padding: 4px 10px; font-size: 12px; border-radius: 8px; cursor: pointer; }
.bgmPopVol { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.bgmPopVol input { flex: 1; min-width: 0; accent-color: #C6F24E; }
.bgmList { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.bgmList li { display: flex; align-items: center; gap: 8px; padding: 5px 8px; font-size: 12px; color: #d4eadb; background: rgba(255,255,255,.04); border-radius: 8px; }
.bgmList li.on { background: rgba(198,242,78,.14); color: #e8ffd0; }
.bgmList .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bgmList .tg { flex: none; font-size: 12px; color: #7fa98c; }
.bgmList .tBgmPlay { flex: none; width: 30px; height: 30px; min-height: 0; padding: 0; font-size: 13px; line-height: 1; color: #C6F24E; background: #14301c; border: 1px solid #3f7a4a; border-radius: 50%; cursor: pointer; }
