/* =========================================================
   끝나지않는NowLoading 리더보드 — 레이아웃
   (테마는 theme-95.css)
   ========================================================= */

.desktop {
  padding: 16px 16px 44px; /* 아래는 작업 표시줄 자리 */
  min-height: 100vh;
}

.main-window {
  max-width: 1200px;
  margin: 0 auto;
}

/* ── 로딩 연출 ─────────────────────────────────────────── */

.loading-panel {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: var(--w95-face);
  border: 2px solid;
  border-color: var(--w95-shadow) var(--w95-light) var(--w95-light)
    var(--w95-shadow);
}

.loading-icon {
  flex: 0 0 auto;
  font-size: 34px;
  line-height: 1;
  /* 디스켓이 돌아가는 느낌 */
  animation: disk-blink 1.4s steps(2) infinite;
}

@keyframes disk-blink {
  50% {
    opacity: 0.35;
  }
}

.loading-body {
  flex: 1 1 auto;
  min-width: 0;
}

.loading-title {
  margin: 0 0 9px;
  font-size: 12px;
}

/* 95 의 진행 막대는 파란 블록이 하나씩 채워지는 형태였습니다. */
.w95-progress {
  height: 20px;
  padding: 2px;
  background: var(--w95-field);
  border: 2px solid;
  border-color: var(--w95-shadow) var(--w95-light) var(--w95-light)
    var(--w95-shadow);
  overflow: hidden;
}

.w95-progress-bar {
  height: 100%;
  width: 0;
  /* 블록 사이가 비어 보이도록 배경을 반복합니다. */
  background-image: linear-gradient(
    90deg,
    var(--w95-title-1) 0 10px,
    transparent 10px 12px
  );
  background-size: 12px 100%;
  transition: width 0.25s steps(4);
}

.loading-status {
  display: flex;
  gap: 10px;
  margin: 6px 0 0;
  font-size: 11px;
  color: #333;
}

.loading-status span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-note {
  margin: 10px 0 0;
  font-size: 11px;
  line-height: 1.7;
  color: #333;
}

/* ── 공통 ──────────────────────────────────────────────── */

.notice {
  margin: 0 0 6px;
  font-size: 12px;
  line-height: 1.7;
}

.notice:last-child {
  margin-bottom: 0;
}

.dim {
  color: var(--w95-gray-text);
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}

/* ── 차트 + 명예의 전당 ────────────────────────────────── */

.content-wrapper {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.chart-section {
  flex: 2.4;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.rank-section {
  flex: 1;
  min-width: 300px;
  display: flex;
  flex-direction: column;
}

.chart-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.chart-hint {
  font-size: 11px;
  color: #333;
}

.chart-select-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  padding-right: 2px;
  font-size: 12px;
}

.chart-canvas-wrap {
  flex: 1 1 auto;
  min-height: 320px;
  background: var(--w95-field);
  border: 2px solid;
  border-color: var(--w95-shadow) var(--w95-light) var(--w95-light)
    var(--w95-shadow);
  box-shadow:
    inset 1px 1px 0 var(--w95-dark),
    inset -1px -1px 0 var(--w95-hilight);
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-placeholder {
  text-align: center;
  color: var(--w95-gray-text);
}

.chart-placeholder p {
  margin: 4px 0;
  font-size: 12px;
}

.ph-icon {
  font-size: 40px;
  opacity: 0.5;
  margin-bottom: 8px;
}

.rank-title-wrapper {
  margin-bottom: 6px;
}

.rank-title {
  font-weight: bold;
  font-size: 13px;
}

.rank-subtitle {
  font-size: 11px;
  color: #333;
  margin-top: 2px;
}

.rank-list {
  flex: 1 1 auto;
  min-height: 200px;
  max-height: 320px;
}

.empty-row {
  color: var(--w95-gray-text);
  padding: 12px 8px !important;
  text-align: center;
}

/* ── 하단 섹션 ─────────────────────────────────────────── */

.bottom-section {
  margin-top: 14px;
  border: 2px solid;
  border-color: var(--w95-light) var(--w95-dark) var(--w95-dark)
    var(--w95-light);
  box-shadow:
    inset 1px 1px 0 var(--w95-hilight),
    inset -1px -1px 0 var(--w95-shadow);
  background: var(--w95-face);
}

.bottom-section[hidden] {
  display: none;
}

/* 섹션 제목을 작은 타이틀바처럼 */
.section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 6px;
  margin: 2px;
  background: linear-gradient(
    90deg,
    var(--w95-title-1) 0%,
    var(--w95-title-2) 100%
  );
  color: #fff;
  font-weight: bold;
  font-size: 12px;
}

.section-body {
  /* 타이틀바가 창 폭을 채우도록 섹션에는 패딩을 주지 않고
     내용에만 줍니다. (전작에서 겪은 여백 문제를 미리 피합니다) */
  padding: 8px 10px 12px;
}

.pending-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
}

