/* === Theme & global === */
:root{
  --bg:#0b1020;
  --surface:#121a2e;
  --surface-2:#182341;
  --text:#e9eefc;
  --muted:#9fb0d0;
  --accent:#4da3ff;
  --line:#263258;
  --pad:8px;
  --radius:8px;
  --h: calc(100vh - 48px - 32px);
  --tab-h:36px;
  --tiny:11px;
  color-scheme: dark;
}

*{box-sizing:border-box}

html,body{
  margin:0;
  padding:0;
  height:100%;
}

body{
  font-family:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  background:var(--bg);
  color:var(--text);
}

.hidden{display:none !important;}

/* === Layout: app shell === */

h3{
  padding: 0;
  margin: 0;
}

.app{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  gap:4px;
  padding:4px;
}

.topbar{
  height:32px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.brand{
  font-size:18px;
  margin:0;
}

.topbar-right{
  display:flex;
  align-items:center;
  gap:8px;
}

.badge{
  font-size:12px;
  color:var(--muted);
}

.main{
  display:grid;
  grid-template-columns:minmax(0,2.2fr) minmax(0,1.2fr);
  gap:4px;
  min-height:var(--h);
}

.left,.right{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.footer{
  height:24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-size:var(--tiny);
  border-top:1px solid var(--line);
  color:var(--muted);
}

.version{
  font-size:12px;
  text-align: right;
}

/* === Panels === */
#gameRoundsPanel{
  height:calc(var(--h)/2 - 4px)
}
#gameRoundsPanel .tabs-content { overflow-y: auto; }
/* expanded: fill left column height and keep internal scroll */
.app.rounds-expanded-vertical #gameRoundsPanel{
  height: var(--h);
}
/* keep internal scroll (don’t spill the whole page) */
.app.rounds-expanded-vertical #gameRoundsPanel .tabs-content{
  overflow-y: auto;
}
/* optional but usually desired: hide the Questions Library to truly “expand to bottom” */
.app.rounds-expanded-vertical #predefQuestionsPanel{
  display:none;
}

.panel{
  background:var(--surface);
  border-radius:var(--radius);
  border:1px solid var(--line);
  display:flex;
  flex-direction:column;
  min-height:0;
  position:relative;
}
/* === Panel loading overlays (shared) === */

.panel-loading-overlay{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,0.35);
  border-radius:inherit;
  z-index:20;
}

.panel-loading-inner{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
  padding:8px 10px;
  background:rgba(15,23,42,0.9);
  border-radius:10px;
  border:1px solid var(--line);
}

.panel-loading-spinner{
  width:24px;
  height:24px;
  border-radius:50%;
  border:3px solid rgba(255,255,255,0.15);
  border-top-color:#fff;
  animation: panel-spin 0.8s linear infinite;
}

.panel-loading-text{
  font-size:11px;
  color:var(--muted);
}

.panel-head{
  padding:6px var(--pad);
  font-weight:600;
  border-bottom:1px solid var(--line);
  background:var(--surface-2);
  border-top-left-radius:var(--radius);
  border-top-right-radius:var(--radius);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:8px;
}

.panel-head-inline{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
}

.panel-head-actions{
  display:flex;
  align-items:center;
  gap:6px;
}

.panel-body{
  padding:var(--pad);
  display:flex;
  flex-direction:column;
  gap:8px;
  min-height:0;
}

.panel-body.no-pad{padding:0;}

.grow{flex:1;}
.half{height:calc(var(--h)/2 - 4px);}

/* === Typography & utilities === */

.muted{color:var(--muted);}
.tiny{font-size:var(--tiny);}

.pad{padding:var(--pad);}

/* === Forms & controls === */

.row{
  display:flex;
  gap:8px;
  align-items:flex-end;
  flex-wrap:wrap;
}

.row-compact>.lbl{min-width:140px;}

.grid2{
  display:grid;
  grid-template-columns:repeat(8,minmax(0,1fr));
  gap:8px;
}

.lbl{
  display:flex;
  flex-direction:column;
  gap:2px;
  font-size:12px;
}

.lbl.tiny{
  font-size:11px;
}

.in{
  height:28px;
  border-radius:8px;
  border:1px solid var(--line);
  background:#0f172a;
  color:var(--text);
  padding:0 8px;
  font-size:12px;
}

.in:focus{
  outline:none;
  border-color:var(--accent);
}

.in-tight{max-width:90px;}
.in-short{max-width:200px;}

textarea.in{
  height:auto;
  min-height:40px;
  padding:6px 8px;
  resize:vertical;
  line-height:16px;
  font-family:inherit;
  font-size:12px;
}

