* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { min-height: 100%; background: #1b1d24; color: #eceef2;
  font-family: 'Noto Sans KR', 'Malgun Gothic', sans-serif; }

.gate { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px; font-size: 18px; line-height: 1.6; }

/* 인증 화면 (그림후원과 동일 톤) */
.pair { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; }
.pair-card { background: #23262f; border: 1px solid #3a3d47; border-radius: 16px; padding: 32px 28px;
  text-align: center; max-width: 420px; width: 100%; box-shadow: 0 12px 44px rgba(0,0,0,.6); }
.pair-title { font-size: 26px; font-weight: 900; margin-bottom: 14px; }
.pair-desc { font-size: 16px; color: #c7ccd6; line-height: 1.6; margin-bottom: 22px; }
.pair-desc b { color: #ffd34d; }
.copy-btn { width: 100%; padding: 18px; border: none; border-radius: 12px; cursor: pointer;
  background: #3a86ff; color: #fff; font-size: 19px; font-weight: 800; transition: background .15s; }
.copy-btn:hover { background: #2f6fd6; }
.copy-btn.copied { background: #28a745; }
.pair-cmd-wrap { margin-top: 16px; font-size: 13px; color: #8b919c; }
.pair-cmd-wrap b { color: #eceef2; font-size: 15px; letter-spacing: 1px; background: #2a2d36; padding: 3px 8px; border-radius: 6px; }
.pair-wait { margin-top: 20px; font-size: 14px; color: #7ee787; }

/* 업로드 */
.app { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.up-card { background: #23262f; border: 1px solid #3a3d47; border-radius: 16px; padding: 28px;
  width: 100%; max-width: 560px; box-shadow: 0 12px 44px rgba(0,0,0,.6); text-align: center;
  transition: outline .12s; outline: 2px dashed transparent; outline-offset: 6px; }
/* 드래그 중 강조 */
.app.dragover .up-card { outline-color: #3a86ff; background: #283042; }
.app.dragover .up-card::after { content: '여기에 놓으세요 📥'; display: block; margin-top: 12px; color: #7ec8ff; font-weight: 700; }
.up-title { font-size: 20px; font-weight: 800; margin-bottom: 18px; }
.up-title #nick { color: #ffd34d; }
.filebtn { display: inline-block; padding: 16px 24px; border-radius: 12px; cursor: pointer;
  background: #3a86ff; color: #fff; font-size: 17px; font-weight: 800; }
.filebtn:hover { background: #2f6fd6; }
.preview-wrap { margin: 20px 0; }
.preview { max-width: 100%; max-height: 50vh; border-radius: 10px; background: #2a2d36;
  border: 1px solid #3a3d47; }
.fileinfo { margin-top: 8px; font-size: 13px; color: #8b919c; }
.up-info { font-size: 14px; color: #c7ccd6; margin: 14px 0; }
.up-info b { color: #ffd34d; }
.hint { display: block; font-size: 12px; color: #8b919c; margin-top: 4px; }
.upload-btn { width: 100%; padding: 16px; border: none; border-radius: 12px; cursor: pointer;
  background: #28a745; color: #fff; font-size: 18px; font-weight: 800; }
.upload-btn:disabled { background: #4a5a4f; cursor: not-allowed; }
.up-msg { margin-top: 14px; font-size: 14px; min-height: 20px; }

/* 즐겨찾기 그리드 (누르면 바로 후원) */
.fav-section { margin: 2px 0 14px; text-align: left; }
.fav-head { font-size: 13px; color: #cfd3dc; margin-bottom: 8px; font-weight: 700; }
.fav-head #fav-count { color: #ffd479; }
.fav-head .hint { color: #8a8f99; font-weight: 400; }
.fav-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.fav-cell { position: relative; aspect-ratio: 1/1; border-radius: 8px; overflow: hidden; border: 1px solid #3a3d47; background: #1c1e26; cursor: pointer; }
.fav-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fav-cell:hover { outline: 2px solid #3a86ff; }
.fav-del { position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border: none; border-radius: 50%; background: rgba(0,0,0,.62); color: #fff; font-size: 12px; line-height: 1; cursor: pointer; padding: 0; }
.fav-gif { position: absolute; bottom: 2px; left: 2px; background: rgba(58,134,255,.9); color: #fff; font-size: 9px; font-weight: 700; padding: 1px 4px; border-radius: 4px; }
.fav-save { display: flex; align-items: center; gap: 12px; justify-content: center;
  font-size: 17px; font-weight: 800; color: #ffd479; margin: 14px 0; padding: 16px 14px; cursor: pointer;
  border: 2px dashed rgba(255,180,40,.55); border-radius: 12px; background: rgba(255,180,40,.08); transition: all .15s; }
.fav-save input { width: 28px; height: 28px; flex: 0 0 auto; cursor: pointer; accent-color: #ffb02e; }
.fav-save:hover { border-color: rgba(255,180,40,.85); }
.fav-save:has(input:checked) { border-style: solid; border-color: #ffb02e;
  background: rgba(255,180,40,.2); color: #ffe7b0; box-shadow: 0 0 16px rgba(255,180,40,.3); }

.fav-empty { grid-column: 1 / -1; font-size: 12px; color: #8a8f99; padding: 6px 2px; }

/* 확인 모달 (네이티브 confirm 대체) */
.cmodal { position: fixed; inset: 0; background: rgba(0,0,0,.62); display: flex;
  align-items: center; justify-content: center; z-index: 1000; padding: 20px;
  animation: cmodalFade .15s ease-out; }
@keyframes cmodalFade { from { opacity: 0; } to { opacity: 1; } }
.cmodal-card { background: #23262f; border: 1px solid #3a3d47; border-radius: 16px;
  padding: 28px 24px; max-width: 380px; width: 100%; text-align: center;
  box-shadow: 0 16px 48px rgba(0,0,0,.5); animation: cmodalPop .18s ease-out; }
@keyframes cmodalPop { from { transform: translateY(10px) scale(.97); opacity: 0; } to { transform: none; opacity: 1; } }
.cmodal-msg { font-size: 17px; color: #eceef2; line-height: 1.65; margin-bottom: 24px; }
.cmodal-msg b { color: #ffd34d; }
.cmodal-msg .cmodal-cost { font-size: 22px; font-weight: 900; color: #ff8e72; }
.cmodal-btns { display: flex; gap: 10px; }
.cmodal-btn { flex: 1; padding: 13px 0; border: none; border-radius: 10px;
  font-size: 16px; font-weight: 800; cursor: pointer; transition: filter .15s; }
.cmodal-btn:hover { filter: brightness(1.12); }
.cmodal-no { background: #3a3d47; color: #c7ccd6; }
.cmodal-ok { background: #28a745; color: #fff; }