.pending-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  font-size: 11px;
  background: var(--w95-face);
  border: 1px solid;
  border-color: var(--w95-light) var(--w95-dark) var(--w95-dark)
    var(--w95-light);
}

.pending-tag {
  padding: 0 4px;
  background: var(--w95-title-1);
  color: #fff;
  font-size: 10px;
}

/* ── 반응형 ────────────────────────────────────────────── */

@media (max-width: 900px) {
  .content-wrapper {
    flex-direction: column;
  }
  .rank-section {
    min-width: 0;
  }
}

@media (max-width: 560px) {
  .desktop {
    padding: 8px 8px 40px;
  }
  .loading-panel {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .btn-row .w95-button {
    flex: 1 1 auto;
  }
}

/* ---------------------------------------------------------
   바탕화면 아이콘
   Win95 처럼 한 번 클릭은 선택, 더블클릭이 실행입니다.
   --------------------------------------------------------- */
/* 아이콘을 자유롭게 옮길 수 있도록 좌표계만 잡아 둡니다.
   (레이어 자체는 클릭을 가로채지 않아야 창을 쓸 수 있습니다) */
.desktop-icons {
  position: absolute;
  top: 14px;
  left: 12px;
  right: 0;
  bottom: 0;
  z-index: 10;
  pointer-events: none;
}

.desktop-icon {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  width: 84px;
  padding: 4px 2px 3px;
  text-decoration: none;
  color: #fff;
  cursor: default;
  user-select: none;
  /* 레이어는 통과시키고 아이콘만 받습니다. */
  pointer-events: auto;
}

/* 끄는 동안은 살짝 비쳐 보입니다. */
.desktop-icon.dragging {
  opacity: 0.7;
  z-index: 20;
}

.desktop-icon-img {
  font-size: 32px;
  line-height: 1;
  /* 아이콘이 청록 바탕에서 묻히지 않게 */
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.5));
}

.desktop-icon-label {
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
  /* 95 의 바탕화면 글자는 검은 그림자가 있었습니다. */
  text-shadow: 1px 1px 0 rgba(0, 0, 0, 0.8);
  padding: 1px 2px;
}

/* 선택 상태 — 파란 배경 + 점선 테두리 (95 그대로) */
.desktop-icon.selected .desktop-icon-label {
  background: var(--w95-select);
  outline: 1px dotted #fff;
  outline-offset: -1px;
  text-shadow: none;
}

.desktop-icon.selected .desktop-icon-img {
  /* 선택된 아이콘은 파랗게 덮이는 느낌 */
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.5))
    drop-shadow(0 0 3px var(--w95-select));
}

/* 창이 아이콘을 가리지 않도록 왼쪽을 비웁니다. */
@media (min-width: 1100px) {
  .desktop {
    padding-left: 112px;
  }
}

/* 좁은 화면에서는 아이콘을 숨깁니다. 창과 겹치면 둘 다 못 씁니다.
   대신 창 안에 같은 곳으로 가는 버튼을 보여 줍니다. */
@media (max-width: 1099px) {
  .desktop-icons {
    display: none;
  }
}

/* 바탕화면 아이콘이 보이는 넓은 화면에서는 버튼이 중복이라 숨깁니다. */
@media (min-width: 1100px) {
  .btn-row .icon-fallback {
    display: none;
  }
}

/* 바탕을 끌 때 나타나는 선택 사각형 (Win95 의 marquee) */
.marquee {
  position: fixed;
  z-index: 30;
  border: 1px dotted #fff;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}

.marquee[hidden] {
  display: none;
}

/* ---------------------------------------------------------
   Win95 대화상자
   --------------------------------------------------------- */
.w95-dialog-overlay {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  /* 95 는 모달 뒤를 어둡게 하지 않았지만, 웹에서는 초점이 어디인지
     알기 어려워 아주 옅게만 깔아 둡니다. */
  background: rgba(0, 0, 0, 0.15);
}

.w95-dialog-overlay[hidden] {
  display: none;
}

.w95-dialog {
  width: 400px;
  max-width: calc(100vw - 32px);
}

.w95-dialog-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 16px 14px;
}

.w95-dialog-symbol {
  flex: 0 0 auto;
  font-size: 30px;
  line-height: 1;
}

.w95-dialog-msg {
  margin: 0;
  padding-top: 3px;
  font-size: 12px;
  line-height: 1.75;
  /* 줄바꿈을 코드에서 준 대로 살립니다. */
  white-space: pre-line;
}

.w95-dialog-footer {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 0 16px 16px;
}
