:root {
  color-scheme: dark;
  --bg: #101114;
  --surface: #171a20;
  --surface-2: #20242d;
  --surface-3: #2a303a;
  --text: #f5f7fb;
  --muted: #a5adba;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #2dd4bf;
  --accent-2: #f97316;
  --danger: #ef4444;
  --ok: #22c55e;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  font-family: Inter, Pretendard, "Segoe UI", "Noto Sans KR", Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(135deg, #101114 0%, #16171b 48%, #1b1512 100%);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  width: min(1600px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.brand-block,
.topbar-actions,
.now-panel,
.toolbar,
.summary-row,
.sport-strip {
  display: flex;
  align-items: center;
}

.brand-block {
  min-width: 0;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(45, 212, 191, 0.45);
  border-radius: 8px;
  background: rgba(45, 212, 191, 0.1);
  color: var(--accent);
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
}

.brand-mark svg,
.icon-button svg,
.search-box svg,
.player-empty svg,
.sport-filter svg,
.stream-icon svg {
  width: 20px;
  height: 20px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.35rem, 2.3vw, 2rem);
  line-height: 1.1;
}

.topbar-actions {
  gap: 10px;
}

.main-menu {
  display: flex;
  align-items: center;
  flex: 1;
  gap: 8px;
  min-width: 0;
  justify-content: center;
}

.main-menu a {
  padding: 9px 10px;
  border: 1px solid transparent;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
}

.main-menu a:hover {
  border-color: rgba(45, 212, 191, 0.32);
  background: rgba(45, 212, 191, 0.08);
  color: var(--text);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  white-space: nowrap;
}

.pulse {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.12);
}

.status-pill.ok .pulse {
  background: var(--ok);
  box-shadow: 0 0 0 5px rgba(34, 197, 94, 0.12);
}

.status-pill.error .pulse {
  background: var(--danger);
  box-shadow: 0 0 0 5px rgba(239, 68, 68, 0.12);
}

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  border-color: rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.11);
}

.icon-button.loading svg {
  animation: spin 900ms linear infinite;
}

.main-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 470px);
  gap: 18px;
  align-items: start;
}

.player-section,
.schedule-panel {
  min-width: 0;
}

.player-wrap {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #050608;
  box-shadow: var(--shadow);
}

.player {
  display: block;
  width: 100%;
  height: 100%;
  background: #050608;
}

.player-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 9px;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%),
    #07080a;
  background-size: 28px 28px;
}

.player-empty.hidden {
  display: none;
}

.player-empty svg {
  width: 46px;
  height: 46px;
  color: var(--accent);
}

