/* 07-schedule.css · 경기 요일, 일정 미리 보기, 리그 시작·만들기, 할 일 서랍 */

/* ===== 경기 요일 고르기 ===== */
.day-picker {
  border: 0;
  padding: 0;
  margin: 6px 0 4px;
}

.day-buttons {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.day-btn {
  padding: 10px 0;
  border: 3px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  font-family: inherit;
  color: var(--ink);
}

.day-btn[aria-pressed="true"] {
  background: var(--grass);
  color: #fff;
  box-shadow: 2px 2px 0 var(--ink);
}

.day-btn:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}

/* ===== 일정 미리 보기 ===== */
.preview-box {
  background: var(--yellow-soft);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 12px 14px;
  margin: 8px 0 16px;
}

.preview-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.preview-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}

.preview-count input {
  width: 70px;
  margin: 0;
  padding: 6px 8px;
  text-align: center;
}

.preview-summary {
  margin: 10px 0 8px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.5;
}

.preview-details summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 14px;
}

.round-list {
  margin: 8px 0 4px;
  padding-left: 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.7;
}

/* ===== 리그 시작 패널 ===== */
.start-panel {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 3px dashed var(--ink);
}

.start-panel h3 {
  margin: 0 0 6px;
}

.start-panel select {
  display: block;
  width: 100%;
  padding: 12px;
  margin: 6px 0 4px;
  border: 3px solid var(--ink);
  border-radius: 7px;
  font-size: 15px;
  background: #fff;
}

.rd-date {
  font-size: 12px;
  font-weight: 600;
  color: #6b7256;
}

/* ===== 일정 미리 보기 (보기 쉽게) ===== */
.preview-big {
  font-size: 20px;
  margin: 10px 0 6px;
}

.preview-big strong {
  font-weight: 900;
}

.preview-period {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  font-weight: 800;
  font-size: 15px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 8px;
  padding: 8px 10px;
}

.preview-period .arrow {
  color: var(--grass-dark);
}

.preview-sub {
  margin: 14px 0 6px;
  font-weight: 800;
  font-size: 14px;
}

.preview-empty {
  margin: 10px 0;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
}

.round-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  font-size: 13.5px;
}

.round-table th,
.round-table td {
  border: 2px solid var(--ink);
  padding: 6px 8px;
  text-align: center;
  vertical-align: middle;
}

.round-table thead th {
  background: var(--olive);
  color: #fff;
  font-weight: 800;
}

.round-table tbody th {
  background: var(--cream);
  white-space: nowrap;
}

.round-table .range {
  display: block;
  font-weight: 700;
}

.round-table .deadline {
  display: block;
  font-size: 12px;
  color: var(--red);
  font-weight: 700;
}

.how-table td {
  font-weight: 800;
  font-size: 15px;
}

.preview-details .table-wrap {
  max-height: 320px;
  overflow-y: auto;
  margin-top: 8px;
}

.rd-date {
  display: block;
  margin-top: 2px;
}

/* 화면에는 안 보이고 화면 읽기 프로그램만 읽는 글 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* 마감 시각·만들기 기간 */
.time-settings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 8px;
}

.time-settings select {
  display: block;
  width: 100%;
  margin-top: 6px;
  padding: 10px;
  border: 3px solid var(--ink);
  border-radius: 7px;
  font-size: 14px;
  background: #fff;
}

@media (max-width: 460px) {
  .time-settings {
    grid-template-columns: 1fr;
  }
}

/* ===== 이번 경기 카드: 지금 할 일 ===== */
.match-task {
  margin: 10px 0 4px;
  font-size: 16px;
  font-weight: 800;
}

.match-deadline {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
}

/* ===== 문제 만들기: 상태·버튼 ===== */
.q-state {
  margin: 10px 0;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  font-weight: 800;
}

.q-state.state-draft { background: var(--yellow-soft); }
.q-state.state-done { background: #e7f1dc; }
.q-state.state-locked { background: #e6e6e6; }

.q-action-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.q-action-grid .btn,
.q-actions > .btn {
  margin-top: 0;
}

.q-actions > .btn {
  margin-top: 10px;
}

.choice-btns {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.choice-btns .btn[data-max="1"],
.choice-btns .btn[data-min="1"] {
  opacity: 0.4;
}

.q-error:empty {
  display: none;
}

/* 확인 창 버튼 3개 */
.modal-actions.three {
  grid-template-columns: 1fr;
}

textarea:disabled,
input:disabled,
select:disabled {
  background: #f1f1ea;
  color: #555;
}

.edit-settings-btn {
  float: right;
  margin-top: 0;
}

/* 리그 나가기: 다른 버튼과 같은 검은 테두리·그림자. 글씨만 빨갛게, 마우스를 올리면 연한 빨강 바탕 */
.btn-leave {
  background: var(--paper);
  color: #b8452f;
}

.btn-leave::before {
  content: "🚪 ";
}

.btn-leave:hover,
.btn-leave:focus-visible {
  background: #fbe4df;
}

/* ===== 리그 만들기: 단계별 카드 ===== */
.step-card .step-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 18px;
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--yellow);
  border: 2px solid var(--ink);
  font-weight: 900;
  font-size: 15px;
}

.step-card .subject-label {
  display: block;
  margin-top: 12px;
}

.step-card .subject-label small {
  font-weight: 600;
  color: #6b7256;
}

.field-help {
  display: block;
  margin-top: 4px;
  font-weight: 600;
  font-size: 12px;
  color: #6b7256;
}

.setting-summary {
  margin: 14px 0 0;
  padding: 10px 12px;
  background: var(--cream);
  border: 2px dashed var(--ink);
  border-radius: 8px;
  font-weight: 800;
  font-size: 14px;
}

.preview-card {
  background: var(--yellow-soft);
}

.preview-card .preview-head .step-title {
  margin: 0;
}

.reward-details > summary {
  cursor: pointer;
  list-style: none;
  margin: 0;
}

.reward-details > summary::-webkit-details-marker {
  display: none;
}

.reward-details > summary::after {
  content: "▾ 펼치기";
  margin-left: auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--grass-dark);
}

