:root {
  --cream: #fffaf0; --panel: rgba(255, 250, 240, .95); --cell: #f8efdf; --line: rgba(140, 105, 70, .16);
  --text: #5b4332; --mute: #a08b78; --honey: #f8b94a; --gold: linear-gradient(180deg, #ffe08c, #f9bd4f); --gold-edge: #dc9a2e; --gold-ink: #5b3a12;
  --mint: #5fc08a; --pink: #f58fa8; --red: #ee7d6b; --soft: #fff3d6; --tag: #ffeec2; --tag-ink: #b9770e;
  --round: 'Jua', 'Pretendard Variable', Pretendard, sans-serif;
  --sticker: 0 4px 0 rgba(140, 105, 70, .14), 0 10px 22px rgba(90, 60, 30, .16);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; margin: 0; overflow: hidden; background: #cfeef4; color: var(--text); overscroll-behavior: none; user-select: none; -webkit-user-select: none;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: inherit; user-select: text; -webkit-user-select: text; }
[hidden] { display: none !important; }
#game { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }

#hud { position: fixed; inset: 0; pointer-events: none; transition: opacity .4s; z-index: 10; }
#hud > * { pointer-events: auto; }
.mode-title #hud { opacity: 0; }
.mode-title #hud > * { pointer-events: none; }
#hud .top { position: absolute; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 12px; display: flex; justify-content: space-between; pointer-events: none; }
.pill { height: 44px; padding: 0 16px 0 10px; border-radius: 22px; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 2px solid #fff; box-shadow: var(--sticker); font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pill b { font: 400 17px var(--round); }
#clockTime { color: var(--mute); font-weight: 600; }
#clockIco { display: grid; place-items: center; width: 26px; height: 26px; }
#clockIco.day { color: #f6a623; }
#clockIco.night { color: #7b8ee0; }
.acorn b { color: #c47a1e; font-size: 19px; }
#acornIco { display: flex; }
.side { position: absolute; right: 12px; top: calc(68px + env(safe-area-inset-top)); display: flex; flex-direction: column; gap: 10px; }
.rbtn { position: relative; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: var(--panel); border: 2px solid #fff; box-shadow: var(--sticker); transition: transform .12s; }
.rbtn:hover { transform: translateY(-2px); }
.rbtn:active { transform: scale(.92); }
.rbtn.off { color: var(--mute); }
#bagCount { position: absolute; right: -8px; bottom: -6px; font-style: normal; font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 9px; background: #fff; border: 1.5px solid var(--line); font-variant-numeric: tabular-nums; }
#bagCount.full { background: var(--red); color: #fff; border-color: transparent; }

#tasksMini { position: absolute; left: 12px; top: 68px; width: 256px; padding: 12px 14px 10px; border-radius: 20px; background: var(--panel); border: 2px solid #fff; box-shadow: var(--sticker); display: none; }
#tasksMini h4 { margin: 0 0 6px; font: 400 14px var(--round); color: var(--tag-ink); }
.task span { word-break: keep-all; }
.task { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; font-size: 13.5px; font-weight: 600; padding: 4px 0; }
.task i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(140, 105, 70, .3); display: grid; place-items: center; }
.task i svg { width: 10px; height: 10px; stroke-width: 4; }
.task b { font-size: 12px; color: var(--mute); font-weight: 700; font-variant-numeric: tabular-nums; }
.task.done span { color: var(--mute); text-decoration: line-through; }
.task.done i { background: var(--mint); border-color: var(--mint); color: #fff; }
.task.done b { color: var(--mint); }
@media (min-width: 900px) and (min-height: 560px) { #tasksMini { display: block; } }

#hotbar { position: absolute; left: 50%; bottom: calc(14px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; padding: 7px; border-radius: 26px; background: var(--panel); border: 2px solid #fff; box-shadow: var(--sticker); transition: opacity .2s, transform .2s; }
#hotbar button { position: relative; width: 66px; height: 66px; border-radius: 19px; display: flex; flex-direction: column; align-items: center; justify-content: center; transition: background .12s, transform .1s; }
#hotbar button:hover { background: rgba(140, 105, 70, .08); }
#hotbar button:active { transform: scale(.94); }
#hotbar button span { font-size: 11px; color: var(--mute); font-weight: 700; margin-top: -1px; }
#hotbar button kbd { position: absolute; left: 8px; top: 5px; font: 700 10px/1 inherit; color: rgba(140, 105, 70, .45); }
#hotbar button.on { background: var(--gold); box-shadow: 0 3px 0 var(--gold-edge), inset 0 2px 0 rgba(255, 255, 255, .55); }
#hotbar button.on span { color: var(--gold-ink); }
#hotbar button.on kbd { color: rgba(91, 58, 18, .55); }
.touch #hotbar kbd { display: none; }

#prompt { position: absolute; left: 50%; bottom: calc(108px + env(safe-area-inset-bottom)); transform: translate(-50%, 8px); opacity: 0; transition: opacity .15s, transform .15s; display: flex; gap: 9px; align-items: center;
  padding: 8px 16px 8px 8px; border-radius: 18px; background: var(--panel); border: 2px solid #fff; box-shadow: var(--sticker); font: 400 17px var(--round); pointer-events: none !important; white-space: nowrap; }
#prompt.show { opacity: 1; transform: translate(-50%, 0); }
#prompt kbd { font: 800 11px/1 'Pretendard Variable', sans-serif; padding: 7px 9px; border-radius: 9px; background: var(--text); color: var(--cream); box-shadow: 0 2px 0 #3a2a1e; }
#prompt.hot { background: var(--honey); color: var(--gold-ink); animation: pulseC .22s infinite alternate; }
#prompt.dim span { color: var(--mute); }
.touch #prompt { display: none; }

#stick, #btnAct { display: none; }
.touch #stick { display: block; position: absolute; left: calc(18px + env(safe-area-inset-left)); bottom: calc(100px + env(safe-area-inset-bottom)); width: 132px; height: 132px; border-radius: 50%;
  background: rgba(255, 250, 240, .42); border: 2.5px solid rgba(255, 255, 255, .85); box-shadow: 0 6px 18px rgba(90, 60, 30, .14); touch-action: none; transition: opacity .2s; }
#stick i { position: absolute; left: 50%; top: 50%; width: 58px; height: 58px; margin: -29px; border-radius: 50%; background: #fff; box-shadow: 0 4px 0 rgba(140, 105, 70, .2), 0 6px 14px rgba(90, 60, 30, .2); transition: transform .1s; }
#stick.on i { transition: none; }
.touch #btnAct { display: grid; place-items: center; position: absolute; right: calc(18px + env(safe-area-inset-right)); bottom: calc(108px + env(safe-area-inset-bottom)); width: 104px; height: 104px; border-radius: 50%;
  background: var(--gold); color: var(--gold-ink); font: 400 19px var(--round); border: 3px solid #fff; box-shadow: 0 6px 0 var(--gold-edge), 0 12px 22px rgba(90, 60, 30, .22); touch-action: none; transition: transform .06s, box-shadow .06s, opacity .2s; }
#btnAct.down { transform: translateY(4px); box-shadow: 0 2px 0 var(--gold-edge), 0 6px 12px rgba(90, 60, 30, .22); }
#btnAct.idle { background: var(--cream); color: var(--mute); box-shadow: 0 6px 0 rgba(170, 140, 110, .55), 0 12px 22px rgba(90, 60, 30, .18); }
#btnAct.hot { animation: pulse .22s infinite alternate; }
#btnAct span { max-width: 84px; text-align: center; line-height: 1.15; word-break: keep-all; }
.mode-dialog #btnAct, .mode-card #btnAct, .mode-dialog #hotbar, .mode-menu #hotbar, .mode-card #hotbar, .mode-dialog #stick, .mode-menu #stick, .mode-card #stick, .mode-menu #btnAct, .mode-dialog #prompt, .mode-menu #prompt, .mode-card #prompt { opacity: 0; pointer-events: none; }
.mode-dialog #hotbar { transform: translate(-50%, 20px); }

#toasts { position: fixed; top: calc(14px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; z-index: 70; width: max-content; max-width: min(560px, calc(100% - 420px)); }
.toast { display: flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 18px; background: var(--panel); border: 2px solid #fff; font-size: 14.5px; font-weight: 700; line-height: 1.4; box-shadow: var(--sticker);
  animation: toastIn .3s cubic-bezier(.2, 1.4, .4, 1); word-break: keep-all; transition: opacity .3s, transform .3s; }
.toast canvas { flex: none; }
.toast.good { border-color: #bfe8cf; background: #f3fff6; }
.toast.warn { border-color: #f7c6bd; background: #fff5f2; }
.toast.new { background: var(--gold); color: var(--gold-ink); }
.toast.out { opacity: 0; transform: translateY(-6px); }
#floats { position: fixed; inset: 0; pointer-events: none; z-index: 9; }
#floats span { position: absolute; left: 0; top: 0; font: 400 19px var(--round); color: #fff; white-space: nowrap; text-shadow: 2px 0 0 #6b4a34, -2px 0 0 #6b4a34, 0 2px 0 #6b4a34, 0 -2px 0 #6b4a34, 1.5px 1.5px 0 #6b4a34, -1.5px 1.5px 0 #6b4a34, 1.5px -1.5px 0 #6b4a34, -1.5px -1.5px 0 #6b4a34, 0 4px 0 rgba(107, 74, 52, .5); }

#dialog { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(720px, calc(100% - 24px)); padding: 30px 26px 22px; border-radius: 28px; background: var(--panel);
  border: 3px solid #fff; box-shadow: 0 6px 0 rgba(140, 105, 70, .16), 0 18px 40px rgba(90, 60, 30, .22); z-index: 20; cursor: pointer; animation: rise .24s cubic-bezier(.2, 1.3, .4, 1); }
#dialog .who { position: absolute; left: 22px; top: -18px; padding: 7px 16px 6px; border-radius: 16px; font: 400 16px var(--round); border: 2.5px solid #fff; box-shadow: 0 3px 0 rgba(140, 105, 70, .18); transform: rotate(-2deg); }
#dialog .text { margin: 0; min-height: 3.2em; font-size: 18px; line-height: 1.6; font-weight: 600; word-break: keep-all; }
#dialog .choices { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
#dialog .choices:empty { display: none; }
#dialog .choices button { text-align: left; padding: 12px 16px; border-radius: 16px; background: var(--cell); border: 2.5px solid transparent; font-size: 16px; font-weight: 700; }
#dialog .choices button.sel, #dialog .choices button:hover { background: var(--soft); border-color: var(--honey); }
#dialog .next { position: absolute; right: 24px; bottom: 14px; width: 0; height: 0; border: 8px solid transparent; border-top: 10px solid var(--honey); border-bottom: 0; opacity: 0; }
#dialog.ready .next { opacity: 1; animation: bobY .5s infinite alternate; }

#modal { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; background: rgba(110, 80, 50, .3); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); padding: 16px; animation: fade .18s; }
.sheet { width: min(860px, 100%); max-height: min(680px, 100%); display: flex; flex-direction: column; border-radius: 30px; background: var(--cream); border: 3px solid #fff; box-shadow: 0 8px 0 rgba(140, 105, 70, .16), 0 30px 70px rgba(90, 60, 30, .3); overflow: hidden; animation: pop .26s cubic-bezier(.2, 1.3, .4, 1); }
.sheet.bag, .sheet.shop { width: min(640px, 100%); }
.head { display: flex; align-items: center; gap: 12px; padding: 18px 20px 12px; }
.head h3 { margin: 0; font: 400 24px var(--round); }
.head .sub { font-size: 13px; color: var(--tag-ink); font-weight: 700; padding: 4px 11px; border-radius: 11px; background: var(--tag); font-variant-numeric: tabular-nums; }
.head .x { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--cell); }
.head .x:hover { background: #f1e3cb; }
.tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 2px solid var(--line); }
.tabs button { white-space: nowrap; padding: 10px 14px 8px; font: 400 17px var(--round); color: var(--mute); border-bottom: 3.5px solid transparent; margin-bottom: -2px; border-radius: 3px 3px 0 0; }
.tabs button.on { color: var(--text); border-color: var(--honey); }
.body { padding: 16px 20px 20px; overflow-y: auto; min-height: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.chips button, .chips span { padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 700; background: var(--cell); color: var(--mute); white-space: nowrap; }
.chips button i { font-style: normal; opacity: .75; font-weight: 700; margin-left: 2px; font-variant-numeric: tabular-nums; }
.chips button.on { background: var(--text); color: var(--cream); }
.chips .price { color: var(--tag-ink); background: var(--tag); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
.cell { position: relative; aspect-ratio: 1; min-width: 0; border-radius: 18px; background: var(--cell); border: 2.5px solid transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; transition: transform .1s, border-color .1s; }
button.cell:hover { border-color: rgba(140, 105, 70, .25); transform: translateY(-2px); }
button.cell:active { transform: scale(.95); }
.cell.on { border-color: var(--honey); background: var(--soft); }
.cell span { font-size: 11.5px; font-weight: 700; color: var(--mute); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.cell.unknown span { opacity: .6; }
.cell em { position: absolute; right: 6px; top: 5px; font-style: normal; font-size: 11.5px; font-weight: 800; padding: 1px 7px; border-radius: 9px; background: var(--text); color: var(--cream); }
.cell.empty { background: transparent; border: 2.5px dashed rgba(140, 105, 70, .16); }
.grid.slots { grid-template-columns: repeat(8, 1fr); }
.grid.sell .cell span { color: var(--tag-ink); font-variant-numeric: tabular-nums; }
.dex { display: grid; grid-template-columns: 1fr 290px; gap: 16px; align-items: start; }
.detail { display: flex; gap: 14px; padding: 16px; border-radius: 22px; background: var(--cell); align-items: flex-start; }
.detail canvas { flex: none; }
.detail .info { flex: 1; min-width: 0; }
.dex .detail { flex-direction: column; align-items: center; text-align: center; position: sticky; top: 0; }
.dex .detail .chips { justify-content: center; margin: 0; }
.detail .chips span { background: #fff; }
.detail .chips .price { background: var(--tag); }
.detail h4 { margin: 0 0 8px; font: 400 21px var(--round); }
.detail h4 em { font: 700 13px 'Pretendard Variable', sans-serif; color: var(--mute); margin-left: 4px; }
.detail p { margin: 8px 0; font-size: 14.5px; line-height: 1.6; font-weight: 500; word-break: keep-all; }
.detail small { color: var(--mute); font-size: 12.5px; font-weight: 600; }
.detail .primary { display: block; margin-top: 10px; }
.hint { color: var(--mute); font-size: 14.5px; margin: 6px 0; line-height: 1.5; font-weight: 600; }
.bag .detail { margin-top: 12px; min-height: 108px; }
.primary { padding: 12px 22px; border-radius: 18px; background: var(--gold); color: var(--gold-ink); font: 400 18px var(--round); box-shadow: 0 4px 0 var(--gold-edge); transition: transform .08s, box-shadow .08s; }
.primary:hover { filter: brightness(1.04); }
.primary:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--gold-edge); }
.primary.wide { width: 100%; margin-top: 14px; }
.note { font-size: 12.5px; color: var(--mute); margin: 12px 0 0; line-height: 1.5; font-weight: 600; }
.note.top { margin: 0 0 10px; }
.tasklist { display: grid; gap: 10px; }
.taskcard { padding: 14px 16px; border-radius: 20px; background: var(--cell); }
.taskcard .row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.taskcard b { font-size: 15.5px; word-break: keep-all; }
.reward { font-size: 12.5px; font-weight: 800; color: var(--tag-ink); padding: 4px 10px; border-radius: 999px; background: var(--tag); white-space: nowrap; }
.bar { height: 10px; border-radius: 5px; background: rgba(140, 105, 70, .12); margin: 10px 0 6px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #7fd3a0, #b6e88f); transition: width .3s; }
.taskcard small { color: var(--mute); font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.taskcard.done .reward { color: #2f8f5a; background: #d9f5e4; }
.taskcard.project .bar i { background: linear-gradient(90deg, #f9bd4f, #ffe08c); }
.friends { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.friend { display: flex; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 20px; background: var(--cell); }
.friend .info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.friend b { font: 400 19px var(--round); }
.friend small { color: var(--mute); font-size: 12.5px; font-weight: 600; }
.hearts { display: flex; gap: 3px; margin-top: 4px; }
.hearts i { width: 12px; height: 11px; background: rgba(140, 105, 70, .18); clip-path: path('M6 11 1 5.5A3 3 0 0 1 6 2a3 3 0 0 1 5 3.5z'); }
.hearts i.on { background: var(--pink); }
.req { margin-top: 4px; font-size: 12px; font-weight: 800; color: var(--tag-ink); }
.goods { display: grid; gap: 8px; }
.good { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 20px; background: var(--cell); }
.good .info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.good b { font: 400 18px var(--round); }
.good small { color: var(--mute); font-size: 12.5px; line-height: 1.4; font-weight: 600; word-break: keep-all; }
.bagico { width: 56px; height: 56px; display: grid; place-items: center; color: var(--honey); flex: none; }
.bagico svg { width: 34px; height: 34px; }
.buy { min-width: 84px; padding: 10px 14px; border-radius: 14px; background: var(--gold); color: var(--gold-ink); font: 400 17px var(--round); font-variant-numeric: tabular-nums; box-shadow: 0 3px 0 var(--gold-edge); flex: none; }
.buy:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--gold-edge); }
.buy.poor { background: rgba(140, 105, 70, .12); color: var(--mute); box-shadow: none; }
.buy.owned { background: #d9f5e4; color: #2f8f5a; box-shadow: none; pointer-events: none; }
#clockEv { font-style: normal; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; background: var(--tag); color: var(--tag-ink); }
.sheet.mail, .sheet.decor { width: min(560px, 100%); }
.sec { display: flex; align-items: center; gap: 8px; margin: 18px 0 8px; font: 400 16px var(--round); color: var(--tag-ink); }
.sec:first-child { margin-top: 0; }
.sec i { font: 700 12px 'Pretendard Variable', sans-serif; font-style: normal; color: var(--mute); padding: 3px 9px; border-radius: 999px; background: var(--cell); }
.cardbox .chips .len, .detail .chips .ss { color: #2f8f5a; background: #d9f5e4; }
.cardbox .chips .record { background: var(--gold); color: var(--gold-ink); box-shadow: 0 2px 0 var(--gold-edge); }

.detail small.best { display: block; margin-top: 4px; color: var(--tag-ink); font-weight: 800; }
.detail p.where { margin: 10px 0 0; padding: 8px 12px; border-radius: 14px; background: #fff; font-size: 13px; color: var(--mute); font-weight: 700; }
.cell.hot { border-color: var(--honey); background: var(--soft); }
.market { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; padding: 10px 14px; border-radius: 18px; background: var(--gold); color: var(--gold-ink); box-shadow: 0 3px 0 var(--gold-edge); }
.market b { font: 400 18px var(--round); }
.market span { font-size: 14px; font-weight: 800; }
.friend .lv { margin-top: 2px; }
.bar.mini { height: 6px; margin: 4px 0 0; width: 120px; }
.bar.mini i { background: linear-gradient(90deg, #f7a5b8, var(--pink)); }
.season { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: 22px; background: var(--soft); border: 2px solid #fff; box-shadow: var(--sticker); }
.season.s0 { background: #ffeef1; } .season.s1 { background: #e8f8ee; } .season.s2 { background: #fff1d6; } .season.s3 { background: #eaf4fa; }
.season canvas { flex: none; }
.season .info { min-width: 0; }
.season b { font: 400 28px var(--round); margin-right: 8px; }
.season small { font-size: 13px; font-weight: 800; color: var(--tag-ink); }
.season p { margin: 6px 0 0; font-size: 13.5px; line-height: 1.55; font-weight: 600; word-break: keep-all; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 12px 0; }
.week div { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 0 7px; border-radius: 16px; background: var(--cell); border: 2.5px solid transparent; min-width: 0; }
.week b { font: 400 16px var(--round); }
.week span { height: 18px; font-size: 11px; font-weight: 800; color: var(--tag-ink); }
.week .ev span { padding: 2px 6px; border-radius: 999px; background: var(--tag); }
.week .past { opacity: .5; }
.week .today { background: var(--soft); border-color: var(--honey); }
.week .today b { color: var(--gold-ink); }
.evcard { display: flex; flex-direction: column; gap: 4px; }
.evcard p { margin: 6px 0 2px; font-size: 14px; line-height: 1.5; font-weight: 600; word-break: keep-all; }
.evcard .now { color: var(--text); font-weight: 800; }
.evcard .go { color: var(--tag-ink); font-weight: 800; }
.reward.done { color: #2f8f5a; background: #d9f5e4; }
.grid.live { grid-template-columns: repeat(auto-fill, minmax(70px, 1fr)); }
.devtools { display: flex; flex-wrap: wrap; gap: 8px; }
.soft { padding: 10px 16px; border-radius: 16px; background: #fff; border: 2px dashed rgba(140, 105, 70, .22); font-size: 14px; font-weight: 800; color: var(--mute); }
.soft:hover { color: var(--text); border-color: var(--honey); }
.klass p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; font-weight: 600; word-break: keep-all; }
.bar.two { display: flex; height: 14px; border-radius: 7px; }
.bar.two i { border-radius: 0; flex: none; }
.bar.two i.me, .legend i.me { background: var(--gold); }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: 12.5px; font-weight: 700; color: var(--mute); font-variant-numeric: tabular-nums; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; background: #7fd3a0; vertical-align: -1px; }
.legend b { margin-left: auto; font-size: 13px; color: var(--text); }
.give { display: flex; gap: 8px; margin-top: 12px; }
.give .buy { flex: 1; min-width: 0; }
.chips.built { margin: 12px 0 0; }
.chips.built .ok { display: inline-flex; align-items: center; gap: 4px; color: #2f8f5a; background: #d9f5e4; }
.chips.built svg { width: 14px; height: 14px; stroke-width: 3; }
.room { flex: none; width: 52px; height: 52px; border-radius: 14px; border: 3px solid #fff; box-shadow: 0 2px 0 rgba(140, 105, 70, .14); }
.mails { display: grid; gap: 8px; }
.mailrow { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 20px; background: var(--cell); border: 2.5px solid transparent; text-align: left; transition: transform .1s, border-color .1s; }
.mailrow:hover { border-color: rgba(140, 105, 70, .2); transform: translateY(-1px); }
.mailrow.new { background: #fff; border-color: var(--tag); }
.mailrow.new::before { content: ''; position: absolute; left: 6px; top: 50%; width: 8px; height: 8px; margin-top: -4px; border-radius: 50%; background: var(--pink); }
.mailrow canvas, .stamp { flex: none; }
.mailrow .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mailrow b { font: 400 17px var(--round); }
.mailrow .info span { font-size: 13px; color: var(--mute); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mailrow.new .info span { color: var(--text); }
.stamp { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--tag); color: var(--tag-ink); }
.gifttag { flex: none; font-style: normal; font-size: 12px; font-weight: 800; padding: 4px 10px; border-radius: 999px; background: var(--gold); color: var(--gold-ink); }
.back { display: inline-flex; align-items: center; gap: 2px; margin-bottom: 10px; padding: 6px 12px 6px 6px; border-radius: 999px; background: var(--cell); font-size: 13px; font-weight: 800; color: var(--mute); }
.back svg { width: 18px; height: 18px; }
.letter { padding: 18px; border-radius: 22px; background: #fff; border: 2px solid var(--tag); box-shadow: var(--sticker); }
.from { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 2px dashed var(--line); }
.from b { display: block; font: 400 20px var(--round); }
.from small { font-size: 12.5px; color: var(--mute); font-weight: 700; }
.letter .txt { margin: 14px 0; font-size: 15.5px; line-height: 1.75; font-weight: 600; word-break: keep-all; white-space: pre-line; }
.gift { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 8px; border-radius: 18px; background: var(--soft); }
.gift span { flex: 1; min-width: 0; font-size: 14px; font-weight: 800; color: var(--tag-ink); word-break: keep-all; }
.gift em { font-style: normal; font-size: 13px; font-weight: 800; color: #2f8f5a; padding: 4px 10px; border-radius: 999px; background: #d9f5e4; }
.letter .ask { display: block; margin: 14px 0 8px; font-size: 12.5px; font-weight: 700; color: var(--mute); }
.chips.replies { margin: 0; }
.chips.replies button { background: var(--soft); color: var(--tag-ink); border: 2px solid var(--tag); }
.chips.replies button:hover { border-color: var(--honey); }
.sent { margin-top: 14px; padding: 10px 14px; border-radius: 16px; background: #d9f5e4; color: #2f8f5a; font-size: 14px; font-weight: 800; }
.hint.empty { text-align: center; padding: 30px 0; }
.roomprev { height: 110px; border-radius: 22px; border: 3px solid #fff; box-shadow: var(--sticker); margin-bottom: 16px; }
.swatches { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.swatch { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px 8px; border-radius: 18px; background: var(--cell); border: 2.5px solid transparent; }
.swatch i { width: 46px; height: 46px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 0 rgba(140, 105, 70, .16); }
.swatch span { font-size: 13px; font-weight: 800; color: var(--mute); }
.swatch.on { border-color: var(--honey); background: var(--soft); }
.swatch.on span { color: var(--gold-ink); }
#fade { position: fixed; inset: 0; z-index: 65; background: var(--cream); opacity: 0; pointer-events: none; transition: opacity .25s; }
#fade.on { opacity: 1; pointer-events: auto; }

#card { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: radial-gradient(circle at 50% 42%, rgba(255, 244, 214, .7), rgba(120, 88, 56, .55)); padding: 16px; cursor: pointer; animation: fade .2s; }
.cardbox { width: min(400px, 100%); padding: 22px 24px 24px; border-radius: 34px; background: var(--cream); border: 3px solid #fff; text-align: center; box-shadow: 0 8px 0 rgba(140, 105, 70, .18), 0 30px 70px rgba(90, 60, 30, .35); }
#card.in .cardbox { animation: pop .4s cubic-bezier(.2, 1.5, .4, 1); }
.badge { display: inline-block; padding: 6px 16px 5px; border-radius: 999px; background: var(--pink); color: #fff; font: 400 15px var(--round); transform: rotate(-3deg); box-shadow: 0 3px 0 #d96f8b; }
.art { position: relative; height: 184px; display: grid; place-items: center; margin: 8px 0 4px; }
.art canvas { position: relative; filter: drop-shadow(0 8px 0 rgba(140, 105, 70, .14)); animation: floaty 2.4s ease-in-out infinite alternate; }
.rays { position: absolute; width: 236px; height: 236px; border-radius: 50%; background: repeating-conic-gradient(rgba(248, 185, 74, .28) 0 12deg, transparent 12deg 30deg); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); mask: radial-gradient(circle, #000 30%, transparent 70%); animation: spin 16s linear infinite; }
.cardbox h2 { margin: 0 0 10px; font: 400 30px var(--round); }
.cardbox .chips { justify-content: center; }
.fact { margin: 4px 0 18px; font-size: 15px; line-height: 1.65; font-weight: 500; word-break: keep-all; }

#title { position: fixed; inset: 0; z-index: 60; display: flex; overflow-y: auto; padding: calc(20px + env(safe-area-inset-top)) 16px calc(20px + env(safe-area-inset-bottom)); background: radial-gradient(circle at 50% 48%, rgba(255, 250, 240, .38), rgba(255, 250, 240, .08) 70%); transition: opacity .5s; }
#title.out { opacity: 0; pointer-events: none; }
.titlebox { margin: auto; text-align: center; width: min(560px, 100%); }
.eyebrow { display: inline-block; padding: 7px 16px 6px; border-radius: 999px; background: var(--cream); border: 2.5px solid #fff; font: 400 15px var(--round); color: var(--tag-ink); box-shadow: var(--sticker); transform: rotate(-2deg); }
#title h1 { margin: 16px 0 14px; font: 400 clamp(68px, 15vw, 128px)/1 var(--round); color: #fff; letter-spacing: -.01em;
  text-shadow: 4px 0 0 #7a4f30, -4px 0 0 #7a4f30, 0 4px 0 #7a4f30, 0 -4px 0 #7a4f30, 3px 3px 0 #7a4f30, -3px 3px 0 #7a4f30, 3px -3px 0 #7a4f30, -3px -3px 0 #7a4f30, 0 10px 0 #7a4f30, 0 18px 26px rgba(90, 60, 30, .35); }
#title .lead { display: inline-block; margin: 0 0 26px; padding: 12px 20px; border-radius: 20px; background: rgba(255, 250, 240, .9); border: 2.5px solid #fff; font-size: clamp(15px, 2vw, 17px); line-height: 1.6; font-weight: 700; word-break: keep-all; box-shadow: var(--sticker); }
.picker { width: min(440px, 100%); margin: 0 auto; padding: 16px; border-radius: 28px; background: var(--panel); border: 3px solid #fff; box-shadow: var(--sticker); text-align: left; animation: pop .32s cubic-bezier(.2, 1.3, .4, 1) .1s backwards; }
.villages h2 { margin: 2px 4px 10px; font: 400 18px var(--round); color: var(--tag-ink); }
#slotList { display: grid; gap: 8px; max-height: 232px; overflow-y: auto; padding: 2px; margin: -2px; }
.slot { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 0; border-radius: 20px; background: var(--cell); border: 2.5px solid transparent; transition: border-color .12s, background .12s; }
.slot.on { background: var(--soft); border-color: var(--honey); }
.slot .pick { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 8px 4px 8px 12px; min-height: 56px; text-align: left; border-radius: 16px; transition: transform .1s; }
.slot .pick:active { transform: scale(.98); }
.slot .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.slot b { font: 400 19px var(--round); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot small { font-size: 12.5px; font-weight: 700; color: var(--mute); font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot .del { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; color: var(--mute); transition: background .12s, color .12s, transform .1s; }
.slot .del:hover { background: #fff; color: var(--red); }
.slot .del:active { transform: scale(.9); }
.slot .del svg { width: 20px; height: 20px; }
.slot.sure { padding: 8px 8px 8px 14px; background: #fff5f2; border-color: #f7c6bd; animation: pop .2s cubic-bezier(.2, 1.3, .4, 1); }
.slot.sure b { font-size: 16px; white-space: normal; word-break: keep-all; }
.slot.sure .soft { padding: 8px 12px; min-height: 44px; }
.danger { flex: none; min-height: 44px; padding: 8px 14px; border-radius: 14px; background: var(--red); color: #fff; font: 400 16px var(--round); box-shadow: 0 3px 0 #c95f4f; transition: transform .08s, box-shadow .08s; }
.danger:active { transform: translateY(2px); box-shadow: 0 1px 0 #c95f4f; }
#btnContinue { display: block; width: 100%; margin-top: 12px; padding: 14px 20px 12px; font-size: 22px; border-radius: 22px; border: 3px solid #fff; box-shadow: 0 5px 0 var(--gold-edge), 0 12px 22px rgba(90, 60, 30, .2); }
#title.has .newvil { margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--line); }
.newvil h2 { margin: 2px 4px 10px; font: 400 18px var(--round); color: var(--tag-ink); }
#btnNew { margin-top: 0; height: 56px; font-size: 20px; }
#title.has #btnNew { background: var(--cream); color: var(--text); border: 2.5px solid var(--line); box-shadow: 0 3px 0 rgba(170, 140, 110, .4); }
.link { display: block; margin: 12px auto 0; min-height: 44px; padding: 0 12px; font-size: 14px; font-weight: 800; color: var(--tag-ink); text-decoration: underline; text-decoration-color: rgba(185, 119, 14, .35); text-underline-offset: 4px; }
#importBox { margin-top: 6px; animation: pop .2s cubic-bezier(.2, 1.3, .4, 1); }
.primary.ghost { min-height: 46px; background: var(--cream); color: var(--mute); font-size: 17px; padding: 11px 22px 10px; box-shadow: 0 4px 0 rgba(170, 140, 110, .5); }
#title > .titlebox > small { display: block; margin-top: 16px; color: #7a5a40; font-size: 13px; font-weight: 700; text-shadow: 0 1px 0 rgba(255, 255, 255, .7); }

@keyframes toastIn { from { opacity: 0; transform: translateY(-10px) scale(.94); } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 14px); } }
@keyframes pop { from { opacity: 0; transform: scale(.9); } }
@keyframes fade { from { opacity: 0; } }
@keyframes pulse { to { transform: scale(1.08); } }
@keyframes pulseC { from { transform: translate(-50%, 0) scale(1); } to { transform: translate(-50%, 0) scale(1.08); } }
@keyframes bobY { to { transform: translateY(4px); } }
@keyframes floaty { to { transform: translateY(-8px) rotate(-3deg); } }
@keyframes spin { to { transform: rotate(360deg); } }

.mailchip { color: var(--tag-ink); }
#mailCount { position: absolute; right: -4px; top: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--pink); color: #fff; border: 2px solid #fff; font: 800 11px/16px 'Pretendard Variable', sans-serif; font-style: normal; text-align: center; animation: pulse .6s ease-in-out infinite alternate; }
.grid.badges { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); }
.badgedet { margin-bottom: 10px; align-items: center; }
.badgedet p { margin: 4px 0; }
.sheet.guide { width: min(460px, 100%); }
.guide { display: grid; gap: 10px; }
.guide .step { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: 20px; background: var(--cell); }
.guide .step > i { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font: 400 17px var(--round); font-style: normal; background: var(--gold); color: var(--gold-ink); box-shadow: 0 2px 0 var(--gold-edge); }
.guide b { font: 400 18px var(--round); }
.guide p { margin: 3px 0 0; font-size: 14.5px; line-height: 1.55; font-weight: 600; word-break: keep-all; }
.mode-menu #toasts, .mode-card #toasts { top: auto; bottom: calc(16px + env(safe-area-inset-bottom)); max-width: calc(100% - 24px); }

@media (max-width: 899px) {
  #toasts { top: calc(68px + env(safe-area-inset-top)); max-width: calc(100% - 140px); }
  .toast { font-size: 13.5px; padding: 9px 13px; }
}
@media (max-width: 759px) {
  .pill { height: 40px; font-size: 14px; padding: 0 13px 0 8px; gap: 6px; }
  .side { top: calc(62px + env(safe-area-inset-top)); }
  .rbtn { width: 46px; height: 46px; }
  #hotbar button { width: 58px; height: 58px; }
  #dialog { padding: 28px 20px 20px; }
  #dialog .text { font-size: 16.5px; }
  #modal { padding: 10px; }
  .sheet { max-height: 100%; border-radius: 26px; }
  .head { padding: 14px 16px 10px; }
  .tabs { padding: 0 8px; gap: 0; }
  .tabs button { flex: 1 1 auto; padding: 10px 4px 8px; font-size: 15px; min-height: 44px; }
  .head .x { width: 44px; height: 44px; }
  .chips button, .back, .soft { min-height: 44px; }
  .pill.clock { position: relative; }
  #clockEv { position: absolute; left: 8px; top: calc(100% + 5px); font-size: 11px; padding: 3px 8px; border: 2px solid #fff; box-shadow: 0 2px 0 rgba(140, 105, 70, .14); }
  .week { gap: 4px; }
  .week b { font-size: 14px; }
  .week span { font-size: 10.5px; }
  .week .ev span { padding: 2px 4px; }
  .season b { font-size: 24px; }
  .give .buy { padding: 10px 6px; font-size: 15px; }
  .body { padding: 14px 16px 18px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
  .grid.slots { grid-template-columns: repeat(4, 1fr); }
  .dex { grid-template-columns: 1fr; }
  .dex .detail { order: -1; flex-direction: row; text-align: left; align-items: flex-start; position: static; }
  .dex .detail .chips { justify-content: flex-start; }
  .dex .detail canvas { width: 72px !important; height: 72px !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

#boot { position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(circle at 50% 45%, #fffaf0, #fdebc8); transition: opacity .5s; }
#boot.out { opacity: 0; pointer-events: none; }
#boot b { font: 400 40px 'Jua', sans-serif; color: var(--text); letter-spacing: -.01em; }
#boot span { font-size: 14px; font-weight: 700; color: var(--mute); }
.nut { position: relative; width: 58px; height: 74px; animation: hop .62s cubic-bezier(.3, 0, .5, 1) infinite alternate; transform-origin: 50% 100%; }
.nut::before { content: ''; position: absolute; left: 6px; right: 6px; top: 20px; bottom: 0; border-radius: 46% 46% 50% 50% / 38% 38% 62% 62%; background: linear-gradient(160deg, #e9a85c, #c47a1e); box-shadow: inset -5px -6px 0 rgba(120, 70, 20, .18); }
.nut::after { content: ''; position: absolute; left: 0; right: 0; top: 8px; height: 24px; border-radius: 30px 30px 12px 12px; background: #8a5a35; box-shadow: inset 0 -4px 0 rgba(0, 0, 0, .12); }
.nut i { position: absolute; left: 26px; top: 0; width: 7px; height: 12px; border-radius: 4px; background: #6b4528; z-index: 1; }
#boot::after { content: ''; position: absolute; left: 50%; top: 50%; width: 46px; height: 10px; margin: 30px 0 0 -23px; border-radius: 50%; background: rgba(140, 105, 70, .18); transform: translateY(-62px); animation: shadow .62s cubic-bezier(.3, 0, .5, 1) infinite alternate; }
@keyframes hop { from { transform: translateY(0) scale(1.08, .92); } 30% { transform: translateY(-6px) scale(1); } to { transform: translateY(-34px) rotate(-6deg); } }
@keyframes shadow { from { transform: translateY(-62px) scale(1); } to { transform: translateY(-62px) scale(.6); opacity: .5; } }

#minimap { position: absolute; left: calc(14px + env(safe-area-inset-left)); bottom: calc(14px + env(safe-area-inset-bottom)); width: 176px; height: 176px; display: none; transition: opacity .2s, transform .12s; }
#minimap .disc { position: absolute; inset: 0; border-radius: 50%; overflow: hidden; border: 4px solid #fff; background: #a9dc8a; box-shadow: var(--sticker); }
#minimap canvas { display: block; width: 100%; height: 100%; }
#minimap em { position: absolute; inset: 0; display: none; place-items: center; font: 400 20px var(--round); font-style: normal; color: var(--text); background: rgba(255, 250, 240, .72); }
#minimap.in em { display: grid; }
#minimap kbd { position: absolute; right: 4px; top: 6px; font: 800 11px/1 'Pretendard Variable', sans-serif; padding: 6px 8px; border-radius: 9px; background: var(--text); color: var(--cream); border: 2px solid #fff; box-shadow: 0 2px 0 rgba(140, 105, 70, .2); }
#minimap:hover { transform: translateY(-2px); }
#minimap:active { transform: scale(.97); }
@media (min-width: 900px) and (min-height: 560px) { body:not(.touch) #minimap { display: block; } body:not(.touch) #btnMap { display: none; } }
.mode-dialog #minimap, .mode-menu #minimap, .mode-card #minimap { opacity: 0; pointer-events: none; }

.sheet.map { width: min(760px, 100%); }
.mapframe { width: min(100%, calc((min(680px, 100vh - 32px) - 190px) * 96 / 60)); margin: 0 auto; border-radius: 22px; overflow: hidden; border: 3px solid #fff; box-shadow: var(--sticker); background: #a9dc8a; line-height: 0; }
.mapframe canvas { display: block; width: 100%; aspect-ratio: 96 / 60; }
.maplegend { justify-content: center; display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 13px; font-weight: 800; color: var(--mute); }
.maplegend span { display: inline-flex; align-items: center; gap: 5px; }
.maplegend .sq { width: 14px; height: 14px; border-radius: 5px; border: 2px solid #fff; box-shadow: 0 1px 0 rgba(140, 105, 70, .25); }
.maplegend .dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #fff; margin-right: -3px; box-shadow: 0 1px 0 rgba(140, 105, 70, .25); }
.maplegend .dot:last-of-type { margin-right: 2px; }
.maplegend .me { width: 0; height: 0; border: 7px solid transparent; border-left: 11px solid #f39a2b; border-right: 0; filter: drop-shadow(0 0 1.5px #fff) drop-shadow(0 0 1px #fff); }
.mapev { margin: 12px 0 0; flex-wrap: wrap; }

.sheet.settings { width: min(520px, 100%); }
.switches { display: grid; gap: 8px; }
.switch { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 8px 14px 8px 16px; border-radius: 18px; background: var(--cell); font: 400 17px var(--round); text-align: left; transition: transform .1s; }
.switch:active { transform: scale(.98); }
.switch i { position: relative; width: 52px; height: 30px; border-radius: 15px; background: rgba(140, 105, 70, .2); transition: background .2s; }
.switch i b { position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(90, 60, 30, .25); transition: transform .22s cubic-bezier(.3, 1.4, .5, 1); }
.switch.on i { background: var(--mint); }
.switch.on i b { transform: translateX(22px); }
.io { display: grid; gap: 8px; }
.io .primary.wide { margin-top: 0; }
textarea.code { width: 100%; height: 92px; resize: none; padding: 12px 14px; border-radius: 16px; border: 2.5px solid var(--line); background: #fff; font: 600 12.5px/1.5 ui-monospace, Menlo, monospace; color: var(--text); word-break: break-all; outline: none; transition: border-color .12s; }
textarea.code:focus { border-color: var(--honey); }
textarea.code::placeholder { font: 700 13.5px 'Pretendard Variable', sans-serif; color: rgba(160, 139, 120, .75); }
textarea.code[readonly] { background: var(--soft); }
.iorow { display: flex; gap: 8px; }
.iorow > * { flex: 1; min-height: 48px; display: grid; place-items: center; text-align: center; }
.iorow .primary { padding: 10px 16px; font-size: 17px; }
.file { position: relative; overflow: hidden; cursor: pointer; }
.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.err { margin: 2px 0 0; padding: 9px 12px; border-radius: 14px; background: #fff5f2; color: #c4513f; font-size: 13.5px; font-weight: 800; line-height: 1.45; word-break: keep-all; }
.settings .primary.ghost.wide { margin-top: 22px; }

.week em { font-style: normal; font-size: 11.5px; font-weight: 800; color: var(--mute); font-variant-numeric: tabular-nums; margin-top: -3px; }
.week .today em { color: var(--tag-ink); }
#modal.closing { animation: fadeOut .15s forwards; pointer-events: none; }
#modal.closing .sheet { animation: popOut .15s forwards; }
.body.swap { animation: swapIn .2s ease-out; }
.tabs button { transition: color .15s, border-color .15s, transform .1s; }
.tabs button:active, .chips button:active, .soft:active, .swatch:active, .mailrow:active, .back:active { transform: scale(.95); }
.chips button, .soft, .swatch, .back { transition: transform .1s, background .12s, color .12s, border-color .12s; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { opacity: 0; transform: scale(.96); } }
@keyframes swapIn { from { opacity: 0; transform: translateY(6px); } }
@media (max-width: 759px) {
  .picker { padding: 14px; border-radius: 24px; }
  .maplegend { gap: 6px 10px; font-size: 12.5px; }
}
@media (max-height: 780px) and (max-width: 759px) {
  #title.has h1 { font-size: 60px; margin: 10px 0 10px; }
  #title.has .lead { display: none; }
}

/* 반 코드로 들어가기 (서버 저장) */
#cloudBox h2 { margin: 2px 4px 6px; font: 400 18px var(--round); color: var(--tag-ink); }
#cloudBox .note.top { margin: 0 4px 10px; }
#cloudBox > .primary.wide { margin-top: 0; }
#title:not(.cloudopen) #cloudBox:not([hidden]) { padding-bottom: 14px; margin-bottom: 14px; border-bottom: 2px dashed var(--line); }
#title.cloudopen .villages, #title.cloudopen .newvil, #title.cloudopen #btnImport, #title.cloudopen #importBox { display: none; }
#cloudBox .row { display: flex; gap: 8px; }
#cloudBox .row input, .cf input { min-width: 0; height: 52px; padding: 0 14px; border-radius: 18px; border: 2.5px solid var(--line); background: #fff; font: 400 19px var(--round); color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s; }
#cloudBox .row input { flex: 1; }
#cloudBox .row .primary { flex: none; height: 52px; padding: 0 16px; font-size: 17px; white-space: nowrap; }
#cloudBox input:focus, .cf input:focus { border-color: var(--honey); box-shadow: 0 0 0 4px rgba(248, 185, 74, .22); }
#cloudBox input::placeholder, .cf input::placeholder { color: rgba(160, 139, 120, .7); font-size: 15px; letter-spacing: 0; }
.cform { display: grid; gap: 8px; }
.cform .primary.wide { margin-top: 4px; }
.cform .primary:disabled { opacity: .6; }
.cfrow { display: grid; grid-template-columns: 1.35fr .8fr 1fr; gap: 8px; }
.cf { display: grid; gap: 4px; min-width: 0; }
.cf span { margin: 0 4px; font-size: 13px; font-weight: 800; color: var(--mute); }
.cf input { width: 100%; padding: 0 10px; text-align: center; }
.cf input:disabled { background: var(--cell); color: var(--mute); }
.cf.code input { text-transform: uppercase; letter-spacing: .06em; }
.cf.pin input { -webkit-text-security: disc; letter-spacing: .2em; }
.uplist { display: grid; gap: 8px; max-height: 200px; overflow-y: auto; }
.uplist .slot { padding: 6px 6px 6px 14px; min-height: 56px; }
.uplist .soft { flex: none; min-height: 44px; }
.slot .lock { flex: none; width: 30px; height: 30px; display: grid; place-items: center; color: var(--tag-ink); }
.slot .lock svg { width: 22px; height: 22px; }
.cloudstat { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 18px; background: var(--cell); }
.cloudstat > i { flex: none; width: 12px; height: 12px; border-radius: 50%; background: var(--mint); }
.cloudstat div { display: grid; gap: 2px; }
.cloudstat b { font: 400 17px var(--round); }
.cloudstat small { font-size: 12.5px; font-weight: 700; color: var(--mute); }
.cloudstat.saving > i { background: var(--honey); animation: pulse .5s infinite alternate; }
.cloudstat.offline > i, .cloudstat.error > i { background: #f0a04b; }
.cloudstat.expired > i, .cloudstat.conflict > i { background: var(--red); }
.settings .cloudstat + .primary.wide { margin-top: 10px; }
.settings .primary.ghost.wide.out { margin-top: 10px; }
.sheet.relogin, .sheet.conflict { width: min(460px, 100%); }
.conflict .primary.ghost.wide { margin-top: 10px; }
.cloudchip > i { position: absolute; right: 2px; bottom: 2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #fff; background: var(--mint); }
.cloudchip.saving > i { background: var(--honey); }
.cloudchip.offline > i, .cloudchip.error > i { background: #f0a04b; }
.cloudchip.expired > i, .cloudchip.conflict > i { background: var(--red); }
.cloudchip.offline, .cloudchip.expired, .cloudchip.conflict { color: #c4513f; }

/* 내 캐릭터 만들기 */
#title.making .villages, #title.making .newvil, #title.making #btnImport, #title.making #importBox, #title.making #cloudBox, #title.making .lead, #title.making > .titlebox > small { display: none !important; }
#title.making .titlebox { width: min(660px, 100%); }
#title.making h1 { font-size: clamp(50px, 9vw, 80px); margin: 12px 0 18px; }
#title.making .picker { width: min(640px, 100%); }
#makeBox h2 { margin: 2px 4px 12px; font: 400 23px var(--round); color: var(--tag-ink); text-align: center; }
#makeBox .note.top { text-align: center; }
.maker { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 16px; }
.stagebox { position: relative; min-height: 300px; border-radius: 22px; overflow: hidden; background: radial-gradient(circle at 50% 38%, #fffef8, #fde9c8 78%); border: 2.5px solid #fff; box-shadow: inset 0 0 0 2px var(--line); }
.stage3d { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.nametag { position: absolute; left: 50%; bottom: 12px; max-width: 88%; transform: translateX(-50%) rotate(-2deg); padding: 6px 16px 5px; border-radius: 14px; background: #fff; border: 2.5px solid var(--honey); font: 400 19px var(--round); color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-shadow: 0 3px 0 rgba(140, 105, 70, .18); }
.nametag.empty { color: var(--mute); border: 2.5px dashed rgba(160, 139, 120, .5); }
.fields { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mf { display: grid; gap: 6px; }
.mf > span { margin: 0 4px; font: 400 16px var(--round); color: var(--tag-ink); }
.mf input { width: 100%; min-width: 0; height: 52px; padding: 0 16px; border-radius: 18px; border: 2.5px solid var(--line); background: #fff; font: 400 20px var(--round); color: var(--text); outline: none; transition: border-color .12s, box-shadow .12s; }
.mf input:focus { border-color: var(--honey); box-shadow: 0 0 0 4px rgba(248, 185, 74, .22); }
.mf input::placeholder { color: rgba(160, 139, 120, .7); }
.mf.shake { animation: shake .4s; }
.looks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.look { display: flex; align-items: center; gap: 4px; min-height: 58px; padding: 4px 10px 4px 4px; border-radius: 18px; background: var(--cell); border: 2.5px solid transparent; font: 400 18px var(--round); color: var(--mute); transition: transform .1s, background .12s, border-color .12s, color .12s; }
.look canvas { flex: none; }
.look.on { background: var(--soft); border-color: var(--honey); color: var(--text); }
.look:active { transform: scale(.96); }
.why { margin: 0 4px; min-height: 20px; font-size: 13.5px; font-weight: 700; color: var(--mute); word-break: keep-all; }
.why.bad { color: #d4553f; }
#btnMake { margin-top: auto; padding: 14px 20px 12px; font-size: 21px; }
#btnMake.off { opacity: .55; filter: grayscale(.8); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.merow { display: flex; align-items: center; gap: 12px; padding: 8px 10px 8px 8px; border-radius: 18px; background: var(--cell); }
.merow .info { flex: 1; min-width: 0; display: grid; gap: 2px; }
.merow b { font: 400 19px var(--round); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.merow small { font-size: 12.5px; font-weight: 700; color: var(--mute); }
.merow .soft { flex: none; min-height: 44px; }
.sheet.me { width: min(640px, 100%); }
.letter .to { margin: 14px 0 -6px; font: 400 17px var(--round); color: var(--tag-ink); }
@media (max-width: 559px) {
  .maker { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .stagebox { min-height: 0; height: 196px; }
  .nametag { left: 12px; top: 12px; bottom: auto; max-width: 40%; transform: rotate(-3deg); }
  #title.making .eyebrow { display: none; }
  #title.making h1 { font-size: 46px; margin: 4px 0 12px; }
}

#saveNote a { color: inherit; font-weight: 700; white-space: nowrap; text-underline-offset: 3px; pointer-events: auto; }
