/* AskRoom — calm, classroom-friendly. One accent, big type, nothing extra. */
:root {
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --ink: #16202A;
  --muted: #667085;
  --line: #E4E7EC;
  --accent: #2F6FED;
  --accent-ink: #FFFFFF;
  --accent-soft: #EAF0FE;
  --ok: #1B9C5B;
  --ok-soft: #E6F6EE;
  --danger: #D33A3A;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 8px 24px rgba(16,24,40,.06);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg); color: var(--ink);
  -webkit-font-smoothing: antialiased; line-height: 1.4;
}
a { color: var(--accent); text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; }
input, textarea { font: inherit; color: var(--ink); }
.hidden { display: none !important; }

.wrap { max-width: 640px; margin: 0 auto; padding: 24px 16px 64px; }
.wrap.wide { max-width: 820px; }

header.top { display: flex; align-items: center; justify-content: space-between; padding: 8px 0 20px; }
.brand { font-weight: 800; font-size: 20px; letter-spacing: -0.3px; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); display: inline-block; }
.brand small { font-weight: 600; color: var(--muted); font-size: 13px; margin-left: 6px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 16px; }
h1 { font-size: 28px; font-weight: 800; letter-spacing: -0.5px; line-height: 1.15; }
h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.3px; }
p.lead { color: var(--muted); font-size: 16px; margin-top: 8px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 20px; border-radius: 12px; font-weight: 700; font-size: 16px;
  background: var(--accent); color: var(--accent-ink); min-height: 48px;
  transition: transform .06s ease, opacity .15s ease;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: #FDECEC; color: var(--danger); }
.btn.sm { padding: 8px 12px; min-height: 36px; font-size: 14px; border-radius: 10px; }

.field { width: 100%; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; font-size: 17px; outline: none; }
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
textarea.field { resize: none; min-height: 110px; line-height: 1.45; }
label.lbl { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; color: var(--ink); }

/* Big room code (teacher) + code input (student) */
.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800; letter-spacing: .28em; font-size: 56px; line-height: 1;
  color: var(--ink); padding-left: .28em; /* balance letter-spacing */
}
.code.sm { font-size: 22px; letter-spacing: .2em; padding-left: .2em; }
.codeinput {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase; letter-spacing: .5em; text-align: center;
  font-size: 40px; font-weight: 800; padding: 18px 12px 18px calc(12px + .5em);
}

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 700; }
.pill.sent { background: var(--accent-soft); color: var(--accent); }
.pill.answered { background: var(--ok-soft); color: var(--ok); }
.pill.closed { background: #F2F4F7; color: var(--muted); }
.pill.live { background: var(--ok-soft); color: var(--ok); }
.pill.live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }

.msg { margin-top: 10px; font-size: 14px; min-height: 20px; }
.msg.err { color: var(--danger); }
.msg.ok { color: var(--ok); }

/* Question cards */
.qlist { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.q {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px;
  display: flex; gap: 14px; align-items: flex-start;
  animation: qin .25s ease;
}
@keyframes qin { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.q .body { flex: 1; font-size: 18px; line-height: 1.4; word-break: break-word; }
.q.done .body { color: var(--muted); text-decoration: line-through; text-decoration-color: #C7CCD3; }
.q .meta { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.q .acts { display: flex; gap: 6px; flex-shrink: 0; }
.q.new { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.iconbtn { width: 40px; height: 40px; border-radius: 10px; background: #F2F4F7; color: var(--ink); font-size: 18px; display: inline-flex; align-items: center; justify-content: center; }
.iconbtn.ok { background: var(--ok-soft); color: var(--ok); }
.iconbtn:hover { filter: brightness(.97); }

.menu { position: relative; }
.menu .pop { position: absolute; right: 0; top: 44px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; min-width: 200px; z-index: 5; }
.menu .pop button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; background: transparent; font-size: 14px; }
.menu .pop button:hover { background: #F2F4F7; }
.menu .pop button.danger { color: var(--danger); }

.rooms { display: flex; flex-direction: column; gap: 10px; }
.room { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.room:hover { border-color: #C9D3F0; }
.room .name { font-weight: 700; font-size: 16px; }

.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); cursor: pointer; user-select: none; }
.toggle input { width: 18px; height: 18px; accent-color: var(--accent); }

.empty { text-align: center; color: var(--muted); padding: 40px 12px; }
.empty .big { font-size: 40px; margin-bottom: 8px; }

footer.foot { margin-top: 32px; text-align: center; color: var(--muted); font-size: 13px; }

@media (max-width: 480px) {
  .code { font-size: 44px; }
  .codeinput { font-size: 32px; }
  h1 { font-size: 24px; }
  .q .body { font-size: 17px; }
}