.btn{
  border-radius:8px;
  border:none;
  background:var(--accent);
  color:#fff;
  font-size:13px;
  padding:6px 14px;
  cursor:pointer;
}

.btn-sm{
  height:24px;
  font-size:12px;
}

.btn:hover{filter:brightness(1.1);}

.btn-add{
  width: 160px;
  align-self:center;
}
.btn-sv-q{
  width: 160px;
  align-self:center;
}
.btn-browse{
  width: 80px;
  height: 18px;
  align-self:center;
}

.chk-inline{
  display:inline-flex;
  align-items:center;
  gap:4px;
  font-size:11px;
  color:var(--muted);
  cursor:pointer;
}
.chk-inline input{margin:0;}

.game-name{
  min-width:160px;
}
.game-name .in{
  height:24px;
  font-size:12px;
  padding-inline:6px;
}

/* === Tabs (Game Rounds) === */

.tabs{
  display:flex;
  flex-direction:column;
  overflow: auto;
}

/* === Tabs (Game Rounds) === */

.tabs-list{
  display:flex;
  align-items:stretch;
  gap:2px;
  padding:4px 4px 0;

  /* NEW: horizontal scroll when tabs exceed panel width */
  overflow-x:auto;
  overflow-y:hidden;
  flex-wrap:nowrap;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  min-height: 32px;
}

/* NEW: prevent tabs from shrinking; they’ll scroll instead */
.tabs-list .tab{
  flex: 0 0 auto;
}

/* Optional: nicer horizontal scrollbar (safe to omit) */
.tabs-list::-webkit-scrollbar{ height: 8px; }
.tabs-list::-webkit-scrollbar-thumb{
  background: rgba(255,255,255,0.18);
  border-radius: 999px;
}

.tab {
  border:none;
  background:transparent;
  border: 1px solid var(--line);
  border-bottom: none;
  color:var(--muted);
  font-size:12px;
  padding:4px 10px;
  border-radius:8px 8px 0 0;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:4px;
}
.round-tab-label{
  max-width:140px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.round-tab-close{
  font-size:11px;
  line-height:1;
  margin-left:2px;
  cursor:pointer;
  opacity:0.6;
}
.round-tab-close:hover{
  opacity:1;
  color:#f87171;
}

.tab.fixed{
  font-weight:600;
}
.tab.tab-add{padding-inline:8px;}

.tab.active{
  background:var(--accent);
  color:var(--text);
}

.tab-drop{
  box-shadow:0 0 0 2px var(--accent);
}

.tabs-content{
  border-top:1px solid var(--line);
  padding:0;
  min-height:0;
}

.tab-pane{
  min-height:120px;
}
.tab-pane.hidden{display:none;}

/* smaller tabs used inside side-panels (Predefined Games) */
.tabs-small{
  display:flex;
  flex-direction:row;
  background:transparent;
}

.tabs-small .tab.small{
  border-radius:8px 8px 0 0;
  border:1px solid var(--line);
  border-bottom:none;
  background:var(--surface);
  color:var(--muted);
  height:24px;
  padding:0 12px;
  font-size:12px;
  cursor:pointer;
}

.tabs-small .tab.small.active{
  background:var(--surface-2);
  color:var(--text);
}

/* predefined games list */

.games-list{
  display:flex;
  flex-direction:column;
  gap:2px;
  overflow:auto;
  padding: 2px;
}

.game-row{
  display:flex;
  align-items:flex-start;
  gap:6px;
  padding:4px 6px;
  border-radius:8px;
  border:1px solid var(--line);
  background:var(--surface-2);
  font-size:12px;
  cursor:pointer;
}

.game-row input[type="radio"]{
  margin-top:3px;
}

.game-meta{
  flex:1;
  min-width:0;
}

.game-title{
  font-weight:600;
  font-size:12px;
}

.game-sub{
  font-size:11px;
}

.round-settings-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin-bottom:4px;
}

.round-settings-meta{
  font-size:11px;
  color:var(--muted);
}

.round-settings-meta .rq-count{
  font-weight:600;
  color:var(--text);
}

/* === Question Generator layout === */

@media (max-width:900px){
  .qg-layout{flex-direction:column;}
  .qg-col-custom{flex:1;max-width:none;}
}

