@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;800&display=swap');
html { font-size: 16px; overscroll-behavior: none; }
input, textarea, select { font-size: 16px; }
:root {
  --bg-gradient: linear-gradient(-45deg, #ff9a9e, #fecfef, #a1c4fd, #c2e9fb);
  --card-bg: rgba(255,255,255,0.6);
  --card-border: rgba(255,255,255,0.5);
  --card-bg-hover: rgba(255, 255, 255, 0.95);
  --text-primary: #333;
  --text-secondary: #555;
  --text-muted: #777;
  --text-faint: #888;
  --text-faintest: #999;
  --border-light: rgba(0,0,0,0.05);
  --border-input: rgba(0,0,0,0.1);
  --border-dashed: rgba(0,0,0,0.15);
  --bg-subtle: rgba(0,0,0,0.03);
  --bg-hover-subtle: rgba(0,0,0,0.05);
  --toast-bg: rgba(255, 255, 255, 0.9);
  --toast-border: rgba(255, 255, 255, 0.5);
  --toast-shadow: 0 10px 30px rgba(0,0,0,0.1);
  --header-bg: rgba(255, 255, 255, 0.4);
  --header-border: rgba(255,255,255,0.3);
  --btn-bg: #fff;
  --btn-border: rgba(0,0,0,0.1);
  --btn-hover-bg: #333;
  --btn-hover-text: #fff;
  --input-bg: #fff;
  --notice-bg: rgba(255, 255, 255, 0.4);
  --notice-shadow: 0 4px 15px rgba(0,0,0,0.02);
  --notice-bg-hover: rgba(255, 255, 255, 0.95);
  --service-bg: rgba(255,255,255,0.5);
  --service-border: rgba(255,255,255,0.6);
  --social-bg: rgba(255,255,255,0.5);
  --social-border: rgba(255,255,255,0.6);
  --social-icon-fill: #555;
  --gb-item-bg: rgba(255,255,255,0.7);
  --reaction-bg: rgba(255,255,255,0.6);
  --reaction-border: rgba(0,0,0,0.1);
  --reaction-popup-bg: #fff;
  --overlay-bg: rgba(0,0,0,0.4);
  --popup-bg: rgba(255,255,255,0.95);
  --popup-intro-bg: rgba(0,0,0,0.03);
  --dropdown-bg: rgba(255,255,255,0.95);
  --dropdown-divider: rgba(0,0,0,0.06);
  --spinner-border: rgba(0,0,0,0.1);
  --loading-state-bg: rgba(255,255,255,0.4);
  --loading-state-border: rgba(0,0,0,0.1);
  --error-state-bg: rgba(250, 200, 200, 0.5);
  --error-state-border: rgba(214, 48, 49, 0.4);
  --footer-border: rgba(255,255,255,0.4);
  --footer-link: #666;
  --footer-link-hover: #333;
  --page-btn-bg: rgba(255,255,255,0.5);
  --page-btn-border: rgba(0,0,0,0.1);
  --page-btn-text: #555;
  --page-btn-hover: rgba(255,255,255,0.9);
  --more-btn-bg: rgba(255,255,255,0.5);
  --more-btn-hover: rgba(255,255,255,0.85);
  --toggle-bg: rgba(0,0,0,0.08);
  --toggle-active-bg: #a1c4fd;
  --info-bg: rgba(255,255,255,0.5);
  --info-border: rgba(255,255,255,0.6);
  --row-border: rgba(0,0,0,0.05);
  --section-bg: rgba(255,255,255,0.5);
  --tag-bg: rgba(255,255,255,0.9);
  --input-border: var(--border-input);
  --btn-text: #555;
  --post-meta-border: rgba(0,0,0,0.06);
  --skeleton-shimmer: rgba(255,255,255,0.4);
  --skeleton-line: rgba(0,0,0,0.06);
  --empty-bg: rgba(255,255,255,0.4);
  --empty-text: #888;
  --empty-sub: #aaa;
  --search-bg: rgba(255,255,255,0.6);
  --search-focus-bg: rgba(255,255,255,0.9);
  --post-badge-bg: rgba(255,255,255,0.5);
  --post-badge-text: #888;
  --comment-bg: rgba(255,255,255,0.5);
  --comment-border: rgba(0,0,0,0.06);
  --card-shadow: 0 10px 30px rgba(0,0,0,0.08);
  --toolbar-bg: rgba(255,255,255,0.5);
  --toolbar-border: rgba(0,0,0,0.08);
  --preview-bg: rgba(255,255,255,0.3);
  --notif-hover: rgba(0,0,0,0.03);
  --notif-unread-bg: rgba(88,101,242,0.08);
  --notif-icon-bg: rgba(0,0,0,0.05);
  --ly-bg: rgba(255,255,255,0.85);
  --ly-border: rgba(255,255,255,0.7);
  --ly-card-bg: rgba(255,255,255,0.6);
  --ly-card-border: rgba(255,255,255,0.7);
  --ly-card-shadow: 0 4px 15px rgba(0,0,0,0.02);
  --ly-text: #333;
  --ly-text-secondary: #555;
  --ly-text-muted: #777;
  --ly-status-border: #fff;
  --ly-close-hover: rgba(0,0,0,0.05);
  --ly-mini-status-border: #fff;
  --fold-btn-bg: rgba(0,0,0,0.03);
  --spotify-bg: rgba(29,185,84,0.15);
  --spotify-border: rgba(29,185,84,0.4);
  --progress-bg: rgba(0,0,0,0.1);
}
[data-theme="dark"] {
  --bg-gradient: linear-gradient(-45deg, #1a1a2e, #16213e, #0f3460, #1a1a2e);
  --card-bg: rgba(30, 30, 40, 0.8);
  --card-border: rgba(255,255,255,0.08);
  --card-bg-hover: rgba(40, 40, 55, 0.95);
  --text-primary: #f0f0f0;
  --text-secondary: #c8c8c8;
  --text-muted: #aaa;
  --text-faint: #bbb;
  --text-faintest: #aaa;
  --border-light: rgba(255,255,255,0.06);
  --border-input: rgba(255,255,255,0.12);
  --border-dashed: rgba(255,255,255,0.15);
  --bg-subtle: rgba(255,255,255,0.03);
  --bg-hover-subtle: rgba(255,255,255,0.06);
  --toast-bg: rgba(40, 40, 55, 0.95);
  --toast-border: rgba(255,255,255,0.1);
  --toast-shadow: 0 10px 30px rgba(0,0,0,0.3);
  --header-bg: rgba(20, 20, 30, 0.6);
  --header-border: rgba(255,255,255,0.08);
  --btn-bg: rgba(50, 50, 65, 0.9);
  --btn-border: rgba(255,255,255,0.1);
  --btn-hover-bg: #a1c4fd;
  --btn-hover-text: #fff;
  --input-bg: rgba(40, 40, 55, 0.8);
  --notice-bg: rgba(30, 30, 40, 0.6);
  --notice-shadow: 0 4px 15px rgba(0,0,0,0.15);
  --notice-bg-hover: rgba(40, 40, 55, 0.95);
  --service-bg: rgba(30, 30, 40, 0.6);
  --service-border: rgba(255,255,255,0.08);
  --social-bg: rgba(30, 30, 40, 0.6);
  --social-border: rgba(255,255,255,0.08);
  --social-icon-fill: #ccc;
  --gb-item-bg: rgba(30, 30, 40, 0.7);
  --reaction-bg: rgba(30, 30, 40, 0.6);
  --reaction-border: rgba(255,255,255,0.1);
  --reaction-popup-bg: rgba(40, 40, 55, 0.95);
  --overlay-bg: rgba(0,0,0,0.6);
  --popup-bg: rgba(30, 30, 40, 0.98);
  --popup-intro-bg: rgba(255,255,255,0.05);
  --dropdown-bg: rgba(30, 30, 40, 0.98);
  --dropdown-divider: rgba(255,255,255,0.08);
  --spinner-border: rgba(255,255,255,0.12);
  --loading-state-bg: rgba(30, 30, 40, 0.5);
  --loading-state-border: rgba(255,255,255,0.08);
  --error-state-bg: rgba(180, 40, 40, 0.2);
  --error-state-border: rgba(214, 48, 49, 0.3);
  --footer-border: rgba(255,255,255,0.08);
  --footer-link: #ccc;
  --footer-link-hover: #f0f0f0;
  --page-btn-bg: rgba(40, 40, 55, 0.6);
  --page-btn-border: rgba(255,255,255,0.1);
  --page-btn-text: #c8c8c8;
  --page-btn-hover: rgba(50, 50, 65, 0.9);
  --more-btn-bg: rgba(40, 40, 55, 0.6);
  --more-btn-hover: rgba(50, 50, 65, 0.9);
  --toggle-bg: rgba(255,255,255,0.08);
  --toggle-active-bg: #5865F2;
  --info-bg: rgba(40, 40, 55, 0.6);
  --info-border: rgba(255,255,255,0.08);
  --row-border: rgba(255,255,255,0.06);
  --section-bg: rgba(40,40,55,0.6);
  --tag-bg: rgba(50,50,65,0.9);
  --input-border: var(--border-input);
  --btn-text: #c8c8c8;
  --post-meta-border: rgba(255,255,255,0.06);
  --skeleton-shimmer: rgba(50,50,65,0.5);
  --skeleton-line: rgba(255,255,255,0.06);
  --empty-bg: rgba(30,30,40,0.5);
  --empty-text: #aaa;
  --empty-sub: #bbb;
  --search-bg: rgba(40,40,55,0.6);
  --search-focus-bg: rgba(50,50,65,0.9);
  --post-badge-bg: rgba(40,40,55,0.6);
  --post-badge-text: #bbb;
  --comment-bg: rgba(40,40,55,0.6);
  --comment-border: rgba(255,255,255,0.06);
  --card-shadow: 0 10px 30px rgba(0,0,0,0.2);
  --toolbar-bg: rgba(40,40,55,0.6);
  --toolbar-border: rgba(255,255,255,0.08);
  --preview-bg: rgba(40,40,55,0.4);
  --notif-hover: rgba(255,255,255,0.04);
  --notif-unread-bg: rgba(88,101,242,0.15);
  --notif-icon-bg: rgba(255,255,255,0.08);
  --ly-bg: rgba(30,30,40,0.9);
  --ly-border: rgba(255,255,255,0.1);
  --ly-card-bg: rgba(40,40,55,0.7);
  --ly-card-border: rgba(255,255,255,0.1);
  --ly-card-shadow: 0 4px 15px rgba(0,0,0,0.2);
  --ly-text: #f0f0f0;
  --ly-text-secondary: #c8c8c8;
  --ly-text-muted: #aaa;
  --ly-status-border: #2a2a3a;
  --ly-close-hover: rgba(255,255,255,0.08);
  --ly-mini-status-border: #2a2a3a;
  --fold-btn-bg: rgba(255,255,255,0.04);
  --spotify-bg: rgba(29,185,84,0.2);
  --spotify-border: rgba(29,185,84,0.3);
  --progress-bg: rgba(255,255,255,0.1);
}
* { -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; padding: 0;
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--bg-gradient);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
body.page-loaded { opacity: 1; }
body.fade-out { opacity: 0; transition: opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes gradientBG { 0% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } 100% { background-position: 0% 50%; } }
img.emoji { height: 1em; width: auto; vertical-align: -0.125em; }
.custom-toast {
  position: fixed; top: calc(30px + env(safe-area-inset-top, 0px)); left: 50%;
  transform: translate(-50%, -100px);
  background: var(--toast-bg);
  backdrop-filter: blur(15px);
  border: 1px solid var(--toast-border);
  box-shadow: var(--toast-shadow);
  padding: 14px 28px; border-radius: 30px;
  font-size: 0.95rem; font-weight: 500;
  z-index: 9999; opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 12px;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.custom-toast.show { transform: translate(-50%, 0); opacity: 1; }
.login-btn {
  background: var(--btn-bg); border: 1px solid var(--btn-border);
  color: var(--text-primary); padding: 8px 20px; border-radius: 20px;
  cursor: pointer; transition: 0.2s; display: flex; align-items: center;
}
.login-btn:hover { background: var(--btn-hover-bg); color: var(--btn-hover-text); }
.profile-avatar-btn {
  width: 38px; height: 38px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255,255,255,0.6); object-fit: cover;
  transition: 0.2s; background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
  position: relative;
}
.profile-avatar-btn:hover { border-color: #5865F2; transform: scale(1.05); }
.avatar-dropdown {
  position: absolute; top: 48px; right: 0;
  background: var(--dropdown-bg); backdrop-filter: blur(20px);
  border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  min-width: 180px; padding: 6px; z-index: 1001;
  opacity: 0; transform: translateY(-10px); pointer-events: none;
  transition: opacity 0.25s cubic-bezier(0.22, 1, 0.36, 1), transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.avatar-dropdown.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.avatar-dropdown .drop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
  transition: 0.15s; font-size: 0.9rem; font-weight: 500;
  color: var(--text-primary);
}
.avatar-dropdown .drop-item:hover { background: var(--bg-hover-subtle); }
.avatar-dropdown .drop-divider { height: 1px; background: var(--dropdown-divider); margin: 4px 8px; }
.sub-avatar-btn {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255,255,255,0.5); object-fit: cover;
  transition: 0.2s; background: linear-gradient(135deg, #a1c4fd, #c2e9fb);
}
.sub-avatar-btn:hover { border-color: #5865F2; transform: scale(1.05); }
.sub-dropdown {
  position: absolute; top: 44px; right: 0;
  background: var(--popup-bg); backdrop-filter: blur(20px);
  border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,0.15);
  min-width: 170px; padding: 6px; z-index: 1001;
  opacity: 0; transform: translateY(-10px); pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.sub-dropdown.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.sub-dropdown .drop-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px; border-radius: 10px; cursor: pointer;
  transition: 0.15s; font-size: 0.88rem; font-weight: 500;
  color: var(--text-primary); white-space: nowrap;
}
.sub-dropdown .drop-item:hover { background: rgba(0,0,0,0.05); }
.sub-dropdown .drop-item img.emoji { height: 1.1em; width: 1.1em; vertical-align: -0.15em; }
.sub-login-btn {
  background: var(--btn-bg); border: 1px solid var(--btn-border);
  color: var(--text-primary); padding: 7px 18px; border-radius: 20px;
  cursor: pointer; font-weight: 600; font-size: 0.85rem;
  transition: all 0.2s; font-family: inherit;
}
.sub-login-btn:hover { background: #5865F2; color: #fff; }
.mobile-tab-bar { display: none; }
@media (max-width: 600px) {
  .mobile-tab-bar {
    display: flex; position: fixed; bottom: 20px; left: 16px; right: 16px;
    height: 58px; background: var(--header-bg); backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px); border: 1px solid var(--header-border);
    border-radius: 28px; z-index: 999; align-items: center;
    justify-content: space-around; padding-bottom: 0;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    padding-bottom: max(0px, env(safe-area-inset-bottom, 0px) - 10px);
  }
  .tab-item {
    display: flex; flex-direction: column; align-items: center; gap: 1px;
    padding: 8px 16px; border-radius: 10px; cursor: pointer;
    transition: all 0.2s; color: var(--text-muted); text-decoration: none;
    font-size: 0.65rem; font-weight: 600; border: none;
    background: none; font-family: inherit;
    min-height: 44px; -webkit-tap-highlight-color: transparent;
  }
  .tab-item.active { color: #5865F2; }
  .tab-item svg { width: 22px; height: 22px; }
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 375px) {
  .tab-item { padding: 6px 10px; font-size: 0.6rem; }
  .tab-item svg { width: 20px; height: 20px; }
  .mobile-tab-bar { left: 8px; right: 8px; border-radius: 24px; height: 54px; }
  body { padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}
.btn-spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid var(--spinner-border); border-top-color: #5865F2;
  border-radius: 50%; animation: spin 0.6s linear infinite;
  vertical-align: middle; margin-right: 6px;
}
.spinner {
  display: inline-block; width: 20px; height: 20px;
  border: 3px solid var(--spinner-border); border-top-color: #a1c4fd;
  border-radius: 50%; animation: spin 1s infinite;
  vertical-align: middle; margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-state { padding: 20px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.error-state { padding: 16px; text-align: center; color: #d63031; font-size: 0.85rem; background: var(--error-state-bg); border: 1px solid var(--error-state-border); border-radius: 10px; margin: 10px 0; }
.role-badge {
  background: linear-gradient(135deg, #a1c4fd, #c2e9fb); color: #fff;
  padding: 5px 12px; border-radius: 20px; font-size: 0.8rem;
  font-weight: 700; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.role-badge.admin { background: linear-gradient(135deg, #ff9a9e, #fecfef); }
.btn {
  padding: 12px 25px; border-radius: 12px; font-weight: 700;
  cursor: pointer; text-decoration: none;
  transition: all 0.3s cubic-bezier(0.22, 1, 0.36, 1);
  border: none; font-size: 0.95rem;
}
.btn-main { background: #333; color: #fff; }
.btn-main:hover { background: #000; transform: translateY(-2px); }
.btn-sub {
  background: var(--input-bg); color: var(--text-primary);
  border: 1px solid var(--border-input);
}
.btn-sub:hover { background: var(--card-bg); transform: translateY(-2px); }
*::-webkit-scrollbar { width: 4px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.15); border-radius: 4px; }
[data-theme="dark"] *::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); }
