/* =========================================================
   student.css
   학생 화면 전용 스타일
========================================================= */

/* 학생 로그인 */
#login-screen {
  width: min(100%, 400px);
  margin: 72px auto;
  padding: 0 20px;
}

#login-screen h1 {
  margin: 0 0 6px;
  font-size: 21px;
  line-height: 1.4;
}

#login-screen > p {
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 14px;
}

.teacher-link {
  margin-top: 18px;
  text-align: center;
  font-size: 13px;
}

.teacher-link a {
  color: var(--teacher);
  font-weight: 600;
  text-decoration: none;
}

/* 학생 메인 */
#student-screen {
  max-width: 720px;
}

.round-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.round-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 76px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.round-card:not(.disabled):hover {
  border-color: #aaa;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.round-card.disabled {
  cursor: default;
  opacity: 0.55;
}

.type-tag {
  flex-shrink: 0;
  padding: 5px 8px;
  border-radius: 5px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.type-tag.comprehension {
  background: var(--comp);
}

.type-tag.writing {
  background: var(--writing);
}

.round-info {
  flex: 1;
  min-width: 0;
}

.round-label {
  margin-bottom: 4px;
  font-size: 16px;
  font-weight: 650;
}

.round-period {
  color: var(--muted);
  font-size: 13px;
}

.round-status {
  flex-shrink: 0;
  font-size: 13px;
  font-weight: 700;
}

.status-open {
  color: var(--writing);
}

.status-done,
.status-upcoming {
  color: var(--muted);
}

.status-closed {
  color: var(--danger);
}

/* 문제 모달 */
#modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.62);
}

.modal-box {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 680px;
  height: 100vh;
  height: 100dvh;
  margin: 0 auto;
  background: #fff;
}

.modal-head {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
  padding: 14px 18px;
  background: var(--ink);
  color: #fff;
}

.modal-head h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
}

.modal-head button {
  display: grid;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  place-items: center;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 22px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.q-label {
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.question-box {
  margin-bottom: 18px;
  padding: 16px 18px;
  border-left: 4px solid var(--comp);
  border-radius: 7px;
  background: #eef4fb;
  color: #1c4a7a;
  font-size: 17px;
  line-height: 1.75;
}

.ko-text {
  display: none;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #b8d4f0;
  color: #4a4a4a;
  font-size: 15px;
  line-height: 1.7;
}

.translate-btn {
  min-height: 40px;
  margin-bottom: 16px;
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #555;
  font-size: 13px;
  cursor: pointer;
}

.example-box {
  margin-bottom: 20px;
  padding: 16px;
  border: 1px dashed #d4d4d4;
  border-radius: 8px;
  background: #f7f7f7;
  font-size: 15px;
  line-height: 1.75;
}

.wc-counter {
  margin-top: 7px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

/* 지문 */
.passage-box {
  max-height: 300px;
  margin-bottom: 20px;
  padding: 18px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8f8f8;
  font-size: 16px;
  line-height: 1.85;
  white-space: pre-wrap;
}

/* 문제 */
.q-block {
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.q-block:last-child {
  border-bottom: 0;
}

.q-prompt {
  margin-bottom: 12px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.7;
}

/* 객관식 선택지 */
.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 50px;
  margin-bottom: 10px;
  padding: 13px 46px 13px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.choice:hover {
  border-color: #aaa;
}

.choice.selected {
  border: 2px solid var(--comp);
  background: #f1f6fc;
  color: #163f68;
  font-weight: 600;
}

.choice.selected::after {
  content: "✓";
  position: absolute;
  right: 16px;
  color: var(--comp);
  font-size: 18px;
  font-weight: 800;
}

/* 드롭다운 */
.dd-select {
  min-height: 42px;
  width: auto;
  max-width: 100%;
  padding: 6px 32px 6px 13px;
  border: 2px dashed var(--comp);
  border-radius: 999px;
  background-color: #f8fafc;
  color: var(--comp);
  font-size: 15px;
  font-weight: 650;
  cursor: pointer;
}

.dd-select.filled {
  border-style: solid;
  background-color: var(--comp);
  color: #fff;
}

.dd-select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

/* 제출 결과 */
.result-banner {
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 700;
  text-align: center;
}

.result-good {
  background: #e8f5ee;
  color: var(--writing);
}

.result-bad {
  background: #fdeceb;
  color: var(--danger);
}

.result-success {
  border: 1px solid #b8d4f0;
  background: #f0f7ff;
  color: #1c4a7a;
}

.feedback-box {
  margin-top: 14px;
  padding: 16px;
  border-radius: 8px;
  background: #fff8e1;
  color: #6b5300;
  font-size: 15px;
  line-height: 1.7;
}

/* 학생 문제 영역 복사·드래그 제한 */
.protected-content {
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.protected-content input,
.protected-content textarea,
.protected-content select,
.protected-content .passage-box {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

/* 지문은 복사 가능함을 시각적으로 살짝 안내 */
.protected-content .passage-box {
  cursor: text;
}

/* 태블릿·PC */
@media (min-width: 680px) {
  .modal-box {
    height: auto;
    max-height: 90vh;
    margin: 5vh auto;
    border-radius: 14px;
    overflow: hidden;
  }
}

/* 휴대전화 */
@media (max-width: 640px) {
  #login-screen {
    margin-top: 44px;
    padding: 0 16px;
  }

  header {
    padding: 12px 16px;
  }

  header h1 {
    max-width: 230px;
    font-size: 15px;
    line-height: 1.4;
  }

  #student-screen {
    padding: 16px;
  }

  .round-card {
    align-items: flex-start;
    padding: 14px;
  }

  .modal-body {
    padding: 18px 16px 32px;
  }

  .passage-box {
    max-height: none;
    overflow: visible;
    padding: 16px;
    font-size: 16px;
    line-height: 1.85;
  }

  .question-box,
  .q-prompt {
    font-size: 16px;
  }

  input,
  textarea,
  select {
    font-size: 16px;
  }
}