.question-form{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.qg-question-main{
  display:flex;
  gap:8px;
  align-items:flex-start;
  flex-wrap:wrap;
  margin-top:4px;
}

.qg-question-meta{
  flex:0 0 220px;
  max-width:260px;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.qg-question-answers{
  flex:1;
  min-width:220px;
}

.pill{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid var(--line);
  font-size:12px;
  cursor:pointer;
}
.pill input{margin:0;}

.question-topics-group{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.q-topic-btn{
  min-height:22px;
  padding:2px 8px;
  border-radius:999px;
  border:1px solid var(--topic-color, var(--line));
  background:rgba(0,0,0,0.22);
  color:#fff;
  font-size:11px;
  line-height:1.1;
  text-transform:none;
  cursor:pointer;
}

.q-topic-btn.is-selected{
  background:var(--topic-color, var(--accent));
  border-color:var(--topic-color, var(--accent));
  color:#000;
  font-weight:600;
}

.qg-topics,
.q-ov-topics{
  margin-top:2px;
}

/* Media area */
.media-area{
  margin-top:4px;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.dropzone{
  border:1px dashed var(--line);
  border-radius:8px;
  padding:6px;
  text-align:center;
}
.dropzone-active{
  border-color:var(--accent);
  background:rgba(77,163,255,.08);
}

/* Answers block */
.answers-block{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.answers-title{
  font-size:13px;
  font-weight:600;
}

.answers-row{
  display:flex;
  align-items:center;
  gap:6px;
}

.answers-row .in{flex:1;}

/* === Predefined questions panel === */

.predef-filters{
  margin-bottom:6px;
  flex-wrap:wrap;
}

.predef-carousel{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:4px;
  flex:1;          /* take all available vertical space */
  min-height:0;
  max-height:300px;
}

.predef-track{
  flex:1;
  display:flex;
  flex-direction:column;
  gap:6px;
  overflow-y:auto;
  scroll-behavior:smooth;
  padding-right:2px;
}

.carousel-nav{
  border:1px solid var(--line);
  background:var(--surface-2);
  height:22px;
  border-radius:8px;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:12px;
  color:var(--text);
}
.carousel-nav:disabled{
  opacity:0.4;
  cursor:default;
}

.predef-card{
  flex:0 0 auto;
  border:1px solid var(--line);
  border-radius:8px;
  padding:6px;
  display:flex;
  flex-direction:column;
  gap:4px;
  background:var(--surface-2);
  font-size:12px;
}

.predef-meta{
  font-size:11px;
  color:var(--muted);
}

.predef-q{
  font-size:12px;
  line-height:1.3;
  overflow:hidden;
  display:-webkit-box;
  -webkit-line-clamp:3;
  line-clamp:3;
  -webkit-box-orient:vertical;
}

/* === Round questions list === */

.round-questions{
  display:flex;
  flex-direction:column;
  gap:4px;
}

.round-questions-head{
  font-size:12px;
  font-weight:600;
}

.round-questions-drop{
  border:1px dashed var(--line);
  border-radius:8px;
  padding:6px;
  min-height:100px;
  overflow-y: auto;
  scroll-behavior: smooth;
  flex: 1;
}

.round-questions-drop.round-drop-active{
  border-color:var(--accent);
  background:rgba(77,163,255,.08);
}

.round-questions-list{
  list-style:none;
  margin:4px 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:4px;
}

.round-question-item{
  border-radius:6px;
  padding:4px 6px;
  background:var(--surface-2);
  font-size:12px;
  display:flex;
  gap:6px;
  align-items:flex-start;
  cursor:grab;
  border-left: 3px solid transparent;
}

.round-question-item.rq-dragging{
  opacity:0.6;
}

.round-question-item.rq-drop-before{
  box-shadow:0 -2px 0 0 var(--accent);
}

.round-question-item.rq-drop-after{
  box-shadow:0 2px 0 0 var(--accent);
}

/* small media box used in library rows */
.rq-media-box{
  width:36px;
  height:36px;
  flex:0 0 36px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  margin-left:6px;
}
.rq-media-box img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}
.rq-media-sound{
  font-size:14px;
  opacity:0.9;
}

/* --- Round question type accents (data-qtype from JS) --- */
.round-question-item[data-qtype="multiple"]{
  border-left-color:#4da3ff;
  background:linear-gradient(90deg, rgba(77,163,255,0.14), rgba(0,0,0,0) 55%), var(--surface-2);
}

.round-question-item[data-qtype="sequence"]{
  border-left-color:#a78bfa;
  background:linear-gradient(90deg, rgba(167,139,250,0.14), rgba(0,0,0,0) 55%), var(--surface-2);
}

.round-question-item[data-qtype="number"]{
  border-left-color:#f59e0b;
  background:linear-gradient(90deg, rgba(245,158,11,0.14), rgba(0,0,0,0) 55%), var(--surface-2);
}

.round-question-item[data-qtype="first-letter"]{
  border-left-color:#34d399;
  background:linear-gradient(90deg, rgba(52,211,153,0.14), rgba(0,0,0,0) 55%), var(--surface-2);
}

/* fallback */
.round-question-item[data-qtype="unknown"]{
  border-left-color:#64748b;
}

.rq-num{
  font-weight:600;
  min-width:20px;
  text-align:right;
  margin-top:2px;
}

.rq-main{
  flex:1;
  min-width:0;
  position: relative;
  padding-bottom: 10px;
}

.round-question-text{
  margin-bottom:2px;
}

.round-question-meta{
  font-size:11px;
}

.rq-remove{
  border:none;
  background:transparent;
  color:var(--muted);
  cursor:pointer;
  font-size:14px;
  padding:0 2px;
  margin-left:4px;
  align-self:flex-start;
}
.rq-remove:hover{
  color:#c33;
}

/* === Overlay (login) === */

.overlay{
  position:fixed;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(0,0,0,.5);
  backdrop-filter:blur(4px);
  padding:8px;
  z-index:10;
}

.overlay .card{
  width:min(420px,94vw);
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:16px;
  padding:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
  align-items:flex-start;
}

#loginOverlay .card{
  width:min(420px,94vw);
  align-items:center;
  margin-bottom:20px;
  padding-bottom:30px;
}

#tipBox{
  padding:4px;
}

.ai-form{
  width:100%;
}

.ai-table{
  width:100%;
  border-collapse:collapse;
  font-size:12px;
}

.ai-table td{
  padding:3px 4px;
  vertical-align:middle;
}

.ai-table td:first-child{
  width:40%;
  color:var(--muted);
  white-space:nowrap;
}

.ai-table label{
  display:block;
}

.ai-actions{
  margin-top:8px;
  text-align:right;
}

/* Optional: stack nicely on small screens */
@media (max-width: 700px){
  .ai-table td{
    display:block;
    width:100%;
  }
  .ai-table tr td:first-child{
    padding-top:6px;
  }
}

.chk-inline.disabled {
  opacity: 0.4;
  pointer-events: none;
}
/* Question overlay */

.q-overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.q-overlay-box {
  max-width: 640px;
  width: 90%;
  max-height: 80vh;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  padding: 16px;
  overflow-y: auto;
  position: relative;
  font-size: 14px;
}

.q-overlay-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: none;
  background: transparent;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--text);
}

