/* 온라인 인천 — 2000년대 미니홈피 느낌을 빌린 화면 (상표·화면을 베끼지 않고 색과 말투만) */
:root {
  color-scheme: dark;
  --ink: #1b1c20;
  --paper: #fffdf6;
  --paper-2: #f3efe2;
  --line: #d9d2bd;
  --text: #2a2622;
  --muted: #7a7266;
  --orange: #ff7a1a;
  --sky: #3aa6dd;
  --pink: #ff5fa2;
  --yellow: #ffd23a;
  --gold: #ffcf3a;
  --shadow: 0 6px 20px rgba(0,0,0,.35);
  --display: "Black Han Sans", "Noto Sans KR", sans-serif;
  --body: "Noto Sans KR", -apple-system, "Apple SD Gothic Neo", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ink); overflow: hidden; font-family: var(--body);
  word-break: keep-all; overflow-wrap: break-word; -webkit-tap-highlight-color: transparent; }
#c { position: fixed; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
[hidden] { display: none !important; }
button, .btn { font: inherit; cursor: pointer; border: 1px solid var(--line); background: var(--paper); color: var(--text);
  border-radius: 10px; padding: 9px 13px; font-size: 14px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
button:focus-visible, .btn:focus-visible, input:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.big { width: 100%; padding: 14px; font-size: 17px; }
.hint { color: var(--muted); font-weight: 500; font-size: 12px; }
.fine { color: var(--muted); font-size: 12px; line-height: 1.6; margin: 10px 0 0; }
.field { display: block; font-weight: 700; font-size: 13px; color: var(--text); margin: 14px 0 6px; }
input { font: inherit; font-size: 16px; width: 100%; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row input { flex: 1 1 180px; min-width: 0; }
.row.end { justify-content: flex-end; }

/* 들어가기 */
.entry { position: fixed; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; overflow-y: auto;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: radial-gradient(1200px 600px at 50% 0%, rgba(58,166,221,.35), transparent 60%), linear-gradient(180deg, rgba(20,22,28,.55), rgba(20,22,28,.85)); }
.entry-card { width: min(440px, 100%); background: var(--paper); border-radius: 18px; padding: 22px 20px 18px; box-shadow: var(--shadow);
  border: 2px dashed #f0b27a; }
.eyebrow { margin: 0; color: var(--sky); font-weight: 700; font-size: 12px; letter-spacing: .08em; }
.logo { font-family: var(--display); font-weight: 400; font-size: 44px; line-height: 1.1; margin: 4px 0 6px; color: var(--ink);
  text-shadow: 3px 3px 0 var(--yellow); text-wrap: balance; }
.lead { margin: 0 0 6px; color: var(--text); font-size: 15px; line-height: 1.6; }
.charset { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.charset button { padding: 5px 9px; font-size: 14px; font-weight: 500; background: var(--paper-2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--paper); padding: 10px 22px; }
.seg button.on { background: var(--ink); color: #fff; }
.presets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.presets button { flex-direction: column; gap: 2px; padding: 10px 6px; font-size: 13px; background: var(--paper-2); }
.presets button small { color: var(--muted); font-weight: 500; font-size: 11px; }
.presets button.on { border-color: var(--orange); background: #fff1e4; box-shadow: inset 0 0 0 2px var(--orange); }

.loading { position: fixed; inset: 0; z-index: 19; display: flex; align-items: center; justify-content: center; color: #e8e2d2; font-size: 15px; background: rgba(20,22,28,.7); }

/* 미니 프로필 */
.profile { position: fixed; z-index: 5; top: max(10px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left));
  flex-direction: column; align-items: stretch; gap: 3px; text-align: left; width: min(240px, calc(100vw - 24px));
  background: var(--paper); border: 2px solid #f0b27a; box-shadow: var(--shadow); padding: 9px 11px; }
.p-row { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.p-kind { color: var(--muted); font-weight: 500; font-size: 12px; }
.p-status { color: var(--sky); font-size: 12px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-stats { display: flex; gap: 10px; font-size: 11px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.p-stats b { color: var(--orange); }
.chan { position: fixed; z-index: 5; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right));
  background: rgba(20,22,28,.7); color: #e8e2d2; font-size: 12px; padding: 6px 10px; border-radius: 999px; }

/* 행동 */
.bar { position: fixed; z-index: 5; left: 50%; transform: translateX(-50%); bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; gap: 6px; padding: 7px; border-radius: 16px; background: rgba(255,253,246,.94); box-shadow: var(--shadow);
  flex-wrap: wrap; justify-content: center; width: max-content; max-width: calc(100vw - 24px); }
.bar button { padding: 9px 11px; font-size: 14px; }
.bar button.accent { background: var(--sky); border-color: var(--sky); color: #fff; }
.bar button.on { background: var(--yellow); border-color: #e2b400; }
.tip { position: fixed; z-index: 4; left: 0; right: 0; text-align: center; bottom: calc(max(12px, env(safe-area-inset-bottom)) + 66px); margin: 0;
  color: #e8e2d2; font-size: 12px; text-shadow: 0 1px 3px #000; pointer-events: none; padding: 0 16px; }

/* 아래에서 올라오는 판 */
.sheet { position: fixed; z-index: 10; left: 50%; transform: translateX(-50%); bottom: max(10px, env(safe-area-inset-bottom));
  width: min(560px, calc(100vw - 20px)); max-height: min(70vh, 620px); display: flex; flex-direction: column;
  background: var(--paper); border-radius: 16px; box-shadow: var(--shadow); border: 2px solid #f0b27a; color: var(--text); }
.sheet header { display: flex; align-items: center; gap: 10px; padding: 12px 14px 8px; border-bottom: 1px dashed var(--line); }
.sheet header b { font-size: 16px; }
.sheet header .hint { flex: 1; min-width: 0; }
.sheet header .x { margin-left: auto; padding: 6px 10px; font-size: 13px; }
.tabs { display: flex; gap: 6px; padding: 10px 14px 6px; overflow-x: auto; flex-wrap: nowrap; }
.tabs button { flex: 0 0 auto; padding: 6px 12px; font-size: 13px; border-radius: 999px; background: var(--paper-2); }
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; padding: 8px 14px 12px; overflow-y: auto; }
.cards button { padding: 12px 8px; font-size: 15px; background: #fff; border-style: dashed; }
.cards button:active { transform: scale(.97); }
.react-foot { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 14px 14px; }
.react-foot button { flex: 1 1 auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 8px 14px; overflow-y: auto; min-height: 0; flex: 1; }
.item { flex-direction: column; align-items: stretch; gap: 5px; padding: 6px; background: #fff; text-align: left; }
.item canvas { width: 100%; aspect-ratio: 1.6; border-radius: 6px; display: block; object-fit: cover; }
.item .nm { font-size: 12px; font-weight: 700; line-height: 1.35; }
.item .pr { font-size: 11px; color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.item.on { border-color: var(--orange); box-shadow: inset 0 0 0 2px var(--orange); }
.item.off-btn { justify-content: center; align-items: center; color: var(--muted); min-height: 96px; }
.colors { display: flex; gap: 8px; padding: 8px 14px 14px; flex-wrap: wrap; align-items: center; border-top: 1px dashed var(--line); }
.colors .lab { font-size: 12px; color: var(--muted); margin-right: 4px; }
.sw { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.sw.on { box-shadow: 0 0 0 3px var(--orange); }
.me { padding-bottom: 14px; }
.me > *:not(header) { margin-left: 14px; margin-right: 14px; }
.illist { list-style: none; padding: 0; margin: 0 14px; max-height: 160px; overflow-y: auto; font-size: 13px; }
.illist li { padding: 6px 0; border-bottom: 1px dotted var(--line); display: flex; justify-content: space-between; gap: 8px; }
.illist li span { color: var(--pink); font-weight: 700; }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; margin-top: 12px; }
.check input { width: auto; }

.modal { position: fixed; z-index: 15; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(380px, calc(100vw - 32px));
  background: var(--paper); color: var(--text); border-radius: 16px; padding: 18px; box-shadow: var(--shadow); border: 2px solid var(--pink); }
.modal p { margin: 0 0 14px; font-size: 15px; line-height: 1.6; }
.selfie img { width: 100%; border-radius: 10px; display: block; margin-bottom: 12px; image-rendering: pixelated; }

.toasts { position: fixed; z-index: 12; top: calc(max(10px, env(safe-area-inset-top)) + 96px); left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 6px; align-items: center; pointer-events: none; width: min(420px, calc(100vw - 32px)); }
.toast { background: rgba(255,253,246,.96); color: var(--text); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  box-shadow: var(--shadow); border: 1px solid #f0b27a; animation: tin .25s ease-out; text-align: center; }
@keyframes tin { from { opacity: 0; transform: translateY(-6px); } }

#labels { position: fixed; inset: 0; pointer-events: none; z-index: 3; overflow: hidden; }
.nm-tag { position: absolute; transform: translate(-50%, -100%); font-size: 11px; font-weight: 700; color: #fff; white-space: nowrap;
  text-shadow: 0 1px 2px #000, 0 0 4px #000; }
.nm-tag.me { color: var(--yellow); }
.nm-tag.npc { color: #c8ccd4; font-weight: 500; }
.bubble { position: absolute; transform: translate(-50%, -100%); background: #fff; color: #222; font-size: 13px; font-weight: 700;
  padding: 5px 10px; border-radius: 12px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.35); }
.bubble:after { content: ""; position: absolute; left: 50%; bottom: -6px; margin-left: -6px; border: 6px solid transparent; border-bottom: 0; border-top-color: #fff; }

@media (max-width: 520px) {
  .logo { font-size: 38px; }
  .bar button { padding: 8px 9px; font-size: 13px; }
  .sheet { max-height: 64vh; }
  .profile { width: min(210px, calc(100vw - 120px)); }
}
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }
