/* class-platform 공용 디자인 시스템
   테마: body.t-student(초록·놀이) / body.t-teacher(호박·관리) / body.t-board(남색·발표) */

@font-face {
  font-family: "Pretendard";
  src: url("/assets/PretendardVariable.woff2") format("woff2-variations");
  font-weight: 45 920;
  font-display: swap;
}

:root {
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  --ink: #2b3440;
  --sub: #7b8794;
  --line: #e8ebf0;
  --teal: #1d9e75; --teal-deep: #0f6e56; --teal-soft: #e1f5ee; --teal-line: #cdeadd;
  --amber: #ba7517; --amber-deep: #854f0b; --amber-soft: #faf0dc; --amber-line: #eee0c4;
  --navy: #0c2a47; --navy-2: #12395e; --blue: #378add; --blue-soft: #9fc3e8;
  --red: #c0392b; --red-soft: #fdecec;
  --gold-soft: #fff4dd; --gold-deep: #9a6b00; --gold-line: #e8c86e;
  --shadow: 0 10px 28px rgba(30, 40, 60, 0.09);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  margin: 0; min-height: 100vh; font-family: var(--font); color: var(--ink);
  display: flex; justify-content: center; padding: 1.1rem;
}
body.t-student { background: linear-gradient(180deg, #e2f4ec, #f4faf7 45%) fixed; --accent: var(--teal); --accent-deep: var(--teal-deep); --accent-soft: var(--teal-soft); --accent-line: var(--teal-line); }
body.t-teacher { background: linear-gradient(180deg, #f4ecdc, #faf7f0 45%) fixed; --accent: var(--amber); --accent-deep: var(--amber-deep); --accent-soft: var(--amber-soft); --accent-line: var(--amber-line); }
body.t-board { background: radial-gradient(1100px 700px at 50% 0%, #14406b, var(--navy) 70%) fixed; color: #fff; align-items: center; text-align: center; --accent: var(--blue); }

.wrap { width: min(640px, 100%); }
body.t-teacher .wrap { width: min(940px, 100%); }

/* ---------- 카드 ---------- */
.card {
  background: #fff; border-radius: 20px; padding: 1.35rem;
  box-shadow: var(--shadow); margin-bottom: 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
}
h1 { font-size: 1.22rem; margin: 0 0 0.9rem; color: var(--accent-deep); }
body.t-student h1 { text-align: center; }
h2 { font-size: 1.03rem; margin: 0 0 0.6rem; color: var(--accent-deep); }

/* ---------- 입력 ---------- */
input, textarea, select {
  padding: 0.68rem 0.75rem; border: 2px solid var(--line); border-radius: 12px;
  font-size: 1rem; font-family: inherit; background: #fff; color: var(--ink);
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
input[type="password"], textarea { width: 100%; }
textarea { min-height: 130px; resize: vertical; }
input.code { width: 100%; padding: 0.85rem; font-size: 1.25rem; text-align: center; }

/* ---------- 버튼 ---------- */
button {
  padding: 0.62rem 1.05rem; border: none; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 700; cursor: pointer;
  font-size: 0.95rem; font-family: inherit;
  transition: transform 0.06s ease, filter 0.12s ease;
}
button:active { transform: scale(0.96); }
button:hover { filter: brightness(1.06); }
button.ghost { background: var(--accent-soft); color: var(--accent-deep); }
button.mini { padding: 0.32rem 0.62rem; font-size: 0.85rem; border-radius: 9px; }
button.ok { background: var(--teal); }
button.no { background: var(--red-soft); color: var(--red); }
button.danger { background: var(--red-soft); color: var(--red); }
button.back { background: none; color: var(--sub); font-weight: 500; margin-top: 0.8rem; }
.go { width: 100%; margin-top: 0.7rem; padding: 0.85rem; font-size: 1.1rem; font-weight: 800; border-radius: 14px; }

/* ---------- 메시지·뱃지 ---------- */
.msg { color: var(--red); font-weight: 700; min-height: 1.35em; margin: 0.45rem 0; }
body.t-student .msg { text-align: center; }
.okmsg, .msg.okmsg { color: var(--teal-deep); }
.hint { color: #9aa2ad; font-size: 0.85rem; margin: 0.4rem 0; }
.empty, .placeholder {
  border: 2px dashed var(--line); border-radius: 14px; padding: 1rem;
  color: #a8b0ba; text-align: center; font-size: 0.93rem; background: #fbfcfd;
}
.st { font-size: 0.8rem; border-radius: 8px; padding: 0.18rem 0.5rem; font-weight: 700; white-space: nowrap; }
.st.pending { background: var(--gold-soft); color: var(--gold-deep); }
.st.approved { background: var(--teal-soft); color: var(--teal-deep); }
.st.rejected { background: var(--red-soft); color: var(--red); }
.kind { font-size: 0.72rem; border-radius: 6px; padding: 0.12rem 0.38rem; font-weight: 700; background: #e6f1fb; color: #185fa5; margin-right: 0.32rem; }

/* ---------- 표 ---------- */
table { width: 100%; border-collapse: collapse; font-size: 0.93rem; }
th, td { padding: 0.48rem 0.5rem; border-bottom: 1px solid #f0f2f5; text-align: center; }
th { color: var(--accent-deep); background: var(--accent-soft); font-weight: 700; }
th:first-child { border-radius: 10px 0 0 10px; }
th:last-child { border-radius: 0 10px 10px 0; }
td.l, td.rs { text-align: left; }
.plus { color: var(--teal-deep); font-weight: 800; }
.minus { color: var(--red); font-weight: 800; }
.row { display: flex; gap: 0.6rem; align-items: center; flex-wrap: wrap; }

/* ---------- 학생: 로그인 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 0.6rem; }
.stu {
  border: 2px solid var(--accent-line); border-radius: 16px; background: #fff;
  padding: 0.75rem 0.3rem; font-size: 0.98rem; cursor: pointer; text-align: center;
  color: var(--ink); font-weight: 600; transition: transform 0.08s ease;
}
.stu:active { background: var(--accent-soft); transform: scale(0.95); }
.stu .e { font-size: 2rem; display: block; margin-bottom: 0.15rem; }
.pinwrap { text-align: center; }
.who { font-size: 1.35rem; font-weight: 800; margin-bottom: 0.6rem; }
.dots { font-size: 1.9rem; letter-spacing: 0.45rem; min-height: 2.6rem; color: var(--accent); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.55rem; max-width: 290px; margin: 0 auto; }
.pad button { font-size: 1.5rem; padding: 0.85rem 0; border-radius: 14px; background: var(--accent-soft); color: var(--accent-deep); font-weight: 800; }
.pad button:active { background: var(--accent-line); }

/* ---------- 학생: 홈 ---------- */
.top { display: flex; align-items: center; gap: 0.8rem; }
.top .e {
  font-size: 2rem; background: var(--accent-soft); border-radius: 50%;
  width: 3.4rem; height: 3.4rem; display: flex; align-items: center; justify-content: center;
}
.top .nm { font-size: 1.12rem; font-weight: 800; }
.top .pt { color: var(--accent-deep); font-weight: 800; font-size: 1.02rem; }
.top .sp { flex: 1; }
.top button { background: #f1f3f6; color: #667; padding: 0.45rem 0.72rem; font-size: 0.85rem; font-weight: 600; }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.65rem; }
.tile {
  border: 2px solid var(--line); border-radius: 18px; padding: 0.85rem 0.3rem;
  text-align: center; background: #fff; color: var(--ink); position: relative;
  font-weight: 700; font-size: 0.95rem; transition: transform 0.08s ease;
}
.tile .te { font-size: 1.9rem; display: block; margin-bottom: 0.1rem; }
.tile.soon { opacity: 0.45; }
.tile .badge { position: absolute; top: 0.35rem; right: 0.35rem; font-size: 0.62rem; background: #eef0f3; border-radius: 6px; padding: 0.12rem 0.32rem; color: #98a0aa; font-weight: 600; }
.tile.live { cursor: pointer; border-color: var(--accent-line); box-shadow: 0 4px 12px rgba(29, 158, 117, 0.12); }
.tile.live:active { transform: scale(0.94); }
.alert { border-left: 4px solid var(--teal); background: #f2faf7; border-radius: 10px; padding: 0.55rem 0.7rem; margin-bottom: 0.4rem; font-size: 0.94rem; }
.alert.no { border-color: #e0608c; background: #fdf0f5; }

/* ---------- 학생: 퀘스트·마켓 카드 ---------- */
.qcard {
  display: flex; gap: 0.7rem; align-items: center;
  border: 2px solid var(--line); border-radius: 16px; padding: 0.75rem 0.9rem; margin-bottom: 0.55rem;
  background: #fff;
}
.qcard .qt { flex: 1; }
.qcard .qn { font-weight: 800; font-size: 1.02rem; }
.qcard .qd { color: #9aa8b5; font-size: 0.82rem; margin-top: 0.1rem; }
.qcard .qp { color: var(--accent-deep); font-weight: 800; white-space: nowrap; }
.qcard button { padding: 0.5rem 0.85rem; }
.req input, .req textarea { width: 100%; margin-bottom: 0.5rem; }

/* ---------- 교사: 탭 내비 ---------- */
.tab { background: var(--accent-soft); color: var(--accent-deep); }
.tab.on { background: var(--accent); color: #fff; box-shadow: 0 4px 10px rgba(186, 117, 23, 0.25); }

/* ---------- 교사: 승인함 ---------- */
.ap { display: flex; gap: 0.7rem; align-items: center; border: 2px solid #f2eee4; border-radius: 14px; padding: 0.6rem 0.8rem; margin-bottom: 0.5rem; background: #fffdf9; }
.ap .who { min-width: 7.5rem; font-weight: 700; font-size: 0.95rem; }
.ap .what { flex: 1; text-align: left; }
.ap .tp { font-size: 0.76rem; border-radius: 6px; padding: 0.12rem 0.4rem; font-weight: 700; margin-right: 0.3rem; }
.tp.point { background: #e6f1fb; color: #185fa5; }
.tp.quest { background: var(--teal-soft); color: var(--teal-deep); }
.tp.diary { background: #eeedfe; color: #534ab7; }
.ap .tm { color: #b9b2a4; font-size: 0.8rem; }

/* ---------- 교사: 수업 체크 ---------- */
table.ck th { font-size: 0.85rem; min-width: 88px; }
.cell { width: 48px; height: 44px; border-radius: 12px; border: 2px solid var(--accent-line); background: #fdfbf6; font-size: 1.15rem; cursor: pointer; padding: 0; color: #fff; }
.cell.pending { background: var(--gold-soft); border-color: var(--gold-line); }
.cell.approved { background: var(--teal); border-color: var(--teal); }

/* ---------- 교사: 대시보드 ---------- */
.stat { flex: 1; min-width: 132px; border: 2px solid #f0ead9; border-radius: 16px; padding: 0.85rem; text-align: center; color: #8a8272; background: #fffdf8; font-size: 0.9rem; }
.stat b { font-size: 1.55rem; color: var(--accent-deep); display: inline-block; margin-top: 0.15rem; }
.stat.hot { border-color: var(--accent); background: var(--accent-soft); cursor: pointer; }

/* ---------- 칠판 ---------- */
body.t-board .clock { font-size: min(18vw, 11rem); font-weight: 800; letter-spacing: 0.02em; }
body.t-board .date { font-size: min(5vw, 2.4rem); color: var(--blue-soft); margin-top: 0.4rem; }
body.t-board .note { font-size: 1.05rem; color: #6e93b8; margin-top: 2rem; }
body.t-board .login { background: var(--navy-2); border-radius: 22px; padding: 2rem; width: min(430px, 92vw); box-shadow: 0 16px 50px rgba(0, 0, 0, 0.35); }
body.t-board .login h1 { font-size: 1.3rem; margin: 0 0 0.5rem; color: #fff; }
body.t-board .login p { color: var(--blue-soft); margin: 0 0 1rem; font-size: 0.95rem; }
body.t-board input { border: none; text-align: center; font-size: 1.2rem; padding: 0.9rem; width: 100%; }
body.t-board button { width: 100%; margin-top: 0.8rem; padding: 0.9rem; font-size: 1.1rem; font-weight: 800; background: var(--blue); }
body.t-board .msg { color: #ffb4a8; }

/* ---------- 시작 페이지 ---------- */
body.t-index { background: linear-gradient(180deg, #eef2fb, #f8fafd 50%) fixed; align-items: center; }
.rolebox { text-align: center; }
.rolebox h1 { color: var(--ink); font-size: 1.5rem; margin-bottom: 1.4rem; }
a.role {
  display: flex; align-items: center; gap: 0.9rem; width: min(340px, 86vw);
  padding: 1rem 1.2rem; border-radius: 18px; text-decoration: none; font-weight: 800;
  color: #fff; margin: 0 auto 0.8rem; font-size: 1.1rem; box-shadow: var(--shadow);
  transition: transform 0.08s ease;
}
a.role:active { transform: scale(0.96); }
a.role .re { font-size: 1.6rem; }
a.role small { font-weight: 500; opacity: 0.85; font-size: 0.8rem; margin-left: auto; }

@media print { .noprint { display: none; } body { background: #fff; } .card { box-shadow: none; } }
