/* dashboard-games-editor.css */
/* ============================================================
   Showdown question editor (v2.75.2, dashboard-games-editor.js +
   dashboard-games-math.js): the full-screen sheet one question is edited
   on — a purple header, a light body (the dashboard is dark; the sheet is
   the one bright thing on the page, on purpose), the Media box, the
   question box, the answer tile — and the Math panel that slides in over
   its right side.
   ============================================================ */
.gq-overlay{
  position:fixed;inset:0;z-index:80;display:flex;align-items:stretch;justify-content:center;
  background:rgba(7,9,14,.72);backdrop-filter:blur(4px);padding:0;
}
.gq-overlay[hidden]{display:none}
body.gq-open{overflow:hidden}
.gq-sheet{
  position:relative;width:100%;max-width:1100px;margin:0 auto;display:flex;flex-direction:column;
  background:#F4F2FB;color:#1B1638;overflow:hidden;
}
@media (min-width:1200px){
  .gq-overlay{padding:28px 0}
  .gq-sheet{border-radius:22px;box-shadow:0 30px 80px rgba(0,0,0,.55)}
}

/* ------------------------------------------------------------ header */
.gq-head{
  display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;
  padding:16px 24px;background:linear-gradient(180deg,#6D3FE0,#5B2FC7);color:#fff;
}
.gq-head-l,.gq-head-r{display:flex;align-items:center;gap:12px}
.gq-title{font-family:var(--serif,'Fraunces',serif);font-size:24px;font-weight:600;letter-spacing:-.01em}
.gq-catslot .quiz-cat{
  padding:8px 34px 8px 12px;border-radius:999px;border:1px solid rgba(255,255,255,.35);
  background:rgba(255,255,255,.14);color:#fff;font-size:13px;font-weight:700;appearance:none;-webkit-appearance:none;
  background-image:linear-gradient(45deg,transparent 50%,#fff 50%),linear-gradient(135deg,#fff 50%,transparent 50%);
  background-position:calc(100% - 18px) 55%,calc(100% - 13px) 55%;background-size:5px 5px,5px 5px;background-repeat:no-repeat;
}
.gq-catslot .quiz-cat option{color:#1B1638}
.gq-btn{
  padding:10px 18px;border-radius:999px;border:1px solid transparent;cursor:pointer;
  font:inherit;font-size:14px;font-weight:700;transition:filter .12s,transform .12s,background .12s;
}
.gq-btn:hover{filter:brightness(1.06)}
.gq-btn:active{transform:scale(.98)}
.gq-btn-ghost{background:rgba(255,255,255,.14);color:#fff;border-color:rgba(255,255,255,.35)}
.gq-btn-go{background:#fff;color:#5B2FC7;box-shadow:0 6px 18px rgba(0,0,0,.18)}
.gq-body .gq-btn-ghost{background:#fff;color:#5B2FC7;border-color:#D6CDF5}

/* ------------------------------------------------------------ body */
.gq-body{flex:1 1 auto;overflow:auto;padding:22px 24px 28px;display:flex;flex-direction:column;gap:16px}
.gq-media{
  border:2px dashed #C9BDF2;border-radius:16px;background:#FBFAFF;padding:14px 16px;transition:border-color .12s,background .12s;
}
.gq-media-over{border-color:#6D3FE0;background:#F1ECFF}
.gq-media-lab{font-size:12px;font-weight:800;letter-spacing:.06em;text-transform:uppercase;color:#7A6FA8;margin-bottom:10px}
.gq-media-lab span{font-weight:600;letter-spacing:0;text-transform:none;color:#9A91BE}
.gq-media-empty{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.gq-media-btn{
  display:inline-flex;align-items:center;gap:10px;padding:14px 22px;border-radius:14px;border:1px solid #D6CDF5;
  background:#fff;color:#1B1638;font:inherit;font-size:15px;font-weight:700;cursor:pointer;
  box-shadow:0 4px 14px rgba(91,47,199,.10);transition:transform .12s,box-shadow .12s,border-color .12s;
}
.gq-media-btn:hover{transform:translateY(-1px);border-color:#8B5CF6;box-shadow:0 8px 20px rgba(91,47,199,.18)}
.gq-media-ico{
  display:inline-grid;place-items:center;width:34px;height:34px;border-radius:10px;
  background:linear-gradient(180deg,#8B5CF6,#6D3FE0);color:#fff;
}
.gq-media-ico svg{display:block}
.gq-media-hint{flex:1 1 260px;margin:0;font-size:13px;color:#7A6FA8;line-height:1.45}
.gq-media-has{display:flex;align-items:center;gap:16px;flex-wrap:wrap}
.gq-thumb{width:220px;max-width:100%;height:140px;object-fit:cover;border-radius:12px;border:1px solid #D6CDF5;background:#fff}
.gq-media-actions{display:flex;gap:8px;flex-wrap:wrap}
.gq-prompt{
  width:100%;min-height:150px;padding:18px 20px;border:2px solid #D6CDF5;border-radius:16px;background:#fff;
  color:#1B1638;font:inherit;font-size:22px;font-weight:600;line-height:1.4;resize:vertical;
}
.gq-prompt::placeholder{color:#B4ABD6;font-weight:500}
.gq-prompt:focus,.gq-answer-in:focus{outline:3px solid rgba(139,92,246,.45);outline-offset:1px;border-color:#8B5CF6}
.gq-answer{
  display:flex;align-items:center;gap:14px;padding:14px 16px;border-radius:16px;
  background:linear-gradient(180deg,#22C55E,#16A34A);box-shadow:0 8px 22px rgba(22,163,74,.25);
}
.gq-answer-lab{flex:0 0 auto;color:#fff;font-size:12px;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.gq-answer-in{
  flex:1 1 auto;min-width:0;padding:12px 14px;border:2px solid rgba(255,255,255,.55);border-radius:12px;background:#fff;
  color:#1B1638;font:inherit;font-size:17px;font-weight:600;
}
.gq-answer-in::placeholder{color:#9A91BE;font-weight:500}
.gq-err{margin:0;min-height:0;color:#C2321B;font-size:14px;font-weight:700}
.gq-err:empty{display:none}

/* ------------------------------------------------------------ the Math panel */
.gq-math{
  position:absolute;top:0;right:0;bottom:0;width:min(440px,100%);display:flex;flex-direction:column;
  background:#fff;border-left:1px solid #D6CDF5;box-shadow:-20px 0 50px rgba(27,22,56,.18);
  transform:translateX(100%);transition:transform .2s ease;z-index:2;
}
.gq-math[hidden]{display:none}
.gq-math-on{transform:translateX(0)}
.gq-math-head{
  display:flex;align-items:center;gap:10px;padding:14px 16px;background:linear-gradient(180deg,#6D3FE0,#5B2FC7);color:#fff;
  font-family:var(--serif,'Fraunces',serif);font-size:19px;font-weight:600;
}
.gq-math-back{
  width:36px;height:36px;border-radius:50%;border:1px solid rgba(255,255,255,.4);background:rgba(255,255,255,.14);
  color:#fff;font-size:18px;cursor:pointer;flex:0 0 auto;
}
.gq-math-build{display:flex;gap:8px;padding:14px 16px 6px}
.gq-math-in{
  flex:1 1 auto;min-width:0;padding:12px 14px;border:2px solid #D6CDF5;border-radius:12px;background:#FBFAFF;
  color:#1B1638;font:inherit;font-size:20px;font-weight:600;
}
.gq-math-in:focus{outline:3px solid rgba(139,92,246,.45);border-color:#8B5CF6}
.gq-math-build .gq-btn-go{background:linear-gradient(180deg,#8B5CF6,#6D3FE0);color:#fff;box-shadow:0 6px 16px rgba(109,63,224,.3)}
.gq-math-scripts{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:6px 16px 10px;border-bottom:1px solid #EAE5FA}
.gq-math-hint{flex:1 1 200px;font-size:12px;color:#7A6FA8;line-height:1.35}
.gq-math-grid{flex:1 1 auto;overflow:auto;padding:10px 16px 20px}
.gq-math-sec{margin-bottom:12px}
.gq-math-sec-h{font-size:11px;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:#7A6FA8;margin:6px 0}
.gq-math-keys{display:flex;flex-wrap:wrap;gap:6px}
.gq-key{
  min-width:40px;height:40px;padding:0 10px;border:1px solid #D6CDF5;border-radius:10px;background:#FBFAFF;
  color:#1B1638;font:inherit;font-size:18px;font-weight:600;cursor:pointer;transition:background .1s,border-color .1s,transform .1s;
}
.gq-key:hover{background:#F1ECFF;border-color:#8B5CF6}
.gq-key:active{transform:scale(.95)}
.gq-key-wide{padding:0 14px;font-size:16px}
.gq-math-scripts .gq-key-wide{background:#fff;color:#5B2FC7;border-color:#8B5CF6;font-weight:800}
.gq-math-scripts .gq-key-on{background:linear-gradient(180deg,#8B5CF6,#6D3FE0);color:#fff;border-color:transparent;box-shadow:0 0 0 3px rgba(139,92,246,.3)}
.gq-math-in-sup{border-color:#8B5CF6;box-shadow:inset 0 3px 0 #8B5CF6}
.gq-math-in-sub{border-color:#8B5CF6;box-shadow:inset 0 -3px 0 #8B5CF6}

@media (max-width:640px){
  .gq-head{padding:12px 14px}
  .gq-body{padding:14px}
  .gq-prompt{font-size:18px}
}
@media (prefers-reduced-motion:reduce){
  .gq-math{transition:none}
}