.player-empty strong {
  color: var(--text);
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.player-empty span {
  max-width: 30rem;
  font-size: 0.95rem;
  line-height: 1.5;
}

.now-panel {
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(23, 26, 32, 0.84);
  backdrop-filter: blur(16px);
}

.now-panel h2 {
  margin-bottom: 6px;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
  line-height: 1.25;
}

.now-panel p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.quality-box {
  display: grid;
  min-width: 96px;
  min-height: 74px;
  place-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.quality-box span {
  color: var(--muted);
  font-size: 0.8rem;
}

.quality-box strong {
  color: var(--accent);
  font-size: 1rem;
}

.schedule-panel {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 40px);
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 20, 25, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.toolbar {
  gap: 10px;
  align-items: stretch;
}

.search-box {
  display: flex;
  align-items: center;
  min-width: 0;
  flex: 1;
  gap: 8px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.search-box input::placeholder {
  color: #737b89;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 172px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
}

.segment {
  min-height: 40px;
  border: 0;
  border-left: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segment:first-child {
  border-left: 0;
}

.segment.active {
  background: var(--accent);
  color: #05211d;
  font-weight: 800;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.summary-row div {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.summary-row span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.summary-row strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--text);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sport-strip {
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 10px;
  scrollbar-width: thin;
}

.sport-filter {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  flex: 0 0 auto;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  cursor: pointer;
}

.sport-filter.active {
  border-color: rgba(45, 212, 191, 0.55);
  background: rgba(45, 212, 191, 0.12);
  color: var(--text);
}

.stream-list {
  display: grid;
  max-height: calc(100vh - 240px);
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.stream-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.052);
  text-align: left;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.stream-card:hover,
.stream-card.active {
  transform: translateY(-1px);
  border-color: rgba(45, 212, 191, 0.52);
  background: rgba(45, 212, 191, 0.09);
}

.stream-card.waiting {
  cursor: default;
}

.stream-card.waiting:hover {
  transform: none;
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.052);
}

.stream-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
}

.stream-info {
  min-width: 0;
}

.stream-league {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

.live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.stream-title {
  overflow: hidden;
  margin: 0;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 760;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stream-time {
  display: grid;
  justify-items: end;
  gap: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  white-space: nowrap;
}

.badge {
  min-width: 54px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  text-align: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.badge.live {
  background: rgba(239, 68, 68, 0.16);
  color: #fecaca;
}

.empty-list,
.error-box {
  padding: 24px 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
}

.error-box {
  border-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.seo-section {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 20, 25, 0.72);
}

.today-live-page {
  margin-top: 18px;
}

.seo-head {
  margin-bottom: 14px;
}

.seo-head h2 {
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.seo-head p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.seo-match-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.seo-match {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.seo-match h3 {
  overflow: hidden;
  margin: 6px 0;
  font-size: 0.95rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-match p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.seo-league {
  display: block;
  overflow: hidden;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.seo-link-section {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.seo-link-section a {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

.seo-link-section a:hover {
  border-color: rgba(61, 220, 151, 0.45);
  color: var(--accent);
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.site-footer strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.95rem;
}

.site-footer p {
  max-width: 560px;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.6;
}

.site-footer nav,
.info-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.site-footer a,
.info-header a {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.site-footer a:hover,
.info-header a:hover {
  color: var(--accent);
}

.info-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 900;
}

.brand-mark.mini {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.info-page {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 20, 25, 0.82);
}

.info-page h1 {
  margin: 6px 0 10px;
  font-size: clamp(2rem, 3vw, 3rem);
}

.info-lead {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.info-sections {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.info-sections section {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.info-sections h2 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.info-sections p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
}

.auth-page,
.board-page,
.post-page {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(18, 20, 25, 0.82);
}

.auth-page {
  width: min(520px, 100%);
  margin: 24px auto 0;
}

.auth-page.wide {
  width: min(920px, 100%);
}

.board-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.board-form label {
  display: grid;
  gap: 7px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 900;
}

.board-form label span {
  color: var(--muted);
  font-size: 0.78rem;
}

.board-form input,
.board-form textarea,
.comment-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  outline: none;
}

.board-form input {
  height: 44px;
  padding: 0 12px;
}

.board-form textarea,
.comment-form textarea {
  padding: 12px;
  resize: vertical;
  line-height: 1.65;
}

.primary-action,
.primary-link,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.primary-action,
.primary-link {
  border: 1px solid rgba(45, 212, 191, 0.45);
  background: rgba(45, 212, 191, 0.14);
  color: var(--text);
}

.ghost-action {
  border: 1px solid rgba(239, 68, 68, 0.34);
  background: rgba(239, 68, 68, 0.08);
  color: #fecaca;
}

.auth-switch {
  margin: 16px 0 0;
  color: var(--muted);
}

.auth-switch a {
  color: var(--accent);
  font-weight: 900;
}

.board-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.board-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.board-card,
.post-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  text-decoration: none;
}

.board-card {
  min-height: 150px;
  padding: 16px;
}

.board-card strong {
  font-size: 1.05rem;
}

.board-card span,
.board-card em,
.post-row span,
.post-meta,
.comment span {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.55;
}

.latest-board {
  display: grid;
  gap: 10px;
  margin-top: 22px;
}

.latest-board h2,
.comments h2 {
  margin-bottom: 4px;
  font-size: 1.15rem;
}

.post-row {
  grid-template-columns: 110px minmax(0, 1fr) auto;
  align-items: center;
  padding: 13px 14px;
}

.post-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-board {
  color: var(--accent) !important;
  font-weight: 900;
}

.post-page {
  display: grid;
  gap: 18px;
}

.post-view,
.comments {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.post-view h1 {
  margin-bottom: 10px;
  font-size: clamp(1.45rem, 2.4vw, 2.4rem);
}

.post-content {
  margin-top: 24px;
  line-height: 1.85;
  white-space: pre-wrap;
}

.post-actions {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.post-actions form {
  margin: 0;
}

.comments {
  display: grid;
  gap: 12px;
}

.comment {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.comment p {
  margin: 8px 0;
  line-height: 1.65;
  white-space: pre-wrap;
}

.comment-form {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

@keyframes spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1080px) {
  .main-grid {
    grid-template-columns: 1fr;
  }

  .schedule-panel {
    position: static;
    max-height: none;
  }

  .stream-list {
    max-height: none;
  }

  .seo-match-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .board-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .post-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .app-shell {
    padding: 12px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .main-menu {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .info-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .info-header nav,
  .site-footer nav {
    justify-content: flex-start;
  }

  .topbar-actions,
  .toolbar,
  .now-panel {
    width: 100%;
  }

  .status-pill {
    flex: 1;
  }

  .toolbar {
    flex-direction: column;
  }

  .segmented {
    width: 100%;
  }

  .now-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .quality-box {
    min-height: 58px;
  }
}

@media (max-width: 460px) {
  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .summary-row {
    grid-template-columns: 1fr;
  }

  .stream-card {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .stream-time {
    grid-column: 2;
    justify-items: start;
    grid-auto-flow: column;
    justify-content: start;
  }

  .seo-match-grid {
    grid-template-columns: 1fr;
  }

  .info-page {
    padding: 20px;
  }

  .auth-page,
  .board-page,
  .post-page {
    padding: 18px;
  }

  .board-title-row {
    flex-direction: column;
  }

  .board-grid {
    grid-template-columns: 1fr;
  }
}
