/* ===== Quiz Do/Don't + Toxic 15 — ธีมน่ารักพาสเทล ===== */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@400;500;600;700;800&display=swap');

:root {
  --bg: #fff8f0;
  --card: #ffffff;
  --ink: #4a3b32;
  --muted: #9a8a7d;
  --accent: #ff8fab;
  --accent-2: #ffd166;
  --ok: #57cc99;
  --bad: #ef476f;
  --r1: #e21b3c; --r2: #1368ce; --r3: #d89e00; --r4: #26890c;
  --shadow: 0 8px 24px rgba(74, 59, 50, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Sarabun', sans-serif;
  background: var(--bg);
  background-image: radial-gradient(#ffe3ec 1.5px, transparent 1.5px);
  background-size: 28px 28px;
  color: var(--ink);
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px 48px;
}

.wrap { width: 100%; max-width: 720px; }

.mascot { font-size: 56px; text-align: center; animation: bob 2.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }

h1 { text-align: center; font-size: 26px; font-weight: 800; margin: 4px 0 2px; }
.sub { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 18px; }

.card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow);
  padding: 24px; margin-bottom: 16px;
}

label { display: block; font-weight: 700; font-size: 15px; margin: 14px 0 6px; }
input[type=text], input[type=number] {
  width: 100%; padding: 14px 16px; font-family: inherit; font-size: 17px;
  border: 2px solid #f0e2d6; border-radius: 14px; background: #fffdfb; color: var(--ink);
  transition: border .15s;
}
input:focus { outline: none; border-color: var(--accent); }

.btn {
  display: block; width: 100%; border: none; cursor: pointer; font-family: inherit;
  font-size: 18px; font-weight: 800; color: #fff; padding: 15px;
  border-radius: 16px; margin-top: 18px; transition: transform .08s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(.98); }
.btn-pink { background: linear-gradient(135deg, #ff8fab, #ff5d8f); }
.btn-blue { background: linear-gradient(135deg, #4ea8de, #1368ce); }
.btn-ghost { background: #f3e9df; color: var(--ink); font-weight: 700; }

.error { color: var(--bad); font-size: 14px; font-weight: 600; margin-top: 10px; text-align: center; min-height: 20px; }

.hidden { display: none !important; }

/* สถานะห้องรอ */
.pill {
  display: inline-block; background: #fff0f4; color: #d34a7a; font-weight: 700;
  padding: 6px 14px; border-radius: 999px; font-size: 14px;
}
.big-pin { font-size: 44px; font-weight: 800; letter-spacing: 8px; text-align: center; color: #d34a7a; }
.player-list { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.chip {
  background: #fff3d6; border-radius: 999px; padding: 6px 14px; font-weight: 600; font-size: 14px;
  animation: pop .25s ease;
}
.chip small { color: var(--muted); font-weight: 500; }
@keyframes pop { from { transform: scale(.6); opacity: 0 } to { transform: scale(1); opacity: 1 } }

/* คำถาม */
.q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.q-num { font-weight: 700; color: var(--muted); font-size: 14px; }
.timer-bar { height: 10px; background: #f0e2d6; border-radius: 999px; overflow: hidden; }
.timer-fill { height: 100%; width: 100%; background: linear-gradient(90deg, #57cc99, #ffd166, #ef476f); border-radius: 999px; }
.timer-text { text-align: right; font-weight: 800; font-size: 15px; margin: 6px 0 12px; color: var(--muted); }

.q-text { font-size: 19px; font-weight: 700; line-height: 1.5; margin-bottom: 16px; }

.opts { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .opts { grid-template-columns: 1fr; } }
.opt {
  border: none; cursor: pointer; font-family: inherit; text-align: left;
  color: #fff; font-size: 16px; font-weight: 700; line-height: 1.4;
  padding: 18px 16px 18px 52px; border-radius: 16px; position: relative;
  transition: transform .08s, filter .15s; min-height: 64px;
}
.opt:hover { filter: brightness(1.08); }
.opt:active { transform: scale(.98); }
.opt .badge {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  font-size: 20px; font-weight: 800;
}
.opt[disabled] { cursor: default; opacity: .85; }
.opt.c1 { background: var(--r1); } .opt.c2 { background: var(--r2); }
.opt.c3 { background: var(--r3); } .opt.c4 { background: var(--r4); }
.opt.dim { opacity: .35; }
.opt.right { outline: 4px solid #2ec4b6; outline-offset: 3px; }
.opt.wrong { outline: 4px solid #ff9f1c; outline-offset: 3px; }

/* ผลตอบ */
.result { text-align: center; padding: 8px 0 2px; }
.result .emoji { font-size: 52px; }
.result .msg { font-size: 20px; font-weight: 800; margin: 6px 0; }
.result .pts { color: var(--muted); font-weight: 700; }
.expl {
  background: #fff7e8; border-radius: 14px; padding: 12px 16px; font-size: 14.5px;
  line-height: 1.55; margin-top: 12px; text-align: left;
}
.waiting { text-align: center; color: var(--muted); font-weight: 600; margin-top: 12px; font-size: 14px; }

/* อันดับ */
.lb { width: 100%; border-collapse: collapse; }
.lb td { padding: 9px 6px; border-bottom: 1px dashed #f0e2d6; font-size: 15px; }
.lb td.rk { font-weight: 800; width: 44px; }
.lb td.sc { text-align: right; font-weight: 800; color: #d34a7a; }
.lb tr.me td { background: #fff3d6; border-radius: 8px; font-weight: 700; }

/* podium */
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; margin-top: 14px; }
.pod { text-align: center; width: 30%; }
.pod .face { font-size: 34px; }
.pod .bar { border-radius: 14px 14px 0 0; color: #fff; font-weight: 800; padding-top: 10px; font-size: 15px; }
.pod .nm { font-weight: 700; font-size: 14px; margin-top: 6px; word-break: break-word; }
.pod.p1 .bar { height: 120px; background: linear-gradient(180deg, #ffd166, #ffb703); }
.pod.p2 .bar { height: 90px; background: linear-gradient(180deg, #b8c0ff, #8d99ae); }
.pod.p3 .bar { height: 70px; background: linear-gradient(180deg, #ffb4a2, #e5989b); }

/* host */
.host-q { font-size: 22px; font-weight: 800; text-align: center; line-height: 1.5; margin-bottom: 16px; }
.bar-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.bar-label { width: 34px; text-align: center; font-weight: 800; color: #fff; border-radius: 10px; padding: 4px 0; }
.bar-track { flex: 1; background: #f0e2d6; border-radius: 999px; height: 22px; overflow: hidden; }
.bar-val { height: 100%; border-radius: 999px; transition: width .4s; min-width: 0; }
.bar-n { width: 46px; text-align: right; font-weight: 800; }
.correct-tag { font-weight: 800; color: #2ec4b6; }
.hctrl { display: flex; gap: 10px; margin-top: 16px; }
.hctrl .btn { margin-top: 0; }

/* admin */
table.log { width: 100%; border-collapse: collapse; font-size: 14px; }
table.log th { background: #fff0f4; padding: 8px 6px; text-align: left; white-space: nowrap; }
table.log td { padding: 7px 6px; border-bottom: 1px solid #f6ece2; }
table.log tr:hover td { background: #fffaf4; }
.filters { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filters input { max-width: 240px; }

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