/* 픽셀투게더 — 도트 감성 UI (r/place · Wplace 참고)
   굵은 잉크 테두리 + 각진 오프셋 그림자 + 모눈종이 배경 + 한글 픽셀 폰트(Galmuri) */

:root {
  --paper: #fff8ec;
  --grid: rgba(40, 32, 80, .07);
  --panel: #ffffff;
  --panel-2: #fff3d6;
  --ink: #241e3a;
  --text: #241e3a;
  --muted: #6e6787;
  --shadow: #241e3a;
  --yellow: #ffd23f;
  --red: #ef3b4a;
  --blue: #3d7bff;
  --green: #22c46a;
  --pink: #ff7eb6;
  --px: "Galmuri11", "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --stage: #1d1a2e;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15131f;
    --grid: rgba(255, 255, 255, .045);
    --panel: #221f33;
    --panel-2: #2c2843;
    --ink: #e9e4ff;
    --text: #f1eefc;
    --muted: #a49fc0;
    --shadow: #000000;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 16px 16px;
  color: var(--text);
  font: 15px/1.5 var(--body);
  display: flex;
  flex-direction: column;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}
#app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
a { color: var(--blue); }
h1, h2, h3, .px { font-family: var(--px); font-weight: 700; letter-spacing: -.2px; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* ───── 버튼·입력 ───── */
button, .btn {
  font: 14px/1.1 var(--px);
  color: var(--text);
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 9px 13px;
  min-height: 38px;
  box-shadow: 3px 3px 0 var(--shadow);
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: transform .06s, box-shadow .06s;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
button:hover:not(:disabled), .btn:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow); }
button:active:not(:disabled), .btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--shadow); }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: var(--yellow); color: #241e3a; }
button.danger { background: var(--red); color: #fff; }
button.on { background: var(--blue); color: #fff; }
button.icon, a.icon {
  min-width: 38px; padding: 6px; font: 17px/1 var(--body);
  background: var(--panel); color: var(--text); text-decoration: none;
  border: 2px solid var(--ink); border-radius: 4px; display: inline-flex; align-items: center; justify-content: center; min-height: 36px;
  box-shadow: 2px 2px 0 var(--shadow);
}
input, select, textarea {
  font: 15px var(--body);
  color: var(--text);
  background: var(--panel);
  border: 2px solid var(--ink);
  border-radius: 4px;
  padding: 8px 10px;
  min-height: 38px;
  width: 100%;
  box-shadow: inset 2px 2px 0 rgba(0, 0, 0, .06);
}
select { font-family: var(--px); font-size: 13px; }
input[type=checkbox] { width: 18px; height: 18px; min-height: 0; accent-color: var(--blue); box-shadow: none; }
input.num { width: 76px; }
label { display: flex; flex-direction: column; gap: 5px; font-family: var(--px); font-size: 13px; }
label.row { flex-direction: row; align-items: center; font-family: var(--body); font-size: 14px; }

.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row > input, .row > select { flex: 1; min-width: 120px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
hr { border: 0; border-top: 2px dashed var(--ink); opacity: .25; width: 100%; }
code.code {
  font: 18px var(--px); letter-spacing: 1px; padding: 12px; background: var(--panel-2);
  border: 2px dashed var(--ink); border-radius: 4px; user-select: all; text-align: center;
}
.panel { background: var(--panel); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 4px 0 var(--shadow); }

/* ───── 로고 ───── */
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.logo-mark { display: grid; grid-template-columns: repeat(2, 11px); grid-template-rows: repeat(2, 11px); border: 2px solid var(--ink); box-shadow: 2px 2px 0 var(--shadow); }
.logo-mark i:nth-child(1) { background: var(--red); }
.logo-mark i:nth-child(2) { background: var(--yellow); }
.logo-mark i:nth-child(3) { background: var(--blue); }
.logo-mark i:nth-child(4) { background: var(--green); }
.logo-text { font: 700 22px/1 var(--px); letter-spacing: -.5px; }
.logo-text b { color: var(--blue); }

/* ───── 배너: 콘텐츠와 분리된 상단 띠(하단 도구와 멀리 → 오클릭 방지) ───── */
.banner { flex: 0 0 auto; height: 58px; padding: 4px 12px; background: var(--panel); border-bottom: 2px solid var(--ink); overflow: hidden; }
.banner-placeholder {
  height: 100%; display: grid; place-items: center; color: var(--muted); font: 12px var(--px);
  border: 2px dashed var(--muted); border-radius: 4px;
  background: repeating-linear-gradient(45deg, transparent 0 8px, var(--grid) 8px 16px);
}

.center-box {
  margin: 48px auto; max-width: 440px; width: calc(100% - 32px); padding: 28px 20px; text-align: center; align-items: center;
  background: var(--panel); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 var(--shadow);
}
.center-box input { max-width: 300px; }
.center-box h2 { margin: 0; }
.lock-big { font-size: 46px; }

/* ───── 방 목록 ───── */
.lobby { max-width: 1040px; margin: 0 auto; padding: 18px 16px 40px; width: 100%; display: flex; flex-direction: column; gap: 18px; }
.lobby-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.profile-chip { border-radius: 999px; font-size: 12.5px; padding: 6px 12px 6px 6px; min-height: 36px; gap: 8px; }
.lv-mini { background: var(--blue); color: #fff; border-radius: 999px; padding: 3px 7px; font-size: 11px; }
.chip-bar { width: 46px; height: 10px; border: 2px solid var(--ink); background: var(--panel-2); position: relative; overflow: hidden; display: inline-block; }
.chip-bar i { position: absolute; inset: 0 auto 0 0; background: var(--green); }

.hero { padding: 26px 22px 22px; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: center; }
.hero h1 { font-size: clamp(26px, 5vw, 38px); line-height: 1.25; margin: 0 0 10px; }
.hero h1 .hl { background: var(--yellow); color: #241e3a; padding: 0 8px; box-shadow: 3px 3px 0 var(--shadow); border: 2px solid var(--ink); display: inline-block; transform: rotate(-1.5deg); }
.hero p { margin: 0 0 16px; color: var(--muted); max-width: 520px; }
.hero-art { display: grid; grid-template-columns: repeat(10, 14px); grid-auto-rows: 14px; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--shadow); }
.hero-art i { animation: twinkle 2.6s steps(1) infinite; }
@keyframes twinkle { 0%, 100% { filter: none; } 50% { filter: brightness(1.2); } }
.notice { padding: 12px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: var(--panel-2); border: 2px dashed var(--ink); border-radius: 6px; }
.searchbar { display: flex; gap: 10px; flex-wrap: wrap; }
.searchbar input { flex: 1 1 220px; width: auto; }
.searchbar select { flex: 0 0 auto; width: auto; }
.section-title { font: 700 17px var(--px); display: flex; align-items: center; gap: 8px; margin-bottom: -6px; }
.section-title::before { content: ""; width: 10px; height: 10px; background: var(--red); border: 2px solid var(--ink); }

.room-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.room-card {
  display: flex; flex-direction: column; color: inherit; text-decoration: none;
  background: var(--panel); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 4px 0 var(--shadow);
  transition: transform .08s, box-shadow .08s; overflow: hidden;
}
.room-card:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow); }
.room-card .frame { aspect-ratio: 1 / 1; border-bottom: 2px solid var(--ink); background: #fff; position: relative; display: grid; place-items: center; }
.room-card .frame canvas { width: 100%; height: 100%; image-rendering: pixelated; display: block; }
.room-card .frame.lock { background: repeating-linear-gradient(45deg, var(--panel-2) 0 10px, var(--panel) 10px 20px); font-size: 40px; }
.room-card .live { position: absolute; left: 8px; top: 8px; font: 11px var(--px); background: var(--ink); color: var(--paper); padding: 4px 7px; border-radius: 3px; display: flex; align-items: center; gap: 5px; }
.room-card .live::before { content: ""; width: 7px; height: 7px; background: var(--green); }
.room-card .live.off::before { background: var(--muted); }
.room-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.room-card-body strong { font: 700 15px var(--px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badges { display: flex; gap: 5px; flex-wrap: wrap; }
.badge { font: 11px var(--px); padding: 3px 6px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--panel-2); white-space: nowrap; }
.empty { padding: 28px; text-align: center; border: 2px dashed var(--ink); border-radius: 6px; color: var(--muted); }
.foot { margin-top: 8px; text-align: center; }

/* ───── 방: 캔버스 전체 + 떠 있는 패널 ───── */
.room { position: relative; flex: 1; min-height: 0; overflow: hidden; background: var(--stage); }
.stage { position: absolute; inset: 0; }
.board { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; display: block; }
.room-top {
  position: absolute; left: 10px; right: 10px; top: 10px; z-index: 5;
  display: flex; align-items: center; gap: 6px; padding: 6px;
  background: var(--panel); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 4px 0 var(--shadow);
}
.room-top select { width: auto; min-width: 0; max-width: 120px; min-height: 36px; padding: 4px 6px; }
.room-head { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; padding-left: 2px; }
.room-title { font: 700 15px var(--px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room-meta { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.minimap {
  position: absolute; right: 10px; top: 76px; z-index: 4; width: 116px; height: 116px;
  border: 2px solid var(--ink); border-radius: 4px; box-shadow: 4px 4px 0 var(--shadow);
  image-rendering: pixelated; cursor: pointer; touch-action: none; background: #fff;
}
.expand-info {
  position: absolute; left: 10px; top: 76px; z-index: 4; max-width: calc(100% - 150px);
  font: 12px/1.35 var(--px); background: var(--ink); color: var(--paper); padding: 6px 9px; border-radius: 4px;
  box-shadow: 3px 3px 0 rgba(0, 0, 0, .35);
}
.dock {
  position: absolute; left: 50%; bottom: calc(10px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  width: min(760px, calc(100% - 20px)); z-index: 5; display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.dock > * { pointer-events: auto; }
.readonly-note {
  align-self: center; font: 12.5px var(--px); background: var(--red); color: #fff; padding: 7px 12px;
  border: 2px solid var(--ink); border-radius: 4px; box-shadow: 3px 3px 0 var(--shadow); pointer-events: none !important;
}
.toolbar {
  background: var(--panel); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 4px 0 var(--shadow);
  padding: 8px; display: flex; flex-direction: column; gap: 8px;
}
.start-btn { font-size: 18px; min-height: 52px; width: 100%; box-shadow: 4px 4px 0 var(--shadow); }
.exit-btn { font-size: 12.5px; min-height: 32px; align-self: center; box-shadow: 2px 2px 0 var(--shadow); background: var(--panel-2); }
.hint { margin: 0; text-align: center; font: 11.5px var(--px); color: var(--muted); }
.steps { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; font: 12px var(--px); }
.steps .step { padding: 4px 7px; border: 2px solid var(--ink); border-radius: 3px; background: var(--panel); color: var(--muted); }
.steps .step.now { background: var(--yellow); color: #241e3a; box-shadow: 2px 2px 0 var(--shadow); }
.steps .step.done { background: var(--panel-2); color: var(--text); }
.steps .arrow { color: var(--muted); }
.tools { gap: 6px; }
.tools .tool, .zoom { min-width: 42px; min-height: 40px; padding: 6px 9px; font-size: 17px; box-shadow: 2px 2px 0 var(--shadow); }
.tools .tool span { font: 12px var(--px); }
.palette { display: flex; gap: 5px; overflow-x: auto; padding: 3px 3px 7px; scrollbar-width: thin; }
.editor .palette { flex-wrap: wrap; overflow: visible; }
.swatch {
  width: 30px; height: 30px; min-height: 30px; min-width: 30px; padding: 0; flex: 0 0 auto;
  border: 2px solid var(--ink); border-radius: 3px; box-shadow: 2px 2px 0 var(--shadow);
}
.swatch.on { transform: translateY(-3px); box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ink), 2px 5px 0 var(--shadow); }
.status { font-size: 14px; flex-wrap: nowrap; gap: 6px; }
.status button { min-height: 38px; padding: 6px 10px; box-shadow: 2px 2px 0 var(--shadow); }
.status .stamp-btn { box-shadow: 3px 3px 0 var(--shadow); }
.charges { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; }
.charges strong { font: 700 16px var(--px); }
.charge-bar { flex: 0 1 120px; min-width: 40px; height: 12px; border: 2px solid var(--ink); background: var(--panel-2); position: relative; }
.charge-bar i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, var(--green) 0 6px, #1aa95a 6px 8px); }
.charges .muted { font: 11.5px var(--px); overflow: hidden; text-overflow: ellipsis; }
.ad-row { font-size: 12px; }
.ad-btn { font-size: 12.5px; background: var(--pink); color: #241e3a; min-height: 34px; box-shadow: 2px 2px 0 var(--shadow); }

/* 픽셀 정보 카드 */
.pixel-info {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  background: var(--panel); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 4px 0 var(--shadow);
}
.info-swatch { width: 38px; height: 38px; flex: 0 0 auto; border: 2px solid var(--ink); border-radius: 3px; background-image: repeating-conic-gradient(#ebe6f5 0 25%, #fbf9ff 0 50%); background-size: 10px 10px; }
.info-swatch[style*="background: rgb"], .info-swatch[style*="background: #"] { background-image: none; }
.info-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.info-body strong { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-msg { font-size: 13.5px; background: var(--panel-2); border: 1.5px solid var(--ink); border-radius: 4px; padding: 4px 8px; quotes: "“" "”"; align-self: flex-start; max-width: 100%; overflow-wrap: anywhere; }
.me-badge { margin-left: 6px; font: 11px var(--px); background: var(--blue); color: #fff; padding: 2px 6px; border-radius: 3px; }
.pixel-info .close { min-width: 32px; min-height: 32px; font-size: 13px; }

.tpl-bar {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px;
  background: var(--panel-2); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 4px 0 var(--shadow); font-size: 13px;
}
.tpl-bar strong { font-family: var(--px); }
.tpl-bar button { min-height: 32px; padding: 6px 9px; font-size: 12.5px; box-shadow: 2px 2px 0 var(--shadow); }

@media (max-width: 600px) {
  .tools .tool span { display: none; }
  .room-top { left: 6px; right: 6px; top: 6px; gap: 4px; padding: 5px; }
  .room-top select { max-width: 70px; font-size: 12px; }
  .room-top .icon { min-width: 30px; padding: 3px; font-size: 15px; }
  .minimap { width: 82px; height: 82px; top: 66px; right: 6px; }
  .expand-info { top: 66px; left: 6px; max-width: calc(100% - 104px); font-size: 11px; }
  .dock { width: calc(100% - 12px); bottom: calc(6px + env(safe-area-inset-bottom)); }
  .charge-bar { display: none; }
  .steps { font-size: 11px; }
  .hero { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .room-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .profile-chip .chip-bar { display: none; }
}

/* ───── 모달 ───── */
.modal-back { position: fixed; inset: 0; background: rgba(20, 16, 40, .55); display: grid; place-items: center; z-index: 50; padding: 12px; }
.modal {
  background: var(--panel); border: 2px solid var(--ink); border-radius: 6px; box-shadow: 6px 6px 0 var(--shadow);
  width: min(460px, 100%); max-height: calc(100dvh - 24px); overflow: auto; padding: 0 16px 16px;
}
.modal.wide { width: min(780px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between; margin: 0 -16px 14px; padding: 10px 12px 10px 16px;
  background: var(--yellow); border-bottom: 2px solid var(--ink); position: sticky; top: 0; z-index: 1;
}
.modal-head h2 { font-size: 16px; margin: 0; color: #241e3a; }
.modal-head button.icon { min-height: 32px; min-width: 32px; font-size: 14px; }
.tabs { gap: 6px; }

/* 프로필 카드 */
.profile-card { display: flex; gap: 12px; align-items: center; padding: 12px; background: var(--panel-2); border: 2px solid var(--ink); border-radius: 6px; }
.lv-badge { width: 58px; height: 58px; flex: 0 0 auto; display: grid; place-items: center; align-content: center; background: var(--blue); color: #fff; border: 2px solid var(--ink); box-shadow: 3px 3px 0 var(--shadow); font: 700 22px/1 var(--px); }
.lv-badge small { font-size: 10px; }
.xp-bar { height: 12px; border: 2px solid var(--ink); background: var(--panel); position: relative; }
.xp-bar i { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(90deg, var(--blue) 0 6px, #2c62d9 6px 8px); }

/* ───── 템플릿 ───── */
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.tpl-card { border: 2px solid var(--ink); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: var(--panel); box-shadow: 3px 3px 0 var(--shadow); }
.tpl-card .row button { padding: 6px 8px; min-height: 30px; font-size: 12px; box-shadow: 2px 2px 0 var(--shadow); }
.tpl-thumb { height: 104px; display: grid; place-items: center; border: 2px solid var(--ink); border-radius: 4px; background: repeating-conic-gradient(#ebe6f5 0 25%, #fbf9ff 0 50%) 0 0 / 12px 12px; }
.tpl-preview { image-rendering: pixelated; }
.tpl-name { font: 700 14px var(--px); }
.tpl-big { padding: 14px; border: 2px solid var(--ink); border-radius: 6px; box-shadow: 4px 4px 0 var(--shadow); background: repeating-conic-gradient(#ebe6f5 0 25%, #fbf9ff 0 50%) 0 0 / 16px 16px; }
.editor-wrap { overflow: auto; max-height: 60dvh; display: flex; justify-content: center; padding: 6px; }
.editor-canvas { touch-action: none; image-rendering: pixelated; border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--shadow); cursor: crosshair; }

/* ───── 토스트 ───── */
#toast {
  position: fixed; left: 50%; bottom: 210px; transform: translateX(-50%) translateY(16px);
  background: var(--ink); color: var(--paper); font: 13.5px var(--px);
  padding: 10px 16px; border-radius: 4px; border: 2px solid var(--paper); box-shadow: 4px 4px 0 rgba(0, 0, 0, .35);
  opacity: 0; transition: opacity .15s, transform .15s; pointer-events: none; z-index: 60;
  max-width: calc(100% - 32px); text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* ───── 반짝이 픽셀(광고 보상 전용) ───── */
.sparkle-sep { flex: 0 0 auto; align-self: center; font-size: 16px; padding: 0 2px 0 6px; border-left: 2px dashed var(--ink); margin-left: 4px; }
.swatch.sparkle { position: relative; overflow: hidden; }
.swatch.sparkle::after, .info-swatch.sparkle::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .85) 50%, transparent 70%);
  background-size: 250% 100%; animation: shine 1.8s linear infinite;
}
.info-swatch.sparkle { position: relative; overflow: hidden; }
.swatch.sp-2, .info-swatch.sp-2 { background: linear-gradient(135deg, #ff5f6d, #ffc371, #7cff6b, #4fc3ff, #c86bff) !important; }
.swatch.sp-3, .info-swatch.sp-3 { background: linear-gradient(135deg, #3ef0b0, #4fc3ff, #8a7dff) !important; }
@keyframes shine { from { background-position: 150% 0; } to { background-position: -100% 0; } }
.sparkle-count { font: 700 15px var(--px); color: #c48a00; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sparkle-count { color: var(--yellow); } }
.ad-btn.sparkle-ad { background: linear-gradient(135deg, #ffe17a, #ffb3e6); }
button.tpl-card { display: flex; flex-direction: column; align-items: stretch; white-space: normal; text-align: left; font: inherit; min-height: 0; }
/* 갤러리: 가로 스크롤 띠 */
.gallery-strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(180px, 210px); gap: 14px; overflow-x: auto; padding: 2px 6px 10px 2px; scroll-snap-type: x mandatory; }
.gallery-strip > * { scroll-snap-align: start; }

/* ───── 약관·정책·신고 ───── */
.legal { padding: 18px 20px; line-height: 1.7; }
.legal h1 { font-size: 22px; margin: 0 0 12px; }
.legal h2 { font-size: 17px; margin: 22px 0 8px; }
.legal blockquote { margin: 10px 0; padding: 10px 12px; background: var(--panel-2); border-left: 4px solid var(--ink); border-radius: 4px; }
.legal .table-wrap { overflow-x: auto; }
.legal table { border-collapse: collapse; width: 100%; font-size: 14px; }
.legal th, .legal td { border: 1.5px solid var(--ink); padding: 6px 8px; text-align: left; vertical-align: top; }
.legal th { background: var(--panel-2); font-family: var(--px); }
.legal-form h2 { margin-bottom: 0; }
.legal-form .hint { font-family: var(--body); }
.legal-form .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.legal-form .grid5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
@media (max-width: 600px) { .legal-form .grid2 { grid-template-columns: 1fr; } .legal-form .grid5 { grid-template-columns: repeat(3, 1fr); } }
.legal-foot { text-align: center; font-size: 13px; color: var(--muted); padding: 10px 0 20px; }
.timeline { padding-left: 20px; }
.notice-item { border: 2px solid var(--ink); border-radius: 6px; padding: 10px; background: var(--panel); }
.notice-item.unread { background: var(--panel-2); }
.notice-body { white-space: pre-wrap; font: 13.5px/1.6 var(--body); margin: 8px 0; }
.bell { position: relative; }
.bell-badge { position: absolute; top: -6px; right: -6px; background: var(--red); color: #fff; font: 11px var(--px); border-radius: 999px; padding: 2px 6px; border: 2px solid var(--ink); }

/* ───── 피버 타임 ───── */
.fever { font: 13px var(--px); padding: 9px 12px; border: 2px dashed var(--ink); border-radius: 6px; background: var(--panel); }
.fever.on { border-style: solid; background: linear-gradient(90deg, #ff9a3c, #ff5f6d); color: #fff; box-shadow: 4px 4px 0 var(--shadow); animation: feverPulse 1.6s ease-in-out infinite; }
@keyframes feverPulse { 50% { filter: brightness(1.12); } }
.fever-chip { animation: feverPulse 1.2s ease-in-out infinite; }
.unlimited { font: 700 14px var(--px); color: var(--blue); }

/* ───── 관리자 ───── */
.admin .tabs button { font-size: 13px; }
.admin tr.click { cursor: pointer; }
.admin tr.click:hover td { background: var(--panel-2); }
.admin .due { color: var(--red); font-weight: 700; }
.admin .mono, .mono { font-family: ui-monospace, Menlo, monospace; font-size: 12px; word-break: break-all; }
.region-box { padding: 8px; display: inline-block; border: 2px solid var(--ink); border-radius: 4px; }
.region-preview { image-rendering: pixelated; display: block; }
.claim-detail h3 { margin: 14px 0 4px; font-family: var(--px); }
.fever-rule { margin-top: 3px; opacity: .85; font-family: var(--body); }

/* ───── 템플릿 막대 ───── */
.tpl-bar { flex-direction: column; align-items: stretch; gap: 6px; }
.tpl-bar .row { gap: 6px; }
.tpl-bar .tpl-head .icon { min-height: 30px; min-width: 30px; font-size: 13px; }
.tpl-bar .nudge { min-width: 34px; min-height: 32px; padding: 4px 8px; }
.tpl-bar .sep { width: 1px; align-self: stretch; background: var(--ink); opacity: .3; margin: 0 2px; }
.tpl-bar .tpl-actions button { flex: 1; }
.tpl-open { font-size: 13px; padding: 6px 10px; box-shadow: 2px 2px 0 var(--shadow); }

/* ───── 모바일 제스처 제한: 더블탭 확대·길게 누르기 메뉴·글자 선택·탭 하이라이트 ───── */
html, body { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
canvas, img { -webkit-user-drag: none; -webkit-touch-callout: none; }
/* 입력칸·글(약관·통지 본문)은 선택·붙여넣기 허용 */
input, textarea, select, [contenteditable], .legal, .notice-body, code.code, .mono { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* 광고 승인 전 자체 안내 배너(광고 아님) */
.banner-house { height: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; font: 13px var(--px); color: var(--text); background: var(--panel-2); border: 2px solid var(--ink); border-radius: 4px; padding: 0 10px; text-align: center; overflow: hidden; }
.house-icon { font-size: 18px; }
