/* 마이 리틀 해시 팜 — 귀여운 파스텔 (2026-10-06) */
:root { --ink: #5a4a5e; --cream: #fff8ee; --pink: #ff8a9a; --orange: #f7931a; --green: #3ec27a; --line: #e8d8cc; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #cfe8b8; color: var(--ink); font-family: 'Noto Sans KR', sans-serif; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
#game { position: fixed; inset: 0; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; }
.wrap-w { width: min(100vw, calc(100vh * 720 / 1100)); }

/* 위 HUD — 2026-10-06: 앱처럼 보이지 않게 — 왼쪽 위 자원 · 오른쪽 위 시세 · 오른쪽 아래 둥근 버튼 (농장 게임풍) */
#hud { position: fixed; top: 0; left: 0; right: 0; display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: max(10px, env(safe-area-inset-top)) 12px 0; z-index: 5; pointer-events: none; }
.hl, .hr { display: flex; flex-direction: column; gap: 6px; } .hl { align-items: flex-start; } .hr { align-items: flex-end; }
.pill { pointer-events: auto; display: flex; align-items: center; gap: 6px; min-width: 150px; padding: 4px 14px 4px 4px; border-radius: 99px; background: var(--cream); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-family: Jua, sans-serif; font-size: 22px; }
.pill small { font-size: 13px; opacity: .7; }
.pill.pulse { animation: pulse .3s; } @keyframes pulse { 50% { transform: scale(1.08); } }
.ico { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-style: normal; font-weight: 900; color: #fff; }
.ico.coin { background: var(--orange); border: 2px solid #b8650a; } .ico.coin::after { content: '₿'; font-size: 17px; }
.ico.won { background: var(--green); border: 2px solid #2a8a56; font-size: 16px; }
.round { pointer-events: auto; width: 46px; height: 46px; border-radius: 50%; background: var(--cream); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-size: 20px; }
.chip { font-size: 13px; font-weight: 800; background: rgba(255, 248, 238, .92); padding: 3px 10px; border-radius: 99px; border: 2px solid var(--ink); white-space: nowrap; }
#h-price em { font-style: normal; } .up { color: var(--green); } .down { color: #e5506a; }
.halv { color: #9a5ad2; }
.bar { position: relative; width: 170px; height: 24px; padding: 0; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ffe066, #ffb84a); }
.bar.max i { background: linear-gradient(90deg, #ff9a8a, #ff6b7f); }
.bar span { position: relative; display: block; text-align: center; line-height: 20px; font-size: 12px; }

/* 오른쪽 아래 둥근 버튼 */
#dock { position: fixed; right: 12px; bottom: max(14px, env(safe-area-inset-bottom)); display: flex; align-items: flex-end; gap: 10px; z-index: 5; }
.rb { position: relative; width: 62px; height: 62px; border-radius: 50%; background: var(--cream); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); display: grid; place-items: center; }
.rb i { font-style: normal; font-size: 28px; line-height: 1; }
.rb em { position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%); padding: 0 7px; border-radius: 99px; background: var(--ink); color: #fff; font-style: normal; font-family: Jua, sans-serif; font-size: 13px; white-space: nowrap; }
.rb.big { width: 82px; height: 82px; background: #ffd24a; } .rb.big i { font-size: 38px; }
.rb:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--ink); }

#toast { position: fixed; left: 50%; top: 22%; transform: translate(-50%, 10px); z-index: 30; padding: 10px 18px; border-radius: 99px; background: var(--ink); color: #fff; font-family: Jua, sans-serif; font-size: 18px; opacity: 0; transition: .25s; pointer-events: none; white-space: nowrap; }
#toast.on { opacity: 1; transform: translate(-50%, 0); }

/* 아래에서 올라오는 창 */
#sheet-bg { position: fixed; inset: 0; background: rgba(60, 40, 70, .35); opacity: 0; pointer-events: none; transition: .2s; z-index: 10; }
#sheet-bg.on { opacity: 1; pointer-events: auto; }
#sheet { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%) scale(.85); opacity: 0; pointer-events: none; width: min(calc(100vw - 24px), 480px); max-height: min(80vh, 720px); overflow-y: auto; z-index: 11; padding: 18px 16px 18px; border-radius: 26px; background: var(--cream); border: 4px solid var(--ink); box-shadow: 0 7px 0 var(--ink), 0 0 0 8px rgba(255, 248, 238, .5); transition: transform .22s cubic-bezier(.2, .9, .3, 1.3), opacity .15s; }
#sheet.on { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.sh-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; padding-right: 40px; position: relative; }
.sh-head h2 { margin: 0; font-family: Jua, sans-serif; font-size: 26px; font-weight: 400; }
.sh-head small { width: 100%; color: #8a7a8e; font-size: 13px; }
.x { position: absolute; right: -4px; top: -4px; width: 38px; height: 38px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); font-weight: 900; }
.list { display: grid; gap: 8px; }
.item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 18px; background: #fff; border: 2px solid var(--line); }
.item img { width: 64px; height: 64px; flex: none; }
.it-txt { flex: 1; min-width: 0; display: grid; gap: 2px; } .it-txt b { font-family: Jua, sans-serif; font-weight: 400; font-size: 18px; } .it-txt small { color: #8a7a8e; font-size: 12px; }
.stat { font-size: 12px; font-weight: 700; color: #7a6a7e; }
.item button, .btns button, .confirm button { flex: none; min-width: 84px; padding: 10px 10px; border-radius: 14px; background: #ffd24a; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-family: Jua, sans-serif; font-size: 16px; line-height: 1.1; }
.item button small { font-family: 'Noto Sans KR'; font-size: 10px; }
.item button.off { background: #eee6e0; color: #a89aa8; }
.item.lock { opacity: .6; } .item.lock button { background: #e6dcf2; }
.btns { display: flex; gap: 8px; margin-top: 10px; } .btns button { flex: 1; }
button.warn { background: #ffb3bd; }
button.big { display: block; width: 100%; padding: 14px; border-radius: 16px; background: #ffd24a; border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); font-family: Jua, sans-serif; font-size: 20px; }
button.ghost { display: block; width: 100%; margin-top: 10px; padding: 10px; border-radius: 14px; background: #fff; border: 2px solid var(--line); color: #8a7a8e; font-weight: 700; }
.note { font-size: 13px; color: #8a7a8e; line-height: 1.5; }
.trade .tp { display: flex; align-items: baseline; gap: 10px; font-family: Jua, sans-serif; } .tp b { font-size: 30px; font-weight: 400; } .tp em { font-style: normal; font-size: 16px; }
#tr-chart { width: 100%; height: auto; margin: 8px 0; border-radius: 14px; background: #fff; border: 2px solid var(--line); }
.tw { font-size: 16px; } .tw b { font-family: Jua, sans-serif; font-size: 22px; font-weight: 400; color: var(--orange); } .tw small { color: #8a7a8e; }
.up p { margin: 6px 0 12px; }
.bigbar { position: relative; height: 34px; border-radius: 99px; background: #fff; border: 3px solid var(--ink); overflow: hidden; }
.bigbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, #ffe066, #ffb84a); } .bigbar span { position: relative; display: block; text-align: center; line-height: 28px; font-family: Jua, sans-serif; font-size: 17px; }
.rig { display: flex; gap: 12px; align-items: center; } .rig img { width: 110px; height: 110px; } .rs p { margin: 4px 0; font-size: 14px; } .rs small { color: #8a7a8e; } .red { color: #e5506a; }
.confirm { margin-top: 10px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-weight: 700; }
.snd-set { display: grid; gap: 4px; } .snd-row { display: flex; align-items: center; gap: 10px; } .snd-row span { width: 70px; } .snd-row input[type=range] { flex: 1; }

/* 대화 */
#dlg { position: fixed; left: 50%; bottom: max(120px, calc(env(safe-area-inset-bottom) + 112px)); transform: translate(-50%, 20px); width: min(calc(100vw - 20px), 540px); display: flex; gap: 10px; padding: 10px; border-radius: 22px; background: var(--cream); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); z-index: 20; opacity: 0; pointer-events: none; transition: .2s; cursor: pointer; }
#dlg.on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
#dlg-por { flex: none; width: 92px; height: 92px; border-radius: 16px; overflow: hidden; border: 3px solid var(--ink); background: #ffe8ee; }
#dlg-por img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dlg-body { flex: 1; position: relative; } #dlg-name { font-family: Jua, sans-serif; font-weight: 400; font-size: 19px; }
#dlg-text { margin: 4px 0 0; font-size: 15.5px; line-height: 1.5; word-break: keep-all; }
#dlg-next { position: absolute; right: 4px; bottom: -2px; color: var(--pink); animation: bob .8s infinite; } @keyframes bob { 50% { transform: translateY(3px); } }

@media (max-width: 480px) {                /* 폰: 위 표시를 작게 */
  .pill { min-width: 0; font-size: 19px; padding-right: 12px; } .ico { width: 26px; height: 26px; }
  .chip { font-size: 11.5px; padding: 2px 8px; } .bar { width: 140px; height: 22px; } .round { width: 40px; height: 40px; font-size: 17px; }
  .rb { width: 56px; height: 56px; } .rb.big { width: 74px; height: 74px; } #dock { gap: 8px; }
}

/* ── M2 침입 (2026-10-06) */
#h-cold { font-style: normal; margin-left: 8px; font-family: 'Noto Sans KR'; font-weight: 800; font-size: 12px; color: #3a8ad0; background: #e6f6ff; padding: 1px 7px; border-radius: 99px; border: 1.5px solid #9fd0f0; }
#pad { display: none; }
body.raid #pad, body.exp #pad { display: block; } body.raid #dock, body.exp #dock { display: none; }
#atk, #swap { position: fixed; z-index: 6; border-radius: 50%; border: 4px solid var(--ink); box-shadow: 0 5px 0 var(--ink); touch-action: none; }
#atk { right: 22px; bottom: max(30px, env(safe-area-inset-bottom)); width: 96px; height: 96px; background: #ff8a9a; font-size: 44px; }
#atk:active { transform: translateY(4px); box-shadow: 0 1px 0 var(--ink); }
#swap { right: 128px; bottom: max(40px, env(safe-area-inset-bottom)); width: 60px; height: 60px; background: var(--cream); font-size: 26px; }
#joy { position: fixed; z-index: 6; width: 124px; height: 124px; margin: -62px 0 0 -62px; border-radius: 50%; background: rgba(255, 248, 238, .35); border: 3px solid rgba(90, 74, 94, .6); opacity: 0; pointer-events: none; }
#joy.on { opacity: 1; } #joy i { position: absolute; left: 50%; top: 50%; width: 54px; height: 54px; border-radius: 50%; background: var(--cream); border: 3px solid var(--ink); transform: translate(-50%, -50%); }
body.raid #pad::before, body.exp #pad::before { content: '왼쪽을 끌어 이동'; position: fixed; left: 18px; bottom: max(30px, env(safe-area-inset-bottom)); z-index: 5; padding: 4px 10px; border-radius: 99px; background: rgba(90, 74, 94, .75); color: #fff; font-size: 12px; font-weight: 700; }
#alarm { position: fixed; inset: 0; z-index: 4; pointer-events: none; opacity: 0; box-shadow: inset 0 0 60px 20px rgba(255, 60, 80, .55); }
body.raid #alarm { animation: alarm 1s infinite; } @keyframes alarm { 50% { opacity: 1; } }
#comm { position: fixed; left: 50%; top: max(118px, calc(env(safe-area-inset-top) + 108px)); transform: translate(-50%, -12px); z-index: 7; display: flex; align-items: center; gap: 8px; width: min(calc(100vw - 24px), 440px); padding: 6px 12px 6px 6px; border-radius: 18px; background: var(--cream); border: 3px solid var(--ink); box-shadow: 0 4px 0 var(--ink); opacity: 0; pointer-events: none; transition: .2s; }
#comm.on { opacity: 1; transform: translate(-50%, 0); }
#comm img { width: 48px; height: 48px; border-radius: 12px; border: 2px solid var(--ink); object-fit: cover; flex: none; } #comm p { margin: 0; font-size: 14px; line-height: 1.35; } #comm b { font-family: Jua, sans-serif; font-weight: 400; }
.wal { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; } .wbox { display: grid; gap: 2px; padding: 10px; border-radius: 16px; border: 3px solid var(--ink); }
.wbox.hot { background: #ffe3ea; } .wbox.cold { background: #e6f6ff; } .wbox span { font-weight: 800; } .wbox b { font-family: Jua, sans-serif; font-weight: 400; font-size: 26px; } .wbox small { color: #8a7a8e; font-size: 11px; }
button.ghostb { background: #fff; }
h3.sub { margin: 16px 0 6px; font-family: Jua, sans-serif; font-weight: 400; font-size: 18px; }
.stl { display: grid; gap: 6px; } .stl div { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 12px; background: #fff; border: 2px solid var(--line); }
.stl b { color: #e5506a; font-family: Jua, sans-serif; font-weight: 400; } .stl span { flex: 1; font-size: 12px; color: #8a7a8e; } .stl button { font-size: 12px; padding: 6px 8px; min-width: 0; background: #e6dcf2; }
.res { text-align: center; } .res h2 { font-family: Jua, sans-serif; font-weight: 400; font-size: 32px; margin: 4px 0 10px; } .res.win h2 { color: #3ec27a; } .res.lose h2 { color: #e5506a; }
.res p { font-size: 16px; } .res .g { color: #3ec27a; } .res .r { color: #e5506a; } .res .bonus b { color: var(--orange); font-family: Jua, sans-serif; font-weight: 400; font-size: 22px; }

/* ── 되찾으러 가기 (2026-10-06) */
#exit { display: none; position: fixed; left: 50%; top: max(12px, env(safe-area-inset-top)); transform: translateX(-50%); z-index: 6; padding: 6px 14px; border-radius: 99px; background: var(--cream); border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-family: Jua, sans-serif; font-size: 15px; }
body.exp #exit { display: block; } body.exp .hr { display: none; }
.stl button { background: #ffd24a; } .late { font-style: normal; color: #e5506a; font-weight: 800; }
.chain { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0 10px; } .chain i { font-style: normal; color: #8a7a8e; }
.nd { padding: 4px 8px; border-radius: 10px; background: #fff; border: 2px solid var(--ink); font-size: 12px; font-weight: 700; font-family: monospace; }
.nd.me { background: #ffe3ea; font-family: 'Noto Sans KR'; } .nd.q { background: #ffd24a; } .nd.hide { background: #e6dcf2; font-family: 'Noto Sans KR'; }
.txs { display: grid; gap: 8px; } .tx { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-radius: 14px; background: #fff; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); }
.tx span { font-family: monospace; font-size: 14px; color: #6a5a6e; } .tx b { font-family: Jua, sans-serif; font-weight: 400; font-size: 20px; color: var(--orange); }
.tx.no { animation: shake .3s; background: #ffe3ea; opacity: .6; } @keyframes shake { 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.hire { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 14px; background: #fff7e0; border: 2px solid #e8d08a; margin: 8px 0; }
.hire img { width: 54px; height: 54px; border-radius: 12px; border: 2px solid var(--ink); object-fit: cover; } .hire div { display: grid; } .hire small { color: #8a7a8e; font-size: 12px; }
.btns button.off { background: #eee6e0; color: #a89aa8; } .g { color: #3ec27a; }

/* ── M3 (2026-10-06) */
.tabs { display: flex; gap: 6px; margin: -4px 0 10px; } .tabs button { flex: 1; padding: 8px; border-radius: 12px; background: #fff; border: 2px solid var(--line); font-family: Jua, sans-serif; font-size: 16px; color: #8a7a8e; }
.tabs button.on { background: #ffd24a; border-color: var(--ink); color: var(--ink); }
.gico { font-style: normal; font-size: 40px; width: 64px; text-align: center; flex: none; }
.upg { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; padding: 8px 10px; border-radius: 14px; background: #fff7e0; border: 2px solid #e8d08a; }
.upg small { color: #8a7a8e; } .upg button { padding: 8px 10px; border-radius: 12px; background: #ffd24a; border: 3px solid var(--ink); box-shadow: 0 3px 0 var(--ink); font-family: Jua, sans-serif; font-size: 15px; }
.gear { display: grid; gap: 8px; } .gslot { padding: 8px; border-radius: 14px; background: #fff; border: 2px solid var(--line); }
.gs-n { font-family: Jua, sans-serif; font-size: 15px; } .gs-items { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; } .gs-items em { font-style: normal; font-size: 12px; color: #a89aa8; }
.gs-items button { display: flex; flex-direction: column; align-items: center; min-width: 72px; padding: 6px; border-radius: 12px; background: #f7f1ee; border: 2px solid var(--line); font-size: 24px; }
.gs-items button small { font-size: 10px; font-weight: 700; color: #6a5a6e; } .gs-items button.on { background: #ffe9a8; border-color: var(--ink); box-shadow: 0 2px 0 var(--ink); }
#h-parts { color: #5a6a8a; }

/* ── M4 글리프 (2026-10-06) */
.glys { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 6px; }
.gly { position: relative; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 6px 4px; border-radius: 14px; background: #fff; border: 2px solid var(--rc); text-align: center; }
.gly img { width: 46px; height: 46px; } .gly b { font-size: 13px; } .gly small { font-size: 10px; color: var(--rc); font-weight: 800; } .gly > span { position: absolute; top: 4px; right: 6px; font-family: Jua, sans-serif; font-size: 15px; }
.gly.none { opacity: .4; } .gly button { margin-top: 3px; padding: 3px 6px; border-radius: 10px; background: #ffd24a; border: 2px solid var(--ink); font-family: Jua, sans-serif; font-size: 12px; line-height: 1.1; } .gly button small { color: #5a4a5e; font-size: 10px; font-family: 'Noto Sans KR'; }
.gly button:disabled { background: #eee6e0; color: #a89aa8; border-color: #c8bcc4; }
.need { display: flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 800; color: #7a6a7e; } .need img { width: 24px; height: 24px; opacity: .35; } .need img.have { opacity: 1; }
.item.rcp.ready { border-color: #ffd24a; box-shadow: 0 0 0 2px #ffe9a8; } button.craftb { background: #e6dcf2 !important; }
#dock { flex-wrap: wrap-reverse; justify-content: flex-end; max-width: min(calc(100vw - 24px), 420px); row-gap: 18px; }   /* 버튼이 많아져서 두 줄로 */

.tabs.small { margin: 6px 0 0; } .tabs.small button { padding: 4px; font-size: 14px; }
.trend { margin: 0 0 6px; font-size: 13px; color: #7a6a7e; } .trend b { color: #9a5ad2; }

/* ── M5 계정 (2026-10-06) */
.setrow { display: flex; align-items: center; gap: 6px; } .chip.cloud { pointer-events: auto; color: #3a8ad0; } .chip.cloud.off { color: #a89aa8; }
.acct { display: grid; gap: 6px; padding: 10px; margin-bottom: 12px; border-radius: 16px; background: #fff; border: 2px solid var(--line); } .acct small { color: #8a7a8e; font-size: 12px; line-height: 1.5; }
.nk { display: flex; gap: 6px; } .nk input { flex: 1; padding: 8px 10px; border-radius: 12px; border: 2px solid var(--line); font: inherit; } .nk button { padding: 8px 14px; border-radius: 12px; background: #ffd24a; border: 3px solid var(--ink); font-family: Jua, sans-serif; }
