/* =========================================================
   팩토리 마블 관리자 — 게임과 같은 톤 (머스터드 바탕 · 먹선 · 크림 카드)
   style.css(앞 프로젝트 공용) 위에 덮어씀
   ========================================================= */
:root {
  --navy: #2b2118;          /* 먹색 */
  --navy-soft: #5b4a3a;
  --yellow: #ffc93c;
  --yellow-deep: #d99a0b;
  --yellow-shadow: #2b2118;
  --sky: #f5b83d;          /* 머스터드 바탕 */
  --white: #fff8e8;        /* 크림 카드 */
  --paper: #fbeccb;
  --line: #2b2118;
  --text: #2b2118;
  --muted: #7a6552;
  --red: #e0503f;
  --green: #23804a;
  --radius: 18px;
  --shadow: 0 5px 0 #2b2118;
  --font-display: "Jua", "Pretendard Variable", Pretendard, sans-serif;
}
body {
  background-color: var(--sky);
  background-image: radial-gradient(#e49b22 18%, transparent 21%);
  background-size: 14px 14px;
}
h1, h2, h3, h4, .num, .display, .stat b { font-weight: 400; }
.panel, .stat, .room-card, .group-card { border: 3px solid var(--navy); }
.panel { box-shadow: var(--shadow); }
.stat { box-shadow: 0 4px 0 var(--navy); }
.hazard { background: repeating-linear-gradient(-45deg, var(--yellow) 0 14px, var(--navy) 14px 28px); }

/* 버튼: 먹선 + 납작 그림자 (게임 단추와 같게) */
.btn { border: 2.5px solid var(--navy); border-radius: 999px; box-shadow: 0 3px 0 var(--navy); font-family: var(--font-display); font-weight: 400; font-size: 16px; }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--navy); }
.btn-yellow { color: var(--navy); }
.btn-yellow:hover { background: #ffd66b; }
.btn-ghost { background: #fff; color: var(--navy); border: 2.5px solid var(--navy); }
.btn-ghost:hover { background: var(--paper); }
.btn-danger { border: 2.5px solid var(--navy) !important; }
.btn-sm { font-size: 14.5px; border-radius: 999px; }

.input, select.input, textarea.input { border: 2px solid var(--navy); background: #fff; }
.input:focus { border-color: #3f86dc; box-shadow: 0 0 0 3px rgba(63, 134, 220, .25); }

.topbar { background: var(--navy); }
.topbar h1 { color: #ffd66b; font-size: 24px; }
.topbar h1 small { color: #fff8e8; font-family: var(--font); font-weight: 700; }
.tab { color: #f3dcae; font-family: var(--font-display); font-weight: 400; font-size: 16px; border-radius: 999px; }
.tab:hover { background: #5b4a3a; }
.tab.active { color: var(--navy); background: var(--yellow); }
.toast { background: var(--navy); border: 2px solid #ffd66b; }
.badge-online { color: var(--navy); }
table.codes th { color: var(--navy-soft); }

/* ---------- 선생님 대시보드 ---------- */
.td-top { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 20px; align-items: start; }
.td-overall { display: flex; flex-direction: column; gap: 8px; }
.td-big { background: #fff; border: 3px solid var(--navy); border-radius: 18px; padding: 14px; text-align: center; box-shadow: 0 4px 0 var(--navy); }
.td-big b { display: block; font-family: var(--font-display); font-size: 52px; line-height: 1.05; }
.td-big span { font-weight: 700; color: var(--muted); }
.td-big.good { background: #dff5e7; } .td-big.mid { background: #fff4c7; } .td-big.low { background: #ffe4dd; }
.td-sub { font-size: 14px; color: var(--muted); font-weight: 600; }
.td-sub b { color: var(--navy); font-size: 17px; }
.td-cats h4 { font-size: 17px; margin-bottom: 8px; }
.td-cat { display: grid; grid-template-columns: 130px minmax(0, 1fr) 52px 70px; gap: 10px; align-items: center; padding: 5px 0; }
.td-cn { font-weight: 700; }
.td-bar { height: 16px; border: 2px solid var(--navy); border-radius: 999px; background: #fff; overflow: hidden; }
.td-bar i { display: block; height: 100%; background: #c9b9a6; }
.td-bar.good i { background: #5ed184; } .td-bar.mid i { background: #ffc93c; } .td-bar.low i { background: #ef8a6f; }
.td-cat b { font-family: var(--font-display); font-size: 18px; text-align: right; }
.td-cat small { color: var(--muted); font-weight: 600; }
.rate { display: inline-block; min-width: 46px; text-align: center; border: 1.5px solid var(--navy); border-radius: 999px; padding: 0 7px; font-weight: 800; font-size: 13px; background: #eee3d0; }
.rate.good { background: #c4ecd2; } .rate.mid { background: #ffe48a; } .rate.low { background: #ffc2b4; }
.td-hard { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.td-hard li { display: flex; gap: 12px; align-items: flex-start; background: #fff; border: 2px solid var(--navy); border-radius: 12px; padding: 8px 12px; }
.td-hard li > div { display: flex; flex-direction: column; min-width: 0; }
.td-hard small { color: var(--muted); font-weight: 600; }

/* ---------- 퀴즈 문제 ---------- */
.qz-form .wide { grid-column: 1 / -1; }
.qz-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.qz-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; margin-bottom: 16px; }
.qz-ch-h { grid-column: 1 / -1; font-size: 14px; font-weight: 700; color: var(--muted); }
.qz-ch { display: flex; align-items: center; gap: 8px; margin: 0; }
.qz-ch input[type=radio] { width: 20px; height: 20px; accent-color: #23804a; flex: none; }
.qz-n { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--navy); display: grid; place-items: center; font-family: var(--font-display); color: var(--navy); flex: none; background: var(--paper); }
.qz-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.qz-item { background: #fff; border: 2.5px solid var(--navy); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.qz-item.off { opacity: .55; background: var(--paper); }
.qz-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.qz-tag { font-size: 12px; font-weight: 800; border: 1.5px solid var(--navy); border-radius: 999px; padding: 0 8px; background: #bfe0ff; }
.qz-tag.lv { background: #fff4c7; } .qz-tag.mine { background: #c4ecd2; } .qz-tag.off { background: #ffc2b4; }
.qz-stat { margin-left: auto; font-size: 12.5px; color: var(--muted); font-weight: 700; }
.qz-text { font-size: 16px; line-height: 1.45; }
.qz-cs { margin: 0; padding-left: 22px; font-size: 14px; }
.qz-cs li.ans { font-weight: 800; color: #23804a; }
.qz-cs li.ans::after { content: " ← 정답"; font-size: 12px; }
.qz-ex { margin: 0; font-size: 13px; color: var(--muted); }
.qz-acts { display: flex; gap: 6px; margin-top: 2px; }

@media (max-width: 900px) {
  .td-top { grid-template-columns: minmax(0, 1fr); }
  .qz-list, .qz-choices { grid-template-columns: minmax(0, 1fr); }
  .td-cat { grid-template-columns: 100px minmax(0, 1fr) 46px; }
  .td-cat small { display: none; }
}
@media (max-width: 560px) {
  .qz-row { grid-template-columns: minmax(0, 1fr); }
}

/* 좁은 화면: 자리 줄을 두 줄로 (자리 이름 / 종류·코드·캐릭터) */
@media (max-width: 560px) {
  .seat { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .seat .seat-no { grid-column: 1 / -1; }
  .seat .seat-code, .seat .seat-level { grid-column: 1 / -1; }
}
