/* 마이룸 — 옛 미니홈피 느낌. 폰 화면을 먼저 생각하고 짰다. */

:root {
  --sky: #6fb7e0; --sky-l: #d6ecf8; --sky-d: #3f8fbe;
  --pink: #ff8fb1; --pink-d: #e26a90;
  --paper: #ffffff; --line: #b9d9ea; --ink: #33454f; --dim: #7b93a1;
  --gold: #ffc84a;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; }
body {
  background: linear-gradient(180deg, #bfe2f5 0%, #e8f5fc 240px, #e8f5fc 100%);
  background-attachment: fixed;
  color: var(--ink);
  font: 14px/1.6 "Pretendard", "Malgun Gothic", system-ui, sans-serif;
  padding-bottom: 68px;
}
.px { font-family: "Galmuri11", "Galmuri14", "DungGeunMo", monospace; letter-spacing: .5px; }

button { font: inherit; cursor: pointer; }
input, select, textarea {
  font: inherit; color: inherit; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; width: 100%;
}
input:focus, select:focus { outline: 2px solid var(--sky); outline-offset: -1px; }

/* 미니홈피 창 하나가 화면 전부다. 폰에서도 데스크탑에서도 같은 폭. */
.app { max-width: 460px; margin: 0 auto; padding: 0 10px; }

#top {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, var(--sky) 0%, var(--sky-d) 100%);
  color: #fff; border-bottom: 2px solid #2e7aa6;
}
#top .bar { max-width: 460px; margin: 0 auto; padding: 9px 12px; display: flex; align-items: center; gap: 10px; }
#top .logo { font-size: 15px; font-weight: 700; text-shadow: 1px 1px 0 rgba(0,0,0,.25); }
#top .sp { flex: 1; }
.stars { background: rgba(255,255,255,.9); color: #7a5a10; border-radius: 999px;
  padding: 3px 10px; font-size: 13px; font-weight: 700; white-space: nowrap; }

/* 아래 탭 */
#tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: #fff; border-top: 2px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
#tabbar button {
  flex: 1; border: 0; background: none; color: var(--dim);
  padding: 8px 2px 10px; font-size: 11px; line-height: 1.3;
}
#tabbar button b { display: block; font-size: 19px; font-weight: 400; }
#tabbar button.on { color: var(--sky-d); font-weight: 700; }

/* 창 */
.win { background: var(--paper); border: 1px solid var(--line); border-radius: 8px;
  margin: 10px 0; overflow: hidden; box-shadow: 0 1px 0 rgba(0,0,0,.05); }
.win > h2 { margin: 0; font-size: 13px; padding: 7px 11px; color: #fff;
  background: linear-gradient(180deg, #8fc9e8, #62a8d2); letter-spacing: .5px; }
.win .body { padding: 12px; }
.dim { color: var(--dim); }
.row { display: flex; gap: 8px; align-items: center; }
.msg { color: var(--pink-d); min-height: 20px; font-size: 13px; }
.center { text-align: center; }

.btn { border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 6px; padding: 9px 12px; }
.btn:active { transform: translateY(1px); }
.btn.p { background: linear-gradient(180deg, #ffa9c4, var(--pink)); color: #fff;
  border-color: var(--pink-d); font-weight: 700; }
.btn.b { background: linear-gradient(180deg, #93cdeb, var(--sky)); color: #fff;
  border-color: var(--sky-d); font-weight: 700; }
.btn.sm { padding: 6px 9px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.btn.wide { width: 100%; }

/* 대문 */
.tabs { display: flex; margin: -12px -12px 12px; }
.tabs button { flex: 1; border: 0; background: #eef7fc; color: var(--dim);
  padding: 10px; border-bottom: 2px solid var(--line); }
.tabs button.on { background: #fff; color: var(--sky-d); font-weight: 700; border-color: var(--pink); }
#gate label { display: block; font-size: 12px; color: var(--dim); margin: 9px 0 3px; }

/* 방 */
.stage-wrap { position: relative; overflow: hidden; background: #000; }
.stage { position: relative; width: 720px; height: 540px; transform-origin: top left; touch-action: none; }
.stage .wall { position: absolute; inset: 0 0 200px 0; }
.stage .floor { position: absolute; inset: 340px 0 0 0; }
.stage .floor::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.10), transparent 40%); }
.it { position: absolute; touch-action: none; }
.it svg { display: block; width: 100%; height: 100%; pointer-events: none; }
.edit .it { cursor: grab; }
.it.sel { outline: 2px dashed var(--pink-d); outline-offset: 2px; }
.bubble { position: absolute; z-index: 950; background: #fff; border: 2px solid var(--sky-d);
  border-radius: 10px; padding: 3px 8px; font-size: 13px; white-space: nowrap; pointer-events: none; }

.namecard { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.namecard h1 { font-size: 17px; margin: 0; }
.lv { background: var(--sky-d); color: #fff; border-radius: 4px; padding: 1px 6px; font-size: 11px; }
.today { font-size: 12px; color: var(--dim); }
.today b { color: var(--pink-d); }

.gauge { margin: 7px 0; }
.gauge .lab { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.gauge .bar { height: 12px; background: #eaf3f8; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.gauge .fill { height: 100%; border-radius: 999px; transition: width .3s; }
.f-full .fill { background: linear-gradient(180deg, #ffd98a, var(--gold)); }
.f-mood .fill { background: linear-gradient(180deg, #ffb0c8, var(--pink)); }
.f-exp .fill { background: linear-gradient(180deg, #a5dcb0, #62b97a); }

.badges { display: flex; gap: 5px; flex-wrap: wrap; }
.badge { border: 1px solid var(--line); background: #f3fafd; border-radius: 999px;
  padding: 2px 9px; font-size: 12px; }

/* 아이템함 · 상점 */
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.chip { border: 1px solid var(--line); background: #f8fcfe; border-radius: 7px;
  padding: 6px 3px 4px; text-align: center; position: relative; }
.chip svg { width: 100%; height: 42px; }
.chip span { display: block; font-size: 11px; color: var(--ink); margin-top: 2px; }
.chip .cost { display: block; font-size: 11px; color: #a8791a; font-weight: 700; }
.chip.have { border-color: var(--sky); background: #eef8fd; }
.chip.locked { opacity: .5; }
.chip.locked .cost { color: var(--dim); }

.swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.sw { width: 32px; height: 32px; border-radius: 6px; border: 2px solid var(--line); padding: 0; }
.sw.on { border-color: var(--pink-d); }

.gb ul { margin: 8px 0 0; padding: 0; }
.gb li { list-style: none; border-top: 1px dashed var(--line); padding: 8px 0; }
.gb .head { display: flex; gap: 7px; align-items: baseline; font-size: 12px; color: var(--dim); }
.gb .head b { color: var(--sky-d); font-size: 13px; }

.rooms { display: grid; gap: 8px; }
.rooms button { text-align: left; width: 100%; }

/* 알림 쪽지 */
#toast { position: fixed; left: 50%; bottom: 84px; transform: translateX(-50%);
  background: rgba(40,60,72,.94); color: #fff; padding: 9px 16px; border-radius: 999px;
  font-size: 13px; z-index: 50; opacity: 0; pointer-events: none; transition: opacity .25s; }
#toast.on { opacity: 1; }
