:root {
  color-scheme: dark;
  --bg: #101114;
  --panel: #181a1f;
  --panel-soft: #20232a;
  --line: #30343d;
  --text: #f2f4f8;
  --muted: #a7afbf;
  --accent: #69d2b0;
  --accent-2: #f3bf5f;
  --danger: #ff7a90;
  --blue: #74a7ff;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(105, 210, 176, 0.13), transparent 34rem),
    linear-gradient(135deg, #101114 0%, #15171d 54%, #111319 100%);
  color: var(--text);
  font-family:
    Inter,
    Pretendard,
    "Segoe UI",
    system-ui,
    -apple-system,
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(520px, 1fr) 390px;
  min-height: 100vh;
}

.sidebar,
.detail-panel {
  background: rgba(24, 26, 31, 0.88);
  border-color: var(--line);
  border-style: solid;
  backdrop-filter: blur(18px);
}

.sidebar {
  border-width: 0 1px 0 0;
  padding: 24px;
}

.detail-panel {
  position: relative;
  border-width: 0 0 0 1px;
  padding: 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-panel .detail-panel-close {
  display: none;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 30px;
}

.mobile-filter-button {
  display: none;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(105, 210, 176, 0.45);
  border-radius: 8px;
  background: rgba(105, 210, 176, 0.14);
  color: var(--accent);
  font-weight: 800;
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.2;
}

.brand p,
.eyebrow,
small,
.meta-line,
.date-line {
  color: var(--muted);
}

.control-group {
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

label {
  color: #d9deea;
  font-size: 13px;
  font-weight: 700;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.input-wrap svg {
  width: 17px;
  color: var(--muted);
}

input,
select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

select {
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.chip.active {
  border-color: rgba(105, 210, 176, 0.7);
  background: rgba(105, 210, 176, 0.15);
  color: var(--text);
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.quick-links button {
  min-height: 28px;
  padding: 0 9px;
  border: 1px solid rgba(105, 210, 176, 0.35);
  border-radius: 7px;
  background: rgba(105, 210, 176, 0.09);
  color: #dff7ef;
  cursor: pointer;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  margin: 0 0 20px;
  color: #d9deea;
  cursor: pointer;
}

.toggle-row input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.stat-stack {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 30px;
}

.stat-stack div {
  min-width: 0;
  padding: 12px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  text-align: center;
}

.stat-stack span {
  display: block;
  margin-bottom: 4px;
  font-size: 21px;
  font-weight: 800;
}

.sidebar-note {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

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

.eyebrow {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h2 {
  font-size: 30px;
}

.toolbar,
.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.icon-button,
.text-button,
.segmented button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  cursor: pointer;
}

.icon-button {
  width: 38px;
  border-radius: 8px;
}

.icon-button svg,
.text-button svg {
  width: 17px;
}

.text-button {
  gap: 8px;
  padding: 0 13px;
  border-radius: 8px;
  text-decoration: none;
}

.text-button.disabled {
  pointer-events: none;
  opacity: 0.45;
}

.segmented {
  display: flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.segmented button {
  min-width: 58px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
}

.segmented button.active {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.insight-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.insight-board article {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.72);
}

.insight-board span,
.insight-board small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.insight-board strong {
  display: block;
  margin: 4px 0;
  font-size: 24px;
}

.spotlight-section {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.spotlight-card {
  display: grid;
  grid-template-rows: auto minmax(58px, auto);
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.75);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.spotlight-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 6px;
  object-fit: cover;
}

.spotlight-card span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.spotlight-card strong,
.spotlight-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-slot {
  display: grid;
  place-items: center;
  border: 1px dashed rgba(167, 175, 191, 0.45);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(167, 175, 191, 0.72);
  font-size: 11px;
  text-transform: uppercase;
}

.ad-wide {
  min-height: 72px;
  margin-bottom: 14px;
}

.ad-box {
  min-height: 250px;
}

.ad-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  text-transform: none;
}

.ad-content img {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 7px;
}

.ad-content div {
  display: grid;
  gap: 4px;
  text-align: left;
}

.ad-content strong {
  color: var(--text);
  font-size: 14px;
}

.ad-content small {
  color: var(--muted);
}

.ad-content a {
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.calendar-head,
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.calendar-head {
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.calendar-grid {
  gap: 8px;
}

.day-cell {
  min-height: 158px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.7);
  overflow: hidden;
}

.day-cell.outside {
  opacity: 0.35;
}

.day-cell.today {
  border-color: rgba(105, 210, 176, 0.72);
  box-shadow: inset 0 0 0 1px rgba(105, 210, 176, 0.2);
}

.day-number {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.release-pill {
  display: grid;
  width: 100%;
  gap: 2px;
  margin-bottom: 6px;
  padding: 7px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.release-pill.high {
  border-left-color: var(--accent-2);
}

.release-pill.discovered {
  border-left-color: var(--blue);
  background: rgba(116, 167, 255, 0.08);
}

.release-pill.released {
  opacity: 0.76;
}

.calendar-more {
  width: 100%;
  min-height: 26px;
  padding: 0 6px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  cursor: pointer;
}

.calendar-more:hover {
  border-color: var(--blue);
  color: var(--text);
}

.day-agenda {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 12px;
}

.day-agenda-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.day-agenda-head h3 {
  font-size: 20px;
}

.release-pill strong,
.game-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.release-pill strong {
  font-size: 12px;
}

.release-pill small {
  font-size: 11px;
}

.game-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 12px;
}

.discovery-more {
  margin: 18px auto 0;
}

.game-card {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.75);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.game-countdown {
  min-width: 54px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(105, 210, 176, 0.13);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.candidate-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.candidate-head h3 {
  margin-bottom: 6px;
  font-size: 20px;
}

.candidate-head p {
  color: var(--muted);
  line-height: 1.5;
}

.candidate-head > span {
  display: grid;
  min-width: 48px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 800;
}

.candidate-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.mini-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--text);
}

.mini-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--accent);
}

#candidateSortSelect {
  width: auto;
  min-height: 38px;
}

.candidate-tools > span {
  display: grid;
  min-width: 48px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 800;
}

.candidate-list {
  display: grid;
  gap: 10px;
}

.candidate-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 26, 31, 0.75);
}

.candidate-card.public {
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
}

.candidate-score {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: rgba(105, 210, 176, 0.14);
  color: var(--accent);
  font-weight: 900;
}

.candidate-main {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.candidate-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-main small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.candidate-keywords {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.candidate-keywords span {
  padding: 5px 7px;
  border-radius: 999px;
  background: rgba(105, 210, 176, 0.13);
  color: #bdebdc;
  font-size: 11px;
  font-weight: 800;
}

.candidate-empty {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.game-thumb {
  width: 74px;
  height: 52px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--panel-soft);
}

.game-info {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.game-tag,
.detail-badges span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(116, 167, 255, 0.15);
  color: #b8ccff;
  font-size: 12px;
  font-weight: 800;
}

.empty-state {
  display: grid;
  min-height: calc(100vh - 48px);
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
  text-align: center;
}

.empty-state svg {
  width: 44px;
  height: 44px;
}

.hidden {
  display: none !important;
}

.detail-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.detail-card.detail-card-enter {
  animation: detail-card-enter 260ms ease-out;
}

@keyframes detail-card-enter {
  from {
    opacity: 0.35;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.detail-hero {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel-soft);
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-badges {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 7px;
}

.detail-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.detail-body h3 {
  font-size: 24px;
  line-height: 1.25;
}

.detail-body p {
  line-height: 1.6;
}

.hint-line {
  color: var(--muted);
  font-size: 12px;
}

.source-box {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.source-box span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.035);
  color: #dbe2ee;
  font-size: 12px;
}

.platform-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.platform-row span {
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #dbe2ee;
  font-size: 12px;
}

.video-frame {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  background: #08090b;
  overflow: hidden;
}

.video-frame video,
.video-frame iframe,
.video-frame a,
.video-frame span {
  width: 100%;
  height: 100%;
}

.video-frame video {
  display: block;
  object-fit: cover;
}

.video-frame iframe {
  border: 0;
}

.video-frame a {
  display: grid;
  place-items: center;
  color: var(--text);
  text-decoration: none;
}

.video-frame span {
  display: grid;
  place-items: center;
  color: var(--muted);
}

@media (min-width: 1181px) {
  .detail-panel {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100vh;
    height: 100dvh;
  }
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
    border-width: 1px 0 0;
  }

  .empty-state {
    min-height: 180px;
  }
}

@media (min-width: 781px) and (max-width: 1180px) {
  .detail-panel {
    position: fixed;
    z-index: 30;
    top: 0;
    right: 0;
    width: min(390px, 48vw);
    height: 100vh;
    height: 100dvh;
    border-width: 0 0 0 1px;
    overflow-y: auto;
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.48);
    transform: translateX(100%);
    transition: transform 240ms ease-out;
  }

  .detail-panel.is-open {
    transform: translateX(0);
  }

  .detail-panel .detail-panel-close {
    position: sticky;
    z-index: 3;
    top: 0;
    display: grid;
    margin: 0 0 10px auto;
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(24, 26, 31, 0.92);
    backdrop-filter: blur(12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .detail-card.detail-card-enter {
    animation: none;
  }

  .detail-panel {
    transition: none;
  }
}

@media (max-width: 780px) {
  .app-shell {
    display: block;
  }

  .sidebar,
  .workspace,
  .detail-panel {
    padding: 16px;
  }

  .sidebar {
    border-width: 0 0 1px;
  }

  .brand {
    margin-bottom: 14px;
  }

  .mobile-filter-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-soft);
    color: var(--text);
    font-weight: 800;
  }

  .mobile-filter-button svg {
    width: 18px;
    height: 18px;
  }

  .mobile-filter-button svg:last-child {
    margin-left: auto;
    transition: transform 160ms ease;
  }

  .sidebar.mobile-open .mobile-filter-button svg:last-child {
    transform: rotate(180deg);
  }

  .sidebar:not(.mobile-open) > :not(.brand):not(.mobile-filter-button) {
    display: none;
  }

  .sidebar.mobile-open .mobile-filter-button {
    margin-bottom: 20px;
  }

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

  .toolbar {
    width: 100%;
  }

  .segmented {
    max-width: 100%;
    overflow-x: auto;
  }

  .segmented button {
    flex: 0 0 auto;
  }

  h2 {
    font-size: 24px;
  }

  .calendar-grid,
  .calendar-head {
    grid-template-columns: repeat(7, minmax(96px, 1fr));
    min-width: 672px;
  }

  .calendar-head {
    display: grid;
  }

  #calendarView {
    overflow-x: auto;
    padding-bottom: 8px;
  }

  .day-cell {
    min-height: 108px;
  }

  .detail-panel {
    position: static;
    width: auto;
    height: auto;
    overflow-y: visible;
    scroll-margin-top: 12px;
    transform: none;
  }

  .detail-panel .detail-panel-close {
    display: none;
  }

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

  .game-list {
    grid-template-columns: 1fr;
  }

  .game-card {
    grid-template-columns: 68px minmax(0, 1fr) auto;
  }

  .game-tag {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .candidate-card,
  .candidate-card.public {
    grid-template-columns: 1fr;
  }

  .candidate-keywords {
    justify-content: flex-start;
  }
}
