:root {
  --bg: #0f0f13;
  --surface: #1a1a24;
  --surface2: #22222e;
  --surface3: #2a2a38;
  --border: #2e2e3e;
  --accent: #7c5cbf;
  --accent2: #9b7de8;
  --win: #3eb489;
  --loss: #e05c5c;
  --draw: #8a8a9a;
  --lesson: #5b9bd5;
  --note: #d4a843;
  --text: #e8e8f0;
  --muted: #6a6a80;
  --radius: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, 'Noto Sans KR', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.7rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.logo { font-size: 1.4rem; font-weight: 700; letter-spacing: -0.5px; white-space: nowrap; }
.motto { color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.dash-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 1.1rem 1.2rem; }
.dash-label { font-size: 0.65rem; font-weight: 700; color: var(--muted); letter-spacing: 0.6px; text-transform: uppercase; margin-bottom: 0.5rem; }
.header-logo { height: 56px; width: auto; display: block; }
.header-logo-symbol { height: 36px; width: auto; display: block; }
@keyframes tagline-slide-in {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes tagline-slide-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(10px); }
}
.tagline-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.5rem 1.5rem;
  font-size: 0.85rem;
  color: var(--muted);
  letter-spacing: 0.2px;
  position: sticky;
  top: var(--header-h, 72px);
  z-index: 99;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.hamburger-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0.3rem;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.15s;
}
.hamburger-btn:hover { color: var(--text); }
.hamburger-btn.open { color: var(--accent2); }

