/*
  NoonTV 뼈대 스타일 — 디자인은 따로 입힐 예정이라 배치·반응형·접근성에 필요한 최소한만 있어요.
  색은 아래 변수만 바꾸면 전체가 바뀝니다. 375px 폭에서 가로 넘침이 없어야 해요.
*/

:root {
  --bg: #171719;
  --surface: #202629;
  --line: #354248;
  --text: #ececf1;
  --muted: #9a9aa6;
  --accent: #78b9c2;
  --live: #f7b76a;
  --radius: 8px;
  --wide: 1280px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 120px; }
.site-main {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 'Noto Sans KR', system-ui, sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}
.site-main a { color: inherit; }
.site-main img, .site-main iframe { max-width: 100%; }
.site-main img { height: auto; display: block; }
.site-main svg { width: 1em; height: 1em; vertical-align: -0.125em; flex: none; }
.site-main h1, .site-main h2, .site-main h3 { line-height: 1.3; margin: 0; }
.site-main p { margin: 0; }
.site-main ul, .site-main ol { margin: 0; padding: 0; list-style: none; }
.site-main input, .site-main textarea, .site-main select, .site-main button { font: inherit; color: inherit; }
.site-main input, .site-main textarea, .site-main select {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
textarea { resize: vertical; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 10; background: var(--surface); padding: 8px 12px; }
.muted, .help { color: var(--muted); font-size: 13px; }

.button, .link-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 40px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  text-decoration: none; cursor: pointer; white-space: nowrap;
}
.button.is-primary { background: var(--accent); border-color: var(--accent); color: #12252a; }
.button.is-danger { border-color: var(--live); color: var(--live); }
.link-button { min-height: auto; padding: 0; background: none; border: 0; color: var(--muted); }

.notice { padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 12px; }
.notice.is-error { border-color: var(--live); }
.notice.is-ok { border-color: var(--accent); }

/* ---------- 머리말 ---------- */

.site-header { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.header-top, .main-nav ul, .site-main, .footer-inner { width: min(100% - 32px, var(--wide)); margin-inline: auto; }
.header-top { display: flex; align-items: center; gap: 16px; min-height: 60px; flex-wrap: wrap; padding-block: 8px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 20px; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; object-fit: contain; border-radius: 7px; }
.site-search { flex: 1; display: flex; max-width: 420px; position: relative; }
.site-search button { position: absolute; right: 4px; top: 4px; bottom: 4px; width: 36px; background: none; border: 0; cursor: pointer; }
.member-area { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.member-area a { text-decoration: none; }
.member-name { display: inline-flex; align-items: center; gap: 4px; }
.main-nav ul { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.main-nav a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 12px; text-decoration: none; white-space: nowrap; color: var(--muted); }
.main-nav a[aria-current='page'] { color: var(--text); box-shadow: inset 0 -2px var(--accent); }

/* ---------- 본문 공통 ---------- */

.site-main { padding-block: 24px 48px; display: grid; gap: 32px; }
.hero { padding: 24px 0 8px; }
.hero h1 { font-size: clamp(24px, 4vw, 36px); }
.hero p { color: var(--muted); margin-top: 8px; }
.page-head h1 { font-size: 24px; }
.page-head p { color: var(--muted); margin-top: 4px; }
.section { display: grid; gap: 12px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.section-head h2 { font-size: 18px; display: inline-flex; align-items: center; gap: 6px; }
.section-more { display: inline-flex; align-items: center; color: var(--muted); text-decoration: none; font-size: 14px; }
.empty-state, .message-page { text-align: center; padding: 48px 16px; display: grid; gap: 12px; justify-items: center; }

.category-tabs ul, .sort-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.category-tabs a, .sort-tabs a { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--muted); }
.category-tabs a[aria-current='page'], .sort-tabs a[aria-current='page'] { color: var(--text); border-color: var(--accent); }

/* ---------- 영상 카드 ---------- */

.video-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px 16px; }
.video-card { display: grid; gap: 6px; text-decoration: none; }
.thumb { position: relative; aspect-ratio: 16 / 9; overflow: hidden; border-radius: var(--radius); background: var(--surface); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-empty { display: grid; place-items: center; width: 100%; height: 100%; font-size: 32px; color: rgb(255 255 255 / 0.7); }
.tone-0 { background: #1e3a5f; } .tone-1 { background: #3b1f4d; } .tone-2 { background: #1f4d3a; }
.tone-3 { background: #4d3a1f; } .tone-4 { background: #4d1f2a; } .tone-5 { background: #2a2a4d; }
.live-badge { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 700; background: rgb(0 0 0 / 0.7); }
.live-badge.is-live { background: var(--live); }
.video-title { font-size: 15px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.video-meta { display: flex; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.video-meta span { display: inline-flex; align-items: center; gap: 3px; }

/* 예정 중계 시간표 */
.schedule { border-top: 1px solid var(--line); }
.schedule a { display: flex; gap: 12px; align-items: baseline; padding: 12px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
.schedule-time { flex: none; width: 120px; font-variant-numeric: tabular-nums; color: var(--accent); }
.schedule-category { flex: none; color: var(--muted); font-size: 13px; }
.schedule-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 영상(중계) 보기 ---------- */

.watch { display: grid; gap: 16px; }
.watch-stage { display: grid; gap: 16px; }
.watch.has-chat .watch-stage { grid-template-columns: minmax(0, 1fr) 360px; }
.player { aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.player iframe { width: 100%; height: 100%; border: 0; display: block; }
.player-empty { height: 100%; display: grid; place-content: center; justify-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.player-empty svg { font-size: 40px; }
.live-chat { min-height: 420px; background: var(--surface); border-radius: var(--radius); overflow: hidden; }
.live-chat iframe { width: 100%; height: 100%; border: 0; display: block; }
.watch-head { display: grid; gap: 8px; }
.watch-head h1 { font-size: 22px; }
.watch-labels { display: flex; gap: 8px; align-items: center; }
.watch-labels .live-badge { position: static; }
.watch-meta { display: flex; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.watch-meta a { display: inline-flex; align-items: center; gap: 4px; }
.watch-description { color: var(--muted); font-size: 14px; white-space: pre-line; }

/* ---------- 커뮤니티 ---------- */

.post-list { border-top: 1px solid var(--line); }
.post-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px solid var(--line); }
.post-row > a { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; text-decoration: none; }
.post-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.post-tag, .post-board { flex: none; font-size: 12px; padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); }
.post-row.is-notice .post-tag { border-color: var(--accent); color: var(--accent); }
.post-comments { flex: none; color: var(--accent); font-size: 13px; }
.post-meta { flex: none; display: flex; gap: 10px; color: var(--muted); font-size: 13px; }
.staff-badge { margin-left: 4px; font-size: 11px; padding: 0 4px; border-radius: 3px; background: var(--accent); color: #12252a; }
.board-tools { display: flex; gap: 12px; justify-content: space-between; flex-wrap: wrap; }
.board-search { display: flex; gap: 8px; flex: 1; max-width: 420px; }

.post { display: grid; gap: 20px; }
.post-head { display: grid; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.post-head h1 { font-size: 22px; }
.post-board-link a { color: var(--accent); text-decoration: none; font-size: 14px; }
.post-body { display: grid; gap: 12px; font-size: 16px; }
.post-actions { display: flex; gap: 8px; justify-content: flex-end; }
.post-form, .auth-form { display: grid; gap: 8px; }
.post-form label, .auth-form label { font-weight: 500; margin-top: 8px; }
.check { display: inline-flex; align-items: center; gap: 6px; }
.check input { width: auto; min-height: auto; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.field-error { color: var(--live); font-size: 13px; font-weight: 400; margin-left: 6px; }

.comments { display: grid; gap: 12px; }
.comments h2 { font-size: 18px; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--line); display: grid; gap: 4px; }
.comment-head { display: flex; gap: 8px; align-items: center; font-size: 14px; }
.comment-head time { color: var(--muted); font-size: 13px; }
.comment-delete { margin-left: auto; }
/* 댓글 신고 링크: 지우기 단추가 없으면 오른쪽 끝으로 */
.comment-report { display: inline-flex; align-items: center; min-height: 40px; padding-inline: 8px; color: var(--muted); font-size: 12px; text-decoration: none; }
.comment-report:hover { color: #ffb4a8; text-decoration: underline; }
.comment-head > .comment-report:not(.comment-delete + .comment-report) { margin-left: auto; }
.comment-body { display: grid; gap: 6px; }
.comment-form { display: grid; gap: 8px; justify-items: end; }

.auth-card { width: min(100%, 400px); margin: 24px auto; display: grid; gap: 16px; }
.auth-card .button.is-primary { margin-top: 12px; }
.auth-switch { text-align: center; color: var(--muted); }

/* ---------- 페이지 · 꼬리말 ---------- */

.pager ul { display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.pager a, .pager span { display: inline-grid; place-items: center; min-width: 40px; height: 40px; border-radius: var(--radius); text-decoration: none; }
.pager [aria-current='page'] { background: var(--accent); color: #12252a; }
.site-footer { border-top: 1px solid var(--line); padding-block: 32px; color: var(--muted); font-size: 13px; }
.footer-inner { display: grid; gap: 12px; }
.footer-links { display: flex; gap: 12px; flex-wrap: wrap; }
.footer-links a { text-decoration: none; }

/* ---------- 반응형 ---------- */

@media (max-width: 1100px) {
  .watch.has-chat .watch-stage { grid-template-columns: 1fr; }
  .live-chat { height: 480px; }
}
@media (max-width: 850px) {
  .video-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .site-header { position: static; }
  .site-search { order: 3; flex-basis: 100%; max-width: none; }
  .video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
  .post-row { flex-wrap: wrap; gap: 4px 12px; }
  .post-meta { width: 100%; }
  .schedule a { flex-wrap: wrap; gap: 4px 12px; }
  .schedule-time { width: auto; }
  .schedule-title { flex-basis: 100%; }
}
@media (max-width: 360px) {
  .video-grid { grid-template-columns: 1fr; }
}

/* 묶음 탭(스포츠 팁·커뮤니티): 게시판이 아닌 화면(스포츠 하이라이트·스코어보드·랭킹)에서. 게시판 화면은 community.css 의 .board-navigation 모양 */
.site-main .section-tabs { display: flex; flex-wrap: wrap; gap: 7px; margin: 4px 0 18px; padding: 5px 0; }
.site-main .section-tabs a {
  display: flex; align-items: center; min-height: 42px; padding: 8px 16px; border: 1px solid #374b50; border-radius: 7px;
  background: #222e32; color: #c1d0d2; font-size: 13px; text-decoration: none; word-break: keep-all; box-shadow: inset 0 1px #ffffff09, 0 2px 0 #10181b;
}
.site-main .section-tabs a:hover { background: #30494e; border-color: #6d999f; color: #fff; }
.site-main .section-tabs a[aria-current="page"] { background: #376b76; border-color: #79aeb6; color: #fff; font-weight: 700; }
@media (max-width: 620px) {
  .site-main .section-tabs { gap: 6px; }
  .site-main .section-tabs a { padding: 8px 12px; font-size: 12px; }
}

/* 회원가입: 선택 칸 표시 (가입경로 자세한 내용) */
.auth-form .auth-optional span { margin-left: 4px; color: var(--muted); font-size: 12px; font-weight: 400; }

/* ---------- 답글 · 댓글 추천 · 알림 · 회원 프로필 ---------- */
.author-link { color: inherit; text-decoration: none; }
.author-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.comment-replies { display: grid; margin: 10px 0 0; padding: 0 0 0 16px; list-style: none; border-left: 2px solid var(--line); }
.comment.is-reply { padding: 10px 0 10px 12px; border-bottom: 0; }
.comment-removed { padding: 4px 0; color: var(--muted); font-size: 13px; }
.comment-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 10px; margin-top: 6px; }
.comment-recommend { margin: 0; }
.comment-like {
  display: inline-flex; align-items: center; gap: 5px; min-height: 40px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 12px; cursor: pointer;
}
.site-main .comment-like svg { width: 14px; height: 14px; }
.comment-like:hover:not(:disabled) { border-color: var(--accent); color: var(--text); }
.comment-like[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.comment-like:disabled { cursor: default; }
.reply-box summary {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 6px; color: var(--muted); font-size: 12px; cursor: pointer; list-style: none;
}
.reply-box summary::-webkit-details-marker { display: none; }
.reply-box summary:hover, .reply-box[open] summary { color: var(--accent); }
.reply-box[open] { flex-basis: 100%; }
.reply-form { margin-top: 4px; }
.comment-reply-login { display: inline-flex; align-items: center; min-height: 40px; padding: 0 6px; color: var(--muted); font-size: 12px; }

.alarm_count, .me-count {
  display: inline-block; min-width: 18px; margin-left: 4px; padding: 0 5px; border-radius: 999px;
  background: #c8323f; color: #fff; font-size: 11px; font-weight: 800; line-height: 18px; text-align: center; vertical-align: 1px;
}
.left_my_alarm { margin-left: 8px; font-size: 12px; text-decoration: none; white-space: nowrap; }
.me-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

.notice-list, .profile-comments { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.notice-item a, .profile-comments a {
  display: grid; gap: 4px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
  text-decoration: none; overflow-wrap: anywhere; word-break: keep-all;
}
.notice-item a:hover, .profile-comments a:hover { border-color: var(--accent); }
.notice-item.is-unread a { border-color: var(--accent); }
.notice-item.is-sanction a { border-left: 4px solid var(--live); }
.notice-new { color: var(--accent); font-size: 12px; font-weight: 800; }
.notice-detail, .profile-comment-where { color: var(--muted); font-size: 13px; }
.notice-item time { color: var(--muted); font-size: 12px; }
.profile-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin: 0 0 22px; }
.profile-stats div { padding: 14px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); text-align: center; }
.profile-stats dt { color: var(--muted); font-size: 12px; }
.profile-stats dd { margin: 4px 0 0; font-size: 20px; font-weight: 800; }

/* 레벨 (src/views/level-avatar.js): 얼굴 위에 계급장 철모를 같은 자리에 겹친 도트 그림, 크기 고정이라 불러오는 동안 밀리지 않아요 */
.level-avatar { position: relative; display: inline-block; flex: none; width: 32px; height: 32px; vertical-align: middle; }
.level-avatar.is-64 { width: 64px; height: 64px; }
/* Density-specific layers are downsampled; nearest-neighbour drops eyes and rank stripes at fractional display scales. */
.level-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: auto; }
.comment-head .level-avatar { margin-right: -2px; }
.left_my_id .level-avatar { margin: -4px 4px -4px 0; }
.left_my_point a { display: flex; align-items: center; width: 100%; min-height: 24px; color: inherit; text-decoration: none; }

.level-card { display: flex; gap: 16px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.level-card.is-staff { display: block; color: var(--muted); }
.level-card-stats { display: grid; flex: 1; gap: 8px; min-width: 0; margin: 0; }
.level-card-stats div { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 8px; align-items: center; }
.level-card-stats dt { color: var(--muted); font-size: 13px; }
.level-card-stats dd { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin: 0; word-break: keep-all; }
.level-points { color: var(--live); font-weight: 800; }
.level-exp { font-size: 13px; font-variant-numeric: tabular-nums; }
.level-bar { flex: 1 1 140px; min-width: 100px; height: 8px; border: 0; border-radius: 999px; background: #354248; overflow: hidden; appearance: none; }
.level-bar::-webkit-progress-bar { border-radius: 999px; background: #354248; }
.level-bar::-webkit-progress-value { border-radius: 999px; background: var(--accent); }
.level-bar::-moz-progress-bar { border-radius: 999px; background: var(--accent); }

.face-picker { margin-top: 14px; }
.face-picker fieldset { margin: 0 0 10px; padding: 0; border: 0; }
.face-picker legend { margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.face-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.face-option { position: relative; display: grid; justify-items: center; gap: 4px; padding: 8px 4px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 12px; text-align: center; word-break: keep-all; cursor: pointer; }
.face-option input { position: absolute; opacity: 0; pointer-events: none; }
.face-option:hover { border-color: var(--accent); }
.face-option:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.face-option:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.level-history-title { margin: 20px 0 8px; font-size: 15px; }

.table-wrap { max-width: 100%; overflow-x: auto; }
.level-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.level-table th, .level-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; word-break: keep-all; }
.level-table thead th { color: var(--muted); font-size: 13px; font-weight: 700; }
.level-table tbody th { font-weight: 700; }
.level-table td { font-variant-numeric: tabular-nums; }
.profile-level dd { display: flex; gap: 6px; align-items: center; justify-content: center; font-size: 16px; }
@media (max-width: 480px) {
  .level-card { align-items: flex-start; padding: 14px; }
  .level-table th, .level-table td { padding: 9px 8px; font-size: 13px; }
}