.q-overlay-body {
  margin-top: 8px;
}

.q-overlay-question {
  font-weight: 600;
  margin-bottom: 8px;
}

.q-overlay-meta {
  margin-bottom: 12px;
  color: #666;
}

.q-overlay-section-title {
  font-weight: 600;
  margin-bottom: 6px;
  margin-top: 8px;
}

.q-overlay-answers {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.q-answer {
  padding: 4px 8px;
  margin-bottom: 4px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.q-answer-correct {
  border-color: #52c41a;
  font-weight: 600;
}

.q-overlay-answer-single {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #52c41a;
}

.q-overlay-no-answers {
  margin-top: 4px;
}

/* in case you don't already have it */
.hidden {
  display: none !important;
}

/* AI generator layout */
.ai-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Simple circular spinner */
.ai-spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 1);
  border-top-color: rgb(255, 255, 255, 0.1);
  animation: ai-spin 0.8s linear infinite;
}

/* Optional: visual feedback on button while loading */
.btn.loading {
  opacity: 0.6;
  cursor: wait;
}

/* If you don't already have this */
.hidden {
  display: none !important;
}

@keyframes ai-spin {
  to{transform: rotate(360deg);}
}

@keyframes panel-spin{
  to{transform:rotate(360deg);}
}

.game-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.game-price {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0.85;
}
.game-price .token-icon {
  width: 12px;
  height: 12px;
  vertical-align: middle;
  margin-right: 2px;
}
.token-icon img {
  width: 100%;
  height: 100%;
}
.game-title-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:6px;
}

.game-price-wrap{
  display:flex;
  align-items:center;
  gap:4px;
}

.game-delete-btn{
  border:none;
  background:transparent;
  padding:0 2px;
  font-size:12px;
  line-height:1;
  cursor:pointer;
  color:var(--muted);
}

.game-delete-btn:hover{
  color:var(--accent);
}

/* Utility: flex child takes available space */
.grow {
  flex: 1 1 auto;
  min-height: 0;
}

/* When used inside .panel-body (already flex-column),
   this pins the footer block to the bottom */