.tab-dropdown {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  z-index: 300;
  min-width: 180px;
  padding: 0.4rem 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.tab-dropdown::-webkit-scrollbar { display: none; }
.tab-dropdown .tab {
  display: flex;
  width: 100%;
  text-align: left;
  padding: 0.7rem 1.3rem;
  border-bottom: none;
  border-radius: 0;
  font-size: 0.92rem;
  box-sizing: border-box;
}
.tab-dropdown .tab.active {
  color: var(--accent2);
  background: rgba(139,92,246,0.08);
  border-bottom: none;
}
.journal-tab { display: none; }
.tab-dropdown .dropdown-expandable { justify-content: space-between; align-items: center; }
.tab-dropdown .dropdown-expandable .expand-arrow { font-size: 1rem; transition: transform 0.2s; margin-left: auto; }
.tab-dropdown .dropdown-expandable.expanded .expand-arrow { transform: rotate(180deg); }
.dropdown-sub { background: rgba(0,0,0,0.15); overflow: hidden; }
.dropdown-sub button { display: flex; width: 100%; text-align: left; padding: 0.55rem 1.3rem 0.55rem 2rem; background: none; border: none; color: var(--muted); font-size: 0.85rem; cursor: pointer; box-sizing: border-box; }
.dropdown-sub button:hover { color: var(--text); }
.dropdown-sub button.active { color: var(--accent2); font-weight: 500; }

/* 백과사전 */
.equip-type-btn { background:var(--surface2); border:1px solid var(--border); color:var(--muted); padding:0.3rem 0.7rem; border-radius:20px; font-size:0.78rem; cursor:pointer; transition:all 0.15s; }
.equip-type-btn.active { background:var(--accent); border-color:var(--accent); color:#fff; }
.wiki-card { background:var(--surface); border:1px solid var(--border); border-radius:10px; padding:0.9rem 1rem; margin-bottom:0.6rem; cursor:pointer; transition:background 0.15s; }
.wiki-card:hover { background:var(--surface2); }
.wiki-card-title { font-weight:600; font-size:0.95rem; color:var(--text); margin-bottom:0.25rem; }
.wiki-card-meta { font-size:0.75rem; color:var(--muted); }
.star-btn { background:none; border:none; font-size:1.4rem; cursor:pointer; padding:0.1rem; color:var(--border); transition:color 0.1s; }
.star-btn.filled { color:#f59e0b; }
.rating-row { display:flex; align-items:center; justify-content:space-between; padding:0.4rem 0; border-bottom:1px solid var(--border); }
.rating-row:last-child { border-bottom:none; }


@media (max-width: 480px) {
  header { padding: 0.5rem 0.8rem; }
  .logo { font-size: 0.95rem; }
  .motto { display: none; }
  .header-logo { height: 40px; }
  .header-logo-symbol { height: 28px; }
  .tagline-bar { padding: 0.35rem 1rem; font-size: 0.72rem; }
  .header-text-btn, #logout-btn, .btn-write, .tab-write-btn {
    padding: 0.25rem 0.4rem;
    font-size: 0.7rem;
    white-space: nowrap;
  }
}

#logout-btn {
  background: rgba(224,92,92,0.15);
  border: 1px solid var(--loss);
  color: var(--loss);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s;
}
#logout-btn:hover { background: rgba(224,92,92,0.3); }

.notif-btn {
  position: relative; cursor: pointer; color: var(--muted);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: color 0.15s, background 0.15s;
}
.notif-btn:hover { color: var(--text); background: var(--surface2); }
.notif-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; border-radius: 8px;
  background: #e05c5c; color: #fff;
  font-size: 0.62rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px; border: 1.5px solid var(--bg);
}
.notif-panel {
  position: fixed; top: calc(var(--header-h, 72px) + 4px); right: 1rem;
  width: 300px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  z-index: 200; overflow: hidden;
}
.notif-panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 0.9rem 1rem 0.7rem; border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 0.9rem;
}
.notif-list { padding: 0.5rem 0; max-height: 320px; overflow-y: auto; }
.notif-item {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.7rem 1rem;
}
.notif-item-avatar {
  width: 38px; height: 38px; border-radius: 50%; background: var(--surface2);
  flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.notif-item-avatar img { width: 100%; height: 100%; object-fit: cover; }
.notif-item-info { flex: 1; min-width: 0; }
.notif-item-name { font-size: 0.85rem; font-weight: 600; }
.notif-item-time { font-size: 0.72rem; color: var(--muted); margin-top: 1px; }
.notif-item-actions { display: flex; gap: 0.4rem; flex-shrink: 0; }
.notif-accept { background: var(--accent); border: none; color: #fff; padding: 0.3rem 0.6rem; border-radius: 6px; font-size: 0.75rem; font-weight: 600; cursor: pointer; }
.notif-reject { background: none; border: 1px solid var(--border); color: var(--muted); padding: 0.3rem 0.6rem; border-radius: 6px; font-size: 0.75rem; cursor: pointer; }
.notif-panel-footer { padding: 0.6rem 1rem; border-top: 1px solid var(--border); text-align: center; }
.notif-empty { padding: 1.5rem 1rem; text-align: center; color: var(--muted); font-size: 0.85rem; }
.notif-item { cursor: pointer; }
.notif-item:hover { background: rgba(255,255,255,0.04); }
.notif-unread { background: rgba(99,102,241,0.07); }

#friends-members-list::-webkit-scrollbar { width: 4px; }
#friends-members-list::-webkit-scrollbar-track { background: transparent; }
#friends-members-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 4px; }

.friend-member-item {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.friend-member-item:last-child { border-bottom: none; }
.friend-member-avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--surface2);
  flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center;
  color: var(--muted);
}
.friend-member-avatar img { width: 100%; height: 100%; object-fit: cover; }
.friend-member-name { flex: 1; font-size: 0.9rem; font-weight: 600; }
.friend-req-btn { background: var(--accent); border: none; color: #fff; padding: 0.3rem 0.75rem; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; }
.friend-req-btn:disabled { background: var(--surface2); color: var(--muted); cursor: default; }
.friend-unfriend-btn { background: none; border: 1px solid var(--border); color: var(--muted); }
.friend-pending-btn { background: none !important; border: 1px solid var(--accent); color: var(--accent); }

.header-avatar-ring {
  position: relative; padding: 2.5px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #6c47ff, #c47fe8);
  cursor: pointer; transition: opacity 0.15s;
}
.header-avatar-ring:hover { opacity: 0.8; }
.header-avatar-gear {
  position: absolute; bottom: 0; right: 0;
  width: 18px; height: 18px; border-radius: 50%;
  background: linear-gradient(135deg, #6c47ff, #c47fe8);
  border: 1.5px solid var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.header-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem; font-weight: 700; color: #fff;
  overflow: hidden;
}
.header-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.my-profile-card {
  display: flex; align-items: center; gap: 1rem;
  background: var(--surface2); border-radius: 12px;
  padding: 1rem 1.2rem; margin-bottom: 1.6rem;
}
.my-avatar-wrap {
  position: relative; flex-shrink: 0; cursor: pointer;
  width: 68px; height: 68px;
  border-radius: 50%;
}
.my-avatar {
  width: 100%; height: 100%; border-radius: 50%;
  background: linear-gradient(135deg, #444, #222);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem; overflow: hidden;
}
.my-avatar img { width: 100%; height: 100%; object-fit: cover; }
.my-avatar-overlay {
  position: absolute; bottom: 1px; right: 1px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent2); border: 2px solid var(--surface2);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; line-height: 1; color: #fff;
  font-weight: 700;
}
.my-avatar-hint { font-size: 0.72rem; color: var(--muted); margin-top: 0.3rem; }
.my-name { font-weight: 700; font-size: 1.05rem; margin-bottom: 0.3rem; }
.my-meta { font-size: 0.82rem; color: var(--muted); }
.my-role-badge {
  display: inline-block; padding: 0.15rem 0.5rem; border-radius: 20px;
  font-size: 0.75rem; font-weight: 600;
}
.my-section-title {
  font-size: 0.82rem; font-weight: 700; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 0.8rem;
}
.my-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  color: var(--text); padding: 0.65rem 0.9rem; border-radius: 8px;
  font-size: 0.93rem; margin-bottom: 0.7rem; box-sizing: border-box;
}
.my-input:focus { outline: none; border-color: var(--accent2); }
.my-save-btn {
  width: 100%; background: var(--accent); border: none; color: #fff;
  padding: 0.7rem; border-radius: 8px; font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: background 0.15s;
}
.my-save-btn:hover { background: var(--accent2); }
.my-msg { font-size: 0.83rem; margin-top: 0.7rem; padding: 0.55rem 0.8rem; border-radius: 7px; display: none; }
.my-msg.error { color: #e05c5c; background: rgba(224,92,92,0.1); }
.my-msg.success { color: var(--win); background: rgba(62,180,137,0.1); }

.header-text-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.4rem 0.9rem;
  border-radius: 8px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.header-text-btn:hover { color: var(--text); border-color: var(--muted); }
.btn-write { color: #fff !important; border-color: #fff !important; }
.btn-write:hover { color: #fff !important; border-color: #fff !important; opacity: 0.8; }

.icon-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.icon-btn:hover { background: var(--surface2); border-color: var(--muted); }

.tab-nav {
  display: none;
  gap: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 1.5rem;
  max-width: 100%;
  position: sticky;
  top: var(--tab-top, 108px);
  z-index: 99;
}

.tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.55rem 1.2rem;
  cursor: pointer;
  font-size: 0.9rem;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
}

.tab.active { color: var(--accent2); border-bottom-color: var(--accent2); }
.tab:hover { color: var(--text); }

.tab-divider { width: 1px; background: var(--border); align-self: stretch; margin: 6px 2px; flex-shrink: 0; }

.tab-write-btn {
  align-self: center;
  flex-shrink: 0;
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
  white-space: nowrap;
}
.tab-write-btn:hover { opacity: 0.8; }

main { max-width: 800px; margin: 0 auto; padding: 1.5rem; }

.sub-tab-nav {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.6rem;
  margin-bottom: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.3rem;
}
.equip-type-filter-nav {
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.equip-type-filter-nav::-webkit-scrollbar { display: none; }
.equip-type-filter-nav .sub-tab { flex-shrink: 0; }
.equip-filter-wrap {
  position: relative;
}
.equip-filter-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 56px;
  background: linear-gradient(to right, transparent, var(--surface));
  pointer-events: none;
  border-radius: 0 10px 10px 0;
  transition: opacity 0.2s;
}
.equip-filter-wrap.at-end::after {
  opacity: 0;
}
.equip-filter-arrow {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s;
  z-index: 1;
  padding: 0;
}
.equip-filter-wrap.at-end .equip-filter-arrow {
  opacity: 0;
  pointer-events: none;
}

.sub-tab {
  background: none;
  border: none;
  color: var(--muted);
  padding: 0.4rem 1rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.sub-tab.active {
  background: var(--accent2);
  color: #fff;
  font-weight: 500;
}

.sub-tab:hover:not(.active) { color: var(--text); background: rgba(255,255,255,0.05); }
.sub-tab-divider { width: 1px; flex-shrink: 0; background: var(--border); margin: 0.2rem 0; align-self: stretch; }

.subtype-btns {
  display: flex;
  gap: 0.4rem;
}

.subtype-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.35rem 0.9rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
}

.subtype-btn.active {
  background: rgba(124,92,191,0.25);
  border-color: var(--accent2);
  color: var(--accent2);
  font-weight: 600;
}

.subtype-btn:hover:not(.active) { border-color: var(--text); color: var(--text); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.filters {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
  flex-wrap: wrap;
}

.filters input, .filters select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
}

.filters input { flex: 1; min-width: 180px; }

.search-wrap {
  flex: 1; min-width: 180px;
  display: flex; align-items: center; gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 0.8rem;
}
.search-wrap:focus-within { border-color: var(--accent2); }
.search-icon { color: var(--muted); flex-shrink: 0; }
.search-divider {
  width: 1px; height: 14px;
  background: var(--border);
  margin: 0 0.65rem;
  flex-shrink: 0;
}
.search-wrap .search-input {
  background: none; border: none; padding: 0.55rem 0;
  flex: 1; min-width: 0; outline: none;
}

.entry-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 0.8rem;
  transition: border-color 0.15s;
}

.entry-card[onclick]:hover,
.entry-card.clickable:hover { border-color: var(--accent); }

.entry-card-top {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.3rem;
}
.entry-title-row {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  margin-bottom: 0.4rem;
}
.entry-title-row .entry-title {
  flex: 1;
  margin-bottom: 0;
}
.card-bottom-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: auto;
  padding-top: 0.4rem;
}
.card-author {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  color: var(--muted);
}
.card-author-avatar {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.card-author-initial {
  background: rgba(155,111,224,0.2);
  color: var(--accent2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.6rem;
  font-weight: 600;
}
.comment-count {
  font-size: 0.72rem;
  color: var(--muted);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}
.comments-count-badge {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}
.badge {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge-lesson { background: rgba(91,155,213,0.2); color: var(--lesson); }
.badge-lesson-private { background: rgba(91,155,213,0.2); color: #7eb8e8; }
.badge-lesson-group { background: rgba(67,200,138,0.2); color: #43c88a; }
.badge-match { background: rgba(124,92,191,0.2); color: var(--accent2); }
.badge-match-sparring { background: rgba(124,92,191,0.2); color: #b07ee8; }
.badge-match-tournament { background: rgba(212,140,40,0.2); color: #e09a40; }
.badge-note { background: rgba(212,168,67,0.2); color: var(--note); }
.badge-training { background: rgba(80,200,180,0.2); color: #50c8b4; }

.game-num {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
  font-weight: 700;
  background: rgba(255,255,255,0.06);
  color: var(--muted);
  letter-spacing: 0.3px;
}

.info-tag {
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  font-weight: 600;
  background: rgba(91,155,213,0.15);
  color: #7eb8e8;
}

.tag-location {
  background: rgba(67,190,140,0.15);
  color: #43c88a;
}

.tag-opponent {
  background: rgba(212,168,67,0.15);
  color: #d4a843;
}

.result-tag {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-weight: 700;
}

.result-win { background: rgba(62,180,137,0.2); color: var(--win); }
.result-loss { background: rgba(224,92,92,0.2); color: var(--loss); }
.result-draw { background: rgba(138,138,154,0.2); color: var(--draw); }

.entry-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  overflow: hidden;
}
.entry-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.no-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  background: var(--surface2);
  color: var(--muted);
  border: 1px solid var(--border);
  flex-shrink: 0;
  letter-spacing: -0.03em;
}

.entry-date { color: var(--muted); font-size: 0.8rem; margin-left: auto; }

.entry-meta {
  color: var(--muted);
  font-size: 0.82rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.entry-snippet {
  color: #9a9ab0;
  font-size: 0.83rem;
  margin-top: 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body {
  display: flex;
  gap: 0.8rem;
  align-items: stretch;
}

.thumb-wrap {
  position: relative;
  width: 42%;
  flex-shrink: 0;
  align-self: flex-start;
}
.card-body.has-thumb .yt-thumb {
  width: 100%;
  display: block;
  border-radius: 6px;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: var(--surface2);
}
.card-author-overlay {
  position: absolute;
  top: 6px;
  left: 6px;
  display: flex;
  align-items: center;
  gap: 0.25rem;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  justify-content: center;
  color: rgba(255,255,255,0.9);
  pointer-events: none;
}

.card-body.has-thumb .card-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.card-body:not(.has-thumb) .card-text {
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* Form */
.entry-form { max-width: 560px; }

.form-row {
  margin-bottom: 1rem;
}

.form-row label {
  display: block;
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.form-row input[type=text],
.form-row input[type=date],
.form-row input[type=url],
.form-row select,
.form-row textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
}

.form-row textarea { resize: vertical; }

.type-btns, .result-btns {
  display: flex;
  gap: 0.5rem;
}

.type-btn, .result-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s;
}

.type-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.result-btn[data-result=win].active { background: var(--win); border-color: var(--win); color: #fff; }
.result-btn[data-result=loss].active { background: var(--loss); border-color: var(--loss); color: #fff; }
.result-btn[data-result=draw].active { background: var(--draw); border-color: var(--draw); color: #fff; }

.form-actions { display: flex; gap: 0.8rem; margin-top: 1.5rem; }

.video-entry {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  margin-bottom: 0.6rem;
  position: relative;
}

.video-entry input[type=url] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  font-size: 0.88rem;
  margin-bottom: 0.5rem;
  box-sizing: border-box;
}

.video-entry textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.5rem 0.7rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-family: inherit;
  resize: vertical;
  min-height: 60px;
  box-sizing: border-box;
}

.video-entry-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 0.3rem;
  display: block;
}

.btn-remove-video {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.85rem;
}
.btn-remove-video:hover { color: var(--loss); }

.btn-add-video {
  background: none;
  border: 1px dashed var(--border);
  color: var(--muted);
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
  width: 100%;
  margin-top: 0.2rem;
  transition: border-color 0.15s, color 0.15s;
}
.btn-add-video:hover { border-color: var(--accent2); color: var(--accent2); }

.btn-primary {
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0.65rem 1.8rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--accent2); }

button#cancel-edit, #btn-draft, #btn-cancel-write {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.65rem 1.2rem;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: 0.9rem;
}
#btn-draft { border-color: var(--accent); color: var(--accent); }
#btn-cancel-write { border-color: var(--loss); color: var(--loss); }

#load-more {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.6rem 2rem;
  border-radius: var(--radius);
  cursor: pointer;
}

/* Stats */
.stats-header { margin-bottom: 1.2rem; }
.stats-header select {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
}

.stat-num { font-size: 2rem; font-weight: 700; color: #fff; }
.stat-label { font-size: 0.8rem; color: var(--muted); margin-top: 0.2rem; }
.stat-win .stat-num { color: #fff; }
.stat-loss .stat-num { color: #fff; }
.stat-lesson .stat-num { color: #fff; }
.stat-match .stat-num { color: #fff; }

.winrate-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}

.bar-track {
  height: 10px;
  background: var(--surface2);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 0.6rem;
}

.bar-fill {
  height: 100%;
  background: var(--win);
  border-radius: 5px;
  transition: width 0.4s;
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 700;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 2rem 1rem;
  overflow-y: auto;
}

.modal-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  width: 100%;
  max-width: 620px;
  padding: 1.5rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-type-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.modal-title-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; margin-bottom: 0.8rem; }
.modal-title { font-size: 1.3rem; font-weight: 700; display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; flex: 1; }
.modal-author { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--muted); white-space: nowrap; flex-shrink: 0; }
.modal-author-avatar { width: 22px; height: 22px; border-radius: 50%; object-fit: cover; }
.modal-author-initial { background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; }
.modal-date { color: var(--muted); font-size: 0.85rem; }

.modal-match-info {
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  margin: 0.8rem 0;
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.modal-match-info span { font-size: 0.88rem; }
.modal-match-info strong { color: var(--text); }
.badge-game-type {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 20px;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border);
  color: var(--muted);
}

.modal-content {
  white-space: pre-wrap;
  line-height: 1.7;
  font-size: 0.92rem;
  color: #c0c0d0;
  margin: 0.8rem 0;
}

.modal-tags { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.8rem; }
.tag {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 0.2rem 0.7rem;
  font-size: 0.78rem;
  color: var(--muted);
}

.modal-actions { display: flex; gap: 0.45rem; margin-top: 1rem; justify-content: flex-end; }

.btn-edit {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent2);
  padding: 0.32rem 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.8rem;
}

.btn-delete {
  background: none;
  border: 1px solid var(--border);
  color: var(--loss);
  padding: 0.32rem 0.85rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.8rem;
}

.yt-embed {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 8px;
  border: none;
  margin: 0.4rem 0 0.8rem;
}

.video-tabs {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin: 0.6rem 0 0;
}

.video-tab-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.15s;
}

.video-tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.video-desc {
  background: var(--surface2);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  font-size: 0.88rem;
  color: #c0c0d0;
  line-height: 1.7;
  margin-top: 0.4rem;
  white-space: pre-wrap;
}

.video-desc:empty { display: none; }
.video-desc blockquote { border-left: 3px solid var(--accent); padding-left: 0.8rem; margin: 0.4rem 0; color: #a0a0c0; }
.video-desc ul { padding-left: 1.2rem; margin: 0.4rem 0; }
.video-desc li { margin-bottom: 0.2rem; }
.video-desc strong { color: var(--text); }

/* 댓글 */
.comments-section { margin-top: 1.2rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.comments-title { font-size: 0.85rem; color: var(--muted); margin-bottom: 0.8rem; }
.comment-item {
  display: flex; gap: 0.7rem; align-items: flex-start;
  background: var(--surface2); border-radius: 8px;
  padding: 0.65rem 0.9rem; margin-bottom: 0.5rem; position: relative;
}
.comment-avatar {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
}
.comment-avatar-initial {
  display: flex; align-items: center; justify-content: center;
  font-size: 0.82rem; font-weight: 700;
}
.comment-main { flex: 1; min-width: 0; }
.comment-header { display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; }
.comment-author { font-size: 0.78rem; font-weight: 600; }
.comment-time { font-size: 0.72rem; color: var(--muted); }
.comment-body { font-size: 0.88rem; margin-top: 0.3rem; line-height: 1.5; }
.comment-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 0.8rem; }
.comment-form { display: flex; gap: 0.5rem; margin-top: 0.8rem; }
.comment-form textarea {
  flex: 1; background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 8px; padding: 0.55rem 0.8rem;
  font-size: 0.88rem; font-family: inherit; resize: none; min-height: 60px;
}
.comment-form textarea:focus { outline: none; border-color: var(--accent); }
.comment-submit {
  background: var(--accent); border: none; color: #fff;
  padding: 0 1rem; border-radius: 8px; cursor: pointer; font-size: 0.85rem; font-weight: 600;
  align-self: flex-end; height: 38px;
}
.comment-submit:hover { background: var(--accent2); }

.empty { text-align: center; color: var(--muted); padding: 3rem 1rem; font-size: 0.95rem; }

/* Day group header */
.day-group { margin-bottom: 1.4rem; }

.day-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 0.6rem;
}

.day-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent2);
  letter-spacing: 0.3px;
  white-space: nowrap;
}

.day-line {
  flex: 1;
  height: 1px;
  background: var(--border);
}

.cal-add-btn {
  margin-left: auto;
  background: var(--accent);
  border: none;
  color: #fff;
  padding: 0.35rem 0.8rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.cal-add-btn:hover { background: var(--accent2); }

.cal-view-toggle { display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 2px; }
.cal-view-btn { background: none; border: none; color: var(--muted); padding: 0.25rem 0.7rem; border-radius: 6px; font-size: 0.78rem; font-weight: 600; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.cal-view-btn.active { background: var(--accent); color: #fff; }

/* Calendar */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-size: 1.05rem;
  font-weight: 700;
}
.cal-nav > :first-child { flex-shrink: 0; }
.cal-nav > :nth-child(2) { flex: 1; justify-content: center; }
.cal-nav > :last-child { flex-shrink: 0; }
#cal-month-label { white-space: nowrap; font-size: 0.95rem; }

.cal-nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  width: 24px; height: 24px;
  font-size: 1rem;
  cursor: pointer;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.cal-nav-btn:hover { border-color: var(--accent2); color: var(--accent2); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}

#cal-body {
  grid-auto-rows: 88px;
}

.cal-dow {
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
  padding: 0.3rem 0 0.5rem;
  font-weight: 600;
}

.cal-cell {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.35rem 0.4rem;
  position: relative;
  overflow: hidden;
  height: 88px;
}

.cal-cell.today { border-color: var(--accent2); }
.cal-cell.other-month { opacity: 0.35; }

.cal-day-num {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  margin-bottom: 0.3rem;
  overflow: hidden;
}
.cal-holiday-name {
  display: block;
  font-size: 0.58rem;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  line-height: 1.2;
}

.cal-cell.today .cal-day-num {
  color: var(--accent2);
}

.cal-entry-pill {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.18rem 0.4rem;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 600;
  margin-bottom: 2px;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  transition: opacity 0.1s;
}
.cal-entry-pill:hover { opacity: 0.8; }
.cal-sched-spacer { height: 22px; margin-bottom: 2px; }

/* Weekly view */
.cal-week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.week-col { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 0.35rem 0.4rem; min-height: 320px; }
.week-col.today { border-color: var(--accent2); }
.week-col-hdr { text-align: center; padding-bottom: 0; margin-bottom: 0.3rem; border-bottom: none; }
.week-date { font-size: 0.75rem; font-weight: 600; color: var(--muted); margin-bottom: 0.3rem; padding-top: 0.1rem; }
.week-col.today .week-date { color: var(--accent2); }

.cal-pill-lesson     { background: rgba(160,160,175,0.2); color: #a0a0b0; }
.cal-pill-match.win  { background: rgba(160,160,175,0.2); color: #a0a0b0; }
.cal-pill-match.loss { background: rgba(160,160,175,0.2); color: #a0a0b0; }
.cal-pill-match.draw { background: rgba(160,160,175,0.2); color: #a0a0b0; }
.cal-pill-match      { background: rgba(160,160,175,0.2); color: #a0a0b0; }
.cal-pill-note       { background: rgba(160,160,175,0.2); color: #a0a0b0; }
.cal-pill-schedule   { background: linear-gradient(135deg, rgba(108,71,255,0.22), rgba(180,100,230,0.22)); color: #b07ee8; }
.cal-pill-camp       { background: linear-gradient(135deg, rgba(33,52,212,0.28), rgba(60,90,240,0.22)); color: #6680ff; }
.cal-pill-tournament { background: linear-gradient(135deg, rgba(220,60,120,0.22), rgba(240,100,160,0.22)); color: #e0609a; }
.cal-pill-other      { background: linear-gradient(135deg, rgba(220,120,30,0.25), rgba(240,160,50,0.22)); color: #e09040; }

.cal-more {
  font-size: 0.65rem;
  color: var(--muted);
  text-align: right;
  margin-top: 1px;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.3rem;
  padding: 1.2rem 0 0.5rem;
  flex-wrap: wrap;
}

.pg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  min-width: 2rem;
  height: 2rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.15s;
  padding: 0 0.5rem;
}

.pg-btn:hover { border-color: var(--accent2); color: var(--accent2); }

.pg-btn.pg-active {
  background: var(--accent2);
  border-color: var(--accent2);
  color: #fff;
  font-weight: 700;
}

.pg-disabled {
  color: var(--border);
  font-size: 0.85rem;
  padding: 0 0.3rem;
}

.pg-ellipsis {
  color: var(--muted);
  font-size: 0.85rem;
  padding: 0 0.2rem;
}

.video-subtitles {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin-top: 0.35rem;
}

.video-subtitle-item {
  font-size: 0.78rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.denied-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 1rem;
  gap: 0.8rem;
}
.denied-icon { color: var(--muted); }
.denied-text { font-size: 1rem; color: var(--muted); font-weight: 600; }

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.2rem;
  font-size: 0.75rem;
  color: var(--muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}
.footer-icon-link {
  display: inline-flex;
  align-items: center;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
  flex-shrink: 0;
}
.footer-icon-link:hover { color: var(--text); }
.footer-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.2rem;
}
.footer-right-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.footer-text-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.75rem;
  transition: color 0.15s;
}
.footer-text-link:hover { color: var(--text); }
.footer-sep { color: var(--muted); font-size: 0.75rem; }
.footer-links { display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap; justify-content: center; }
.footer-copy { font-size: 0.75rem; color: var(--muted); }

.member-row { display: flex; align-items: center; gap: 0.8rem; }
.member-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 0.95rem;
}
#avatar-zoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#avatar-zoom-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
}
.member-tag {
  display: inline-block; padding: 0.15rem 0.55rem; border-radius: 20px;
  font-size: 0.72rem; font-weight: 700;
}
.tag-coach { background: rgba(224,92,92,0.2); color: var(--loss); }
.tag-user  { background: rgba(91,155,213,0.2); color: var(--lesson); }

.admin-pending-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  padding: 0.4rem 0.9rem; border-radius: 8px; font-size: 0.82rem;
  cursor: pointer; transition: color 0.15s, border-color 0.15s; white-space: nowrap;
}
.admin-pending-btn:hover { color: var(--text); border-color: var(--muted); }

.mf-nav {
  display: flex; flex-wrap: nowrap; gap: 0.4rem; margin-bottom: 0.5rem;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 0.3rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mf-nav::-webkit-scrollbar { display: none; }
.mf-btn {
  background: none; border: none; color: var(--muted);
  padding: 0.4rem 1rem; border-radius: 7px; font-size: 0.85rem;
  cursor: pointer; transition: all 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.mf-btn.active { background: var(--accent2); color: #fff; font-weight: 600; }
.mf-btn:hover:not(.active) { color: var(--text); background: rgba(255,255,255,0.05); }

.comment-edit-btn { background: none; border: none; color: var(--muted); font-size: 0.72rem; cursor: pointer; padding: 0; }
.comment-edit-btn:hover { color: var(--accent2); }
.comment-edit-textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 0.4rem 0.6rem; font-size: 0.88rem; resize: vertical;
  min-height: 56px; box-sizing: border-box; margin-top: 0.3rem;
}
.comment-save-btn { background: var(--accent); border: none; color: #fff; padding: 0.3rem 0.7rem; border-radius: 6px; font-size: 0.8rem; cursor: pointer; }
.comment-cancel-btn { background: none; border: 1px solid var(--border); color: var(--muted); padding: 0.3rem 0.7rem; border-radius: 6px; font-size: 0.8rem; cursor: pointer; }

.replies-wrap { margin-left: 1.8rem; margin-top: 0.3rem; }
.comment-reply { background: rgba(255,255,255,0.03); }
.comment-avatar-sm { width: 26px !important; height: 26px !important; font-size: 0.7rem !important; }
.comment-reply-btn { background: none; border: none; color: var(--muted); font-size: 0.72rem; cursor: pointer; padding: 0.2rem 0; margin-top: 0.2rem; }
.comment-reply-btn:hover { color: var(--accent2); }
.reply-form { margin-top: 0.5rem; }

/* 날짜 바텀시트 */
.day-sheet-section { margin-bottom: 1.2rem; }
.day-sheet-section-title { font-size: 0.72rem; font-weight: 700; color: var(--muted); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 0.5rem; }
.day-sheet-empty { font-size: 0.83rem; color: var(--muted); padding: 0.4rem 0; }
.day-sheet-item { background: var(--surface2); border-radius: 10px; padding: 0.7rem 0.9rem; margin-bottom: 0.5rem; cursor: pointer; transition: background 0.15s; }
.day-sheet-item:hover { background: var(--border); }
.day-sheet-item-label { font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.2rem; }
.day-sheet-item-sub { font-size: 0.75rem; color: var(--muted); }
.day-sheet-journal { background: var(--surface2); border-radius: 10px; padding: 0.7rem 0.9rem; font-size: 0.84rem; color: var(--text); line-height: 1.6; white-space: pre-wrap; }

/* ── 커스텀 날짜 피커 ─────────────────────────────────────── */
.date-display-btn { width: 100%; text-align: left; background: var(--bg); border: 1px solid var(--border); color: var(--muted); padding: 0.55rem 0.8rem; border-radius: 8px; font-size: 0.9rem; cursor: pointer; font-family: inherit; box-sizing: border-box; }
.date-display-btn.has-date { color: var(--text); }
.cdp-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.55); }
.cdp-sheet { position: absolute; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto; background: var(--surface); border-radius: 20px 20px 0 0; padding: 1.3rem 1.2rem 2.5rem; }
.cdp-quick { display: flex; gap: 0.6rem; margin-bottom: 1rem; }
.cdp-quick button { flex: 1; padding: 0.6rem; border-radius: 10px; background: rgba(124,92,191,0.15); color: var(--accent2); border: 1px solid rgba(124,92,191,0.35); font-size: 0.88rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.cdp-nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; }
.cdp-nav-btn { background: none; border: none; color: var(--text); font-size: 1.5rem; padding: 0.2rem 0.7rem; cursor: pointer; }
.cdp-month { font-size: 1rem; font-weight: 700; color: var(--text); }
.cdp-weekdays { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; font-size: 0.68rem; color: var(--muted); padding: 0.3rem 0; margin-bottom: 0.2rem; }
.cdp-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 3px; }
.cdp-cell { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 0.88rem; cursor: pointer; color: var(--text); -webkit-tap-highlight-color: transparent; }
.cdp-cell:active { background: var(--surface2); }
.cdp-cell.is-today { color: var(--accent2); font-weight: 700; }
.cdp-cell.is-selected { background: var(--accent) !important; color: #fff !important; font-weight: 700; }
.cdp-cell.is-empty { pointer-events: none; }
.rdp-grid .cdp-cell.rdp-start { background: var(--accent) !important; color: #fff !important; font-weight: 700; border-radius: 50% 0 0 50%; }
.rdp-grid .cdp-cell.rdp-end { background: var(--accent) !important; color: #fff !important; font-weight: 700; border-radius: 0 50% 50% 0; }
.rdp-grid .cdp-cell.rdp-start.rdp-end { border-radius: 50%; }
.rdp-grid .cdp-cell.rdp-in-range { background: rgba(124,92,191,0.22) !important; border-radius: 0; color: var(--text); }

/* ── 친구 태그 카드 ──────────────────────────────────────── */
.ftag-card { display: inline-flex; align-items: center; gap: 5px; border-radius: 6px; padding: 3px 8px 3px 4px; font-size: 0.8rem; font-weight: 600; vertical-align: middle; border: 1px solid currentColor; border-color: inherit; }
.ftag-teacher { background: rgba(91,155,213,0.15); color: #7eb8e8; border: 1px solid rgba(91,155,213,0.25); }
.ftag-opponent { background: rgba(180,130,90,0.15); color: #d4a574; border: 1px solid rgba(180,130,90,0.25); }
.ftag-avatar { width: 20px; height: 20px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.ftag-initial { width: 20px; height: 20px; border-radius: 50%; background: var(--surface2); display: flex; align-items: center; justify-content: center; font-size: 0.65rem; font-weight: 700; flex-shrink: 0; }

/* ── 이름 자동완성 ────────────────────────────────────────── */
.name-autocomplete-wrap { position: relative; flex: 1; }
.name-autocomplete-wrap input { width: 100%; }
.name-suggest-list { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; z-index: 200; overflow: hidden; box-shadow: 0 4px 16px rgba(0,0,0,0.3); }
.name-suggest-list.open { display: block; }
.name-suggest-item { display: flex; align-items: center; gap: 8px; padding: 0.6rem 0.8rem; cursor: pointer; font-size: 0.88rem; transition: background 0.15s; }
.name-suggest-item:hover { background: var(--surface3); }
.name-suggest-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.name-suggest-initial { width: 28px; height: 28px; border-radius: 50%; background: var(--accent)22; color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 0.75rem; font-weight: 700; flex-shrink: 0; }

@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes badgePopIn { from { opacity:0; transform:scale(0.6) translateY(-20px); } to { opacity:1; transform:scale(1) translateY(0); } }
@keyframes badgeEarn { 0%{transform:scale(1)} 30%{transform:scale(1.25)} 60%{transform:scale(0.9)} 100%{transform:scale(1)} }


/* ── 스크롤바 스타일 ─────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.22); }

/* 내 코치 / 내 친구 목록 스크롤바 */
#my-coaches-list::-webkit-scrollbar,
#my-friends-list::-webkit-scrollbar { width: 2px; }
#my-coaches-list::-webkit-scrollbar-track,
#my-friends-list::-webkit-scrollbar-track { background: transparent; }
#my-coaches-list::-webkit-scrollbar-thumb,
#my-friends-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.18); border-radius: 2px; }
#my-coaches-list::-webkit-scrollbar-button,
#my-friends-list::-webkit-scrollbar-button { display: none; }
#my-coaches-list, #my-friends-list { padding-right: 6px; scrollbar-width: thin; }
