:root{--blue:#247cf1;--orange:#ffad1f;--red:#ef5034;--ink:#1f2b45;--muted:#66758f;--line:#dce7f5;--card:#fff;--shadow:0 10px 30px rgba(30,68,114,.09);--radius:22px}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:'Nunito',Arial,sans-serif;color:var(--ink);background:#f7fbff}body{background:radial-gradient(circle at 12% 8%,rgba(90,170,255,.14),transparent 25%),linear-gradient(180deg,#fffdfa,#f3fbff)}button,input,textarea,select{font:inherit}.builder-wrap{position:relative;max-width:1360px;margin:auto;padding:22px}.ui-language-toggle{display:flex;justify-content:flex-end;gap:4px;margin-bottom:6px}.ui-language-toggle button{height:39px;min-width:52px;border:1px solid #d6e4f7;background:#fff;color:#61718b;font-weight:900;border-radius:999px;cursor:pointer}.ui-language-toggle button.active{background:var(--blue);color:#fff;border-color:var(--blue)}.builder-header{text-align:center;margin:6px 0 22px}.builder-header h1{margin:0;font-size:clamp(34px,4.8vw,58px);font-weight:900;letter-spacing:.5px}.blue{color:var(--blue)}.orange{color:var(--orange)}.red{color:var(--red)}.builder-header p{margin:8px auto 0;color:var(--muted);font-weight:700;max-width:740px}.builder-grid{display:grid;grid-template-columns:375px 1fr;gap:18px;align-items:start}.card{background:var(--card);border:1px solid #e2ecf8;border-radius:var(--radius);box-shadow:var(--shadow);padding:20px}.settings h2,.bank-head h2{margin:0 0 15px;font-size:22px}.settings label{display:block;font-weight:800;margin:12px 0 6px}.settings input,.settings select{height:48px;width:100%;border:1px solid var(--line);border-radius:12px;padding:0 12px;outline:none;background:#fff}.settings select{cursor:pointer}.settings input:focus,.settings select:focus,.q-field:focus{border-color:var(--blue);box-shadow:0 0 0 3px rgba(36,124,241,.12)}.note{font-size:13px;line-height:1.45;color:var(--muted);margin:7px 0}.preview{border:1px solid #e4edf9;border-radius:15px;background:#f8fbff;padding:13px;margin-top:15px;display:flex;align-items:center;gap:12px}.preview img{height:48px;width:48px;border-radius:10px;object-fit:contain}.preview strong{display:block;font-weight:900;color:var(--blue);text-transform:uppercase}.builder-alert{margin-top:14px;padding:11px 12px;border-radius:13px;font-size:13px;line-height:1.45;font-weight:700;background:#fff4dd;border:1px solid #ffe0a5;color:#9b6100}.builder-alert.ready{background:#eaf9ef;border-color:#b8e9c8;color:#13753b}.action-main{width:100%;border:0;background:linear-gradient(135deg,#1871ec,#3691f2);color:#fff;font-weight:900;padding:14px 12px;border-radius:13px;margin-top:16px;cursor:pointer}.action-main:hover{filter:brightness(1.03)}.technical{font-size:12px;margin-top:10px;color:var(--muted);line-height:1.4}.bank-head{display:flex;justify-content:space-between;gap:12px;align-items:start;margin-bottom:12px}.bank-actions{display:flex;flex-wrap:wrap;justify-content:end;gap:8px}.btn{border:1px solid #d6e4f7;background:#f1f7ff;color:#234b80;border-radius:11px;min-height:42px;padding:0 13px;font-size:14px;font-weight:900;cursor:pointer;white-space:nowrap}.btn.danger{background:#fff3f1;color:#b73e2a;border-color:#ffd1c7}.upload{position:relative;display:inline-flex;align-items:center}.upload input{display:none}.question-list{display:flex;flex-direction:column;gap:12px;max-height:calc(100vh - 188px);overflow:auto;padding-right:4px}.question-item{border:1px solid #e2ebf7;background:#fcfdff;border-radius:16px;padding:13px}.q-top{display:flex;justify-content:space-between;gap:8px;align-items:center;margin-bottom:9px}.q-top strong{color:var(--blue)}.delete-q{border:0;background:#fff0ed;color:#bc4430;border-radius:9px;padding:7px 10px;font-weight:800;cursor:pointer}.q-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.q-span{grid-column:1/-1}.q-field{width:100%;border:1px solid var(--line);border-radius:10px;padding:9px 10px;min-height:43px;outline:none;background:#fff;font-size:14px}.q-field.textarea{min-height:62px;resize:vertical}.q-field.small{height:43px}.footer-note{font-size:12px;color:var(--muted);margin-top:15px;text-align:center}@media(max-width:980px){.builder-grid{grid-template-columns:1fr}.question-list{max-height:none}}@media(max-width:620px){.builder-wrap{padding:12px}.card{padding:14px}.q-grid{grid-template-columns:1fr}.bank-head{display:block}.bank-actions{justify-content:start;margin:10px 0}}

.q-field.rtl-input{direction:rtl;text-align:right;font-family:'Noto Naskh Arabic','Amiri','Traditional Arabic',serif;font-size:17px;line-height:1.55}.question-list.rtl-bank .q-top{direction:rtl}.question-list.rtl-bank .q-top strong{font-family:'Noto Naskh Arabic',serif}.detected-language{font-weight:800;color:#1764d7}

/* Footer styling adopted from the supplied reference footer only */
.app-footer{background:#0b1324;color:#94a3b8;text-align:center;padding:24px 16px 28px;border-top:1px solid rgba(255,255,255,.06);margin-top:18px;border-radius:16px;}
.app-footer .footer-main{font-size:13px;font-weight:600;letter-spacing:.02em;}
.app-footer .footer-brand{color:#fff;font-weight:800;text-decoration:none;}
.app-footer .footer-brand:hover{text-decoration:underline;}
.app-footer .footer-updated{margin-top:10px;font-size:10px;font-weight:800;letter-spacing:.28em;text-transform:uppercase;color:#64748b;}
@media(max-width:620px){.app-footer{padding:18px 14px}.app-footer .footer-main{font-size:12px;line-height:1.35}.app-footer .footer-updated{font-size:9px;letter-spacing:.18em}}

.correct-field{border-color:#9bd7ae;background:#f2fff5;font-weight:700}
.game-preview{margin-top:18px;padding:18px}.game-preview.hidden{display:none}.preview-head{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-bottom:14px}.preview-head h2{margin:0 0 3px;font-size:22px}.preview-head .note{margin:0}.action-download{border:0;background:linear-gradient(135deg,#16a052,#22c86e);color:#fff;font-weight:900;min-height:48px;padding:0 18px;border-radius:13px;cursor:pointer;white-space:nowrap}.action-download:hover{filter:brightness(1.03)}#gamePreviewFrame{display:block;width:100%;height:min(820px,82vh);min-height:660px;border:1px solid #dce7f5;border-radius:16px;background:#fff}@media(max-width:620px){.preview-head{display:block}.action-download{width:100%;margin-top:12px}#gamePreviewFrame{min-height:560px;height:76vh}}

/* Host-owned Google Sheet backend setting */
.backend-setup{margin-top:14px;padding:12px;border-radius:14px;background:#f7fbff;border:1px solid #dce9f8}
.backend-setup label{margin-top:0}
.backend-setup input{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}
.backend-setup .note{margin-bottom:0}


/* Apps Script setup popup only */
.backend-label-row{display:flex;justify-content:space-between;align-items:center;gap:8px}.backend-label-row label{margin:0}.setup-help-btn{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #cbdff8;background:#eaf3ff;color:#165cc5;border-radius:999px;padding:0;cursor:pointer;flex:0 0 auto;transition:background .16s,transform .16s}.setup-help-btn:hover{background:#dcebff;transform:translateY(-1px)}.setup-help-btn:focus-visible{outline:3px solid rgba(36,124,241,.2);outline-offset:2px}.setup-help-icon{width:20px;height:20px;display:block;fill:currentColor}.setup-modal{position:fixed;inset:0;z-index:80;background:rgba(11,19,36,.62);display:flex;align-items:center;justify-content:center;padding:18px}.setup-modal.hidden{display:none}.setup-modal-card{width:min(840px,100%);max-height:min(92vh,940px);overflow:auto;background:#fff;border-radius:20px;padding:20px;box-shadow:0 22px 60px rgba(0,0,0,.22)}.setup-modal-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:10px}.setup-modal-head h2{margin:0;font-size:22px}.modal-close-btn{border:0;border-radius:999px;background:#eef4fc;color:#32435f;font-size:25px;line-height:1;width:39px;height:39px;cursor:pointer}.setup-steps{margin:10px 0 12px;padding-left:22px;color:#384760;font-weight:700;line-height:1.55}.setup-tip{padding:10px 12px;background:#eaf8f0;border:1px solid #bde8cd;border-radius:12px;color:#136d38;font-size:13px;font-weight:700;line-height:1.45}.code-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:14px 0 7px}.apps-code{margin:0;background:#0c1527;color:#e5edf8;border-radius:13px;padding:14px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;max-height:350px;overflow:auto;white-space:pre}.action-main[disabled]{opacity:.72;cursor:wait}


/* v2.8.1 - Front-page UI styling only, aligned to the supplied reference */
.builder-header{
  position:relative;
  width:min(1370px,100%);
  min-height:112px;
  margin:0 auto 16px;
  display:flex;
  justify-content:center;
  align-items:center;
  text-align:left;
}
.builder-header-main{
  min-width:0;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:13px;
  padding-right:130px;
}
.builder-logo-box{
  width:102px;
  height:102px;
  flex:0 0 102px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:transparent;
}
.builder-app-logo{
  display:block;
  width:100px;
  height:100px;
  object-fit:contain;
  background:transparent;
}
.builder-title-box{
  min-width:min(820px,calc(100vw - 370px));
  display:flex;
  flex-direction:column;
  justify-content:center;
  text-align:center;
  padding:0 10px;
}
.builder-title-box h1{
  margin:0;
  font-size:clamp(36px,4.1vw,57px);
  line-height:1;
  font-weight:900;
  letter-spacing:.04em;
}
.builder-title-box p{
  margin:8px auto 0;
  max-width:760px;
  color:var(--muted);
  font-weight:700;
  font-size:clamp(13px,1.08vw,15px);
  line-height:1.35;
}
.builder-header-tools{
  position:absolute;
  top:13px;
  right:0;
  display:flex;
  flex-direction:column;
  gap:9px;
  align-items:stretch;
  width:118px;
}
.builder-header-tools .ui-language-toggle{
  margin:0;
  justify-content:center;
  padding:4px;
  background:#fff;
  border:1px solid #dbe7f4;
  border-radius:999px;
  box-shadow:var(--shadow);
  gap:2px;
}
.builder-header-tools .ui-language-toggle button{
  flex:1;
  height:38px;
  min-width:0;
  border:0;
}
.howto-details{position:relative;width:100%}
.howto-button{
  list-style:none;
  width:100%;
  min-height:46px;
  border:1px solid #d6e4f7;
  border-radius:999px;
  background:#fff;
  color:#244978;
  box-shadow:var(--shadow);
  display:flex;
  align-items:center;
  justify-content:center;
  gap:7px;
  font-weight:900;
  font-size:13px;
  cursor:pointer;
  user-select:none;
}
.howto-button::-webkit-details-marker{display:none}
.howto-icon{
  width:21px;
  height:21px;
  border-radius:50%;
  background:#e8f2ff;
  color:var(--blue);
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
}
.howto-popover{
  position:absolute;
  top:54px;
  right:0;
  z-index:20;
  width:286px;
  background:#fff;
  border:1px solid #dbe7f4;
  border-radius:15px;
  box-shadow:0 15px 36px rgba(25,54,94,.16);
  padding:13px;
  display:flex;
  flex-direction:column;
  gap:7px;
  color:#43526a;
  font-size:12.5px;
  line-height:1.4;
}
.howto-popover strong{color:var(--ink);font-size:14px}
.bank-actions .upload{justify-content:center}
@media(max-width:980px){
  .builder-header{justify-content:flex-start;min-height:auto;padding-top:62px}
  .builder-header-main{padding-right:0;margin:0 auto}
  .builder-header-tools{top:4px;right:0;width:118px}
}
@media(max-width:640px){
  .builder-header{padding-top:112px;margin-bottom:12px}
  .builder-header-main{flex-direction:column;gap:3px}
  .builder-logo-box{width:82px;height:82px;flex-basis:82px}
  .builder-app-logo{width:80px;height:80px}
  .builder-title-box{min-width:0;padding:0}
  .builder-title-box h1{font-size:clamp(31px,10vw,42px)}
  .builder-header-tools{left:50%;right:auto;transform:translateX(-50%);width:124px}
  .howto-popover{right:50%;transform:translateX(50%);width:min(286px,calc(100vw - 32px))}
}
