/* Base reset */
html,
body {
  margin: 0;
  padding: 0;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: var(--color-text);
  background: var(--color-bg);
}

a {
  color: inherit;
  text-decoration: none;
}

* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-strong: #eef3ff;
  --color-text: #141b2d;
  --color-text-muted: #5f687f;
  --color-border: #f0f0f0;
  --color-primary: #1d4ed8;
  --color-primary-strong: #1e40af;
  --color-shadow: rgba(13, 22, 44, 0.12);
  --focus-ring: rgba(29, 78, 216, 0.2);
  --nav-glass: rgba(255, 255, 255, 0.88);
  --nav-height: 64px;
  --color-red: #ff3f59;
  --page-title-icon: url(/assets/img/icon/n1_b.png) left center no-repeat;
  --date-icon: url(/assets/img/icon/date_b.png);
  --gt-icon: url(/assets/img/icon/n1_b.png) center center no-repeat;
}

/* Theme tokens */
html[data-theme='dark'] {
  color-scheme: dark;
  --color-bg: #0f1220;
  --color-surface: #171b2f;
  --color-surface-strong: #1f2540;
  --color-text: #f1f5ff;
  --color-text-muted: #b2b9cd;
  --color-border: #2d355a;
  --color-primary: #7aa2ff;
  --color-primary-strong: #93b4ff;
  --color-shadow: rgba(0, 0, 0, 0.42);
  --focus-ring: rgba(122, 162, 255, 0.25);
  --nav-glass: rgba(23, 27, 47, 0.88);
  --page-title-icon: url(/assets/img/icon/n1_w.png) left center no-repeat;
  --date-icon: url(/assets/img/icon/date_w.png);
  --gt-icon: url(/assets/img/icon/n1_w.png) center center no-repeat;

  /* Bootstrap outline button 반전용 기본값 */
  --bs-btn-color: #f1f5ff;
  --bs-btn-border-color: #f1f5ff;
  --bs-btn-hover-color: #0f1220;
  --bs-btn-hover-bg: #f1f5ff;
  --bs-btn-hover-border-color: #f1f5ff;
  --bs-btn-active-color: #0f1220;
  --bs-btn-active-bg: #dbe4ff;
  --bs-btn-active-border-color: #dbe4ff;
}

html[data-theme='dark'] .btn-outline-dark {
  --bs-btn-color: #f1f5ff;
  --bs-btn-border-color: #f1f5ff;
  --bs-btn-hover-color: #0f1220;
  --bs-btn-hover-bg: #f1f5ff;
  --bs-btn-hover-border-color: #f1f5ff;
  --bs-btn-active-color: #0f1220;
  --bs-btn-active-bg: #dbe4ff;
  --bs-btn-active-border-color: #dbe4ff;
}

html[data-theme='dark'] .btn-outline-light {
  --bs-btn-color: #0f1220;
  --bs-btn-border-color: #f1f5ff;
  --bs-btn-bg: #f1f5ff;
  --bs-btn-hover-color: #0f1220;
  --bs-btn-hover-bg: #dbe4ff;
  --bs-btn-hover-border-color: #dbe4ff;
  --bs-btn-active-color: #0f1220;
  --bs-btn-active-bg: #cbd7ff;
  --bs-btn-active-border-color: #cbd7ff;
}

body {
  min-height: 100vh;
}