.panel-footer-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.q-overlay-media {
  margin-bottom: 12px;
  text-align: center;
}

.q-overlay-image {
  max-width: 100%;
  max-height: 320px;
  border-radius: 4px;
  object-fit: contain;
}

.q-overlay-audio-btn {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid #ccc;
  background: #f4f4f4;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 6px;
}

.q-overlay-audio {
  display: none; /* we control playback via the button */
}
.panel-loading-progress { margin-top: 10px; width: 100%; }
.panel-loading-progress-track {
  width: 100%;
  height: 10px;
  border-radius: 8px;
  background: rgba(255,255,255,0.12);
  overflow: hidden;
}
.panel-loading-progress-bar {
  height: 10px;
  width: 0%;
  background: rgba(255,255,255,0.65);
  border-radius: 8px;
  transition: width 120ms linear;
}
.panel-loading-progress-meta {
  margin-top: 6px;
  font-size: 12px;
  opacity: 0.8;
}

/* === Custom Question Overlay === */
.round-params{display:none !important;}

.cq-overlay-backdrop{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.55);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:9999;
}

.cq-overlay-box{
  width:min(980px, 96vw);
  max-height:92vh;
  overflow:auto;
}

.cq-overlay-close{
  border:1px solid var(--line);
  background:transparent;
  color:var(--text);
  border-radius:10px;
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
}

.cq-media-preview{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:6px;
}

.cq-media-thumb{
  width:50px;
  height:50px;
  object-fit:cover;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
}

.cq-audio-btn{
  white-space:nowrap;
}


/* === Question overlay: media thumb + viewer === */
.q-ov-question-row{
  display:flex;
  align-items:stretch;
  gap:8px;
}

.q-ov-question{
  flex:1 1 auto;
  min-width:0;
}

.q-ov-media-box{
  width:56px;
  height:56px;
  flex:0 0 56px;
  border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.03);
  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
  cursor:pointer;
}

.q-ov-media-box img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.q-ov-media-sound{
  cursor:default;
  padding:0;
}

.q-ov-audio-btn{
  width:100%;
  height:100%;
  border:none;
  background:transparent;
  color:var(--text);
  cursor:pointer;
  font-size:12px;
}

.q-ov-audio-btn:hover{
  background:rgba(255,255,255,0.05);
}

.q-ov-audio{
  display:none; /* controlled via the button */
}

.q-media-viewer{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.70);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:16px;
  z-index:10000;
}

.q-media-viewer.hidden{
  display:none !important;
}

.q-media-viewer-box{
  position:relative;
  max-width:95vw;
  max-height:90vh;
  display:flex;
  align-items:center;
  justify-content:center;
}

.q-media-viewer-img{
  max-width:95vw;
  max-height:90vh;
  border-radius:12px;
  border:1px solid var(--line);
  background:var(--surface);
  object-fit:contain;
  display:block;
}

.q-media-viewer-close{
  position:absolute;
  top:-10px;
  right:-10px;
  width:32px;
  height:32px;
  border-radius:10px;
  border:1px solid var(--line);
  background:var(--surface);
  color:var(--text);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
}

.q-media-viewer-close:hover{
  border-color:var(--accent);
}

#googleSignIn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
#googleSignIn .btn-spinner{
  width:16px;
  height:16px;
  border:2px solid currentColor;
  border-right-color: transparent;
  border-bottom-color: transparent;
  border-radius:50%;
  display:none;
  animation: qbSpin 0.8s linear infinite;
}
#googleSignIn.is-loading .btn-spinner{ display:inline-block; }
#googleSignIn.is-loading{ cursor: wait; opacity: 0.9; }
@keyframes qbSpin{ to{ transform: rotate(360deg); } }

.rq-main-row{
  display:flex;
  align-items:flex-start;
  gap:10px;
}

.rq-lines{
  flex:1 1 auto;
  min-width:0;
}

.round-question-answer{
  margin-top:2px;
  opacity:.9;
}

.rq-media-slot{
  flex:0 0 auto;
  width:30px;
  height:30px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.rq-media-image img{
  width:30px;
  height:30px;
  object-fit:cover;
  border-radius:6px;
}

.rq-media-audio-btn{
  width:30px;
  height:30px;
  border-radius:6px;
  border:1px solid rgba(255,255,255,.18);
  background:rgba(255,255,255,.06);
  cursor:pointer;
}
#predefApplyFilterBtn.is-dirty{
  outline:2px solid rgba(255,255,255,.25);
}

/* Existing Quizzes: action buttons row */
.games-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.games-actions > button{
  flex:1 1 auto;
}