.reward-details[open] > summary::after {
  content: "▴ 접기";
}

.reward-details[open] > summary {
  margin-bottom: 10px;
}

/* ===== 리그 관리: 할 일 목록·코드 카드 ===== */
.todo-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.todo-list li {
  display: grid;
  grid-template-columns: 26px 1fr;
  column-gap: 8px;
  padding: 10px 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: #fff;
}

.todo-list li.done {
  background: #e7f1dc;
}

.todo-mark {
  grid-row: span 2;
  font-size: 18px;
}

.todo-help {
  font-size: 13px;
  color: #5f6652;
}

.code-card {
  text-align: center;
  background: var(--yellow-soft);
}

#editSettingsBtn {
  margin-top: 12px;
}

/* ===== 할 일 서랍 (오른쪽 옆) ===== */
.todo-tab {
  position: fixed;
  right: 0;
  top: 45%;
  z-index: 60;
  padding: 12px 10px;
  border: 3px solid var(--ink);
  border-right: 0;
  border-radius: 10px 0 0 10px;
  background: var(--yellow);
  font-family: inherit;
  font-weight: 800;
  font-size: 14px;
  cursor: pointer;
  box-shadow: -3px 3px 0 var(--ink);
  writing-mode: vertical-rl;
  letter-spacing: 2px;
}

.todo-tab:hover,
.todo-tab:focus-visible {
  background: #e0d955;
}

.todo-count {
  display: inline-block;
  margin-top: 6px;
  padding: 4px 2px;
  border-radius: 6px;
  background: var(--paper);
  border: 2px solid var(--ink);
  font-size: 12px;
  writing-mode: horizontal-tb;
}

.todo-drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 70;
  width: min(340px, 88vw);
  height: 100%;
  overflow-y: auto;
  padding: 20px 18px;
  background: var(--paper);
  border-left: 3px solid var(--ink);
  box-shadow: -6px 0 0 rgba(31, 42, 26, 0.9);
  transform: translateX(105%);
  transition: transform 0.25s ease-out;
  visibility: hidden;
}

.todo-drawer.open {
  transform: translateX(0);
  visibility: visible;
}

.todo-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.todo-drawer-head h3 {
  margin: 0;
}

.todo-drawer-head .btn {
  margin-top: 0;
}

@media (prefers-reduced-motion: reduce) {
  .todo-drawer { transition: none; }
}

/* 아직 완성 안 했을 때 경고 */
.q-warn {
  margin: 0 0 10px;
  font-weight: 800;
  color: #b8452f;
}

.q-warn:empty {
  display: none;
}

.q-warn.urgent {
  padding: 8px 10px;
  background: #fbe4df;
  border: 2px solid var(--red);
  border-radius: 8px;
}

/* 문제 만들기 맨 아래 버튼 줄 (화면에 붙어 있지 않고 맨 끝에 있다) */
.q-actions {
  padding: 14px;
}

/* 위쪽 제목 옆: [임시 저장] [뒤로가기] */
.q-top-btns {
  display: flex;
  gap: 6px;
}

.q-top-btns .btn {
  margin-top: 0;
}

.q-actions .hint {
  margin: 0 0 6px;
}

.q-actions .q-action-grid {
  grid-template-columns: auto 1fr 1fr;
  align-items: stretch;
}

.q-actions .q-action-grid .btn-small {
  margin-top: 0;
  white-space: nowrap;
}

/* 과목 줄: 이름·문제 수·지우기 + 아래 줄에 기본 출제 범위 */
.subject-row {
  flex-wrap: wrap;
}

.subject-row .subject-scope {
  flex: 1 1 100%;
  margin-top: 0;
  font-size: 14px;
}

/* 리그 기간 방식 고르기 */
.mode-picker {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.mode-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px;
  border: 3px solid var(--ink);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  line-height: 1.45;
}

.mode-option input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  flex: 0 0 auto;
}

.mode-option small {
  color: #5f6652;
}

.mode-option:has(input:checked) {
  background: #e7f1dc;
  box-shadow: 3px 3px 0 var(--ink);
}