/* Shared utilities */
/* Shared filter / date controls */
.filter-bar {
  display: flex;
  gap: 30px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-group {
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-group>.btn {
  min-width: 100px;
}

.date-picker-field {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.date-range {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.date-range .form-control {
  min-height: 38px;
  border-radius: 10px;
}

.date-picker-field>input[type='date'] {
  width: 100%;
  padding-right: 2.8rem;
}

.date-picker-button {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
  width: 1.3rem;
  height: 1.3rem;
  padding: 0;
  border: 0;
  background: var(--date-icon) center center / contain no-repeat transparent;
  cursor: pointer;
  z-index: 2;
}

.date-picker-button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px var(--focus-ring);
  border-radius: 4px;
}

input[type='date']::-webkit-calendar-picker-indicator {
  opacity: 0;
  pointer-events: none;
}

input[type='date']::-webkit-inner-spin-button,
input[type='date']::-webkit-clear-button {
  display: none;
  -webkit-appearance: none;
}

input[type='date'] {
  -webkit-appearance: none;
  appearance: none;
}

.btn-red {
  --bs-btn-color: #fff;
  --bs-btn-bg: #ff3f59;
  --bs-btn-border-color: #ff3f59;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #bb2d3b;
  --bs-btn-hover-border-color: #b02a37;
  --bs-btn-focus-shadow-rgb: 225, 83, 97;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #b02a37;
  --bs-btn-active-border-color: #a52834;
  --bs-btn-active-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.125);
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #ff3f59;
  --bs-btn-disabled-border-color: #ff3f59;
}

.link-underline {
  text-decoration: underline;
}

.fs-7 {
  font-size: 0.75rem !important;
}

/* App shell layout */
.site-main {
  min-height: 100vh;
  display: grid;
  gap: 0;
}

.site-main.has-aside {
  grid-template-columns: 280px minmax(0, 1fr);
  grid-template-rows: var(--nav-height) auto minmax(0, 1fr) auto;
  grid-template-areas:
    "nav nav"
    "aside header"
    "aside content"
    "aside footer";
}

.site-main.has-aside.no-footer {
  grid-template-rows: var(--nav-height) auto minmax(0, 1fr);
  grid-template-areas:
    "nav nav"
    "aside header"
    "aside content";
}

.site-main.no-aside {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: var(--nav-height) auto minmax(0, 1fr) auto;
  grid-template-areas:
    "nav"
    "header"
    "content"
    "footer";
}

.site-main.no-aside.no-footer {
  grid-template-rows: var(--nav-height) auto minmax(0, 1fr);
  grid-template-areas:
    "nav"
    "header"
    "content";
}

.site-nav {
  grid-area: nav;
  position: sticky;
  top: 0;
  height: var(--nav-height);
  z-index: 1100;
  background: var(--nav-glass);
  border-bottom: 1px solid var(--color-border);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 48px -20px var(--color-shadow);
}

.site-header {
  grid-area: header;
}

section.main {
  grid-area: content;
  min-width: 0;
}

.site-footer {
  grid-area: footer;
  padding: 0 1rem 1rem;
}

.site-nav-inner {
  height: 100%;
  margin: 0 auto;
  padding: 0 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.nav-left,
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-icon-btn {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.member-btn {
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.menu-icon-wrap {
  width: 25px;
  height: 25px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-icon {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.menu-icon-dark {
  display: none;
}

html[data-theme='dark'] .menu-icon-light {
  display: none;
}

html[data-theme='dark'] .menu-icon-dark {
  display: block;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  height: 38px;
}

.brand-image {
  height: 30px;
  max-width: 170px;
  object-fit: contain;
}

.brand-fallback {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.04em;
}

.nav-search {
  position: relative;
}

.nav-search input {
  width: 320px;
  height: 38px;
  padding: 0 42px 0 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  outline: none;
}

.nav-search-submit {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 26px;
  height: 26px;
  border: 0;
  padding: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.nav-search-submit img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.nav-search input::placeholder {
  color: var(--color-text-muted);
}

.nav-search input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.member-menu-wrap {
  position: relative;
  display: flex;
}

.member-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.member-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 176px;
  padding: 1rem;
  border: 1px solid var(--color-border);
  border-radius: 12px;
  background: var(--color-surface);
  box-shadow: 0 16px 30px -18px var(--color-shadow);
  text-align: center;
}

.member-dropdown hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 6px 0;
}

.theme-option.is-active {
  color: var(--color-primary-strong);
  font-weight: 700;
}

.site-aside {
  grid-area: aside;
  height: 100%;
  width: 280px;
  padding: 14px 12px;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow-y: auto;
  align-self: start;
  position: sticky;
  top: calc(var(--nav-height) + 1px);
  max-height: calc(100vh - var(--nav-height) - 1px);
  z-index: 1000;
}

.user-avatar {
  display: flex;
  justify-content: center;
  position: relative;
}

.user-avatar.live::after {
  content: "";
  background: url(/assets/img/icon/live.png) bottom / 70% no-repeat;
  display: block;
  width: 100%;
  height: 100%;
  position: absolute;
  bottom: -6px;
}

.user-avatar .img-box {
  --avatar-size: 72px;
  --avatar-ring: 5px;
  width: var(--avatar-size);
  aspect-ratio: 1 / 1;
  position: relative;
  border-radius: 50%;
  overflow: hidden;
  background: url(/assets/img/profile_line.png) center / cover no-repeat;
}

.user-avatar .img-box img {
  position: absolute;
  inset: var(--avatar-ring);
  width: calc(100% - (var(--avatar-ring) * 2));
  height: calc(100% - (var(--avatar-ring) * 2));
  border-radius: 50%;
  object-fit: cover;
  object-position: center center;
  display: block;
}



.user-details {
  text-align: start;
  padding-left: 20px;
}

.user-name {
  font-weight: 800;
  font-size: 15px;
  color: var(--color-text);
}

.user-level {
  margin-top: 4px;
  display: inline-flex;
  gap: 6px;
  color: var(--color-text-muted);
  font-size: 12px;
}

.user-info {
  display: grid;
  grid-template-columns: 1.5fr 4fr;
  align-items: center;
}

.user-point {
  margin: 0;
  padding-top: 10px;
  color: var(--color-text-muted);
  font-size: 12px;
  grid-column: auto / span 2;
}

.user-point .btn {
  border-radius: 10px;
}

.aside-divider {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 12px 0;
}

.aside-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.aside-nav>li {
  margin: 0;
}

.aside-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--color-text);
  background: transparent;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.aside-link:hover {
  background: var(--color-surface-strong);
  border-color: var(--color-border);
  transform: translateX(2px);
}

.aside-link.active {
  color: #dc3545;
  /* border-color: rgba(220, 53, 69, 0.22);
  background: rgba(220, 53, 69, 0.08); */
}

.aside-link.active .aside-icon {
  color: #dc3545;
}

.aside-link.active .aside-text {
  color: #dc3545;
  font-weight: 700;
}

.aside-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
}

.aside-icon i {
  font-size: 16px;
  line-height: 1;
}

/* 아이콘을 img로 교체할 때 동일 슬롯 크기를 유지합니다. */
.aside-icon img {
  object-fit: contain;
  display: block;
}

.aside-text {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aside-theme-row {
  justify-content: space-between;
  gap: 8px;
}

.theme-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  margin-left: auto;
  cursor: pointer;
}

.theme-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.theme-switch-slider {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #ddd;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.theme-switch-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px var(--color-shadow);
  transition: transform 0.2s ease;
}

.theme-switch input:checked+.theme-switch-slider {
  background: #ff3f59;
  border-color: var(--color-border);
}

.theme-switch input:checked+.theme-switch-slider::before {
  transform: translateX(-20px);
}

.theme-switch input:focus-visible+.theme-switch-slider {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.switch-slider {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #ddd;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.switch-slider::before {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 6px var(--color-shadow);
  transition: transform 0.2s ease;
}

.switch input:checked+.switch-slider {
  background: #ff3f59;
  border-color: var(--color-border);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.switch input:checked+.switch-slider::before {
  transform: translateX(20px);
}

.switch input:focus-visible+.switch-slider {
  box-shadow: 0 0 0 3px var(--focus-ring);
}

html[data-aside='closed'] .site-main.has-aside {
  grid-template-columns: 0 minmax(0, 1fr);
  grid-template-areas:
    "nav nav"
    ". header"
    ". content"
    ". footer";
}

html[data-aside='closed'] .site-main.has-aside.no-footer {
  grid-template-areas:
    "nav nav"
    ". header"
    ". content";
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.checkbox-group {
  display: grid;
  grid-template-columns: 1.5rem 100%;
}

@media (max-width: 768px) {
  :root {
    --nav-height: 60px;
  }

  .site-nav-inner {
    padding: 0 10px;
  }

  .brand-image {
    max-width: 120px;
  }

  .nav-search input {
    width: 220px;
  }

  .site-main.has-aside,
  .site-main.no-aside,
  .site-main.has-aside.no-footer,
  .site-main.no-aside.no-footer {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: var(--nav-height) auto minmax(0, 1fr) auto;
    grid-template-areas:
      "nav"
      "header"
      "content"
      "footer";
  }

  .site-main.no-footer,
  .site-main.has-aside.no-footer,
  .site-main.no-aside.no-footer {
    grid-template-rows: var(--nav-height) auto minmax(0, 1fr);
    grid-template-areas:
      "nav"
      "header"
      "content";
  }

  .site-aside {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    bottom: 0;
    width: min(82vw, 300px);
    max-height: none;
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 0 18px 40px -24px var(--color-shadow);
    z-index: 1150;
  }

  html[data-aside='open'] .site-aside {
    transform: translateX(0);
  }

  .date-range {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 560px) {
  .nav-search {
    display: none;
  }
}

.page-title::before {
  content: "";
  background: var(--gt-icon);
  display: inline-block;
  width: 20px;
  height: 15px;
  margin-right: 0.5rem;
}

.icon-gt::before {
  content: "";
  background: var(--gt-icon);
  display: inline-block;
  width: 20px;
  height: 15px;
  margin-left: 0.5rem;
}

.video-platform-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  width: 20px;
  height: 20px;
  font-weight: 700;
  border: 1px solid transparent;
}

.video-platform-badge.is-youtube {
  color: #ff3f59;
}

.video-platform-badge.is-twitch {
  color: #5933a5;
}

.video-platform-badge.is-chzzk {
  color: #0b7a5a;
}

.video-platform-badge.is-soop {
  color: #0d4da2;
}

.video-platform-badge.is-default {
  color: var(--muted);
  background: var(--chip);
  border-color: var(--line);
}